@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root{
  --aqua:   #2aa9ff;
  --aqua-d: #0a64c8;
  --sky:    #bfe9ff;
  --glass:  rgba(255,255,255,.45);
  --glass-b: rgba(255,255,255,.65);
  --ink:    #0b3a5e;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; overflow:hidden; touch-action:none; overscroll-behavior:none; }
body{
  font-family:'Quicksand', 'Segoe UI', system-ui, sans-serif;
  color:var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, #eafaff 0%, #bfe9ff 38%, #5fb8f5 72%, #2a7de1 100%);
  -webkit-font-smoothing:antialiased;
  user-select:none;
  /* the system cursor is hidden everywhere; on menu/pause screens a custom
     glowing crosshair (#crosshair) follows the mouse instead (see gallery.js) */
  cursor:none;
}
.hidden{ display:none !important; }

#scene{ position:fixed; inset:0; }
#scene canvas{ display:block; }

/* ── White swoop / fade overlay ─────────────────────────────── */
#fade{
  position:fixed; inset:0; z-index:40; pointer-events:none;
  background:
    radial-gradient(120% 120% at 50% 50%, #ffffff 0%, #eafaff 60%, #cdeeff 100%);
  opacity:0;
  transition:opacity 1.6s cubic-bezier(.6,0,.2,1);
}

/* ── Shared glassy "Frutiger Aero" card ─────────────────────── */
.glass{
  position:relative;
  background:linear-gradient(160deg, var(--glass-b), var(--glass) 45%, rgba(255,255,255,.25));
  border:1px solid rgba(255,255,255,.8);
  border-radius:28px;
  backdrop-filter:blur(18px) saturate(1.5);
  -webkit-backdrop-filter:blur(18px) saturate(1.5);
  box-shadow:
    0 20px 60px rgba(10,70,140,.35),
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -30px 60px rgba(120,200,255,.25);
  overflow:hidden;
}
/* glossy top-light sweep */
.glass::before{
  content:""; position:absolute; inset:0 0 55% 0;
  background:linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0));
  pointer-events:none;
}

/* roomier interior on narrow portrait phones so the title/subtitle/handle
   button get more width before the font has to shrink */
.card{ padding:clamp(38px,8vw,58px) clamp(26px,8vw,64px); text-align:center; max-width:600px; }
/* pause modal: generous, uncramped padding around the Resume pill */
.card.small{ padding:clamp(36px,7vw,46px) clamp(34px,8vw,52px); }
.card.small h2{ margin-bottom:8px; }
.card.small p{ margin-bottom:0; opacity:.82; }
.card.small .aero-btn{ margin-top:26px; }

/* ── configurable card lines ──
   gallery.js tags any line the owner blanks out ("" in CONFIG) with .gone,
   and the card re-balances so every combination still reads as designed:
   no cramped title-on-button, no orphaned gaps. */
.gone{ display:none !important; }
/* subtitle removed → the enter button keeps breathing room under the title */
#title:not(.gone) + #subtitle.gone + #enterBtn{ margin-top:30px; }
/* pause card stripped down to the Resume pill → drop its now-orphaned gap */
#pauseTitle.gone + #pauseNote.gone + #resumeBtn{ margin-top:0; }

#enter,#pause,#oops{
  position:fixed; inset:0; z-index:50;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  animation:fadeIn .8s ease both;
}
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }

h1{
  font-size:clamp(42px,7.5vw,78px); font-weight:700; letter-spacing:.14em;
  line-height:1.04;
  /* sky → grass: the lower half goes green so it reads against the blue and
     echoes the grassy horizon instead of vanishing into it */
  background:linear-gradient(180deg,#ffffff 0%, #dff4ff 26%, #bfe79a 60%, #5aa838 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 1px 0 rgba(6,40,70,.55)) drop-shadow(0 4px 14px rgba(20,80,40,.5));
  margin-bottom:10px;
}
h2{ font-size:26px; letter-spacing:.05em; margin-bottom:6px; color:var(--aqua-d); }
#subtitle{ font-size:21px; opacity:.9; margin-bottom:32px; letter-spacing:.05em; }
.fineprint{ margin-top:22px; font-size:14.5px; opacity:.72; letter-spacing:.04em; }

/* ── Glossy aqua button ─────────────────────────────────────── */
.aero-btn{
  /* centered, never-wrapping pill — JS (fitEnterBtn) shrinks the handle
     font so a long name stays on ONE centered line on portrait phones */
  display:inline-flex; align-items:center; justify-content:center;
  max-width:100%; white-space:nowrap;
  font-family:inherit; font-weight:600; font-size:20px; letter-spacing:.04em;
  /* cursor:none so hovering a button never shows the OS finger/hand — only the
     custom crosshair dot (which grows + glows via #crosshair.active) rides over it */
  color:#fff; cursor:none; text-shadow:0 1px 2px rgba(4,46,104,.5);
  padding:18px clamp(30px,7vw,44px); border:none; border-radius:999px;
  /* layered fill: a baked top-gloss over a deep aqua gradient — keeps the
     label crisp (gloss is in the background, not an overlay on the text) */
  background:
    linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.14) 38%, rgba(255,255,255,0) 54%),
    linear-gradient(180deg, #9fdcff 0%, #4fb6ff 42%, var(--aqua) 66%, var(--aqua-d) 100%);
  box-shadow:
    0 14px 32px rgba(10,90,200,.5),
    0 3px 8px rgba(10,70,160,.4),
    inset 0 2px 3px rgba(255,255,255,.95),
    inset 0 -12px 22px rgba(0,60,140,.5),
    inset 0 0 0 1px rgba(255,255,255,.4);
  transition:transform .15s ease, filter .2s ease, box-shadow .2s ease;
}
/* .cursor-over is the single hover state, driven by the shared virtual cursor (mouse
   OR gamepad) in gallery.js. Native :hover is intentionally NOT used: the virtual
   crosshair can sit off the real OS pointer after an input switch, so :hover would
   light the wrong button. */
.aero-btn.cursor-over{
  transform:translateY(-2px) scale(1.03); filter:brightness(1.08);
  box-shadow:
    0 18px 40px rgba(10,90,200,.58),
    0 3px 8px rgba(10,70,160,.4),
    inset 0 2px 3px rgba(255,255,255,.95),
    inset 0 -12px 22px rgba(0,60,140,.5),
    inset 0 0 0 1px rgba(255,255,255,.5);
}
.aero-btn:active{ transform:translateY(0) scale(.99); }
.aero-btn:disabled{ opacity:.6; cursor:none; filter:saturate(.7); }


/* ── Custom crosshair cursor (menu/pause screens only) ──────────
   JS sets left/top to the mouse position and toggles .show / .active.
   z-index above every overlay so it always rides on top of the UI. */
#crosshair{
  position:fixed; left:0; top:0; z-index:90; pointer-events:none;
  transform:translate(-50%,-50%);
  opacity:0; transition:opacity .18s ease;
}
#crosshair.show{ opacity:1; }
#crosshair .dot{
  display:block; width:11px; height:11px; border-radius:50%;
  background:rgba(255,255,255,.95);
  box-shadow:0 0 8px rgba(120,210,255,.9), 0 0 2px rgba(0,80,160,.6);
  transition:transform .2s ease, background .2s ease, box-shadow .2s ease;
}
/* grows + glows when hovering a button — the old in-world hover animation */
#crosshair.active .dot{
  transform:scale(2.1);
  background:rgba(180,240,255,.95);
  box-shadow:0 0 18px rgba(120,210,255,1), 0 0 4px rgba(0,80,160,.7);
}

/* ── In-world HUD ───────────────────────────────────────────── */
#hud{ position:fixed; inset:0; z-index:20; pointer-events:none; }
#prompt{
  position:absolute; left:50%; bottom:14%; transform:translateX(-50%);
  font-size:18px; font-weight:600; letter-spacing:.06em; color:#fff;
  text-shadow:0 2px 10px rgba(0,60,140,.7);
  padding:10px 22px; border-radius:999px;
  background:linear-gradient(180deg, rgba(120,200,255,.55), rgba(20,110,210,.45));
  border:1px solid rgba(255,255,255,.55);
  backdrop-filter:blur(8px);
  opacity:0; transition:opacity .3s ease, transform .3s ease;
}
#prompt.show{ opacity:1; transform:translateX(-50%) translateY(-4px); }
#legend{
  position:absolute; bottom:22px; left:50%; transform:translateX(-50%);
  font-size:clamp(9.5px, 2.6vw, 13px);  /* shrinks on narrow portrait screens */
  letter-spacing:.03em; color:#eaf7ff;
  text-shadow:0 1px 6px rgba(0,50,120,.7);
  opacity:.8;
  white-space:nowrap;   /* never wraps — font shrinks to fit instead */
}
#legend b{ color:#fff; }

/* ── On-screen touch controls ───────────────────────────────── */
#touch{ position:absolute; inset:0; pointer-events:none; }
/* floating analog joystick (JS positions it where your thumb lands) */
#joy{
  position:fixed; width:112px; height:112px; margin:-56px 0 0 -56px; border-radius:50%;
  background:radial-gradient(circle at 50% 38%, rgba(255,255,255,.30), rgba(140,200,255,.16) 60%, rgba(120,190,255,.05) 100%);
  border:1.5px solid rgba(255,255,255,.55);
  box-shadow:0 6px 20px rgba(10,70,140,.3), inset 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  opacity:0; transition:opacity .18s ease; pointer-events:none;
}
#joy.on{ opacity:1; }
#joyKnob{
  position:absolute; left:50%; top:50%; width:52px; height:52px; border-radius:50%;
  transform:translate(-50%,-50%);
  background:linear-gradient(180deg, rgba(170,225,255,.96), rgba(40,150,230,.96));
  border:1.5px solid rgba(255,255,255,.85);
  box-shadow:0 4px 12px rgba(10,80,180,.5), inset 0 2px 2px rgba(255,255,255,.85);
}
.touch-btn{
  position:fixed; pointer-events:auto; -webkit-tap-highlight-color:transparent;
  font-family:inherit; font-weight:600; color:#fff; border:none; border-radius:999px;
  background:linear-gradient(180deg, #7fd0ff 0%, var(--aqua) 50%, var(--aqua-d) 100%);
  box-shadow:0 8px 20px rgba(10,90,200,.45), inset 0 2px 2px rgba(255,255,255,.85), inset 0 -8px 14px rgba(0,60,140,.4);
}
.touch-btn:active{ filter:brightness(1.08); transform:scale(.97); }
/* no on-screen "visit" button on mobile — you tap the floating 3D "visit?" text */
#pauseBtn{ left:18px; top:18px; width:48px; height:48px; font-size:14px; opacity:.9; }
