/*
 * Theme tokens. Defaults preserve the existing visual exactly. Theme override
 * stylesheets (e.g. /css/theme-sunset.css) only redefine these variables.
 */
:root {
  /* Type — editorial stack used by homepage / morefun / auth pages.
     Pages may opt in by setting font-family: var(--font-serif|sans|mono).
     Themes can override --font-* without touching markup. */
  --font-serif: 'Iowan Old Style', 'Hoefler Text', 'Apple Garamond', 'Palatino Linotype',
                'Source Han Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong',
                Georgia, 'Times New Roman', serif;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Mono', 'Roboto Mono', ui-monospace,
               Menlo, Consolas, monospace;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.85);
  --text-tertiary: rgba(255,255,255,0.72);
  --text-muted: rgba(255,255,255,0.55);
  --text-faint: rgba(255,255,255,0.4);
  --text-placeholder: rgba(255,255,255,0.5);

  /* Accent */
  --accent: #93c5fd;
  --accent-soft: #bfdbfe;
  --coin-gold: #ffd76b;
  --error: #ff6b6b;
  --error-soft: #fecaca;

  /* Glass surfaces */
  --surface-card: rgba(255,255,255,0.08);
  --surface-card-hover: rgba(255,255,255,0.16);
  --surface-panel: rgba(255,255,255,0.10);
  --surface-section: rgba(0,0,0,0.45);
  --surface-input: rgba(255,255,255,0.10);
  --surface-header: rgba(255,255,255,0.15);
  --surface-header-hover: rgba(255,255,255,0.25);
  --surface-header-strong: rgba(255,255,255,0.28);

  /* Borders */
  --border-soft: rgba(255,255,255,0.10);
  --border-medium: rgba(255,255,255,0.20);
  --border-bright: rgba(255,255,255,0.30);
  --border-input-focus: rgba(255,255,255,0.60);
  --glass-card-border: rgba(255,255,255,0.08);
  --glass-panel-border: rgba(255,255,255,0.06);

  /* Shadows */
  --shadow-card: 0 12px 40px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.12);
  --shadow-panel: 0 12px 36px rgba(0,0,0,0.18);
  --shadow-section: 0 12px 32px rgba(0,0,0,0.18);
  --shadow-header-hover: 0 4px 16px rgba(0,0,0,0.15);
  --shadow-nav-card-hover: 0 16px 40px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.15);
  --nav-card-border: rgba(255,255,255,0.10);
  --nav-card-border-hover: rgba(255,255,255,0.20);
  --nav-card-ring-hover: rgba(255,255,255,0.18);

  /* Decorative gradients (homepage hero + footer + dividers) */
  --hero-text-gradient: linear-gradient(135deg, #ffffff 0%, #bfdbfe 50%, #ddd6fe 100%);
  --section-divider-gradient: linear-gradient(90deg, rgba(255,255,255,0.18), transparent);
  --nav-card-tint-gradient: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  --footer-gradient: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.18) 70%, transparent 100%);
  --footer-gradient-mobile: linear-gradient(to top, rgba(0,0,0,0.55), transparent);

  /* Buttons */
  --btn-bg: linear-gradient(135deg, rgba(96,165,250,0.92) 0%, rgba(59,130,246,0.85) 100%);
  --btn-bg-hover: linear-gradient(135deg, rgba(125,180,255,1) 0%, rgba(74,143,250,0.95) 100%);
  --btn-text: #ffffff;
  --btn-border: rgba(255,255,255,0.18);
  --btn-border-hover: rgba(255,255,255,0.42);
  --btn-shadow: 0 6px 18px rgba(59,130,246,0.30);
  --btn-shadow-hover: 0 12px 28px rgba(59,130,246,0.45);
  --btn-frame: linear-gradient(135deg, rgba(191,219,254,0.85), rgba(147,197,253,0.55), rgba(96,165,250,0.85));
  --btn-shine: rgba(255,255,255,0.32);
  --btn-disabled-bg: rgba(255,255,255,0.10);
  --btn-disabled-text: rgba(255,255,255,0.55);

  /* Site background (themes can override --site-bg-image) */
  --site-bg-image: url("/bg.jpg");

  /*
   * Per-app card backgrounds. Each game / tool / extras link uses a named
   * key (in services/game-catalog.js) which maps to one of these tokens.
   * Themes may optionally re-tint (warm-shift / cool-shift) but the default
   * palette preserves each app's identity color.
   */
  --game-bg-azure:   rgba(100,150,255,0.40);
  --game-bg-lime:    rgba(100,255,150,0.40);
  --game-bg-amber:   rgba(255,180,100,0.40);
  --game-bg-coral:   rgba(255,140,80,0.40);
  --game-bg-violet:  rgba(170,130,255,0.42);
  --game-bg-pink:    rgba(255,120,180,0.42);
  --game-bg-sky:     rgba(125,211,252,0.38);
  --game-bg-emerald: rgba(34,197,94,0.38);
  --game-bg-honey:   rgba(245,158,11,0.36);
  --game-bg-indigo:  rgba(99,130,240,0.30);
  --game-bg-rose:    rgba(220,100,150,0.35);
  --game-bg-gold:    rgba(255,200,60,0.42);
  --game-bg-gold-soft: rgba(255,200,60,0.32);
  --game-bg-neutral: rgba(255,255,255,0.18);

  /* Theme-wide wash applied over every nav-card. Default = no tint, so
   * each app keeps its identity color. Themes set this to a uniform
   * translucent gradient for a subtle warm / cool shift across the grid. */
  --card-theme-tint: none;
}

body.site-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-primary);
  margin: 0;
  background-color: #06111f;
  background-image: linear-gradient(rgba(6,17,31,0.22), rgba(6,17,31,0.22)), var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.site-page-auth {
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  box-sizing: border-box;
}

body.site-page-auth .auth-card {
  margin: auto;
}

@media (max-width: 420px) {
  body.site-page-auth {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    min-height: 100dvh;
  }
}

body.site-page-shop {
  padding: 0 20px 60px;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (max-width: 420px) {
  body.site-page-shop {
    padding: 0 12px 40px;
  }
}

body.site-page h1 {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

body.site-page-home {
  text-align: center;
  min-height: 100vh;
  padding-bottom: 100px;
  box-sizing: border-box;
}

body.site-page-centered {
  text-align: center;
  padding: 40px 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

body.site-page-dictionary {
  min-height: 100vh;
}

.site-page .auth-bar {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 100;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100vw - 32px);
}

.site-page .auth-bar a,
.site-page .auth-bar span {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  padding: 8px 18px;
  background: var(--surface-header);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  min-width: auto;
  min-height: 44px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  transition: all 0.25s ease;
}

.site-page .auth-bar a:hover {
  background: var(--surface-header-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-header-hover);
}

/* Hide admin shortcut links on narrow viewports — admin can still reach
 * the management pages via the banner iframe's "更多" dropdown on the
 * other pages, and from desktop the full row is visible. */
@media (max-width: 540px) {
  .site-page .auth-bar .auth-admin-link {
    display: none;
  }
}

.site-page .glass-card {
  background: var(--surface-section);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--glass-card-border);
}

.site-page .glass-panel {
  background: var(--surface-panel);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-panel);
  border: 1px solid var(--glass-panel-border);
}

.site-page .page-links {
  margin-top: 24px;
}

.site-page .page-links a {
  display: inline-block;
  padding: 10px 24px;
  background: var(--surface-header);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  margin: 4px;
  transition: background 0.3s;
  min-height: 44px;
  box-sizing: border-box;
}

.site-page .page-links a:hover {
  background: var(--surface-header-hover);
}

.site-page .back-link {
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 16px;
  opacity: 0.9;
}

.site-page .back-link:hover {
  color: var(--accent-soft);
}

.site-page .auth-card {
  padding: 40px;
  width: 360px;
  max-width: 90vw;
  background: rgba(0,0,0,0.62);
  box-sizing: border-box;
}

.site-page .auth-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--surface-input);
  color: var(--text-primary);
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
}

.site-page .auth-input::placeholder {
  color: rgba(255,255,255,0.64);
}

.site-page .auth-input:focus {
  border-color: var(--border-input-focus);
}

.site-page .auth-error {
  color: var(--error);
  margin-bottom: 16px;
  min-height: 20px;
  font-size: 14px;
}

.site-page .auth-error:empty {
  display: none;
}

.site-page .form-links {
  margin-top: 20px;
  font-size: 14px;
}

.site-page-auth .form-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-page .form-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  box-sizing: border-box;
}

.site-page .form-links a:hover {
  color: var(--text-primary);
}

.site-page .form-hint {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-tertiary);
  margin-top: -8px;
  margin-bottom: 14px;
  text-align: left;
}

@media (max-width: 420px) {
  .site-page .form-hint {
    margin-top: -6px;
    margin-bottom: 18px;
  }
  .site-page .auth-card {
    padding: 28px 24px;
  }
  body.site-page-centered {
    padding: 24px 16px;
    min-height: 100dvh;
  }
}

.site-page .glass-section {
  background: var(--surface-section);
  backdrop-filter: blur(18px);
  border-radius: 16px;
  box-shadow: var(--shadow-section);
}

/*
 * Themed button. Applied to every <button> inside .site-page (excluding
 * pill-shaped .tab buttons in the leaderboard). The shine sweep + frame
 * are pseudo-elements; themes override --btn-* tokens to restyle without
 * touching markup. Pages with intentionally different buttons (e.g. red
 * .session-revoke, .logout-btn) bump their own selector specificity to
 * win the cascade tie.
 */
.site-page button:not(.tab):not(.no-btn-style),
.site-page .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.18s ease,
              box-shadow 0.25s ease,
              background 0.25s ease,
              border-color 0.25s ease,
              filter 0.25s ease;
  box-shadow: var(--btn-shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Shine sweep — diagonal highlight slides across on hover */
.site-page button:not(.tab):not(.no-btn-style)::before,
.site-page .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent 10%, var(--btn-shine) 50%, transparent 90%);
  transform: skewX(-18deg);
  transition: left 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 1;
}

/* Animated gradient frame — fades in around the button on hover */
.site-page button:not(.tab):not(.no-btn-style)::after,
.site-page .btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--btn-frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.site-page button:not(.tab):not(.no-btn-style):hover,
.site-page .btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
}

.site-page button:not(.tab):not(.no-btn-style):hover::before,
.site-page .btn:hover::before {
  left: 130%;
}

.site-page button:not(.tab):not(.no-btn-style):hover::after,
.site-page .btn:hover::after {
  opacity: 1;
}

.site-page button:not(.tab):not(.no-btn-style):active,
.site-page .btn:active {
  transform: translateY(0) scale(0.97);
}

.site-page button:not(.tab):not(.no-btn-style):focus-visible,
.site-page .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-page button:not(.tab):not(.no-btn-style)[disabled],
.site-page .btn[disabled] {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  cursor: default;
  box-shadow: none;
  transform: none;
  border-color: var(--border-soft);
  filter: none;
}

.site-page button:not(.tab):not(.no-btn-style)[disabled]::before,
.site-page button:not(.tab):not(.no-btn-style)[disabled]::after,
.site-page .btn[disabled]::before,
.site-page .btn[disabled]::after {
  display: none;
}

@media (max-width: 680px) {
  body.site-page-dictionary {
    background-attachment: scroll;
  }
  /* iOS Safari does not support background-attachment: fixed — fall back gracefully */
  body.site-page {
    background-attachment: scroll;
    background-size: cover;
  }
  .banner-frame { height: 56px; }
}

@media (max-width: 420px) {
  .banner-frame { height: 54px; margin-top: 20px; margin-bottom: 16px; }
  .site-page .page-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .site-page .page-links a {
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 10px 10px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px;
    box-sizing: border-box;
  }
}

/* ===== Global entrance animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmerGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* --- Banner iframe (shared across all sub-pages) --- */
.banner-frame {
  width: 100%;
  border: none;
  height: 52px;
  display: block;
  margin-top: 40px;
  margin-bottom: 30px;
}

@media (max-width: 680px) {
  .banner-frame { height: 52px; }
}

@media (max-width: 420px) {
  .banner-frame { height: 52px; margin-top: 20px; margin-bottom: 16px; }
}

/*
 * Section + card grid layout (used by index.html, but reusable by any
 * page that wants the homepage card-grid look — e.g. a future user
 * dashboard).
 */
.section-group {
  max-width: 960px;
  margin: 0 auto 36px;
  padding: 0 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-left: 4px;
}

.section-icon { font-size: 22px; }

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-divider {
  flex: 1;
  height: 1px;
  background: var(--section-divider-gradient);
  margin-left: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/*
 * Per-app card tints. data-bg key set by JS from services/game-catalog.js.
 * Falls back to --game-bg-neutral if the key is missing or unrecognized.
 * background-color stays per-app (identity); background-image is the
 * theme wash so themes can shift the whole grid warm/cool without
 * collapsing each app's distinct hue.
 */
.nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 18px;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nav-card-border);
  animation: fadeInUp 0.4s ease-out both;
  background-image: var(--card-theme-tint);
}

.nav-card[data-bg]                  { background-color: var(--game-bg-neutral); }
.nav-card[data-bg="azure"]          { background-color: var(--game-bg-azure); }
.nav-card[data-bg="lime"]           { background-color: var(--game-bg-lime); }
.nav-card[data-bg="amber"]          { background-color: var(--game-bg-amber); }
.nav-card[data-bg="coral"]          { background-color: var(--game-bg-coral); }
.nav-card[data-bg="violet"]         { background-color: var(--game-bg-violet); }
.nav-card[data-bg="pink"]           { background-color: var(--game-bg-pink); }
.nav-card[data-bg="sky"]            { background-color: var(--game-bg-sky); }
.nav-card[data-bg="emerald"]        { background-color: var(--game-bg-emerald); }
.nav-card[data-bg="honey"]          { background-color: var(--game-bg-honey); }
.nav-card[data-bg="indigo"]         { background-color: var(--game-bg-indigo); }
.nav-card[data-bg="rose"]           { background-color: var(--game-bg-rose); }
.nav-card[data-bg="gold"]           { background-color: var(--game-bg-gold); }
.nav-card[data-bg="gold-soft"]      { background-color: var(--game-bg-gold-soft); }

.nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nav-card-tint-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Themed inner-ring — fades in on hover */
.nav-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 var(--nav-card-ring-hover);
  pointer-events: none;
  transition: box-shadow 0.32s ease;
}

.nav-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-nav-card-hover);
  border-color: var(--nav-card-border-hover);
}

.nav-card:hover::before { opacity: 1; }
.nav-card:hover::after  { box-shadow: inset 0 0 0 1.5px var(--nav-card-ring-hover); }
.nav-card:active        { transform: translateY(-2px) scale(1.01); }

.card-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

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

.card-label {
  font-size: 17px;
  font-weight: 600;
  display: block;
  line-height: 1.3;
  /* Subtle drop shadow keeps white text legible on lighter app tints
   * (honey amber, sky cyan, lime green) while staying invisible on dark. */
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.card-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  display: block;
  margin-top: 2px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.card-arrow {
  font-size: 18px;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.nav-card:hover .card-arrow {
  opacity: 0.7;
  transform: translateX(0);
}

/* Stagger entry animations across the grid (up to 12 cards). Tighter
 * intervals so the last card lands ~0.7s into the page rather than 1.1s. */
.nav-card:nth-child(1)  { animation-delay: 0.03s; }
.nav-card:nth-child(2)  { animation-delay: 0.06s; }
.nav-card:nth-child(3)  { animation-delay: 0.09s; }
.nav-card:nth-child(4)  { animation-delay: 0.12s; }
.nav-card:nth-child(5)  { animation-delay: 0.15s; }
.nav-card:nth-child(6)  { animation-delay: 0.18s; }
.nav-card:nth-child(7)  { animation-delay: 0.21s; }
.nav-card:nth-child(8)  { animation-delay: 0.24s; }
.nav-card:nth-child(9)  { animation-delay: 0.27s; }
.nav-card:nth-child(10) { animation-delay: 0.30s; }
.nav-card:nth-child(11) { animation-delay: 0.33s; }
.nav-card:nth-child(12) { animation-delay: 0.36s; }

.empty-state {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  padding: 48px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

/* Responsive: tablet — 2 columns */
@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Responsive: mobile — single column, app-like list rows */
@media (max-width: 540px) {
  .section-group  { padding: 0 16px; margin-bottom: 24px; }
  .section-header { margin-bottom: 12px; }
  .section-icon   { font-size: 18px; }
  .section-title  { font-size: 14px; letter-spacing: 0.3px; }
  .card-grid      { gap: 12px; }

  .nav-card {
    flex-direction: row;
    align-items: center;
    padding: 16px 18px;
    border-radius: 16px;
    min-height: 0;
    -webkit-tap-highlight-color: rgba(255,255,255,0.12);
  }
  .nav-card:hover  { transform: none; }
  .nav-card:active {
    transform: scale(0.98);
    background-color: rgba(255,255,255,0.22) !important;
  }
  .card-icon { font-size: 26px; width: 36px; text-align: center; }
  .card-label { font-size: 15.5px; font-weight: 600; }
  .card-desc {
    font-size: 13.5px;
    margin-top: 1px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
  }
  .card-arrow { display: none; }
  .empty-state { padding: 32px 16px; font-size: 15px; }
}

/* Extra-small phones — single column for comfortable reading */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .nav-card {
    padding: 14px 16px;
  }
  .card-icon { font-size: 28px; width: 40px; }
  .card-label { font-size: 16px; }
  .card-desc { -webkit-line-clamp: 2; }
}
