/* css/components/main-nav.css — Duolingo-style main navigation */

/* ── Left sidebar navigation ── */
.main-nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.main-nav-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 8px 20px;
  text-decoration: none;
  cursor: pointer;
}

.main-nav-logo {
  height: 56px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.main-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #4b4b4b;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: left;
}

.main-nav-item:hover {
  background: #f7f7f7;
}

.main-nav-item.active {
  background: #ddf4ff;
  border-color: #84d8ff;
  color: #1899d6;
}

.main-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--nav-color, #1cb0f6) 18%, white);
  flex-shrink: 0;
}

.main-nav-icon .material-symbols-outlined {
  font-size: 1.2rem;
  color: var(--nav-color, #1cb0f6);
}

.main-nav-item.active .main-nav-icon {
  background: color-mix(in srgb, #1899d6 18%, white);
}

.main-nav-item.active .main-nav-icon .material-symbols-outlined {
  color: #1899d6;
}

.main-nav-label {
  flex: 1;
  min-width: 0;
}

/* ── Right sidebar stats bar (Duolingo-style top row) ── */
.main-nav-stats-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  padding: 0 0 16px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.stats-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #4b4b4b;
  cursor: default;
  min-height: 40px;
  box-sizing: border-box;
}

button.stats-bar-item {
  cursor: pointer;
  transition: background 0.15s;
}

button.stats-bar-item:hover,
button.stats-bar-item.is-active {
  background: #f0f0f0;
}

.stats-bar-item .material-symbols-outlined {
  font-size: 1.35rem;
}

.stats-bar-streak .material-symbols-outlined {
  color: #ff9600;
}

.stats-bar-streak-inactive .material-symbols-outlined,
.stats-bar-streak-inactive strong {
  color: #afafaf;
}

.stats-bar-xp .material-symbols-outlined {
  color: #ff9600;
}

.stats-bar-calc .material-symbols-outlined {
  color: #ff9600;
}

.stats-bar-calc-wrap {
  position: relative;
  display: inline-flex;
}

.stats-bar-lang .material-symbols-outlined {
  color: #1cb0f6;
}

.stats-bar-lang {
  font-weight: 900;
}

/* ── Language popover (translation target language) ── */
.stats-bar-lang-wrap {
  position: relative;
  display: inline-flex;
}

/* Invisible hover bridge between stats bar buttons and their popovers */
.stats-bar-lang-wrap::after,
.stats-bar-streak-wrap::after,
.stats-bar-dict-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -32px;
  right: -32px;
  height: 0;
  pointer-events: none;
}

.stats-bar-lang-wrap:has(.lang-popover.is-open)::after,
.stats-bar-streak-wrap:has(.streak-popover.is-open)::after,
.stats-bar-dict-wrap:has(.dict-popover.is-open)::after {
  height: 32px;
  pointer-events: auto;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  z-index: 2600;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.lang-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-popover.is-open::after {
  content: '';
  position: absolute;
  top: -28px;
  left: -40px;
  right: -40px;
  height: 28px;
  pointer-events: auto;
}

.lang-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-left: 2px solid #e5e5e5;
  border-top: 2px solid #e5e5e5;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.lang-popover-inner {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 16px;
  padding: 18px 16px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-height: 360px;
  overflow-y: auto;
}

.lang-popover-kicker {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1cb0f6;
  margin-bottom: 4px;
}

.lang-popover-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #3c3c3c;
  margin-bottom: 14px;
  line-height: 1.2;
}

.lang-popover-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-popover-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.lang-popover-option:hover {
  background: #f0f9ff;
  border-color: #93c5fd;
}

.lang-popover-option.active {
  background: #f0f9ff;
  border-color: #1cb0f6;
}

.lang-popover-option .material-symbols-outlined {
  font-size: 1.3rem;
  color: #1cb0f6;
}

.lang-popover-option strong {
  font-size: 1rem;
  font-weight: 800;
  color: #3c3c3c;
  display: block;
  line-height: 1.1;
}

.lang-popover-option small {
  font-size: 0.78rem;
  font-weight: 600;
  color: #777;
}

/* Legacy level popover styles kept for mobile-level-modal */
.level-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.level-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.level-popover.is-open::after {
  content: '';
  position: absolute;
  top: -28px;
  left: -40px;
  right: -40px;
  height: 28px;
  pointer-events: auto;
}

.level-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-left: 2px solid #e5e5e5;
  border-top: 2px solid #e5e5e5;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.level-popover-inner {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 16px;
  padding: 18px 16px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.level-popover-kicker {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9600;
  margin-bottom: 4px;
}

.level-popover-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #3c3c3c;
  margin-bottom: 14px;
  line-height: 1.2;
}

.level-popover-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-popover-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.level-popover-option:hover {
  background: #fff8e6;
  border-color: #f0d090;
}

.level-popover-option.active {
  background: #fff8e6;
  border-color: #ff9600;
}

.level-popover-option .material-symbols-outlined {
  font-size: 1.3rem;
  color: #ff9600;
}

.level-popover-option strong {
  font-size: 1rem;
  font-weight: 800;
  color: #3c3c3c;
  display: block;
  line-height: 1.1;
}

.level-popover-option small {
  font-size: 0.78rem;
  font-weight: 600;
  color: #777;
}

/* ── Dictionary popover (Duolingo-style) ── */
.stats-bar-dict-wrap {
  position: relative;
  display: inline-flex;
}

.dict-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.dict-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.dict-popover.is-open::after {
  content: '';
  position: absolute;
  top: -28px;
  left: -40px;
  right: -40px;
  height: 28px;
  pointer-events: auto;
}

.dict-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: var(--bg-light, #F4F7FF);
  border-left: 2px solid var(--border-light, #e8ecf4);
  border-top: 2px solid var(--border-light, #e8ecf4);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.dict-popover-inner {
  background: var(--bg-light, #F4F7FF);
  border: 2px solid var(--border-light, #e8ecf4);
  border-radius: 16px;
  padding: 16px 14px 12px;
  box-shadow: 0 8px 24px rgba(45, 46, 95, 0.12);
}

.dict-popover-title {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark, #2D2E5F);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dict-popover-title .material-symbols-outlined {
  font-size: 1.3rem;
  color: var(--secondary, #1E9D8E);
}

.dict-popover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dict-popover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border-light, #e8ecf4);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: var(--white, #fff);
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.dict-popover-card:hover {
  background: var(--white, #fff);
  border-color: var(--secondary, #1E9D8E);
  transform: translateY(-2px);
}

.dict-popover-card .material-symbols-outlined {
  font-size: 1.3rem;
  color: var(--secondary, #1E9D8E);
}

.dict-popover-card span:last-child {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dark, #2D2E5F);
  font-family: 'Fredoka', 'Nunito', sans-serif;
  text-align: center;
  line-height: 1.2;
}

/* ── Streak popover (Duolingo-style) ── */
.stats-bar-streak-wrap {
  position: relative;
  display: inline-flex;
}

.streak-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.streak-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.streak-popover.is-open::after {
  content: '';
  position: absolute;
  top: -28px;
  left: -40px;
  right: -40px;
  height: 28px;
  pointer-events: auto;
}

.streak-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: #fff8e6;
  border-left: 2px solid #f0e0b8;
  border-top: 2px solid #f0e0b8;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.streak-popover-inner {
  background: #fff8e6;
  border: 2px solid #f0e0b8;
  border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.streak-popover-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}

.streak-popover-count {
  font-family: 'Nunito', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ce7c3a;
  margin-bottom: 6px;
  line-height: 1.2;
}

.streak-popover-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #5c5c5c;
  line-height: 1.35;
  max-width: 200px;
}

.streak-popover-flame-bg {
  font-size: 4.5rem !important;
  color: rgba(206, 124, 58, 0.18);
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.streak-popover-week {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px 12px;
  border: 2px solid #ebebeb;
}

.streak-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.streak-week-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #afafaf;
  text-transform: uppercase;
}

.streak-week-today .streak-week-label {
  color: #ff9600;
}

.streak-week-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e5e5;
  display: block;
}

.streak-week-done .streak-week-circle {
  background: #1cb0f6;
  position: relative;
}

.streak-week-done .streak-week-circle::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.streak-week-today.streak-week-done .streak-week-circle {
  background: #ff9600;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.streak-week-today.streak-week-done .streak-week-circle::after {
  transform: rotate(45deg);
}

/* ── Desktop mode cards (Duolingo-style center content) ── */
.desktop-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-bottom: 4px solid #d0d0d0;
  border-radius: 18px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, transform 0.1s, box-shadow 0.1s;
}

.mode-card:hover {
  border-color: #c8c8c8;
  border-bottom-color: #b8b8b8;
  background: #fafafa;
}

.mode-card:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.mode-card-body {
  flex: 1;
  min-width: 0;
}

.mode-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.mode-card-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #3c3c3c;
  line-height: 1.2;
}

.mode-card-super {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1cb0f6 0%, #ce82ff 50%, #ff4b9a 100%);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mode-card-status {
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #777;
  line-height: 1.35;
}

.mode-card-status-done {
  color: #58a700;
  font-weight: 700;
}

.mode-card-icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mode-card-icon .material-symbols-outlined {
  font-size: 3.25rem;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
  line-height: 1;
}

.mode-card-icon-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4b4b;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}

/* ── Desktop layout: home mode cards ── */
@media (min-width: 769px) {
  .desktop-mode-cards {
    display: flex;
  }

  body:has(.dashboard-layout) .app-container {
    max-width: none;
    margin: 0;
    padding: 0 0 0 var(--dashboard-left-sidebar-width);
    background: #f7f7f7;
    min-height: 100vh;
    box-sizing: border-box;
  }

  .dashboard-layout {
    max-width: none;
    grid-template-columns: minmax(0, 1fr) var(--dashboard-right-sidebar-width);
    gap: 20px;
    padding: var(--dashboard-top-spacing, 28px) 0 0 12px;
    margin: 0;
    width: 100%;
  }

  .dashboard-layout > .dashboard-left-sidebar.dashboard-sidebar-shell {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: var(--dashboard-left-sidebar-width);
    z-index: 50;
    padding: 16px 12px;
    background: #fff;
    border-right: 2px solid #e5e5e5;
    box-sizing: border-box;
    overflow-y: auto;
    align-self: stretch;
    max-height: none;
  }

  .dashboard-left-sidebar {
    border-right: none;
    padding-right: 0;
    position: static;
    top: auto;
    align-self: auto;
    max-height: none;
    overflow-y: visible;
  }

  .dashboard-center {
    min-width: 0;
    padding-top: 4px;
    padding-left: 14px;
    padding-right: 16px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-center .dashboard-home-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .dashboard-right-sidebar {
    padding-top: 4px;
    padding-right: 16px;
    z-index: 5;
  }

  .dashboard-right-sidebar .main-nav-stats-bar {
    position: relative;
    z-index: 1500;
  }

  .dashboard-center {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 768px) {
  body:has(.dashboard-layout) .app-container {
    padding-left: 0;
    padding-right: 0;
    background: #f7f7f7;
  }

  .main-nav-sidebar {
    display: none !important;
  }

  .dashboard-right-sidebar {
    display: none !important;
  }

  .desktop-mode-cards {
    display: flex !important;
  }

  .dashboard-center-header {
    display: none;
  }

  .mobile-learn-pane--legacy,
  .mobile-app-hero {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-nav-top-bar,
  .mobile-bottom-nav--duo,
  .mobile-menu-sheet {
    display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --dashboard-right-sidebar-width: 260px;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) var(--dashboard-right-sidebar-width);
    gap: 14px;
    padding: 24px 0 0 10px;
  }

  .dashboard-layout > .dashboard-left-sidebar.dashboard-sidebar-shell {
    padding: 12px 10px;
  }

  .mode-card {
    padding: 18px 20px;
    gap: 12px;
  }

  .mode-card-title {
    font-size: 1.1rem;
  }

  .mode-card-icon-wrap {
    width: 60px;
    height: 60px;
  }

  .mode-card-icon .material-symbols-outlined {
    font-size: 2.75rem;
  }
}

/* ── Mobile top bar (Duolingo-style stats header) ── */
/* Disabled: the mobile header (brand + language/streak/dictionary/calculator)
   must never render on phones; the app keeps only the fixed bottom nav. */
.mobile-nav-top-bar {
  display: none !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 1100;
  margin: 0 -4px 12px;
  padding: 10px 8px 12px;
  background: #f7f7f7;
  border-bottom: 2px solid #e5e5e5;
}

.mobile-nav-top-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.mobile-nav-top-logo {
  height: 36px;
  width: auto;
  display: block;
}

.mobile-nav-top-stats {
  flex: 1;
  min-width: 0;
}

.mobile-nav-top-stats .main-nav-stats-bar {
  padding: 0;
  justify-content: flex-end;
}

.mobile-nav-top-stats .stats-bar-item {
  padding: 6px 8px;
  font-size: 0.88rem;
  min-height: 36px;
}

.mobile-nav-top-stats .stats-bar-item .material-symbols-outlined {
  font-size: 1.15rem;
}

/* ── Mobile bottom nav (Duolingo-style) ── */
.mobile-bottom-nav--duo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 1200;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  border: none;
  border-top: 2px solid #e5e5e5;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.mobile-bottom-nav--duo .mobile-bottom-nav-btn {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #afafaf;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mobile-bottom-nav--duo .mobile-bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--nav-color, #1cb0f6) 14%, white);
}

.mobile-bottom-nav--duo .mobile-bottom-nav-icon .material-symbols-outlined {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--nav-color, #1cb0f6);
}

.mobile-bottom-nav--duo .mobile-bottom-nav-btn.active {
  background: #ddf4ff;
  border-color: #84d8ff;
  color: #1899d6;
}

.mobile-bottom-nav--duo .mobile-bottom-nav-btn.active .mobile-bottom-nav-icon {
  background: color-mix(in srgb, #1899d6 18%, white);
}

.mobile-bottom-nav--duo .mobile-bottom-nav-btn.active .mobile-bottom-nav-icon .material-symbols-outlined {
  color: #1899d6;
}

/* ── Mobile menu sheet (More) ── */
.mobile-menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.mobile-menu-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-menu-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mobile-menu-sheet.is-open .mobile-menu-sheet-backdrop {
  opacity: 1;
}

.mobile-menu-sheet-panel {
  position: relative;
  width: min(100%, 430px);
  max-height: min(78vh, 560px);
  overflow-y: auto;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.mobile-menu-sheet.is-open .mobile-menu-sheet-panel {
  transform: translateY(0);
}

.mobile-menu-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 4px auto 10px;
  border-radius: 999px;
  background: #e5e5e5;
}

.mobile-menu-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.mobile-menu-sheet-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #3c3c3c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobile-menu-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #777;
  cursor: pointer;
}

.mobile-menu-sheet-close .material-symbols-outlined {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  transform: translate(-0.5px, 0.5px);
}

.mobile-menu-sheet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-sheet-item {
  width: 100%;
}

body.mobile-menu-open,
body.mobile-popover-open {
  overflow: hidden;
}

/* ── Mobile mode cards ── */
@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  .desktop-mode-cards {
    gap: 14px;
    padding-bottom: 8px;
  }

  .mode-card {
    padding: 18px 20px;
    border-radius: 16px;
    border-bottom: 4px solid #d0d0d0;
  }

  .mode-card-title {
    font-size: 1.05rem;
  }

  .mode-card-icon-wrap {
    width: 56px;
    height: 56px;
  }

  .mode-card-icon .material-symbols-outlined {
    font-size: 2.5rem;
  }

  .dashboard-center:has(.mobile-bottom-nav--duo),
  .dashboard-center--subpage:has(.mobile-bottom-nav--duo) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .dashboard-home:has(.mobile-bottom-nav--duo) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile popovers as bottom sheets */
  .mobile-nav-top-stats .lang-popover,
  .mobile-nav-top-stats .streak-popover,
  .mobile-nav-top-stats .dict-popover {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    transform: translateY(12px);
    z-index: 2600;
  }

  .mobile-nav-top-stats .lang-popover {
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-top-stats .lang-popover .lang-popover-inner {
    max-height: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .mobile-nav-top-stats .lang-popover.is-open,
  .mobile-nav-top-stats .streak-popover.is-open,
  .mobile-nav-top-stats .dict-popover.is-open {
    transform: translateY(0);
  }

  .mobile-nav-top-stats .lang-popover::before,
  .mobile-nav-top-stats .streak-popover::before,
  .mobile-nav-top-stats .dict-popover::before {
    display: none;
  }
}

/* Desktop: escape the scrollable right sidebar so the language picker is not clipped */
@media (min-width: 901px) {
  .dashboard-right-sidebar .lang-popover.is-open {
    position: fixed;
    z-index: 2600;
  }

  .dashboard-layout:not(.dashboard-layout--crossword-play):not(.dashboard-layout-right-closed) > .dashboard-right-sidebar:has(.lang-popover.is-open) {
    overflow: visible;
  }
}
