:root {
  --ink: #fff4ec;
  --muted: #b9abd6;
  --panel: rgba(24, 16, 62, 0.84);
  --panel-solid: #1c1347;
  --edge: rgba(150, 240, 214, 0.24);
  --cyan: #59f0c8;
  --pink: #ff8a4c;
  --gem: #f7c6ff;
  --deep: #8f9bff;
  --rare: #2fe0b5;
  --school: #ffcf5c;
  --clever: #ff7461;
  --plankton: #b7c3cf;
  --none: #4a4f60;
  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #0b0722; }
body { margin: 0; color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #0b0722; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cyan); }

* { scrollbar-width: thin; scrollbar-color: rgba(255, 138, 76, 0.5) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 138, 76, 0.4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- stage ---------- */
.stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #1fa8a6; }
body.playing { overflow: hidden; }
body.playing .stage { position: fixed; inset: 0; height: auto; min-height: 0; z-index: 5; }
body.playing .content, body.playing .foot { display: none; }

.scene { position: absolute; left: 0; right: 0; top: 0; height: 4200px; will-change: transform; transition: transform 1.7s cubic-bezier(0.5, 0, 0.25, 1); }
.scene .water { position: absolute; inset: 0;
  background: linear-gradient(180deg, #2b1d63 0, #7a3f8f 4%, #ff8a6e 8%, #ffc98a 10%, #3fd0bd 10.01%, #1fa8a6 12%, #13808f 16%, #12577e 22%, #17396e 32%, #1b265e 46%, #171a4c 62%, #100c35 80%, #080420 100%); }
.scene .rays { position: absolute; left: -10%; right: -10%; top: 10%; height: 10%; background: repeating-linear-gradient(78deg, rgba(255, 236, 200, 0.08) 0 24px, transparent 24px 110px); mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent); }
.scene .sun { position: absolute; left: 64%; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, #fff1c2 0, #ffc27a 45%, #ff8a6e 70%, transparent 71%); box-shadow: 0 0 80px 30px rgba(255, 170, 110, 0.35); }
.scene .cloud { position: absolute; height: 14px; border-radius: 14px; background: rgba(255, 214, 196, 0.55); }
.scene .buoy { position: absolute; left: 22%; width: 40px; height: 70px; animation: buoy 4s ease-in-out infinite; transform-origin: 50% 70%; }
.scene .grass, .scene .coral { position: absolute; opacity: 0.75; transform-origin: bottom center; }
.scene .grass { animation: sway 7s ease-in-out infinite; }
.scene .fish { position: absolute; animation: swim linear infinite; }
.scene .jelly { position: absolute; opacity: 0.7; animation: drift ease-in-out infinite; }
.scene .mark { position: absolute; font: 600 11px/1.3 var(--display); letter-spacing: 0.06em; color: rgba(255, 236, 220, 0.6); white-space: nowrap; transition: opacity 0.6s; }
.scene .mark.l { left: 66px; }
.scene .mark.r { right: 16px; text-align: right; }
.scene .mark.zone { color: #fff; font-weight: 800; text-transform: uppercase; }
body:not(.playing) .scene .mark { opacity: 0; }
.scene .floor { position: absolute; left: 0; right: 0; height: 140px; background: radial-gradient(70% 100% at 50% 100%, #2a1640 0, transparent 70%); }

@keyframes sway { 0%, 100% { transform: skewX(-4deg); } 50% { transform: skewX(4deg); } }
@keyframes buoy { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(4px); } }
@keyframes swim { from { transform: translateX(calc(100vw + 120px)); } to { transform: translateX(-120px); } }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-36px); } }

.bubbles { position: absolute; inset: 0; pointer-events: none; opacity: 0.45;
  background-image: radial-gradient(circle at 18% 40%, transparent 2px, rgba(255, 255, 255, 0.7) 2.5px, transparent 3.5px), radial-gradient(circle at 64% 70%, transparent 3px, rgba(255, 255, 255, 0.6) 3.5px, transparent 4.5px), radial-gradient(circle at 82% 25%, transparent 1.5px, rgba(255, 255, 255, 0.7) 2px, transparent 3px), radial-gradient(circle at 38% 88%, transparent 2px, rgba(255, 255, 255, 0.5) 2.5px, transparent 3.5px);
  background-size: 240px 320px; animation: bubbles 14s linear infinite; }
@keyframes bubbles { from { background-position: 0 0; } to { background-position: 0 -320px; } }

.ruler { position: absolute; top: 0; bottom: 0; left: 0; width: 60px; pointer-events: none; }
.ruler-track { position: absolute; left: 8px; top: 0; height: 4200px; width: 50px; border-left: 2px dotted rgba(255, 236, 220, 0.4); transition: transform 1.7s cubic-bezier(0.5, 0, 0.25, 1); will-change: transform; }
.ruler-track i { position: absolute; left: 0; width: 6px; border-top: 1px solid rgba(255, 236, 220, 0.45); }
.ruler-track i.big { width: 12px; border-top-width: 2px; }
.ruler-track span { position: absolute; left: 16px; font: 600 10px var(--display); color: rgba(255, 236, 220, 0.7); transform: translateY(-50%); white-space: nowrap; }
.you { position: absolute; left: 6px; top: 42%; font: 800 10px var(--display); color: var(--pink); transform: translateY(-50%); }
.you::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--pink); vertical-align: middle; margin-right: 4px; }

.diver { position: absolute; right: 14%; top: 42%; width: 64px; height: 40px; transform: translateY(-50%); animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 0 12px var(--glow, rgba(255, 138, 110, 0.55))); }
@keyframes bob { 0%, 100% { margin-top: -5px; } 50% { margin-top: 5px; } }
.diver.sinking { animation: bob 0.7s ease-in-out infinite; }

/* ---------- hud: one capsule at the top ---------- */
.hud { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; z-index: 3; pointer-events: none; padding: 6px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge); backdrop-filter: blur(6px); white-space: nowrap; }
.panel { padding: 0 12px; min-width: 78px; font-family: var(--display); text-align: center; }
.panel small, .dots-wrap small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); }
.panel b { font-size: 19px; line-height: 1.1; color: var(--cyan); }
.panel b.pink { color: var(--pink); }
.dots-wrap { text-align: center; padding: 0 6px; border-left: 1px solid var(--edge); border-right: 1px solid var(--edge); }
.dots { display: flex; gap: 4px; justify-content: center; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--edge); }
.dots i.now { background: transparent; border: 2px solid var(--pink); box-shadow: 0 0 8px rgba(255, 138, 76, 0.7); }
.dots i.t-gem { background: var(--gem); } .dots i.t-deep { background: var(--deep); } .dots i.t-rare { background: var(--rare); }
.dots i.t-school { background: var(--school); } .dots i.t-clever { background: var(--clever); } .dots i.t-plankton { background: var(--plankton); } .dots i.t-none { background: var(--none); }
.dots-wrap small { margin-top: 3px; }

.menu-btn { position: absolute; top: 72px; right: 10px; z-index: 6; width: 42px; height: 42px; border-radius: 50%; background: var(--panel); border: 1px solid var(--edge); display: grid; place-content: center; gap: 4px; }
.menu-btn span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); }
.menu-btn span:nth-child(2) { width: 11px; justify-self: end; }
.menu { position: absolute; top: 120px; right: 10px; z-index: 6; display: grid; gap: 2px; background: var(--panel-solid); border: 1px solid var(--edge); border-radius: 18px; padding: 8px; min-width: 190px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); }
.menu[hidden] { display: none; }
.menu button, .menu a { text-align: left; background: none; border: 0; padding: 10px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font: 700 14px var(--display); }
.menu button:hover, .menu a:hover { background: rgba(255, 138, 76, 0.16); }
.menu hr { border: 0; border-top: 1px solid var(--edge); margin: 4px 6px; }

/* ---------- screens ---------- */
.app { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; pointer-events: none; }
.app > * { pointer-events: auto; }

.home { margin: auto; text-align: center; padding: 110px 20px 40px; max-width: 560px; }
.kicker { margin: 0 0 10px; font: 800 12px var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: #fff1c2; }
.title { margin: 0; font: 900 clamp(44px, 13vw, 76px)/0.95 var(--display); color: #fff; text-shadow: 0 4px 0 #b9403a, 0 0 36px rgba(255, 138, 110, 0.5); }
.title span { display: inline-block; color: var(--cyan); text-shadow: 0 4px 0 #0f6f61, 0 0 36px rgba(89, 240, 200, 0.4); transform: rotate(-3deg); }
.sub { margin: 10px 0 0; font: 700 14px var(--display); letter-spacing: 0.3em; color: #fff1c2; }
.tag { margin: 16px 0 24px; font: 600 15px var(--display); color: #fff4ec; }
.go { display: inline-block; font: 900 18px var(--display); letter-spacing: 0.06em; padding: 15px 34px; border-radius: 999px; border: 0; color: #2a0d12; background: linear-gradient(180deg, #ffb07a, #ff7a55); box-shadow: 0 5px 0 #b9403a, 0 10px 28px rgba(255, 122, 85, 0.45); }
.go:active { transform: translateY(3px); box-shadow: 0 2px 0 #b9403a, 0 6px 18px rgba(255, 122, 85, 0.4); }
.go.ghosty { background: var(--panel); color: var(--ink); border: 1px solid var(--edge); box-shadow: none; font-size: 14px; font-weight: 800; padding: 11px 18px; }
.go.ghosty:hover { border-color: var(--cyan); }
.row { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.small { font: 600 12px var(--display); color: #e9dcf7; letter-spacing: 0.05em; margin-top: 16px; }
a.yday { display: inline-block; margin-top: 16px; font: 800 14px var(--display); color: #fff1c2; text-decoration: none; border-bottom: 2px dotted rgba(255, 241, 194, 0.6); }
a.yday:hover { color: #fff; }
.stats { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.stats div { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 6px 14px; min-width: 74px; font-family: var(--display); }
.stats b { display: block; font-size: 18px; color: var(--cyan); }
.stats span { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; color: var(--muted); }

.prompt-card { margin: 126px 12px 0 68px; background: var(--panel); border: 1px solid var(--edge); border-left: 4px solid var(--pink); border-radius: 18px; padding: 16px 20px; backdrop-filter: blur(4px); max-width: 640px; }
.prompt-card small { font: 800 11px var(--display); letter-spacing: 0.2em; color: var(--pink); }
.prompt-card h2 { margin: 6px 0 8px; font: 800 clamp(22px, 5.4vw, 31px)/1.22 var(--display); }
.prompt-card p { margin: 0; font: 600 12px var(--display); letter-spacing: 0.06em; color: var(--muted); }

.bar { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, rgba(11, 7, 34, 0.92) 40%); }
.clock { position: relative; width: 58px; height: 58px; flex: none; }
.clock svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.clock circle { fill: var(--panel-solid); stroke: rgba(150, 240, 214, 0.18); stroke-width: 5; }
.clock circle.left { fill: none; stroke: var(--cyan); stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.clock b { position: absolute; inset: 0; display: grid; place-items: center; font: 900 18px var(--display); color: var(--cyan); }
.clock.hurry circle.left, .clock.hurry b { stroke: var(--clever); color: var(--clever); }
.bar form { flex: 1; display: flex; gap: 8px; min-width: 0; }
.bar input { flex: 1; min-width: 0; font: 700 18px var(--display); padding: 14px 18px; border-radius: 999px; background: var(--panel-solid); color: var(--ink); border: 2px solid var(--edge); outline: none; }
.bar input:focus { border-color: var(--cyan); }
.bar .dive { font: 900 16px var(--display); letter-spacing: 0.12em; padding: 0 22px; border-radius: 999px; border: 0; background: var(--cyan); color: #072b25; box-shadow: 0 4px 0 #13907a; }
.bar .dive:disabled { opacity: 0.6; }
.err { position: absolute; bottom: 86px; left: 0; right: 0; text-align: center; font: 600 13px var(--display); color: var(--clever); }
.err:not(:empty) { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); margin: 0; padding: 7px 14px; border-radius: 999px; background: var(--panel-solid); border: 1px solid rgba(255, 116, 97, 0.5); color: #ffa497; }

.verdict { margin: auto auto 28px; text-align: center; padding: 24px 24px 28px; max-width: 560px; width: calc(100% - 96px); background: rgba(24, 16, 62, 0.7); border: 1px solid var(--edge); border-radius: 26px; backdrop-filter: blur(5px); }
.verdict .label { font: 900 clamp(32px, 9vw, 52px)/1.05 var(--display); letter-spacing: 0.02em; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.verdict .said { font: 800 18px var(--display); margin-top: 12px; }
.verdict .pts { font: 800 18px var(--display); margin-top: 10px; }
.verdict .pts em { font-style: normal; color: var(--pink); }
.verdict .note { font: 500 14px/1.5 var(--display); color: #e2d6f3; margin-top: 8px; }
.verdict .fact { margin: 14px auto 0; max-width: 460px; background: rgba(247, 198, 255, 0.1); border: 1px solid rgba(247, 198, 255, 0.45); border-radius: 16px; padding: 10px 14px; font-size: 14px; color: #fbe6ff; }
.verdict .fact b { color: var(--gem); }
.verdict .go { margin-top: 24px; }

.c-gem { color: var(--gem); } .c-deep { color: var(--deep); } .c-rare { color: var(--rare); } .c-school { color: var(--school); }
.c-clever { color: var(--clever); } .c-plankton { color: var(--plankton); } .c-none { color: #c7cad6; }

.sheet { position: absolute; inset: 0; overflow-y: auto; z-index: 4; padding: 76px 12px 40px; background: linear-gradient(180deg, rgba(11, 7, 34, 0.15), rgba(11, 7, 34, 0.9) 30%); }
.sheet .inner { max-width: 640px; margin: 0 auto; }
.summary { text-align: center; padding: 30px 0 10px; }
.summary small { font: 800 12px var(--display); letter-spacing: 0.2em; color: #fff1c2; }
.summary .depth { font: 900 clamp(52px, 16vw, 86px)/1 var(--display); color: #fff; text-shadow: 0 4px 0 #b9403a; margin: 10px 0 6px; }
.summary .zone { font: 900 16px var(--display); letter-spacing: 0.14em; color: var(--cyan); text-transform: uppercase; }
.summary .score { font: 700 16px var(--display); margin-top: 8px; }
.summary .squares { font-size: 24px; letter-spacing: 3px; margin: 12px 0 0; }
.summary .beat { font: 600 13px var(--display); color: var(--muted); margin-top: 6px; }
.box { background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; margin-top: 10px; }
.box > button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.box .q { font-size: 13px; color: var(--muted); }
.box .a { font: 800 16px var(--display); overflow-wrap: anywhere; }
.box .chip { flex: none; }
.box .more { padding: 0 16px 14px; font-size: 14px; }
.box .more h4 { margin: 12px 0 4px; font: 800 12px var(--display); letter-spacing: 0.1em; }
.box .more p { margin: 0; color: #e2d6f3; }
.box .gemfact { color: #fbe6ff; }
.check { display: flex; gap: 6px; margin-top: 12px; }
.check input { flex: 1; min-width: 0; font: 600 15px var(--display); padding: 9px 14px; border-radius: 999px; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--edge); }
.check button { border: 0; border-radius: 999px; padding: 0 16px; background: var(--cyan); color: #072b25; font: 900 13px var(--display); }
.check-out { font: 600 13px var(--display); margin-top: 6px; min-height: 1.2em; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font: 800 11px var(--display); letter-spacing: 0.03em; color: #1a1030; white-space: nowrap; }
.t-gem { background: var(--gem); } .t-deep { background: var(--deep); } .t-rare { background: var(--rare); } .t-school { background: var(--school); }
.t-clever { background: var(--clever); } .t-plankton { background: var(--plankton); } .t-none { background: var(--none); color: #fff; }

.list { display: grid; gap: 6px; margin-top: 12px; }
.list button { display: flex; justify-content: space-between; background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 16px; font: 700 14px var(--display); }
.list button:hover { border-color: var(--pink); }
.list .date { color: var(--muted); font-weight: 500; margin-left: 8px; }
.modal-text { max-width: 560px; margin: 0 auto; font-size: 15px; }
.modal-text h2 { font: 900 24px var(--display); text-align: center; }
.modal-text li { margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: #fff1c2; color: #2a0d12; padding: 10px 20px; border-radius: 999px; font: 800 14px var(--display); z-index: 40; max-width: calc(100vw - 24px); text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }

a.go { text-decoration: none; }
button.stats { background: none; border: 0; padding: 0; margin-left: auto; margin-right: auto; color: inherit; }
button.stats:hover div { border-color: var(--pink); }
.bar input.miss { border-color: var(--clever); animation: miss 0.32s ease-in-out; }
@keyframes miss { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.clock.paused b { color: var(--muted); }
.clock.paused circle.left { stroke: var(--muted); }

/* ---------- modal: tour, settings, stats ---------- */
.modal-back { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 12px; background: rgba(11, 7, 34, 0.66); backdrop-filter: blur(4px); overflow-y: auto; }
.modal-back.in-dive { bottom: 88px; align-items: start; }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100svh - 24px); overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--edge); border-radius: 24px; padding: 16px 18px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); outline: none; }
.modal-back.in-dive .modal { max-height: calc(100svh - 112px); }
.modal h2 { margin: 6px 0 8px; font: 900 21px/1.25 var(--display); text-align: center; color: #fff; }
.modal h3 { margin: 18px 0 8px; font: 800 12px var(--display); letter-spacing: 0.16em; color: #fff1c2; text-transform: uppercase; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head small { font: 800 11px var(--display); letter-spacing: 0.2em; color: var(--pink); }
.modal .x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.05); font: 700 20px/1 var(--display); color: var(--ink); }
.modal .x:hover { border-color: var(--pink); }
.modal :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.modal .fine { font: 500 12px/1.5 var(--display); color: var(--muted); margin: 14px 0 0; text-align: center; }

.tut-art { margin: 12px 0 4px; border-radius: 18px; padding: 14px; background: linear-gradient(180deg, #2fbfb3, #14667f 55%, #1b265e); border: 1px solid rgba(255, 236, 220, 0.25); position: relative; overflow: hidden; }
.tut-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 16% 30%, transparent 2px, rgba(255, 255, 255, 0.5) 2.5px, transparent 3.5px), radial-gradient(circle at 80% 70%, transparent 3px, rgba(255, 255, 255, 0.4) 3.5px, transparent 4.5px); }
.tut-art.mock small { font: 800 10px var(--display); letter-spacing: 0.2em; color: #fff1c2; }
.tut-art.mock > b { display: block; margin: 4px 0 12px; font: 800 19px/1.25 var(--display); }
.mock-bar { display: flex; gap: 8px; align-items: center; }
.mock-clock { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--cyan); font: 900 14px var(--display); color: var(--cyan); background: var(--panel-solid); }
.mock-input { flex: 1; min-width: 0; padding: 9px 14px; border-radius: 999px; background: var(--panel-solid); border: 2px solid var(--cyan); font: 700 15px var(--display); white-space: nowrap; overflow: hidden; }
.mock-input i { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--pink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mock-dive { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--cyan); color: #072b25; font: 900 12px var(--display); letter-spacing: 0.1em; }
.ladder { display: grid; gap: 8px; }
.rung { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(40px, 1fr) 34px; gap: 8px; align-items: center; font: 700 13px var(--display); }
.rung .said { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung b { text-align: right; color: var(--pink); }
.meter { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .card { background: rgba(11, 7, 34, 0.55); border: 1px solid var(--edge); border-radius: 14px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.pair .card.gem { border-color: rgba(247, 198, 255, 0.6); }
.pair .card.clever { border-color: rgba(255, 116, 97, 0.6); }
.pair .card .chip { justify-self: start; white-space: normal; }
.pair .card b { font: 800 15px var(--display); }
.pair .card small { font-size: 12px; line-height: 1.45; color: #e2d6f3; }
.tut-text { margin: 0; font-size: 14.5px; line-height: 1.55; color: #f0e6fb; text-align: center; }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 12px; }
.tut-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.tut-dots i.on { width: 22px; border-radius: 5px; background: var(--pink); }
.tut-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.tut-nav .go { width: 100%; padding: 13px 10px; font-size: 15px; }
.tut-nav .go.ghosty { font-size: 13px; }

.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(150, 240, 214, 0.12); cursor: pointer; }
.opt b { display: block; font: 800 14px var(--display); }
.opt small { display: block; font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 2px; }
.opt input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--edge); position: relative; cursor: pointer; margin: 0; transition: background 0.2s; }
.opt input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #e2d6f3; transition: transform 0.2s; }
.opt input:checked { background: var(--pink); border-color: var(--pink); }
.opt input:checked::after { transform: translateX(20px); background: #2a0d12; }
.chips-preview { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0 4px; }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skin { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; background: rgba(11, 7, 34, 0.55); border: 1px solid var(--edge); text-align: center; }
.skin .skin-art { display: grid; place-items: center; height: 44px; }
.skin b { font: 800 12px var(--display); }
.skin small { font: 500 10px/1.35 var(--display); color: var(--muted); }
.skin.on { border-color: var(--pink); box-shadow: 0 0 14px rgba(255, 138, 76, 0.35); }
.skin.on small { color: var(--pink); }
.skin.locked .skin-art { filter: grayscale(1) brightness(1.5) opacity(0.4); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(11, 7, 34, 0.55); border: 1px solid var(--edge); }
.tabs button { border: 0; border-radius: 999px; padding: 9px 6px; background: none; font: 800 13px var(--display); color: var(--muted); }
.tabs button.on { background: var(--pink); color: #2a0d12; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.tiles div { background: rgba(11, 7, 34, 0.55); border: 1px solid var(--edge); border-radius: 14px; padding: 8px 6px; text-align: center; font-family: var(--display); }
.tiles b { display: block; font-size: 17px; color: var(--cyan); }
.tiles span { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 120px minmax(30px, 1fr) 30px 36px; gap: 8px; align-items: center; font: 600 12px var(--display); }
.dist-row .chip { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dist-row b { text-align: right; }
.dist-row small { color: var(--muted); text-align: right; }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 12px; background: rgba(11, 7, 34, 0.5); font: 600 12px var(--display); }
.history .h-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e2d6f3; }
.history .h-sq { font-size: 12px; letter-spacing: 1px; }
.history b { text-align: right; color: var(--cyan); }
.empty { margin: 16px 0 4px; padding: 16px; border-radius: 16px; border: 1px dashed var(--edge); font-size: 14px; color: #e2d6f3; text-align: center; }
.row.export { margin-top: 16px; }

/* ---------- colour-blind friendly tiers (Okabe–Ito) ---------- */
.cb { --gem: #f0e442; --deep: #cc79a7; --rare: #009e73; --school: #56b4e9; --clever: #e69f00; --plankton: #bbbbbb; --none: #d55e00; }
.cb .dots i { display: grid; place-items: center; font: 900 8px/1 var(--display); color: #1a1030; }
.cb .dots i.t-gem::after { content: "P"; } .cb .dots i.t-deep::after { content: "A"; } .cb .dots i.t-rare::after { content: "R"; }
.cb .dots i.t-school::after { content: "S"; } .cb .dots i.t-clever::after { content: "H"; } .cb .dots i.t-plankton::after { content: "L"; } .cb .dots i.t-none::after { content: "×"; color: #fff; }

/* ---------- reduced motion (setting or device) ---------- */
.reduce-motion .scene, .reduce-motion .ruler-track, .reduce-motion .opt input, .reduce-motion .opt input::after { transition: none; }
.reduce-motion .bubbles, .reduce-motion .diver, .reduce-motion .scene .grass, .reduce-motion .scene .buoy, .reduce-motion .scene .fish, .reduce-motion .scene .jelly, .reduce-motion .mock-input i, .reduce-motion .bar input.miss { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html:not(.full-motion) .scene, html:not(.full-motion) .ruler-track { transition: none; }
  html:not(.full-motion) .bubbles, html:not(.full-motion) .diver, html:not(.full-motion) .scene .grass, html:not(.full-motion) .scene .buoy, html:not(.full-motion) .scene .fish, html:not(.full-motion) .scene .jelly { animation: none; }
}

/* ---------- text below the game ---------- */
.content { max-width: 780px; margin: 0 auto; padding: 34px 18px 10px; color: #e2d6f3; }
.content h1 { color: #fff; font: 900 30px/1.2 var(--display); margin: 6px 0 12px; }
.content h2 { color: #fff; font: 900 25px/1.25 var(--display); margin: 36px 0 10px; }
.content h3 { color: #fff1c2; font: 800 18px var(--display); margin: 20px 0 6px; }
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 14px 16px 14px 54px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: #2a0d12; font: 900 15px var(--display); }
.tiers { width: 100%; border-collapse: collapse; font-size: 14px; }
.tiers th, .tiers td { text-align: left; padding: 9px 6px; border-bottom: 1px solid rgba(150, 240, 214, 0.15); vertical-align: top; }
.tiers th { color: var(--muted); font-weight: 700; }
details { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 12px 18px; margin: 8px 0; }
summary { cursor: pointer; font: 800 16px var(--display); color: #fff; }
details p { margin: 10px 0 0; }
.foot { max-width: 780px; margin: 0 auto; padding: 26px 18px 50px; color: var(--muted); font-size: 13px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 10px; font: 700 14px var(--display); }
.foot a { color: #e2d6f3; text-decoration: none; }
.foot a:hover { color: var(--pink); }

[data-feedback-form] { margin: 22px 0; }
[data-feedback-form] .fb-row { display: flex; gap: 14px; flex-wrap: wrap; }
[data-feedback-form] .fb-row > div { flex: 1 1 220px; }
[data-feedback-form] .fb-field { margin-bottom: 16px; }
[data-feedback-form] label { display: block; margin: 0 0 6px; font-weight: 700; font-size: 14px; }
[data-feedback-form] .fb-hint { font-weight: 400; color: var(--muted); }
[data-feedback-form] input, [data-feedback-form] textarea { width: 100%; padding: 11px 14px; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-solid); border: 1px solid var(--edge); border-radius: 14px; outline: 0; }
[data-feedback-form] input:focus, [data-feedback-form] textarea:focus { border-color: var(--cyan); }
[data-feedback-form] textarea { min-height: 150px; resize: vertical; }
[data-feedback-form] button[type="submit"] { width: 100%; padding: 13px 18px; font: 900 15px var(--display); color: #2a0d12; background: linear-gradient(180deg, #ffb07a, #ff7a55); border: 0; border-radius: 999px; cursor: pointer; }
[data-feedback-form] button:disabled { opacity: 0.6; cursor: default; }
[data-feedback-form] [data-feedback-captcha] { margin: 4px 0 16px; }
[data-feedback-form] altcha-widget { --altcha-max-width: 100%; }
[data-feedback-form][data-state="error"] [data-feedback-status] { color: var(--clever); }
[data-feedback-form][data-state="sent"] [data-feedback-status] { color: var(--rare); }

@media (max-width: 520px) {
  .hud { padding: 5px 4px; }
  .panel { min-width: 60px; padding: 0 7px; }
  .panel b { font-size: 16px; }
  .dots i { width: 11px; height: 11px; }
  .prompt-card { margin: 118px 10px 0 62px; padding: 14px 16px; }
  .verdict { width: calc(100% - 72px); margin: auto 10px 18px auto; padding: 18px 14px 20px; }
  .content h1 { font-size: 25px; }
}
@media (max-width: 400px) {
  .modal { padding: 12px 12px 14px; }
  .tut-art { padding: 11px; }
  .pair .card { padding: 8px; }
  .tut-text { font-size: 13.5px; }
  .skins { grid-template-columns: repeat(2, 1fr); }
  .dist-row { grid-template-columns: 110px minmax(20px, 1fr) 26px 32px; gap: 6px; }
  .dist-row .chip { font-size: 10.5px; padding: 2px 7px; }
  .rung { grid-template-columns: minmax(0, 1fr) auto 34px; }
  .rung .meter { display: none; }
}
