:root {
  color-scheme: light;
  --ink: #123039;
  --muted: #49616a;
  --sea: #006b65;
  --sea-dark: #004d4c;
  --paper: #f2f6f0;
  --white: #fcfdfa;
  --line: #d6e2d8;
  --orange: #ffbf7e;
  --font: "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #ad551c; outline-offset: 4px; }
button, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--sea-dark); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.08; }
p { line-height: 1.55; }
[hidden] { display: none !important; }
.frame { width: min(1136px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #f7faf5; }
.masthead { height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand, .nav-button, .text-button { background: transparent; border: 0; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; font-size: 1.22rem; font-weight: 800; letter-spacing: -.06em; }
.brand-period { color: var(--sea); }
.brand-mark { width: 35px; height: 35px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; background: var(--sea-dark); transform: rotate(-19deg); }
.brand-mark i { width: 16px; height: 4px; border-top: 1.6px solid #d5ffde; border-radius: 50%; }
.brand-mark i:nth-child(2) { width: 19px; }
.brand-mark i:nth-child(3) { width: 12px; }
nav { display: flex; align-items: center; gap: 9px; }
.nav-button { padding: 8px 11px; border-radius: 7px; font-weight: 650; font-size: .93rem; }
.nav-button:hover, .text-button:hover { color: var(--sea); text-decoration: underline; text-underline-offset: 3px; }
.help-button { padding-inline: 12px; border: 1px solid var(--line); display: flex; gap: 7px; align-items: center; }
.help-button > span:first-child { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .76rem; }
main { min-height: 65vh; }
.hero { display: grid; grid-template-columns: 1.12fr 1fr; min-height: 474px; margin-top: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: #fcfdf8; }
.hero-copy { padding: clamp(27px, 5vw, 62px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--sea-dark); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; margin-bottom: 17px; }
.eyebrow::before { content: ""; border-radius: 50%; width: 8px; height: 8px; background: #1b8f7c; box-shadow: 0 0 0 4px #d5eee2; flex: 0 0 auto; }
.hero h1 { margin: 0 0 19px; font-family: var(--serif); font-size: clamp(3.2rem, 6.6vw, 6.3rem); font-weight: 500; letter-spacing: -.077em; line-height: .95; }
.hero h1 em { color: var(--sea); font-weight: inherit; }
.hero p { max-width: 37ch; color: var(--muted); font-size: 1.08rem; margin-bottom: 24px; }
.hero small { margin-top: 14px; color: var(--muted); font-size: .88rem; }
.hero-art { margin: 0; position: relative; min-width: 0; background: #0b3b56; min-height: 100%; overflow: hidden; }
.hero-art img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; object-position: 50% 52%; }
.hero-detail { position: absolute; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; background: #062730df; border: 1px solid #c9f8eb66; color: #f4fffb; font-size: .8rem; font-weight: 650; }
.hero-detail b { color: #ffc891; font-variant-numeric: tabular-nums; }
.primary, .secondary, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; text-decoration: none; line-height: 1.24; }
.primary { color: #fff; background: var(--sea-dark); }
.primary:hover { background: #006b64; }
.hero .primary { padding: 12px 24px; min-height: 51px; }
.secondary { color: var(--ink); background: var(--white); border-color: #a6beb2; }
.secondary:hover { background: #eaf4e9; }
.ghost { color: var(--sea-dark); background: transparent; }
.ghost:hover { background: #e4efe5; }
.text-button { font-size: .9rem; padding: 4px 0; text-align: left; }
.mode-section { margin-block: 36px 29px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 15px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font: 500 clamp(1.75rem, 3vw, 2.2rem)/1 var(--serif); letter-spacing: -.04em; }
.section-head p { margin: 0; font-size: .91rem; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.mode-card { width: 100%; text-align: left; display: flex; align-items: flex-start; gap: 14px; padding: 19px 17px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 13px; transition: border-color .16s, background .16s; }
.mode-card:hover { border-color: #88ae9e; background: #fff; }
.mode-card > span:last-child { min-width: 0; }
.mode-card strong { display: block; margin-bottom: 5px; letter-spacing: -.025em; font-size: 1.04rem; }
.mode-card small { display: block; line-height: 1.42; color: var(--muted); font-size: .9rem; }
.mode-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 11px; font-size: 1.48rem; color: #0b625d; background: #daf0e7; font-weight: 500; }
.mode-icon.family { background: #f9e9d4; color: #823c19; }
.mode-icon.packs { background: #e6eafa; color: #414d91; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; padding-block: 17px 24px; color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem; }
.footer button { color: var(--muted); }
.screen-head { margin: 31px 0 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px 13px; justify-content: space-between; }
.screen-head .eyebrow { margin: 0; }
.screen-head p { margin: 0; color: var(--muted); font-weight: 650; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .36fr); gap: 17px; }
.panel { border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4.5vw, 43px); background: var(--white); }
.game-panel { min-height: 416px; display: flex; flex-direction: column; }
.game-panel h1, .content-panel h1 { font: 500 clamp(2.05rem, 5.5vw, 4rem)/1.03 var(--serif); letter-spacing: -.051em; margin-bottom: 13px; overflow-wrap: anywhere; }
.game-panel p, .content-panel > p { color: var(--muted); max-width: 62ch; }
.game-panel .hint { font-size: 1rem; margin-bottom: 18px; }
.solo-center { justify-content: center; align-items: flex-start; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 16px; }
.label { color: var(--sea-dark); font-size: .83rem; letter-spacing: .06em; font-weight: 800; text-transform: uppercase; }
.timer { color: var(--sea-dark); font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.timer.urgent { color: #a13525; }
progress { width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; background: #e0ede2; display: block; margin: 0 0 24px; }
progress::-webkit-progress-bar { background: #e0ede2; }
progress::-webkit-progress-value { border-radius: 8px; background: #1e8c77; }
progress::-moz-progress-bar { border-radius: 8px; background: #1e8c77; }
progress.urgent::-webkit-progress-value { background: #b84b2c; }
progress.urgent::-moz-progress-bar { background: #b84b2c; }
.game-form { margin-top: auto; padding-top: 8px; }
.game-form label, .setup-form label { display: block; font-weight: 700; margin-bottom: 7px; }
.input-row { display: flex; gap: 8px; }
input, select { padding: 11px 12px; background: #fff; color: var(--ink); border: 1px solid #a6beb2; border-radius: 8px; min-height: 45px; min-width: 0; }
input::placeholder { color: #61737a; }
.input-row input { flex: 1 1 auto; width: 100%; }
.game-form .ghost { margin-top: 6px; padding-inline: 0; min-height: 36px; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.depth-card { min-height: 301px; align-self: stretch; border-radius: 18px; padding: 23px; color: #f4fff9; background: linear-gradient(158deg, #0e5d63 0%, #083c51 53%, #0a263c 100%); overflow: hidden; position: relative; }
.depth-card h2 { font-size: 1rem; margin: 0 0 5px; color: #d7f5ef; overflow-wrap: anywhere; }
.depth-total { display: block; font: 500 clamp(2.4rem, 4vw, 3.5rem)/1.05 var(--serif); letter-spacing: -.065em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.depth-points { color: #c4eacb; font-size: .92rem; margin: 5px 0 17px; }
.depth-visual { position: relative; height: 150px; margin-bottom: 17px; border-block: 1px solid #c6f1e654; background: repeating-linear-gradient(to bottom, transparent 0 23%, #b0e3e12b 24% 25%); }
.depth-line { position: absolute; top: var(--depth); left: 0; right: 0; height: 2px; background: #ffbf7e; transform: translateY(-1px); transition: top .35s ease; }
.depth-line::after { content: ""; position: absolute; right: 0; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #ffbf7e; transform: translateY(-50%); box-shadow: 0 0 12px #ffbf7eaa; }
.round-pips { display: flex; gap: 4px; }
.round-pips span { flex: 1 1 0; height: 7px; border-radius: 8px; background: #c0e3ee40; }
.round-pips span.current { outline: 1px solid #d5f7e4; outline-offset: 2px; }
.round-pips span.done, .round-pips span[class*="tier-"] { background: var(--pip, #c8eee1); }
.round-pips span.tier-0 { --pip: #9eb5c1; }
.round-pips span.tier-10 { --pip: #b1eedb; }
.round-pips span.tier-15 { --pip: #e2ecc3; }
.round-pips span.tier-30 { --pip: #8fdbf7; }
.round-pips span.tier-60 { --pip: #cdc5ff; }
.round-pips span.tier-85 { --pip: #ffc1db; }
.round-pips span.tier-100 { --pip: #ffd086; }
.result-box { padding: 18px 20px; border-radius: 11px; background: #eaf5ec; margin-top: 14px; }
.result-box p { margin: 5px 0 0; color: #284e51; overflow-wrap: anywhere; }
.result-box .label { display: block; margin-bottom: 6px; }
.result-box .gem { margin-top: 9px; }
.tier-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: #e5eceb; color: #304e56; font-weight: 750; white-space: nowrap; font-size: .89rem; }
.tier-badge.tier-10 { background: #d9f2e8; color: #0b6256; }
.tier-badge.tier-15 { background: #e9efcf; color: #475420; }
.tier-badge.tier-30 { background: #d6edf9; color: #195474; }
.tier-badge.tier-60 { background: #eee7fb; color: #59438c; }
.tier-badge.tier-85 { background: #fbe3ef; color: #782952; }
.tier-badge.tier-100 { background: #ffe1a8; color: #673a12; }
.result-box strong { color: var(--ink); }
.answer-list { padding: 0; margin: 12px 0 0; list-style: none; }
.answer-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 7px; border-top: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.answer-list small { color: var(--muted); font-size: .88rem; }
.answer-list .item-detail { display: grid; gap: 4px; min-width: 0; flex: 1 1 160px; }
.completion { margin: 10px 0 20px; font: 500 clamp(2.3rem, 6vw, 4.4rem)/1 var(--serif); letter-spacing: -.06em; color: var(--sea-dark); }
.content-panel { margin: 0 0 23px; }
.content-panel.standalone { margin-top: 30px; }
.setup-form { max-width: 510px; }
.setup-form input, .setup-form select { width: 100%; }
.setup-form fieldset { padding: 0; margin: 16px 0; border: 0; }
.setup-form legend { font-weight: 750; margin-bottom: 8px; }
.setup-form .radio-row { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.radio-row input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; accent-color: var(--sea-dark); flex: 0 0 auto; }
.setup-group { margin-block: 14px; }
.player-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.small-heading { font-size: 1.15rem; margin-top: 23px; margin-bottom: 7px; }
.compact-list { display: grid; gap: 7px; padding: 0; list-style: none; }
.compact-list > li > button { width: 100%; text-align: left; padding: 12px 13px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; }
.compact-list > li > button:hover { border-color: #6b9a85; }
.compact-list small { font-size: .88rem; color: var(--muted); }
.notice { margin: 14px 0; padding: 10px 12px; border-radius: 7px; background: #fff0d6; color: #653a18; }
dialog { border: 1px solid var(--line); border-radius: 17px; padding: 22px; width: min(560px, calc(100% - 27px)); max-height: 88vh; color: var(--ink); background: var(--white); box-shadow: 0 15px 55px #092e3940; }
dialog::backdrop { background: #082d39aa; }
.dialog-head { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.dialog-head h2 { font: 500 2rem/1 var(--serif); letter-spacing: -.045em; margin: 0 0 16px; }
.close-dialog { padding: 0; display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.25rem; line-height: 1; border-radius: 8px; }
.share-text { width: 100%; padding: 9px; border: 1px solid #a6beb2; border-radius: 8px; color: var(--ink); font: inherit; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: absolute; z-index: 5; left: 10px; top: 10px; padding: 10px; background: #fff; }
@media (max-width: 800px) {
  .frame { width: calc(100% - 38px); }
  .hero { min-height: 405px; }
  .hero-copy { padding: 26px; }
  .hero h1 { font-size: clamp(3.2rem, 7.9vw, 5rem); }
  .mode-card { flex-direction: column; gap: 9px; }
  .mode-icon { flex: 0 0 auto; width: 42px; }
}
@media (max-width: 610px) {
  .frame { width: calc(100% - 24px); }
  .masthead { height: 58px; }
  .brand { font-size: 1.05rem; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  nav { gap: 2px; }
  .nav-button { padding: 7px 5px; font-size: .81rem; }
  .help-button { padding-inline: 6px; }
  .help-button > span:first-child { display: none; }
  .hero { grid-template-columns: 1fr; margin-top: 17px; min-height: 0; border-radius: 17px; }
  .hero-art { min-height: clamp(185px, 53vw, 288px); }
  .hero-art img { object-position: center 55%; }
  .hero-copy { padding: 24px; }
  .hero p { margin-bottom: 17px; }
  .section-head { margin-bottom: 10px; }
  .mode-section { margin-block: 25px 19px; }
  .mode-grid, .game-grid { grid-template-columns: 1fr; }
  .mode-card { flex-direction: row; align-items: center; padding: 12px; }
  .game-panel { min-height: 345px; }
  .depth-card { min-height: 198px; }
  .depth-visual { height: 65px; }
  .screen-head { margin-top: 19px; }
  .footer { margin-top: 23px; }
}
@media (max-width: 360px) {
  .brand-mark { display: none; }
  .input-row { flex-wrap: wrap; }
  .input-row .primary { width: 100%; }
  .player-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
