/* ════════════════════════════════════════════════════════════════
   SHARED UI STYLES — root scale, header, footer, menus & modals
   Used by the platform page and every game (pages can override after it).
   ════════════════════════════════════════════════════════════════ */

/* Fluid scale for every page: sizes are in rem, so this one root
   font-size scales the whole UI with whichever of the window's width or
   height is tighter — 14px floor for short laptop windows, 24px cap on big
   monitors (embedded games measure their own iframe, not the window).
   dvh = the height actually visible (Safari's vh includes the area under
   its toolbars, which pushed the games list off the bottom); the vh line
   is the fallback for older browsers. */
html{ font-size:clamp(14px, min(1.45vw, 2.15vh), 24px); }
html{ font-size:clamp(14px, min(1.45vw, 2.15dvh), 24px); }

:root{
  --bg:#070c18; --panel:#0d1525; --border:#24406a;
  --accent:#00e5ff; --accent2:#ff4d6d; --stealth:#39ff14;
  --text:#ddeeff; --muted:#7c9cc4;
}

/* ──────────────────────────────────────────────────────────────
   HEADER
   ────────────────────────────────────────────────────────────── */
.header-outer{
  position:relative; z-index:10; border-bottom:1px solid var(--border);
  background:rgba(7,12,24,0.88); backdrop-filter:blur(0.625rem);
}

header{
  display:flex; align-items:center; justify-content:space-between;
  padding:1rem 1.25rem; max-width:87.5rem; margin:0 auto; position:relative; width:100%;
  font-family:'Orbitron',monospace;
}

.logo-wrap{
  display:flex; align-items:center; gap:0.75rem;
}

.back-link{
  font-family:'Orbitron',monospace; font-size:0.6875rem; letter-spacing:2px;
  color:var(--muted); text-decoration:none; transition:color .2s;
}

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

.logo{
  font-family:'Orbitron',monospace; font-size:1.1875rem; font-weight:900;
  letter-spacing:2px; text-shadow:0 0 1rem rgba(0,229,255,.4);
}

.header-right{
  display:flex; gap:0.625rem; align-items:center;
}

.help-btn{
  background:none; border:1px solid var(--border); border-radius:0.5rem;
  color:var(--muted); cursor:pointer; padding:0.4375rem 0.75rem;
  font-family:'Orbitron',monospace; font-size:0.75rem; letter-spacing:1px;
  transition:border-color .2s, color .2s;
}

.help-btn:hover{
  border-color:var(--stealth); color:var(--stealth);
}

.menu-btn{
  background:none; border:1px solid var(--border); border-radius:0.5rem;
  color:var(--muted); cursor:pointer; padding:0.4375rem 0.75rem;
  font-family:'Orbitron',monospace; font-size:0.6875rem; letter-spacing:2px;
  transition:border-color .2s, color .2s;
  display:flex; align-items:center; gap:0.375rem;
}

.menu-btn:hover{
  border-color:var(--accent); color:var(--accent);
}

/* ──────────────────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────────────────── */
footer{
  position:relative; z-index:1; text-align:center; padding:0.875rem;
  font-size:0.8125rem; color:var(--muted); border-top:1px solid var(--border);
  letter-spacing:1px; margin-top:auto;
}

footer a{
  color:var(--accent); text-decoration:none;
}

/* ──────────────────────────────────────────────────────────────
   MODAL OVERLAY (base)
   ────────────────────────────────────────────────────────────── */
.modal-overlay{
  display:none; position:fixed; inset:0;
  background:rgba(7,12,24,0.92); z-index:2000; backdrop-filter:blur(0.375rem);
  align-items:center; justify-content:center;
}

.modal-overlay.open{
  display:flex;
}

/* ──────────────────────────────────────────────────────────────
   MENU MODAL
   ────────────────────────────────────────────────────────────── */
#menu-modal{ z-index:2500; }

.menu-modal{
  background:var(--panel); border:1px solid var(--border); border-radius:1rem;
  width:100%; max-width:18.75rem; margin:1.25rem;
  box-shadow:0 0 2.5rem rgba(57,255,20,.12);
}

.modal-close{
  background:none; border:none; color:var(--muted); font-size:1.125rem;
  cursor:pointer; padding:0 0.25rem;
}

.modal-close:hover{
  color:var(--text);
}

/* ──────────────────────────────────────────────────────────────
   TABBED MENU (game pages) — mirrors the main hub's own menu modal
   (About/Settings/Share/Feedback), plus a game-specific landing tab.
   See setupSimpleMenu()/switchGameTab() in ui.js.
   ────────────────────────────────────────────────────────────── */
.modal{
  background:var(--panel); border:1px solid var(--border);
  border-radius:1rem; width:100%; margin:1.25rem; overflow:hidden;
  box-shadow:0 0 2.5rem rgba(0,229,255,.12);
}
.modal-header{
  background:rgba(0,180,255,.06); border-bottom:1px solid var(--border);
  padding:0.875rem 1.125rem; display:flex; justify-content:space-between; align-items:center;
}
.modal-title{ font-family:'Orbitron',monospace; font-size:0.8125rem; letter-spacing:2px; color:var(--accent); }
.modal-body{ padding:1.125rem; display:flex; flex-direction:column; gap:1rem; }

.modal-tabs{ display:flex; border-bottom:1px solid var(--border); }
.modal-tab{
  flex:1; padding:0.625rem; text-align:center; cursor:pointer;
  font-family:'Orbitron',monospace; font-size:0.625rem; letter-spacing:1px;
  color:var(--muted); border-bottom:2px solid transparent;
  transition:color .2s, border-color .2s;
}
.modal-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.modal-tab-content{ display:none; }
.modal-tab-content.active{ display:flex; flex-direction:column; gap:0.75rem; }

.modal-section{ display:flex; flex-direction:column; gap:0.5rem; }
.modal-section-title{ font-family:'Orbitron',monospace; font-size:0.6875rem; letter-spacing:2px; color:var(--text); text-transform:uppercase; }
/* Divider between sections of a menu tab. */
.modal-section + .modal-section{ border-top:1px solid var(--border); margin-top:0.5rem; padding-top:1.5rem; }

.toggle-row{ display:flex; justify-content:space-between; align-items:center; padding:0.5rem 0; }
.toggle-label{ font-size:0.8125rem; color:var(--text); }
.toggle-sub{ font-size:0.8125rem; color:var(--muted); margin-top:2px; }
.toggle-switch{ position:relative; width:2.5rem; height:1.375rem; flex-shrink:0; }
.toggle-switch input{ opacity:0; width:0; height:0; }
.toggle-slider{
  position:absolute; inset:0; background:var(--border);
  border-radius:0.6875rem; cursor:pointer; transition:background .2s;
}
.toggle-slider::before{
  content:''; position:absolute; width:1rem; height:1rem; left:0.1875rem; top:0.1875rem;
  background:#fff; border-radius:50%; transition:transform .2s;
}
.toggle-switch input:checked + .toggle-slider{ background:var(--accent); }
.toggle-switch input:checked + .toggle-slider::before{ transform:translateX(1.125rem); }

.modal-btn{
  display:flex; align-items:center; gap:0.625rem;
  padding:0.625rem 0.875rem; border-radius:0.5rem;
  background:rgba(255,255,255,.04); border:1px solid var(--border);
  color:var(--text); cursor:pointer; font-size:0.8125rem;
  transition:border-color .2s, background .2s;
  text-decoration:none; font-family:'Nunito',sans-serif;
}
.modal-btn:hover{ border-color:var(--accent); background:rgba(0,229,255,.06); }
.modal-btn-icon{ font-size:1.25rem; width:1.25rem; text-align:center; }

.share-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0.5rem; }

.about-text{ font-size:0.8125rem; color:var(--muted); line-height:1.7; }
/* Every text link in the menu looks the same: cyan, no underline. */
.modal-body a:not(.modal-btn){ color:var(--accent); text-decoration:none; }
.modal-body a:not(.modal-btn):hover{ color:var(--text); }

.feedback-area{
  width:100%; background:rgba(255,255,255,.03); border:1px solid var(--border);
  border-radius:0.5rem; padding:0.625rem; color:var(--text); font-family:'Nunito',sans-serif;
  font-size:0.8125rem; resize:vertical; min-height:5rem; outline:none;
}
.feedback-area:focus{ border-color:var(--accent); }
/* Star rating (same markup as the platform page's feedback tab). */
.feedback-rating-row{ display:flex; align-items:center; justify-content:space-between; gap:0.75rem; }
.star-rating{ display:flex; gap:0.25rem; font-size:1.375rem; line-height:1; cursor:pointer; }
.star-rating .star{ color:rgba(255,255,255,.15); transition:color .15s; }
.star-rating .star.filled{ color:#ffb400; }
/* Styled like the section headings. */
.feedback-rating-label{ font-size:0.6875rem; color:var(--text); letter-spacing:2px; text-transform:uppercase; font-family:'Orbitron',monospace; }
.feedback-submit{
  padding:0.5625rem 1.125rem; background:rgba(0,229,255,.1); border:1px solid var(--accent);
  border-radius:0.5rem; color:var(--accent); font-family:'Orbitron',monospace;
  font-size:0.6875rem; letter-spacing:2px; cursor:pointer; align-self:flex-end;
  transition:background .2s;
}
.feedback-submit:hover{ background:rgba(0,229,255,.2); }

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────── */
@media (max-width:600px){
  header{ padding:0.875rem 1rem; }
  .logo{ font-size:1rem; }
  .menu-btn{ font-size:0.625rem; padding:0.375rem 0.625rem; }
}
