/* Lantern Glide: page layout, HUD and screens. Night indigo glass, warm lantern light. */
:root {
  --night: #070a1f;
  --ink: #0b0e2a;
  --cream: #fff4e2;
  --amber: #ffb85c;
  --amber-hi: #ffd98a;
  --red: #e8562e;
  --leaf: #c6ff5a;
  --glass: rgba(10, 12, 40, 0.5);
  --line: rgba(255, 214, 160, 0.2);
  --ui: var(--kit-grotesk);
  --display: var(--kit-didone);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--cream);
  font: 600 15px/1.35 var(--ui);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; }
#game { position: absolute; inset: 0; cursor: pointer; }
#game canvas { display: block; }

.hud {
  position: absolute;
  top: max(2.2vh, env(safe-area-inset-top));
  left: 2.4vw;
  right: 2.4vw;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font-size: clamp(14px, 1.45vw, 26px);
}
.hud-group { display: flex; gap: 0.55em; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 2.1em;
  padding: 0 0.85em;
  border-radius: 0.75em;
  background: var(--glass);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--line), 0 0.35em 1.2em rgba(0, 0, 10, 0.35);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 10, 0.6);
}
.chip b { font-weight: 600; font-size: 0.62em; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.chip .num { font-weight: 700; }
.chip .icon { width: 1.25em; height: 1.25em; }
.flames { gap: 0.32em; }
.flame { width: 0.95em; height: 1.22em; --paper: #ffa04e; --cap: #2a1c22; filter: drop-shadow(0 0 0.3em rgba(255, 150, 70, 0.85)); }
.flame.out { --paper: rgba(255, 244, 226, 0.12); --cap: rgba(255, 244, 226, 0.3); --rib: rgba(255, 244, 226, 0.2); filter: none; }


.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.2vh;
  padding: 24px;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 12, 0.8);
}
.screen p { margin: 0; }
.screen-title {
  background:
    radial-gradient(ellipse 58% 52% at 50% 44%, rgba(6, 8, 30, 0.6), rgba(6, 8, 30, 0.15) 70%, rgba(6, 8, 30, 0) 100%),
    linear-gradient(to bottom, rgba(6, 8, 30, 0.45), rgba(6, 8, 30, 0) 32%, rgba(6, 8, 30, 0) 70%, rgba(6, 8, 30, 0.55));
}
.kicker { font-size: clamp(12px, 1.05vw, 18px); letter-spacing: 0.34em; text-transform: uppercase; color: var(--amber); }
.screen-title h1 {
  margin: 0 0 0.6vh;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 8vw, 144px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff1d6;
  text-shadow: 0 0 18px rgba(255, 170, 90, 0.65), 0 0 60px rgba(255, 120, 60, 0.45), 0 4px 18px rgba(0, 0, 12, 0.8);
}
.tagline { font-size: clamp(15px, 1.35vw, 22px); font-weight: 500; max-width: 32em; color: #f6e6d4; }
.keys { color: rgba(240, 232, 255, 0.78); font-size: clamp(12px, 0.95vw, 15px); font-weight: 500; }
.meta { color: var(--leaf); font-size: clamp(12px, 0.9vw, 14px); letter-spacing: 0.08em; text-transform: uppercase; }
.meta span + span::before { content: "· "; color: rgba(240, 232, 255, 0.6); }
.meta span:empty, .meta span:empty + span::before { display: none; }

.panel {
  place-self: center;
  position: relative;
  min-width: min(440px, 86vw);
  padding: 34px 40px 30px;
  border-radius: 22px;
  background: linear-gradient(to bottom, rgba(26, 24, 66, 0.86), rgba(10, 12, 40, 0.92));
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 70px rgba(0, 0, 12, 0.55), 0 0 80px rgba(255, 140, 70, 0.12);
}
#app > .panel { position: absolute; inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.panel h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.2vw, 52px); color: #fff1d6; text-shadow: 0 0 18px rgba(255, 170, 90, 0.55); }
.big { font-size: clamp(20px, 2vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; }

.cta {
  margin-top: 1.4vh;
  font: inherit;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #2a0f06;
  background: radial-gradient(ellipse at 50% 30%, #ffe6b0, #ffb85c 55%, #e8702e);
  border: 0;
  border-radius: 999px;
  padding: 0.85em 1.9em;
  cursor: pointer;
  text-shadow: none;
  box-shadow: 0 0 0 1px rgba(255, 230, 190, 0.5), 0 0 30px rgba(255, 150, 70, 0.55), 0 10px 26px rgba(0, 0, 12, 0.5);
  animation: glow 2.2s ease-in-out infinite;
}
.cta:focus-visible { outline: 3px solid var(--leaf); outline-offset: 5px; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgba(255, 230, 190, 0.6), 0 0 46px rgba(255, 160, 80, 0.75), 0 10px 26px rgba(0, 0, 12, 0.5); } }

.status {
  position: absolute;
  left: 50%;
  bottom: max(2vh, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 0.45em 1.1em;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(12px, 0.95vw, 16px);
  font-weight: 600;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}
.is-capturing .status, .status:empty { display: none; }

.touch { position: absolute; inset: 0; pointer-events: none; }
.touch-pause {
  pointer-events: auto;
  position: absolute;
  right: 18px;
  top: 74px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 214, 0.45);
  background: rgba(10, 12, 40, 0.5);
  color: var(--cream);
  font: inherit;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) { .cta { animation: none; } }
