/* Create23 drone game — interface. Brand: ink #0a0b0f, lime #7ff454, paper #f3f3ef. */
:root {
  --ink: #0a0b0f;
  --lime: #7ff454;
  --lime-deep: #3c7d20;
  --paper: #f3f3ef;
  --orange: #ff5c38;
  --amber: #ffb547;
  --glass: rgba(10, 11, 15, 0.8);
  --line: rgba(243, 243, 239, 0.14);
  --muted: rgba(243, 243, 239, 0.72);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --gap: clamp(12px, 2.2vw, 24px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--sans); overflow: hidden; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button, a { font: inherit; }
#app { position: fixed; inset: 0; touch-action: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 600; }
.lime { color: var(--lime); }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lime); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--lime); color: var(--ink); font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn:hover { background: #a2fb80; }
.btn:focus-visible, .card:focus-visible, .ghost:focus-visible, .iconbtn:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(243, 243, 239, 0.32); background: transparent; color: var(--paper); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.ghost:hover { border-color: var(--paper); }

/* full screens over the 3D scene */
.screen { position: absolute; inset: 0; display: flex; padding: var(--gap); overflow-y: auto; background: linear-gradient(90deg, rgba(10, 11, 15, 0.92) 0%, rgba(10, 11, 15, 0.7) 55%, rgba(10, 11, 15, 0.35) 100%); }
.screen.solid { background: radial-gradient(ellipse 60% 55% at 40% 52%, #1d2430 0%, var(--ink) 72%); }
.screen.red { background: radial-gradient(ellipse 60% 55% at 30% 52%, #2a1d1d 0%, var(--ink) 72%); }

/* loading + intro */
.intro { flex-direction: column; justify-content: safe center; gap: 22px; max-width: 760px; }
.intro h1 { margin: 0; font-size: clamp(40px, 7vw, 84px); font-weight: 800; letter-spacing: -0.055em; line-height: 0.96; }
.intro p { margin: 0; max-width: 560px; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; color: var(--muted); }
.intro .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.small { font-size: 12px; line-height: 1.5; color: rgba(243, 243, 239, 0.6); max-width: 620px; }
.progress { width: min(420px, 80vw); height: 6px; border-radius: 3px; background: rgba(243, 243, 239, 0.15); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--lime); transition: width 0.25s; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; max-width: 620px; font-size: 13px; font-weight: 600; color: var(--muted); }
.keys span { display: flex; align-items: center; gap: 8px; }
kbd { padding: 3px 8px; border-radius: 6px; background: rgba(243, 243, 239, 0.14); font: 700 12px var(--sans); color: var(--paper); }

/* hangar */
.hangar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); grid-template-rows: auto 1fr auto; gap: var(--gap); }
.hangar-head { grid-column: 1; display: flex; flex-direction: column; gap: 10px; }
.hangar h2, .big-title { margin: 0; font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.hangar-stage { grid-column: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; }
.hangar-stage::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 14%; height: 70px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(127, 244, 84, 0.3), rgba(127, 244, 84, 0) 70%); }
.hangar-stage svg { position: relative; width: min(100%, 520px); height: auto; max-height: 34vh; }
.hangar-stage .name { position: relative; display: flex; gap: 10px; align-items: baseline; }
.hangar-stage .name b { font-size: 28px; font-weight: 900; letter-spacing: -0.04em; }
.panel { grid-column: 2; grid-row: 1 / span 2; align-self: start; padding: 22px; border-radius: 20px; background: rgba(243, 243, 239, 0.06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.panel .kicker { color: rgba(243, 243, 239, 0.65); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check svg { flex-shrink: 0; margin-top: 1px; }
.panel .note { padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: rgba(243, 243, 239, 0.62); }
.cards { grid-column: 1 / span 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.card { padding: 10px 12px 12px; border-radius: 16px; background: rgba(243, 243, 239, 0.05); border: 2px solid var(--line); color: var(--paper); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.card svg { width: 100%; max-width: 116px; height: auto; }
.card b { font-size: 15px; font-weight: 800; }
.card small { font-size: 12px; color: var(--muted); }
.card[aria-pressed="true"] { background: rgba(127, 244, 84, 0.12); border-color: var(--lime); }
.card:hover { border-color: rgba(243, 243, 239, 0.4); }

/* grounded */
.grounded { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 460px); gap: var(--gap); align-items: stretch; }
.grounded .stage { position: relative; display: flex; flex-direction: column; gap: 8px; }
.grounded .stage svg { width: min(100%, 560px); opacity: 0.55; margin-top: auto; margin-bottom: auto; }
.stamp { position: absolute; left: 12%; top: 46%; transform: rotate(-12deg); padding: 10px 26px; border: 6px solid var(--orange); border-radius: 12px; color: var(--orange); font-size: clamp(30px, 5vw, 56px); font-weight: 900; letter-spacing: 0.08em; }
.needs { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
.needs div { display: flex; gap: 10px; }
.needs i { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 181, 71, 0.18); color: var(--amber); font: 800 12px var(--sans); display: flex; align-items: center; justify-content: center; font-style: normal; }
.needs i.r { background: rgba(255, 92, 56, 0.2); color: #ff8a6e; }

/* modal cards (briefing, rule, complete) */
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--gap); background: rgba(10, 11, 15, 0.55); }
.sheet { width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: clamp(20px, 3vw, 30px); border-radius: 22px; background: var(--paper); color: var(--ink); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.sheet.dark { background: var(--ink); color: var(--paper); border: 1px solid var(--line); }
.sheet h3 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.sheet p { margin: 0; font-size: 15px; line-height: 1.55; color: rgba(10, 11, 15, 0.75); }
.sheet.dark p { color: var(--muted); }
.sheet .kicker { color: var(--lime-deep); }
.sheet.dark .kicker { color: var(--lime); }
.sheet .kicker.bad { color: #b23a1e; }
.sheet .steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.sheet .fine { font-size: 12px; color: rgba(10, 11, 15, 0.6); }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sheet .ghost { color: var(--ink); border-color: rgba(10, 11, 15, 0.3); }
.sheet.dark .ghost { color: var(--paper); border-color: rgba(243, 243, 239, 0.32); }
.stats { display: flex; gap: 22px; font-size: 13px; font-weight: 700; }
.stats b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.04em; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { position: absolute; }
.hud .box { border-radius: 14px; background: var(--glass); backdrop-filter: blur(6px); }
.mission { left: var(--gap); top: var(--gap); width: min(360px, 40vw); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mission .t { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.mission .s { font-size: 13px; line-height: 1.4; color: var(--muted); }
.pills { display: flex; gap: 6px; }
.pills i { width: 30px; height: 7px; border-radius: 4px; background: rgba(243, 243, 239, 0.25); }
.pills i.on { background: var(--lime); }
.chips { right: var(--gap); top: var(--gap); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chips .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { padding: 7px 11px; border-radius: 10px; background: var(--glass); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.chip .ok { color: var(--lime); }
.chip .low { color: var(--orange); }
.iconbtn { pointer-events: auto; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--glass); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.alt { left: var(--gap); top: 50%; transform: translateY(-50%); width: 64px; height: min(300px, 42vh); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.alt .lbl { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); }
.alt .bar { position: relative; width: 10px; flex-grow: 1; border-radius: 5px; background: rgba(243, 243, 239, 0.18); }
.alt .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 5px; background: var(--lime); }
.alt .fill.warn { background: var(--amber); }
.alt .fill.bad { background: var(--orange); }
.alt .limit { position: absolute; left: -12px; right: -12px; height: 3px; background: var(--orange); }
.alt .v { font-size: 20px; font-weight: 900; letter-spacing: -0.04em; }
.alt .v small { font-size: 11px; font-weight: 700; }
.alt .m { font-size: 10px; font-weight: 700; color: #ff8a6e; }
.arrow { left: 50%; top: var(--gap); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; font-weight: 800; }
.arrow svg { transition: transform 0.08s linear; }
.toasts { left: 50%; bottom: calc(var(--gap) + 4px); transform: translateX(-50%); width: min(560px, 54vw); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { width: 100%; padding: 14px 18px; border-radius: 16px; background: var(--paper); color: var(--ink); display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); animation: pop 0.25s ease-out; }
.toast .ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.toast .k { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lime-deep); }
.toast .h { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.toast .x { font-size: 13px; line-height: 1.45; color: rgba(10, 11, 15, 0.72); }
.warnbar { width: auto; padding: 9px 16px; border-radius: 12px; background: var(--orange); color: var(--ink); font-size: 14px; font-weight: 800; }
.warnbar.amber { background: var(--amber); }
.flash { padding: 8px 14px; border-radius: 10px; background: var(--glass); font-size: 14px; font-weight: 800; color: var(--lime); }
.flash.bad { color: var(--amber); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.minimap { right: var(--gap); bottom: var(--gap); width: 168px; height: 168px; border-radius: 50%; overflow: hidden; background: var(--glass); border: 2px solid var(--line); }
.minimap canvas { width: 100%; height: 100%; display: block; }
.hints { left: var(--gap); bottom: var(--gap); display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: rgba(243, 243, 239, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hints span { display: flex; gap: 6px; align-items: center; }
.credit { right: calc(var(--gap) + 180px); bottom: calc(var(--gap) + 2px); font-size: 10px; color: rgba(243, 243, 239, 0.7); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); text-align: right; max-width: 260px; }
.whiteout { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.whiteout.on { opacity: 0.85; transition: none; }
.viewfinder { position: absolute; inset: 12% 18%; border: 2px solid rgba(243, 243, 239, 0.6); border-radius: 6px; pointer-events: none; }
.viewfinder::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 2px solid var(--lime); border-radius: 50%; }

/* touch controls */
.touch { position: absolute; inset: 0; pointer-events: none; }
.stick { position: absolute; bottom: calc(var(--gap) + 8px); width: 128px; height: 128px; border-radius: 50%; background: rgba(10, 11, 15, 0.42); border: 2px solid rgba(243, 243, 239, 0.35); display: flex; align-items: center; justify-content: center; pointer-events: auto; touch-action: none; }
.stick > i { width: 54px; height: 54px; border-radius: 50%; background: rgba(243, 243, 239, 0.88); }
.stick.l { left: calc(var(--gap) + 8px); }
.stick.r { right: calc(var(--gap) + 8px); }
.stick b { position: absolute; bottom: -18px; font-size: 10px; font-weight: 700; color: var(--paper); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); white-space: nowrap; }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.tbtn.photo { right: calc(var(--gap) + 152px); bottom: calc(var(--gap) + 40px); width: 64px; height: 64px; background: var(--lime); color: var(--ink); border: 4px solid var(--ink); }
.tbtn.walk { right: calc(var(--gap) + 160px); bottom: calc(var(--gap) + 116px); width: 52px; height: 52px; background: var(--glass); color: var(--paper); }
.tbtn.view { left: calc(var(--gap) + 152px); bottom: calc(var(--gap) + 40px); width: 48px; height: 48px; background: var(--glass); color: var(--paper); }
body.is-touch .hints { display: none; }
body.is-touch .minimap { width: 120px; height: 120px; bottom: auto; top: calc(var(--gap) + 96px); }
body.is-touch .credit { right: var(--gap); bottom: auto; top: calc(var(--gap) + 220px); width: 120px; max-width: none; font-size: 9px; text-align: center; }

/* debrief */
.debrief { flex-direction: column; justify-content: safe center; gap: 18px; max-width: 760px; }
.rules-met { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rules-met div { padding: 12px 14px; border-radius: 14px; background: rgba(243, 243, 239, 0.06); border: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.rules-met b { display: block; font-size: 14px; margin-bottom: 2px; }

/* rotate notice */
.rotate { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 32px; text-align: center; background: var(--ink); font-size: 18px; font-weight: 700; flex-direction: column; gap: 18px; }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: flex; } }

/* small landscape screens (phones) */
@media (max-height: 520px) {
  :root { --gap: 10px; }
  .intro { gap: 12px; }
  .intro h1 { font-size: clamp(30px, 5.4vw, 44px); }
  .intro p { font-size: 14px; }
  .small { font-size: 11px; }
  .arrow { top: calc(var(--gap) + 46px); padding: 5px 10px; }
  .chip { padding: 6px 9px; font-size: 12px; }
  .hangar { grid-template-rows: auto 1fr auto; }
  .hangar h2, .big-title { font-size: clamp(24px, 3.6vw, 32px); }
  .hangar-head p { display: none; }
  .hangar-stage { min-height: 0; }
  .hangar-stage .name b { font-size: 20px; }
  .panel { grid-row: 1 / span 3; max-height: calc(100vh - 2 * var(--gap)); overflow-y: auto; }
  .cards { grid-column: 1; gap: 6px; }
  .grounded .stage svg { max-height: 40vh; }
  .mission { width: min(300px, 38vw); padding: 10px 12px; }
  .mission .t { font-size: 15px; }
  .mission .s { font-size: 12px; }
  .alt { width: 52px; height: 40vh; }
  .alt .v { font-size: 16px; }
  .toasts { width: min(440px, 46vw); bottom: calc(var(--gap) + 70px); }
  .toast { padding: 10px 12px; }
  .toast .x { display: none; }
  .stick { width: 112px; height: 112px; }
  .hangar { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 10px; }
  .hangar-stage svg { max-height: 22vh; }
  .panel { padding: 14px; gap: 8px; }
  .check { font-size: 12px; }
  .card { padding: 6px 8px 8px; }
  .card svg { max-width: 70px; }
  .card b { font-size: 12px; }
  .card small { font-size: 10px; }
  .sheet { gap: 8px; }
  .sheet p { font-size: 13px; }
}
@media (max-width: 760px) and (min-height: 521px) {
  .hangar, .grounded { grid-template-columns: 1fr; }
  .panel { grid-column: 1; grid-row: auto; }
  .cards { grid-column: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
