/* Everywhen — shared UI: theme tokens (CYBER / MONO / 8-BIT), brand, header buttons and the settings panel.
   Loaded by the main map (before style.css) and by every subpage, so all pages look and behave the same. */
/* 8-BIT pixel font, served from this site (SIL Open Font License, /fonts/press-start-2p/OFL.txt).
   Browsers download it only on pages that draw with it, i.e. once 8-BIT is picked. */
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/press-start-2p/press-start-2p-cyrillic-ext-400-normal.woff2) format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/press-start-2p/press-start-2p-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/press-start-2p/press-start-2p-greek-400-normal.woff2) format('woff2'); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/press-start-2p/press-start-2p-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/press-start-2p/press-start-2p-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ==========================================================================
       CSS VARIABLES & THEME DEFINITIONS
       ========================================================================== */
    :root {
      --font-mono: 'SF Mono', Consolas, Monaco, monospace;
      --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-pixel: 'Press Start 2P', monospace, sans-serif;
      --transition-smooth: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      /* page type and spacing shared by every subpage (world clock, planner, privacy, credits, 404) */
      --fs-h1: clamp(22px, 5vw, 32px);
      --fs-h2: 18px;
      --fs-sub: 14px;      /* line under the page title */
      --fs-label: 13px;    /* small uppercase section labels */
      --fs-note: 12.5px;   /* footnotes under a block */
      --space-head: 22px;  /* page title block to the content */
      --space-section: 30px; /* above each section heading */
    }

    /* Cyberpunk Theme (Default) */
    body[data-theme="cyberpunk"] {
      --bg-color: #03070d;
      --bg-gradient: radial-gradient(circle at 50% 45%, #071526 0%, #020509 100%);
      --text-main: #e6f4fa;
      --text-muted: #6e8e9e;
      --accent: #00ffaa;
      --accent-glow: rgba(0, 255, 170, 0.45);
      --accent-secondary: #00e5ff;
      --accent-secondary-glow: rgba(0, 229, 255, 0.4);
      --amber-gold: #ffaa00;
      --amber-glow: rgba(255, 170, 0, 0.65);
      --card-bg: rgba(7, 16, 28, 0.95);
      --card-border: rgba(0, 229, 255, 0.35);
      --card-border-glow: 0 0 25px rgba(0, 229, 255, 0.18);
      --land-day: #00ff9d;
      --land-night: #1c3552;
      --land-twilight: #2dd4bf;
      --globe-ocean: #040b17;
      --globe-atmosphere: rgba(0, 229, 255, 0.25);
      --city-beacon: #ffaa00;
      --hud-font: var(--font-mono);
      --border-radius: 8px;
    }

    /* Minimal Monochrome Theme (Clean Black & Platinum White) */
    body[data-theme="mono"],
    body[data-theme="luxury"] {
      --bg-color: #06080d;
      --bg-gradient: radial-gradient(circle at 50% 45%, #0f141f 0%, #040508 100%);
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --accent: #ffffff;
      --accent-glow: rgba(255, 255, 255, 0.6);
      --accent-secondary: #cbd5e1;
      --accent-secondary-glow: rgba(203, 213, 225, 0.25);
      --amber-gold: #ffffff;
      --amber-glow: rgba(255, 255, 255, 0.8);
      --card-bg: rgba(11, 15, 23, 0.95);
      --card-border: rgba(255, 255, 255, 0.20);
      --card-border-glow: 0 20px 50px rgba(0, 0, 0, 0.8);
      --land-day: #4f5d6f;
      --land-night: #18202c;
      --land-twilight: #333f50;
      --globe-ocean: #070a10;
      --globe-atmosphere: rgba(255, 255, 255, 0.18);
      --city-beacon: #ffffff;
      --hud-font: var(--font-sans);
      --border-radius: 14px;
    }

    /* Retro 8-bit Arcade Theme */
    body[data-theme="retro"] {
      --bg-color: #120e24;
      --bg-gradient: radial-gradient(circle at 50% 45%, #1d163d 0%, #0d091b 100%);
      --text-main: #fce762;
      --text-muted: #9c8dc4;
      --accent: #5cd688;
      --accent-glow: rgba(92, 214, 136, 0.45);
      --accent-secondary: #ff5e7e;
      --accent-secondary-glow: rgba(255, 94, 126, 0.4);
      --amber-gold: #ffd152;
      --amber-glow: rgba(255, 209, 82, 0.65);
      --card-bg: rgba(24, 18, 48, 0.96);
      --card-border: #ffffff;
      --card-border-glow: 0 0 0 2px #120e24, 0 0 0 4px #5cd688;
      --land-day: #5cd688;
      --land-night: #3e326b;
      --land-twilight: #a3e635;
      --globe-ocean: #150d2c;
      --globe-atmosphere: rgba(92, 214, 136, 0.28);
      --city-beacon: #ffd152;
      --hud-font: var(--font-pixel);
      --border-radius: 0px;
    }

    /* Retro Font Size Scaling: Bold, legible 8-bit typography & unified heights */
    body[data-theme="retro"] .brand-section {
      height: 38px;
      box-sizing: border-box;
    }
    body[data-theme="retro"] .brand-title {
      font-size: 12px;
      letter-spacing: -0.5px;
    }
    body[data-theme="retro"] .brand-badge {
      font-size: 9px;
    }
    body[data-theme="retro"] .search-input-box {
      height: 38px;
      box-sizing: border-box;
      font-size: 10.5px;
    }
    body[data-theme="retro"] .top-action-btn {
      height: 38px;
      box-sizing: border-box;
      font-size: 10px;
      padding: 0 12px;
      gap: 6px;
    }
    body[data-theme="retro"] .settings-dropdown {
      width: 375px;
      padding: 16px 18px;
      gap: 14px;
    }
    body[data-theme="retro"] .settings-header {
      font-size: 13px;
      font-weight: 800;
      padding-bottom: 10px;
      letter-spacing: -0.3px;
    }
    body[data-theme="retro"] .settings-label {
      font-size: 11.5px;
      font-weight: 700;
      margin-bottom: 6px;
      letter-spacing: -0.3px;
    }
    body[data-theme="retro"] .theme-btn {
      font-family: var(--font-pixel), monospace;
      font-size: 11.5px;
      font-weight: 700;
      padding: 8px 6px;
      gap: 6px;
      min-height: 38px;
      letter-spacing: -0.5px;
    }

    .brand-section {
      height: 38px;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      padding: 0 16px;
      border-radius: var(--border-radius);
      box-shadow: var(--card-border-glow);
    }

    .logo-pulse {
      width: 10px;
      height: 10px;
      background: var(--accent);
      border-radius: 50%;
      box-shadow: 0 0 10px var(--accent);
      animation: pulse-ring 2s infinite;
    }

    @keyframes pulse-ring {
      0% { transform: scale(0.9); opacity: 1; }
      50% { transform: scale(1.3); opacity: 0.6; }
      100% { transform: scale(0.9); opacity: 1; }
    }

    .brand-title {
      font-weight: 800;
      font-size: 14px;
      letter-spacing: 1px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .brand-badge {
      font-size: 10px;
      padding: 2px 6px;
      background: rgba(0, 255, 170, 0.15);
      color: var(--accent);
      border: 1px solid var(--accent);
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .top-action-btn {
      height: 38px;
      box-sizing: border-box;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      color: var(--text-main);
      padding: 0 13px;
      border-radius: var(--border-radius);
      cursor: pointer;
      font-size: 12.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: var(--card-border-glow);
      transition: var(--transition-smooth);
      font-family: inherit;
      user-select: none;
      white-space: nowrap;
      /* the page's line-height must not leak in: with it, letters drawn from a fallback font (Hangul, kana) sit off-centre */
      line-height: normal;
    }

    .top-action-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      box-shadow: 0 0 14px var(--accent-glow);
    }

    /* Floating Settings Dropdown Panel */
    .settings-dropdown {
      position: absolute;
      top: calc(100% + 10px);
      inset-inline-end: 0;
      width: 360px;
      background: rgba(6, 14, 25, 0.96);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      padding: 16px 18px;
      border-radius: var(--border-radius);
      box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85), var(--card-border-glow);
      display: none;
      flex-direction: column;
      gap: 15px;
      z-index: 150;
      user-select: none;
      box-sizing: border-box;
    }

    .settings-dropdown.active {
      display: flex;
      animation: fadeInDown 0.18s ease-out;
    }

    @keyframes fadeInDown {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .settings-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 8px;
      font-size: 11.5px;
      font-weight: 800;
      color: var(--accent);
      letter-spacing: 0.8px;
    }

    .settings-close-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      padding: 0 4px;
      transition: var(--transition-smooth);
    }

    .settings-close-btn:hover {
      color: var(--text-main);
    }

    .settings-row {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .settings-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: 0.5px;
    }

    /* Theme Selectors */
    .theme-selector {
      display: flex;
      background: rgba(0, 0, 0, 0.45);
      border: 1px solid var(--card-border);
      padding: 2px;
      border-radius: 6px;
      gap: 2px;
    }

    .theme-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 8px 10px;
      border-radius: 4px;
      cursor: pointer;
      transition: var(--transition-smooth);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 1;
      justify-content: center;
      white-space: nowrap;
      min-height: 36px;
      box-sizing: border-box;
    }

    .theme-btn:hover {
      color: var(--text-main);
    }

    .theme-btn.active {
      background: var(--accent);
      color: #03070d;
      box-shadow: 0 0 10px var(--accent-glow);
    }

    /* Custom Glassmorphic Language Selector (20 Global Languages) */
    .lang-dropdown-wrapper {
      position: relative;
      width: 100%;
      box-sizing: border-box;
    }

    .lang-select-trigger {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(0, 0, 0, 0.45);
      border: 1px solid var(--card-border);
      padding: 8px 12px;
      border-radius: 6px;
      color: var(--text-main);
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: var(--transition-smooth);
      box-sizing: border-box;
    }

    .lang-select-trigger:hover,
    .lang-dropdown-wrapper.open .lang-select-trigger {
      border-color: var(--accent);
      box-shadow: 0 0 10px var(--accent-glow);
    }

    .lang-trigger-text {
      flex: 1;
      text-align: start;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      letter-spacing: 0.3px;
    }

    .lang-trigger-arrow {
      font-size: 11px;
      color: var(--text-muted);
      transition: transform 0.2s ease;
      margin-inline-start: 8px;
    }

    .lang-dropdown-wrapper.open .lang-trigger-arrow {
      transform: rotate(180deg);
      color: var(--accent);
    }

    .lang-dropdown-menu {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      background: rgba(6, 12, 22, 0.98);
      border: 1px solid var(--card-border);
      border-radius: 6px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.92), 0 0 15px var(--accent-glow);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      z-index: 200;
      padding: 6px;
      box-sizing: border-box;
      max-height: 250px;
      flex-direction: column;
      gap: 6px;
    }

    .lang-dropdown-wrapper.open .lang-dropdown-menu {
      display: flex;
      animation: fadeInDown 0.15s ease-out;
    }

    .lang-search-box {
      width: 100%;
      box-sizing: border-box;
      padding: 2px 0 4px 0;
    }

    .lang-search-input {
      width: 100%;
      background: rgba(0, 0, 0, 0.55);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-main);
      font-size: 11.5px;
      font-family: inherit;
      padding: 6px 10px;
      border-radius: 4px;
      box-sizing: border-box;
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .lang-search-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 8px var(--accent-glow);
    }

    .lang-options-list {
      display: flex;
      flex-direction: column;
      gap: 2px;
      overflow-y: auto;
      max-height: 185px;
      padding-inline-end: 2px;
    }

    .lang-options-list::-webkit-scrollbar {
      width: 4px;
    }

    .lang-options-list::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 2px;
    }

    .lang-option-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 10px;
      border-radius: 4px;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease;
      user-select: none;
      box-sizing: border-box;
    }

    a.lang-option-item { color: inherit; text-decoration: none; }

    .lang-option-item:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .lang-option-item.active {
      background: var(--accent);
      color: #03070d;
      font-weight: 700;
    }

    .lang-option-main {
      display: flex;
      align-items: baseline;
      gap: 6px;
    }

    .lang-native-name {
      font-size: 12px;
      font-weight: 700;
    }

    .lang-sub-name {
      font-size: 10px;
      color: var(--text-muted);
    }

    .lang-option-item.active .lang-sub-name {
      color: #03070d;
      opacity: 0.85;
    }

    .lang-check-icon {
      font-size: 12px;
      font-weight: 900;
      opacity: 0;
    }

    .lang-option-item.active .lang-check-icon {
      opacity: 1;
    }

    /* The brand pill is a link to the map on every page */
    a.brand-section { color: var(--text-main); text-decoration: none; cursor: pointer; transition: var(--transition-smooth); }
    a.brand-section:hover { border-color: var(--accent); text-decoration: none; }

    /* City search box (map header and subpage header) */
    .search-input-box {
      width: 100%;
      height: 38px;
      box-sizing: border-box;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      color: var(--text-main);
      font-family: inherit;
      font-size: 13.5px;
      padding: 0;
      padding-inline: 40px 14px;
      border-radius: var(--border-radius);
      outline: none;
      box-shadow: var(--card-border-glow);
      transition: var(--transition-smooth);
    }

    .search-input-box:focus {
      border-color: var(--accent);
      box-shadow: 0 0 18px var(--accent-glow);
    }

    .search-icon {
      position: absolute;
      inset-inline-start: 14px;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      color: var(--accent);
      pointer-events: none;
      z-index: 2;
      filter: drop-shadow(0 0 8px var(--accent-glow));
      line-height: 1;
    }

    .search-icon-svg {
      stroke: var(--accent);
      width: 17px;
      height: 17px;
      display: block;
    }

    .search-results {
      position: absolute;
      top: calc(100% + 6px);
      left: 0; right: 0;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-radius: var(--border-radius);
      max-height: 290px;
      overflow-y: auto;
      display: none;
      flex-direction: column;
      box-shadow: 0 14px 35px rgba(0, 0, 0, 0.85);
      z-index: 80;
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    }

    .search-results::-webkit-scrollbar {
      width: 4px;
    }
    .search-results::-webkit-scrollbar-track {
      background: transparent;
      margin: 4px 0;
    }
    .search-results::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.22);
      border-radius: 4px;
    }
    .search-results::-webkit-scrollbar-thumb:hover {
      background: var(--accent);
    }

    .search-results.active {
      display: flex;
    }

    .search-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 9px 14px;
      cursor: pointer;
      font-size: 13.5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      transition: background 0.15s ease, color 0.15s ease;
    }

    .search-item:last-child {
      border-bottom: none;
    }

    .search-item:hover, .search-item.highlighted {
      background: rgba(255, 255, 255, 0.08);
      color: var(--accent);
    }

    .search-item-info {
      display: flex;
      align-items: baseline;
      gap: 7px;
    }

    .search-item-city {
      font-weight: 700;
      letter-spacing: 0.2px;
      color: var(--text-main);
    }

    .search-item:hover .search-item-city,
    .search-item.highlighted .search-item-city {
      color: var(--accent);
    }

    .search-item-native {
      font-size: 11.5px;
      color: var(--text-muted);
      font-weight: 400;
    }

    .search-item-country {
      font-size: 12px;
      color: var(--text-muted);
      font-family: var(--font-mono);
      letter-spacing: 0.3px;
    }


/* Settings panel: support button and the credits / privacy links (same on every page) */
.settings-support-btn {
  background: rgba(255, 170, 0, 0.12);
  border: 1px solid rgba(255, 170, 0, 0.35);
  color: #ffaa00;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.settings-support-btn:hover {
  background: rgba(255, 170, 0, 0.24);
  border-color: #ffaa00;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}
body[data-theme="cyberpunk"] .settings-support-btn {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #00e5ff;
}
body[data-theme="cyberpunk"] .settings-support-btn:hover {
  background: rgba(0, 229, 255, 0.22);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
}
body[data-theme="mono"] .settings-support-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
body[data-theme="mono"] .settings-support-btn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}
body[data-theme="retro"] .settings-support-btn {
  background: #1d163d !important;
  border: 2px solid #ffd152 !important;
  color: #ffd152 !important;
  font-family: var(--font-pixel), monospace !important;
  font-size: 11px !important;
  border-radius: 0px !important;
  box-shadow: 2px 2px 0px #000000 !important;
  letter-spacing: -0.3px !important;
}
body[data-theme="retro"] .settings-support-btn:hover {
  background: #ffd152 !important;
  color: #120e24 !important;
  box-shadow: 1px 1px 0px #000000 !important;
  transform: translate(1px, 1px) !important;
}
a.settings-support-btn {
  display: block;
  text-decoration: none;
}
.settings-credits-link { text-align: center; font-size: 11px; letter-spacing: .04em; color: var(--text-muted, #8aa0b8); opacity: .75; text-decoration: none; }
.settings-credits-link:hover { opacity: 1; text-decoration: underline; }


/* Settings panel: every control 36px tall, the same text size, the same 6px from its label and 14px between rows,
   whatever page it is on (the page's own line-height no longer leaks in) */
.settings-dropdown { line-height: 1.35; gap: 14px; }
.settings-dropdown .settings-row { gap: 6px; }.settings-dropdown .lang-select-trigger,
.settings-dropdown .settings-support-btn,
.settings-dropdown .theme-selector,
.settings-dropdown .density-mode-group,
.settings-dropdown .airplane-toggle-group { height: 36px; box-sizing: border-box; }
.settings-dropdown .lang-select-trigger,
.settings-dropdown .settings-support-btn { display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-decoration: none; }
.settings-dropdown .settings-support-btn { justify-content: center; gap: 6px; }
.settings-dropdown .theme-btn, .settings-dropdown .density-pill, .settings-dropdown .airplane-pill { min-height: 0; height: 100%; font-size: 12px; }
.settings-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; } /* they wrap in longer languages */
.settings-contact { margin: 6px 0 0; text-align: center; font-size: 11px; letter-spacing: .04em; color: var(--text-muted, #8aa0b8); opacity: .75; }
.settings-contact a { color: inherit; }
.settings-contact a:hover { text-decoration: underline; }
body[data-theme="retro"] .settings-contact { font-size: 9px; }

/* 8-BIT: one pixel-font size for every control in the panel; links stay on one line */
body[data-theme="retro"] .settings-dropdown :is(.lang-trigger-text, .settings-support-btn, .theme-btn, .density-pill, .airplane-pill) { font-size: 11px; }
/* 8-BIT's own min-heights, padding and label margin would stretch its rows past 36px and 6px; keep the same box as the other themes */
body[data-theme="retro"] .settings-dropdown :is(.theme-btn, .density-pill, .airplane-pill) { min-height: 0; padding-top: 0; padding-bottom: 0; }
body[data-theme="retro"] .settings-dropdown #sound-toggle-btn { min-height: 0; padding: 0 12px; }
body[data-theme="retro"] .settings-dropdown .settings-label { margin-bottom: 0; }
.settings-links .settings-credits-link { white-space: nowrap; }
body[data-theme="retro"] .settings-links .settings-credits-link { font-size: 9px; }

/* Hidden settings rows (the install row until the browser offers installation) stay hidden on every page */
.settings-row[hidden] {
  display: none !important;
}
.install-app-btn {
  background: rgba(0, 255, 170, 0.10);
  border-color: var(--card-border);
  color: var(--accent);
}
.install-app-btn:hover {
  background: rgba(0, 255, 170, 0.2);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Theme Adaptive Custom Language Selector */
/* Mono Theme Language Overrides */
body[data-theme="mono"] .lang-select-trigger {
  border-color: rgba(255, 255, 255, 0.25);
}
body[data-theme="mono"] .lang-select-trigger:hover,
body[data-theme="mono"] .lang-dropdown-wrapper.open .lang-select-trigger {
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
body[data-theme="mono"] .lang-dropdown-menu {
  background: rgba(11, 15, 23, 0.98);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255, 255, 255, 0.15);
}
body[data-theme="mono"] .lang-option-item.active {
  background: #ffffff !important;
  color: #000000 !important;
}
body[data-theme="mono"] .lang-option-item.active .lang-sub-name {
  color: #000000 !important;
}

/* Retro Theme Language Overrides */
body[data-theme="retro"] .lang-dropdown-wrapper,
body[data-theme="retro"] .lang-select-trigger,
body[data-theme="retro"] .lang-dropdown-menu,
body[data-theme="retro"] .lang-search-input,
body[data-theme="retro"] .lang-option-item {
  border-radius: 0px !important;
  font-family: var(--font-pixel), monospace !important;
}
body[data-theme="retro"] .lang-select-trigger {
  border: 1px solid #5cd688 !important;
  background: #0d091b !important;
  font-size: 11px !important;
}
body[data-theme="retro"] .lang-dropdown-menu {
  background: #120e24 !important;
  border: 2px solid #5cd688 !important;
  box-shadow: 4px 4px 0px #000000 !important;
}
body[data-theme="retro"] .lang-search-input {
  border: 1px solid #5cd688 !important;
  background: #0a0614 !important;
}
body[data-theme="retro"] .lang-option-item.active {
  background: #5cd688 !important;
  color: #0d091b !important;
}
body[data-theme="retro"] .lang-option-item.active .lang-sub-name {
  color: #0d091b !important;
}

/* The contact line keeps its size whatever the page styles its own paragraphs with */
.settings-dropdown .settings-contact { font-size: 11px; line-height: 1.35; }
body[data-theme="retro"] .settings-dropdown .settings-contact { font-size: 9px; }

/* Header: the same letters, case and line box on every page */
.brand-section, .top-action-btn { line-height: normal; text-transform: uppercase; }
body[data-theme="retro"] .search-input-box { font-family: var(--font-pixel), monospace; }
/* The page you are on, and switched-on buttons (AMBIENT): one look on every page, in the theme's own colour */
body { --accent-tint: rgba(0, 255, 170, 0.12); }
body[data-theme="mono"], body[data-theme="luxury"] { --accent-tint: rgba(255, 255, 255, 0.12); }
body[data-theme="retro"] { --accent-tint: rgba(92, 214, 136, 0.16); }
.top-action-btn.active, .top-action-btn[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--card-bg);
  box-shadow: 0 0 16px var(--accent-glow);
}
body[data-theme="retro"] .top-action-btn.active, body[data-theme="retro"] .top-action-btn[aria-current="page"] { box-shadow: var(--card-border-glow); }

/* ---------- Phone and tablet (≤900px): the settings button is ☰ and the panel is the menu drawer ----------
   the three sections sit at the top of the drawer, then every setting; the page behind is dimmed */
.menu-ico, .drawer-brand, .drawer-nav, .drawer-label { display: none; }
@media (max-width: 900px) {
  #settings-toggle-btn .menu-ico { display: block; flex: none; }
  body[data-theme] #settings-toggle-btn .btn-label, body[data-theme] #settings-toggle-btn .btn-ico { display: none; }
  body[data-theme] #settings-toggle-btn { flex: none; width: 42px; min-width: 42px; padding: 0; justify-content: center; }
  html body[data-theme] .settings-dropdown {
    position: fixed; top: 0; bottom: 0; left: 0; right: auto; inset-inline-start: 0; inset-inline-end: auto;
    width: min(340px, 86vw); max-width: none; height: 100dvh; max-height: none; margin: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(20px + env(safe-area-inset-bottom, 0px));
    border-width: 0 1px 0 0; border-radius: 0; overflow-y: auto; z-index: 1000;
  }
  body:has(.settings-dropdown.active)::after { content: ""; position: fixed; inset: 0; z-index: 299; } /* a tap beside the drawer only closes it */
  body:has(.settings-dropdown.active) header { z-index: 1001; } /* the header holding the drawer sits over everything while it is open */
  html body[data-theme] .settings-dropdown.active { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6); animation: drawerIn .2s ease-out; }
  html[dir="rtl"] body[data-theme] .settings-dropdown { left: auto; right: 0; border-width: 0 0 0 1px; }
  .settings-dropdown #settings-title { display: none; }
  .settings-dropdown .settings-close-btn { font-size: 18px; padding: 6px 8px; }
  .drawer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--hud-font); font-size: 15px; font-weight: 800; letter-spacing: 1px; color: var(--text-main); }
  .drawer-nav { display: flex; flex-direction: column; gap: 6px; }
  .drawer-nav-link { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border: 1px solid var(--card-border); border-radius: var(--border-radius); color: var(--text-main); font-size: 14px; font-weight: 700; text-decoration: none; text-transform: uppercase; }
  .drawer-nav-link.on { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
  .drawer-label { display: block; margin: 6px 0 -4px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.8px; color: var(--accent); text-transform: uppercase; }
  body[data-theme="retro"] :is(.drawer-brand, .drawer-nav-link, .drawer-label) { font-family: var(--font-pixel), monospace; font-size: 11px; border-radius: 0; }
}
@keyframes drawerIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }


/* ---------- AdSense places (js/ads.js fills the shown ones; an empty place takes no room) ---------- */
.ad-slot { text-align: center; line-height: 0; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.ad-flow { max-width: 728px; margin: 0 auto; }
.ad-flow:has(ins[data-ad-status="filled"]) { margin: 28px auto; }
/* side columns beside a 1000px page: only where the margin holds 160px + gaps, and the window is tall enough */
.ad-rail { display: none; position: fixed; top: 96px; z-index: 5; }
.ad-rail-l { left: 24px; }
.ad-rail-r { right: 24px; }
@media (min-width: 1440px) and (min-height: 720px) { .ad-rail { display: block; } }

/* Thin footer line on every subpage: privacy, sound credits, contact */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; max-width: 968px; margin: 28px auto 0; padding: 14px 16px 22px; border-top: 1px solid var(--card-border, rgba(0, 229, 255, 0.25)); font-size: 12px; letter-spacing: .03em; color: var(--text-muted, #8aa0b8); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--text-main, #e6f4fa); text-decoration: underline; }
body[data-theme="retro"] .site-footer { font-size: 10px; }
