/* ================================================================
   S4leeh — Maintenance page (standalone, no frameworks)
   Single viewport · vertical flow: navbar → hero → game → YT → footer
   Design tokens copied from the main site (legacy-styles.css)
   ================================================================ */

:root {
  --gold:      #D4AF37;
  --gold-dim:  rgba(212,175,55,.28);
  --gold-glow: rgba(212,175,55,.09);
  --gold-mid:  rgba(212,175,55,.16);
  --bg:        #0e0d0f;
  --surface:   rgba(255,255,255,.032);
  --surface-h: rgba(255,255,255,.058);
  --border:    rgba(255,255,255,.065);
  --border-h:  rgba(255,255,255,.12);
  --text:      #F0EFEF;
  --text-2:    rgba(240,239,239,.55);
  --text-3:    rgba(240,239,239,.3);
  --yt-red:    #FF0000;
  --blur:      blur(10px);
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-f:   9999px;
  --t-f:   130ms cubic-bezier(.2,.8,.2,1);
  --t-m:   200ms cubic-bezier(.2,.8,.2,1);
  --t-e:   460ms cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar       { width: 0; height: 0; }
* { scrollbar-width: none; }
::selection { background: rgba(212,175,55,.25); color: var(--text); }

/* ================================================================
   BACKGROUND FX
   ================================================================ */
#starCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
#cursorGlow {
  position: fixed; top: 0; left: 0;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.07) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity .4s ease;
}
#cursorGlow.active { opacity: 1; }

/* ================================================================
   PAGE SHELL — one viewport, vertical stack
   navbar → hero → game → youtube card → footer
   ================================================================ */
.page {
  position: relative; z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 10px clamp(12px, 3vw, 28px) calc(8px + env(safe-area-inset-bottom));
  gap: clamp(6px, 1.2vh, 14px);
  max-width: 1060px; margin: 0 auto;
}

/* ================================================================
   NAVBAR
   ================================================================ */
#siteHeader { flex-shrink: 0; width: 100%; }
.navbar-base {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  width: fit-content; max-width: 100%; margin: 0 auto;
  padding: 7px 20px;
  border-radius: var(--r-f);
  position: relative; overflow: visible;
  background: rgba(10,9,12,.72);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.navbar-base::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.045), transparent 48%),
              radial-gradient(circle at 15% 110%, rgba(212,175,55,.04), transparent 50%);
}
.navbar-base > * { position: relative; z-index: 1; }

.nav-logo-wrap {
  position: relative; width: 32px; height: 32px;
  border-radius: var(--r-f); overflow: visible; flex-shrink: 0;
}
.nav-logo-wrap img {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: var(--r-f); display: block;
}
.nav-brand {
  color: var(--gold); font-weight: 800; font-size: .82rem; letter-spacing: .12em;
}
.nav-closed-chip {
  display: inline-flex; align-items: center;
  padding: .14rem .6rem; border-radius: var(--r-f);
  font-size: .64rem; font-weight: 700;
  background: var(--gold-mid); border: 1px solid var(--gold-dim); color: var(--gold);
}

/* ================================================================
   HERO — compact centered block
   ================================================================ */
.hero-col {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: clamp(3px, .7vh, 7px);
  padding-top: clamp(2px, 1vh, 12px);
}
.hero-logo-ring {
  position: relative;
  width: clamp(64px, 13.5vmin, 128px); aspect-ratio: 1;
  border-radius: var(--r-f); overflow: visible;
  animation: hero-float 5.5s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
  box-shadow: 0 20px 70px rgba(0,0,0,.5), 0 0 50px rgba(212,175,55,.09);
  flex-shrink: 0;
  margin-bottom: clamp(2px, .6vh, 8px);
}
.hero-logo-ring img {
  width: 100%; height: 100%;
  object-fit: contain; display: block; border-radius: var(--r-f);
}
@keyframes hero-float {
  0%,100% { transform: translateY(0);     box-shadow: 0 20px 70px rgba(0,0,0,.5),  0 0 50px rgba(212,175,55,.09); }
  50%     { transform: translateY(-11px); box-shadow: 0 32px 80px rgba(0,0,0,.45), 0 0 70px rgba(212,175,55,.13); }
}
.hero-title {
  font-size: clamp(1.15rem, 3vmin, 1.7rem);
  font-weight: 800; letter-spacing: .04em;
  color: var(--text); margin: 0;
}
.closed-title {
  font-size: clamp(.92rem, 2.5vmin, 1.25rem);
  font-weight: 700; color: var(--gold);
  margin: 0;
  text-shadow: 0 0 26px rgba(212,175,55,.3);
}
.closed-sub {
  font-size: clamp(.68rem, 1.7vmin, .84rem);
  color: var(--text-2); line-height: 1.6; margin: 0;
}

/* ================================================================
   GAME — takes all remaining vertical space
   ================================================================ */
.game-col {
  flex: 1 1 auto; min-height: 120px;
  width: 100%;
  display: flex; flex-direction: column;
  gap: 7px;
}
.game-head {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.divider-line { flex: 1; border: none; border-top: 1px solid var(--border); margin: 0; }
.section-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
  color: rgba(240,239,239,.65);
}

.game-frame {
  position: relative;
  flex: 1; min-height: 110px;
  width: 100%;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 20px 70px rgba(0,0,0,.45), 0 0 50px rgba(212,175,55,.05);
  overflow: hidden;
}
.scoreboard {
  position: absolute; top: 10px; left: 14px; z-index: 5;
  display: flex; gap: 14px;
  font-size: .72rem; font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  user-select: none; pointer-events: none;
}
.score-item b { color: var(--text-2); font-weight: 700; }
.score-item.flash b { color: var(--gold); }

#gameCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: manipulation;
}

/* ── Overlays ── */
.game-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .65rem; text-align: center; padding: 14px;
  background: rgba(14,13,15,.62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: opacity var(--t-m);
}
.game-overlay.hidden { display: none; }

.overlay-hint { font-size: .7rem; color: var(--text-3); margin: 0; }
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: block; }
  .overlay-hint:not(.touch-only) { display: none; }
}

.key-cap {
  display: inline-block; padding: .05rem .42rem;
  border-radius: 6px; font-size: .66rem; font-weight: 700;
  background: var(--surface-h); border: 1px solid var(--border-h);
  color: var(--text-2);
}

.over-code {
  font-family: monospace; font-size: .7rem; letter-spacing: .14em;
  color: var(--text-3); margin: 0;
}
.over-title { font-size: 1.15rem; font-weight: 800; color: var(--text); margin: 0; }
.over-score { font-size: .82rem; color: var(--text-2); margin: 0; }
.over-score b { color: var(--gold); font-size: .95rem; }
.over-best {
  margin: 0; padding: .14rem .7rem; border-radius: var(--r-f);
  font-size: .68rem; font-weight: 800;
  color: #0e0d0f; background: var(--gold);
  animation: record-pop 500ms cubic-bezier(.2,.8,.2,1) both;
}
.over-best.hidden { display: none; }
@keyframes record-pop {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Buttons ── */
.btn-gold {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.5rem; border-radius: var(--r-f);
  font-family: inherit; font-size: .82rem; font-weight: 800;
  background: var(--gold); color: #0a0a0a;
  border: none; cursor: pointer;
  transition: opacity var(--t-m), transform var(--t-m), box-shadow var(--t-m);
}
.btn-gold:hover {
  opacity: .88; transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(212,175,55,.35);
}
.btn-gold:active { transform: translateY(0) scale(.98); }

.btn-ghost-sm {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .28rem .75rem; border-radius: var(--r-f);
  font-size: .7rem; font-weight: 600; font-family: inherit; cursor: pointer;
  background: transparent; color: var(--text-2); border: 1px solid var(--border);
  transition: background var(--t-f), color var(--t-f), border-color var(--t-f);
}
.btn-ghost-sm:hover { background: var(--surface-h); color: var(--text); border-color: var(--border-h); }

/* ── Under-frame row ── */
.game-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-shrink: 0;
}
.last-score { font-size: .72rem; color: var(--text-3); margin: 0; }
.last-score b { color: var(--text-2); }

/* ================================================================
   MINI YOUTUBE CARD
   ================================================================ */
.yt-card {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  width: min(100%, 420px);
  padding: 9px 10px;
  border-radius: var(--r-lg);
  text-decoration: none;
  background: rgba(14,12,18,.76);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: border-color var(--t-m), box-shadow var(--t-m), transform var(--t-m);
}
.yt-card:hover {
  border-color: rgba(255,0,0,.35);
  box-shadow: 0 6px 24px rgba(255,0,0,.14);
  transform: translateY(-2px);
}
.yt-thumb {
  position: relative; flex-shrink: 0;
  width: clamp(76px, 9vw, 104px); aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden;
  background: #17151a;
  border: 1px solid rgba(255,255,255,.07);
}
.yt-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: .38; filter: saturate(.85);
}
.yt-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,13,15,.05) 40%, rgba(14,13,15,.55));
}
.yt-play {
  position: absolute; z-index: 2; inset: 0; margin: auto;
  width: 32px; height: 23px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--yt-red); color: #fff;
  box-shadow: 0 3px 14px rgba(255,0,0,.45);
  transition: transform var(--t-m), box-shadow var(--t-m);
}
.yt-play svg { width: 13px; height: 13px; }
.yt-card:hover .yt-play {
  transform: scale(1.12);
  box-shadow: 0 4px 20px rgba(255,0,0,.6);
}
.yt-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yt-label {
  font-size: .56rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(240,239,239,.35);
}
.yt-title {
  font-size: .78rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yt-watch {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .66rem; font-weight: 700; color: rgba(255,102,102,.85);
  transition: color var(--t-f);
}
.yt-card:hover .yt-watch { color: #ff5a5a; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer { flex-shrink: 0; text-align: center; }
.site-footer p { margin: 0; font-size: .64rem; color: var(--text-3); opacity: .75; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 480px) {
  .navbar-base { gap: .55rem; padding: 6px 14px; }
  .nav-brand { font-size: .74rem; }
  .nav-closed-chip { font-size: .58rem; }
  .game-footer-row { flex-wrap: wrap; }
  .yt-title { font-size: .72rem; }
}

/* short screens (landscape phones / small laptops) */
@media (max-height: 600px) {
  .page { gap: 4px; }
  .hero-col { flex-direction: row; justify-content: center; gap: 14px; padding-top: 0; }
  .hero-logo-ring { width: clamp(48px, 16vmin, 72px); margin-bottom: 0; }
  .hero-col { text-align: right; }
  .closed-sub { display: none; }
  .overlay-hint { display: none; }
  .touch-only.overlay-hint { display: block; }
  .site-footer { display: none; }
}

/* ================================================================
   MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-logo-ring, .over-best { animation: none !important; }
}
