:root {
  --sand: #fff7e8;
  --sand-2: #fbecd2;
  --card: #ffffff;
  --ink: #1c2a33;
  --ink-2: #4e5d66;
  --ink-3: #85929a;
  --sea: #0f7c80;
  --sea-d: #0b5b5e;
  --coral: #ff6a4d;
  --coral-d: #e2502f;
  --sun: #ffc24b;
  --leaf: #2f9e5b;
  --line: #eadcc2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 42, 51, .06), 0 6px 20px rgba(28, 42, 51, .07);
  --display: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Quicksand', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sand); color: var(--ink); font: 16px/1.5 var(--body);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--sea); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 18px; }
main { flex: 1; padding-bottom: 40px; }

/* Header + footer */
.top { padding: 14px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 1.2rem var(--display); color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.foot { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--ink-3); font-size: .88rem; }
.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--ink-2); }

/* Buttons + inputs */
.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 13px 20px; font: 700 1rem var(--display);
  background: var(--coral); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; min-height: 48px; transition: transform .06s, background .15s, box-shadow .15s;
  box-shadow: 0 2px 0 var(--coral-d);
}
.btn:hover { background: var(--coral-d); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { background: #d9cfc0; box-shadow: none; cursor: not-allowed; color: #fff; }
.btn.sea { background: var(--sea); box-shadow: 0 2px 0 var(--sea-d); }
.btn.sea:hover { background: var(--sea-d); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { background: var(--sand-2); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: .92rem; border-radius: 11px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 4px; }
label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: .95rem; }
.hint { color: var(--ink-3); font-size: .86rem; font-weight: 400; }
input[type=text], select {
  width: 100%; font: 1rem var(--body); padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); min-height: 48px;
}
input[type=text]:focus, select:focus { outline: none; border-color: var(--sea); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.error { color: var(--coral-d); font-weight: 600; min-height: 1.4em; margin: 8px 0 0; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.card.tight { padding: 14px 16px; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* Pickers */
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emojis button {
  font-size: 1.45rem; aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; background: var(--sand);
  cursor: pointer; padding: 0; line-height: 1;
}
.emojis button[aria-pressed=true] { border-color: var(--sea); background: #e3f4f2; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice {
  text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; cursor: pointer;
  font: inherit; color: var(--ink); min-height: 48px;
}
.choice b { display: block; font-family: var(--display); }
.choice span { color: var(--ink-3); font-size: .84rem; }
.choice[aria-pressed=true] { border-color: var(--sea); background: #e9f6f4; }
.choice:disabled { opacity: .45; cursor: not-allowed; }
.settings { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.settings .choice { display: flex; gap: 12px; align-items: center; padding: 12px; }
.settings .choice .big { font-size: 2rem; }

/* Landing */
.hero { padding: 26px 0 8px; }
.hero .kicker { display: inline-block; background: #fff; border-radius: 99px; padding: 5px 12px; font-weight: 700; font-size: .85rem; color: var(--sea); box-shadow: var(--shadow); margin-bottom: 14px; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.hero .row { margin-top: 18px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.step { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.step .n { font: 800 1.6rem var(--display); color: var(--coral); }

/* Episode */
.episode { background: linear-gradient(180deg, #0f5f6a 0%, #0c4a55 100%); color: #f4fbf9; border-radius: 22px; padding: 22px 20px; box-shadow: var(--shadow); margin: 16px 0; position: relative; overflow: hidden; }
.episode::after { content: ''; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 75, .35), transparent 70%); pointer-events: none; }
.episode h2 { color: #fff; }
.episode .sub { color: #a9d6d2; font-size: .9rem; margin-bottom: 12px; }
.lines { list-style: none; padding: 0; margin: 0; }
.lines li { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 1.02rem; }
.lines li:first-child { border-top: 0; }
.lines li.hi { color: #fff; }
.lines li.hi::before { content: '★ '; color: var(--sun); }
.lines li.k-rescued { color: var(--sun); font-weight: 600; }
.lines li.k-winner { color: var(--sun); font-weight: 700; font-size: 1.1rem; }
.lines li.reveal { animation: pop .45s ease both; }
.name { font-weight: 800; color: #fff; }
.card .name, .finale .name { color: var(--ink); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rescue-banner { margin-top: 14px; background: rgba(255, 194, 75, .16); border-radius: 14px; padding: 12px 14px; font-weight: 700; color: #ffe2a3; }
.episode .btn.ghost { color: #e8f6f4; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.episode .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.archive summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 8px 0; }

/* Season header */
.status { display: flex; align-items: center; gap: 14px; }
.status .em { font-size: 2.4rem; }
.status h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin: 0; }
.status .sub { color: var(--ink-2); font-weight: 600; }
.countdown { font: 800 1.05rem var(--display); color: var(--coral-d); }

/* Cast */
.cast { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cast li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--sand); }
.cast li.out { opacity: .6; }
.cast .av { font-size: 1.5rem; width: 36px; text-align: center; }
.cast .who { flex: 1; min-width: 0; }
.cast .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast .who span { font-size: .82rem; color: var(--ink-3); }
.tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cast .who .meters { display: inline-flex; }
.meters { display: flex; gap: 8px; font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.tag { font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 3px 8px; background: #fff; color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: #e2f5e9; color: #1f7a45; }
.tag.host { background: #fff1d6; color: #8a5a00; }

/* Moves */
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.move { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); min-height: 76px; }
.move .ic { font-size: 1.5rem; display: block; }
.move b { font-family: var(--display); display: block; }
.move span { color: var(--ink-3); font-size: .8rem; }
.move[aria-pressed=true] { border-color: var(--coral); background: #fff1ec; }
.targets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.targets button { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; cursor: pointer; font: 600 .95rem var(--body); color: var(--ink); min-height: 40px; }
.targets button[aria-pressed=true] { border-color: var(--coral); background: #fff1ec; }
.picked { margin-top: 12px; background: #e9f6f4; color: var(--sea-d); padding: 10px 12px; border-radius: 12px; font-weight: 600; }

/* Invite */
.invite { display: flex; gap: 8px; }
.invite input { flex: 1; font-size: .92rem; }

/* Finale */
.finale { background: linear-gradient(160deg, #fff3d4, #ffe1d6); border-radius: 22px; padding: 24px 20px; margin: 16px 0; box-shadow: var(--shadow); text-align: center; }
.finale .crown { font-size: 3rem; }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 16px 0 6px; text-align: left; }
.award { background: rgba(255, 255, 255, .75); border-radius: 14px; padding: 12px; }
.award small { display: block; color: var(--ink-3); font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 9; box-shadow: var(--shadow); }

.sample { font-size: .98rem; }
.sample .name { color: #fff; }
.legal h2 { margin-top: 1.2em; }
@media (max-width: 480px) {
  .emojis { grid-template-columns: repeat(6, 1fr); }
  .card { padding: 16px; }
  .meters { gap: 5px; font-size: .78rem; }
}
