/* One phone-width column. Sky-to-sea diorama on top, views behind a bottom tab bar. */
:root {
  --bg: #e6f5f3; --surface: #ffffff; --ink: #12303a; --muted: #4d6b75; --line: #c3dedc;
  --sea: #0b7f93; --coral: #d93a36; --on-coral: #ffffff; --sun: #f2a52b; --pine: #1c7448;
  --sky-top: #bfe9ef; --sky-bot: #ffdcae; --chat-bg: #dcefe9; --bubble-out: #d2f4c8;
  --font-display: "Chango", "Arial Black", Impact, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1b29; --surface: #13293a; --ink: #eef7f5; --muted: #9dbac4; --line: #24445a;
    --sea: #48c6d6; --coral: #ff7566; --on-coral: #2b0906; --sun: #ffc857; --pine: #56c98d;
    --sky-top: #050f1f; --sky-bot: #1c3654; --chat-bg: #0e2433; --bubble-out: #1d5a45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1b29; --surface: #13293a; --ink: #eef7f5; --muted: #9dbac4; --line: #24445a;
  --sea: #48c6d6; --coral: #ff7566; --on-coral: #2b0906; --sun: #ffc857; --pine: #56c98d;
  --sky-top: #050f1f; --sky-bot: #1c3654; --chat-bg: #0e2433; --bubble-out: #1d5a45;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.45; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); font-weight: 800; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.app { max-width: 440px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.app.plain { padding-bottom: 32px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 12px; background: var(--sky-top); }
.brand { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; background: none; border: 0; padding: 0; }
.lang { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin: 0; }
.lang button { border: 0; background: transparent; padding: 6px 14px; font-weight: 800; font-size: 14px; min-height: 36px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.hero { background: linear-gradient(var(--sky-top), var(--sky-bot)); }
.hero-text { padding-top: 8px; padding-bottom: 4px; display: grid; gap: 8px; }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 10.5vw, 46px); line-height: 1.02; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero-text p { font-weight: 600; max-width: 32ch; }
.stage { position: relative; aspect-ratio: 1 / 1; max-width: 100%; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.stage .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; }
.hint { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 12px; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 800; pointer-events: none; }

.view { display: grid; gap: 28px; }
.block { display: grid; gap: 12px; scroll-margin-top: 16px; }
.pad-top { padding-top: 24px; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; text-wrap: balance; }
h3 { font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.lede { color: var(--muted); font-weight: 600; }
.small { font-size: 14px; color: var(--muted); font-weight: 600; }

.strip { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); color: var(--bg); }
.strip > * { padding: 14px 16px; display: grid; gap: 2px; min-width: 0; text-align: left; background: none; border: 0; color: inherit; }
.strip > * + * { border-left: 1px solid var(--muted); }
.strip b { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.strip span { font-size: 14px; font-weight: 600; }

.steps { display: grid; gap: 18px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--coral); }
.steps strong { display: block; font-weight: 800; }
.steps span { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 22px; border-radius: 16px; border: 2px solid var(--ink); background: var(--coral); color: var(--on-coral); font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.small-btn { min-height: 44px; padding: 6px 14px; font-size: 15px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn[disabled] { opacity: .6; cursor: default; }
.actions { display: grid; gap: 14px; }
.eggs { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.eggs b { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--coral); font-variant-numeric: tabular-nums; }

.gift { background: var(--coral); color: var(--on-coral); border: 2px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 26px 20px; display: grid; gap: 12px; justify-items: center; text-align: center; position: relative; overflow: hidden; }
.gift.calm { background: var(--surface); color: var(--ink); }
.gift .big { font-size: 76px; line-height: 1; animation: wobble 2.6s ease-in-out infinite; }
.gift .who { font-family: var(--font-display); font-size: clamp(34px, 12vw, 52px); line-height: 1; overflow-wrap: anywhere; }
.gift small { font-weight: 600; }
.gift .btn { background: var(--surface); color: var(--ink); }
.gift .face { display: grid; gap: 12px; justify-items: center; }
.gift .face.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes wobble { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) translateY(-4px); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.5s ease-in forwards; pointer-events: none; }
.confetti.c0 { background: #ffc857; } .confetti.c1 { background: #ffffff; } .confetti.c2 { background: #48c6d6; } .confetti.c3 { background: #56c98d; } .confetti.c4 { background: #12303a; }
@keyframes fall { to { transform: translateY(380px) rotate(540deg); opacity: 0; } }

.list { display: grid; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: 10px; align-items: center; justify-content: space-between; overflow-wrap: anywhere; }
.list form { margin: 0; flex: none; }
.linkish { background: none; border: 0; padding: 8px 4px; color: var(--muted); font-weight: 800; font-size: 14px; text-decoration: underline; min-height: 40px; }
.row { display: flex; gap: 8px; margin: 0; }
.row input, .row select { flex: 1; min-width: 0; min-height: 52px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--ink); background: var(--surface); }
.row .btn { min-height: 52px; padding: 8px 16px; font-size: 16px; }
.note { border-left: 4px solid var(--sun); padding: 4px 0 4px 12px; color: var(--muted); font-weight: 600; }
.qa { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qa q { font-weight: 800; quotes: "«" "»"; }
.qa .ans { color: var(--pine); font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--pine); font-weight: 800; font-size: 15px; }
.chip.wait { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.board li { display: block; }
.board .hit { color: var(--pine); font-weight: 800; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 2px solid var(--ink); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 5; }
.tabs div { max-width: 440px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabs button { border: 0; background: transparent; min-height: 60px; font-weight: 800; font-size: 15px; color: var(--muted); border-top: 4px solid transparent; }
.tabs button[aria-current="page"] { color: var(--ink); border-top-color: var(--coral); }
.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(400px, calc(100% - 32px)); background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; z-index: 6; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 16px 0; background: none; border: 0; width: 100%; }
body.sunstroke .app { animation: sway 1.2s ease-in-out 3; }
@keyframes sway { 0%,100% { transform: rotate(0); } 25% { transform: rotate(1.6deg); } 75% { transform: rotate(-1.6deg); } }

/* admin + simulator */
.admin { max-width: 760px; margin: 0 auto; padding-top: 16px; padding-bottom: 60px; display: grid; gap: 28px; }
.admin h1 { font-family: var(--font-display); font-weight: 400; font-size: 30px; }
.card { background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 800; color: var(--muted); }
.field input, .field select, .field textarea { min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); font-weight: 600; width: 100%; }
.field textarea { min-height: 110px; }
.people { display: grid; gap: 8px; }
.people details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.people summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; cursor: pointer; font-weight: 800; }
.people summary small { color: var(--muted); font-weight: 600; }
.tag { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--line); color: var(--muted); }
.tag.ok { border-color: var(--pine); color: var(--pine); }
.tag.warn { border-color: var(--sun); color: var(--ink); background: var(--sun); }
.msg { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 800; }
.danger { border-color: var(--coral); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 0; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; }
.stats b { font-family: var(--font-display); font-weight: 400; font-size: 26px; display: block; font-variant-numeric: tabular-nums; }

.sim { max-width: 440px; margin: 0 auto; display: grid; gap: 12px; padding-top: 12px; padding-bottom: 24px; }
.chat { background: var(--chat-bg); border-radius: 22px; padding: 14px 12px; display: grid; gap: 8px; min-height: 300px; align-content: start; }
.chat-thread { display: grid; gap: 8px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; font-size: 22px; flex: none; }
.chat-head b { display: block; line-height: 1.2; }
.chat-head small { color: var(--muted); font-weight: 600; }
.bubble-msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; background: var(--surface); justify-self: start; border-top-left-radius: 4px; white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.bubble-msg.out { background: var(--bubble-out); justify-self: end; border-radius: 16px; border-top-right-radius: 4px; }
.bubble-msg.tpl { border: 2px dashed var(--muted); }
.bubble-msg small { display: block; color: var(--muted); font-weight: 800; font-size: 12px; }
.qr { justify-self: start; width: 86%; display: grid; gap: 6px; }
.qr button { background: var(--surface); color: var(--sea); text-align: center; font-weight: 800; padding: 10px; border-radius: 12px; border: 0; min-height: 44px; }
.typing { justify-self: start; color: var(--muted); font-weight: 800; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .gift .big, .gift .face.pop, .confetti, body.sunstroke .app { animation: none; }
  .confetti { display: none; }
}
