:root {
  --navy: #0b1b33;
  --sea: #12b5cb;
  --coral: #ff6b57;
  --gold: #ffc94d;
  --cream: #fff6e5;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(10, 24, 48, 0.8);
  --font: 'Fredoka', system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: #fff; background: var(--navy); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input { font-family: inherit; }
.hidden { display: none !important; }
.grow { flex: 1; }

/* ---------- backdrop ---------- */

.ocean { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #0a1733 0%, #143b6e 42%, #1c7fa6 76%, #19a7b8 100%); }
.ocean-sun { position: absolute; right: 11%; top: 12%; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, #fff1c4 0%, #ffc94d 42%, rgba(255, 201, 77, 0) 70%); }
body[data-screen='yard'] .ocean-sun { display: none; }
.ocean-wave { position: absolute; left: 0; right: 0; height: 170px; background-repeat: repeat-x; background-size: 800px 100%; animation: drift 18s linear infinite; }
.ocean-wave.w1 { bottom: 70px; opacity: 0.35; animation-duration: 30s; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 160' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q100 0 200 40 T400 40 T600 40 T800 40 V160 H0Z' fill='%237fe3ee'/%3E%3C/svg%3E"); }
.ocean-wave.w2 { bottom: 30px; opacity: 0.6; animation-duration: 22s; animation-direction: reverse; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 160' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q100 10 200 40 T400 40 T600 40 T800 40 V160 H0Z' fill='%2312b5cb'/%3E%3C/svg%3E"); }
.ocean-wave.w3 { bottom: -30px; animation-duration: 15s; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 160' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q100 5 200 40 T400 40 T600 40 T800 40 V160 H0Z' fill='%230c6f96'/%3E%3C/svg%3E"); }
@keyframes drift { to { background-position-x: -800px; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-10px) rotate(1.2deg); } }

/* ---------- shared pieces ---------- */

.screen { display: none; }
.screen.active { display: block; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.note { font-size: 14px; color: rgba(255, 255, 255, 0.72); min-height: 1.3em; }

.btn { font: 600 15px var(--font); padding: 11px 20px; border-radius: 999px; border: 0; color: #fff; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, background 0.15s; white-space: nowrap; }
.btn.primary { background: linear-gradient(180deg, #ff8a5c, #ff5a4f); box-shadow: 0 5px 0 #b8362f; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 0 #b8362f; }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #b8362f; }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.ghost, .btn.glass { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); }
.btn.ghost:hover, .btn.glass:hover { background: rgba(255, 255, 255, 0.2); }
.btn.glass { background: rgba(11, 27, 51, 0.72); }
.btn.small { font-size: 13px; padding: 7px 13px; }
.btn.wide { width: 100%; font-size: 17px; padding: 14px; }
.btn:focus-visible, input:focus-visible, .sw:focus-visible, .step:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.chip { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
.chip b { letter-spacing: 0.1em; color: var(--gold); }
.chip.warn { background: rgba(255, 107, 87, 0.3); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); padding: 12px 20px; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); opacity: 0; pointer-events: none; transition: 0.25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- landing ---------- */

#landing.active { display: flex; align-items: center; min-height: 100vh; padding: 40px clamp(20px, 6vw, 90px) 150px; gap: 30px; position: relative; overflow: hidden; }
.hero { max-width: 560px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(46px, 7.4vw, 92px); line-height: 0.95; font-weight: 700; margin: 8px 0 18px; text-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); }
.lede { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: rgba(255, 255, 255, 0.9); margin-bottom: 26px; }
.join { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.join input { flex: 1; min-width: 180px; font-size: 17px; padding: 12px 18px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); color: #fff; }
.join input::placeholder { color: rgba(255, 255, 255, 0.6); }
.join .btn { font-size: 17px; padding: 12px 24px; }
.steps { list-style: none; padding: 0; margin: 26px 0 16px; display: grid; gap: 8px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: center; font-size: 15px; color: rgba(255, 255, 255, 0.86); }
.steps li::before { content: counter(step); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.steps b { color: #fff; }
.practice { font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.practice a { color: #fff; }
.hero-ship { position: absolute; right: clamp(-40px, 3vw, 80px); bottom: 62px; width: min(52vw, 700px); height: auto; animation: bob 5s ease-in-out infinite; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.3)); }

/* ---------- shipyard ---------- */

#yard.active { padding: 16px clamp(12px, 2.4vw, 32px) 40px; max-width: 1500px; margin: 0 auto; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand { font-size: 22px; font-weight: 700; margin-right: 6px; }
.hostbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.yard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); gap: 16px; align-items: start; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; background: rgba(255, 255, 255, 0.09); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { font: 500 14px var(--font); border: 0; background: none; color: rgba(255, 255, 255, 0.85); padding: 7px 11px; border-radius: 9px; cursor: pointer; min-height: 32px; }
.seg button:hover { background: rgba(255, 255, 255, 0.12); }
.seg button.on { background: #fff; color: var(--navy); }
.sizes button { display: grid; place-items: center; width: 36px; padding: 0; }
.sizes i { width: var(--d); height: var(--d); border-radius: 50%; background: currentColor; }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; position: relative; }
.sw.on { box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--gold); }
.sw.custom { background: conic-gradient(#e63946, #ffd23f, #3bb273, #12b5cb, #8a4fff, #e63946); overflow: hidden; }
.sw.custom input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }
.sw.stamp { background: rgba(255, 255, 255, 0.1); font-size: 17px; display: grid; place-items: center; border-radius: 10px; width: 36px; height: 36px; }

.sheet { position: relative; aspect-ratio: 640 / 288; border-radius: 16px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.25);
  background:
    linear-gradient(180deg, transparent 0 86%, rgba(11, 60, 104, 0.75) 86% 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 12.5%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5.625%),
    linear-gradient(180deg, #3f7fb8, #63a8da); }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sheet-bow, .sheet-water { position: absolute; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.75); pointer-events: none; }
.sheet-bow { right: 12px; top: 10px; }
.sheet-water { left: 12px; bottom: 4px; text-transform: uppercase; font-size: 10px; }
.sheet-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(15px, 1.8vw, 22px); color: rgba(255, 255, 255, 0.8); pointer-events: none; text-align: center; padding: 20px; }
.gallery { margin-top: 14px; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, 0.78); margin-bottom: 8px; }
.hull-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hull { display: grid; gap: 2px; padding: 4px 4px 5px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #3f7fb8 0 72%, #1d4f7f 72%); color: #fff; font: 500 12px var(--font); cursor: pointer; min-width: 0; transition: transform 0.12s, border-color 0.12s; }
.hull:hover { transform: translateY(-2px); border-color: var(--gold); }
.hull canvas { width: 100%; height: auto; display: block; }
.hull span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn { font-family: var(--font); color: #fff; cursor: pointer; }
.chip-btn:hover { background: rgba(255, 255, 255, 0.2); }

.specs { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.field input { font-size: 17px; font-weight: 500; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.09); color: #fff; }
.specs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.specs-head h2 { font-size: 17px; font-weight: 600; }
.budget { font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.budget b { font-size: 20px; color: var(--gold); }
.budget.spent b { color: #7fe3a8; }

.stat-rows, .shape-rows { display: grid; gap: 9px; }
.stat-top { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; }
.stat-top b { color: var(--gold); font-weight: 600; }
.stat small, .shape small { display: block; font-size: 12px; line-height: 1.3; color: rgba(255, 255, 255, 0.6); margin-top: 3px; }
.stat-ctl { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.step { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.step:hover { background: rgba(255, 255, 255, 0.25); }
.pips { flex: 1; display: flex; gap: 4px; }
.pips i { flex: 1; height: 14px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); cursor: pointer; transition: background 0.15s; }
.pips i:hover { background: rgba(255, 255, 255, 0.3); }
.pips i.on { background: linear-gradient(180deg, #ffe08a, #ffb52e); }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #12b5cb, #7fe3ee); transition: width 0.3s; }
.shape .stat-top b { color: #7fe3ee; }

.jokes { margin-bottom: 16px; }
.jokes-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jokes-head h2 { font-size: 17px; font-weight: 600; }
.joke-list { max-height: 48vh; overflow-y: auto; margin-top: 12px; padding-right: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 16px; align-items: start; }
.joke-group { margin-bottom: 8px; min-width: 0; }
.joke-group h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 0 0 2px; }
.joke-all { font: 500 11px var(--font); letter-spacing: 0.04em; text-transform: none; color: rgba(255, 255, 255, 0.7); background: none; border: 0; padding: 2px 4px; cursor: pointer; text-decoration: underline; }
.joke-all:hover { color: #fff; }
.joke-row { display: flex; gap: 6px; align-items: stretch; margin-top: 4px; }
.joke-row .joke { margin-top: 0; flex: 1; min-width: 0; }
.joke-use { flex: none; display: grid; place-items: center; width: 32px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); cursor: pointer; }
.joke-use input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.joke-row.off .joke { opacity: 0.45; text-decoration: line-through; }
.joke { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; margin-top: 4px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: #fff; font: 400 13.5px/1.35 var(--font); cursor: pointer; }
.joke:hover { background: rgba(255, 255, 255, 0.16); border-color: var(--gold); }
.joke:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.joke span { flex: none; }
.pa.yard-pa { position: fixed; top: auto; bottom: 84px; width: min(520px, calc(100vw - 32px)); z-index: 40; }
.fleet { margin-top: 16px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 12px; }
.roster:empty::after { content: 'No one here yet.'; color: rgba(255, 255, 255, 0.6); font-size: 14px; }
.card { position: relative; display: grid; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); text-align: center; min-width: 0; }
.card.ready { border-color: rgba(18, 181, 203, 0.8); }
.card.me { border-color: var(--gold); background: rgba(255, 201, 77, 0.12); }
.card-ship { height: 58px; display: grid; place-items: center; font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.card-ship img { max-width: 100%; max-height: 58px; }
.card b, .card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card b { font-size: 14px; font-weight: 600; }
.card small { font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.kick { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.35); color: #fff; cursor: pointer; line-height: 1; }
.kick:hover { background: var(--coral); }

/* ---------- race ---------- */

#race.active { position: fixed; inset: 0; background: var(--navy); overflow: hidden; }
#raceCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.leg-banner { position: absolute; left: 22px; top: 70px; pointer-events: none; }
.leg-card { display: grid; padding: 10px 16px; border-radius: 14px; background: rgba(11, 27, 51, 0.74); border: 1px solid var(--line); animation: slideIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1); }
.leg-card span { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.leg-card b { font-size: 24px; font-weight: 700; }
.leg-card i { font-style: normal; font-size: 13px; color: rgba(255, 255, 255, 0.78); }
@keyframes slideIn { from { transform: translateX(-40px); opacity: 0; } }

.board { position: absolute; right: 16px; top: 70px; width: 252px; padding: 12px; border-radius: 16px; background: rgba(11, 27, 51, 0.74); border: 1px solid var(--line); }
.board h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.brows { position: relative; }
.brow { position: absolute; left: 0; right: 0; top: 0; height: 26px; display: flex; align-items: center; gap: 7px; padding: 0 6px; border-radius: 9px; font-size: 14px; transition: transform 0.45s cubic-bezier(0.3, 1.2, 0.4, 1), opacity 0.3s; }
.brow.me { background: rgba(255, 201, 77, 0.25); }
.brow .pos { width: 18px; text-align: right; font-weight: 700; color: rgba(255, 255, 255, 0.75); }
.brow .thumb { width: 40px; height: 22px; display: grid; place-items: center; flex: none; }
.brow .thumb img { max-width: 40px; max-height: 22px; }
.brow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.brow .st { color: var(--gold); font-size: 13px; font-variant-numeric: tabular-nums; }

.ticker { position: absolute; left: 22px; bottom: 18px; display: grid; gap: 6px; max-width: min(520px, 48vw); pointer-events: none; }
.tick { justify-self: start; padding: 7px 14px; border-radius: 999px; background: rgba(11, 27, 51, 0.78); font-size: 15px; font-weight: 500; animation: slideIn 0.4s ease-out; }
.tick:nth-child(2) { opacity: 0.7; }
.tick:nth-child(3) { opacity: 0.4; }

.pa { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(480px, calc(100vw - 580px)); min-width: 280px; pointer-events: none; }
.pa-card { display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.95); color: var(--navy); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); animation: paIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.pa-face { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 26px; }
.pa-card b { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #c2452f; }
.pa-card p { font-size: 15px; font-weight: 500; line-height: 1.3; }
@keyframes paIn { from { transform: translateY(-24px) scale(0.9); opacity: 0; } }
.my-card { position: absolute; right: 16px; bottom: 18px; display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: 999px; background: rgba(11, 27, 51, 0.8); border: 1px solid rgba(255, 201, 77, 0.6); font-size: 15px; font-variant-numeric: tabular-nums; }
.my-card b { color: var(--gold); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-actions { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.countdown span { font-weight: 700; text-shadow: 0 8px 0 rgba(0, 0, 0, 0.25), 0 0 60px rgba(0, 0, 0, 0.4); animation: pop 0.9s ease-out both; }
.countdown .num { font-size: clamp(120px, 26vw, 300px); color: var(--gold); }
.countdown .word { font-size: clamp(44px, 9vw, 110px); }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 30% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 0.92; } }

.results { position: absolute; inset: 0; overflow-y: auto; background: rgba(8, 18, 38, 0.84); animation: fadeIn 0.6s; }
@keyframes fadeIn { from { opacity: 0; } }
#fxCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.results-inner { position: relative; max-width: 980px; margin: 0 auto; padding: 34px 18px 70px; display: grid; gap: 22px; }
.res-head { text-align: center; }
.res-head h2 { font-size: clamp(30px, 5vw, 56px); font-weight: 700; line-height: 1.05; margin: 6px 0; }
.res-head p:last-child { font-size: 17px; color: rgba(255, 255, 255, 0.85); }
.res-head.won h2 { background: linear-gradient(90deg, #ffc94d, #fff3c4, #ffc94d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.2s linear infinite, pop 0.9s ease-out; }
@keyframes shine { to { background-position: -200% 0; } }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.pod { flex: 1; max-width: 250px; min-width: 0; text-align: center; padding: 14px 12px 16px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); animation: rise 0.7s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.pod.p1 { max-width: 330px; padding-bottom: 24px; border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(255, 201, 77, 0.28), rgba(10, 24, 48, 0.7)); box-shadow: 0 0 60px rgba(255, 201, 77, 0.3); animation-delay: 0.35s; }
.pod.p2 { animation-delay: 0.15s; }
.pod.mine { outline: 3px solid var(--coral); outline-offset: 3px; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.pod-medal { font-size: 34px; line-height: 1; }
.p1 .pod-medal { font-size: 52px; }
.pod-ship { height: 86px; display: grid; place-items: center; margin: 8px 0; }
.p1 .pod-ship { height: 132px; }
.p1 .pod-ship img { max-height: 132px; }
.pod-ship img { max-width: 100%; max-height: 86px; animation: bob 3.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }
.pod-name { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.p1 .pod-name { font-size: 25px; }
.pod-capt { font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.pod-time { font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 4px; color: var(--gold); }
.pod-ribbon { display: inline-block; margin-top: 10px; padding: 5px 14px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 13px; font-weight: 700; }

.award { display: flex; align-items: center; gap: 18px; padding: 16px 20px; border-radius: 20px; background: linear-gradient(90deg, rgba(18, 181, 203, 0.3), rgba(10, 24, 48, 0.7)); border: 1px solid rgba(127, 227, 238, 0.6); }
.award.mine { outline: 3px solid var(--coral); outline-offset: 3px; }
.award-ship { width: 170px; height: 84px; flex: none; display: grid; place-items: center; }
.award-ship img { max-width: 100%; max-height: 66px; animation: bob 3.8s ease-in-out infinite; }
.award h3 { font-size: 23px; font-weight: 700; margin: 3px 0; }
.award h3 small { font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 0.75); margin-left: 6px; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.awards .award-ship { width: 120px; height: 66px; }
.award.rev { background: linear-gradient(90deg, rgba(63, 174, 90, 0.34), rgba(10, 24, 48, 0.7)); border-color: rgba(140, 230, 160, 0.65); }
.cash { color: #8ee6a0; font-variant-numeric: tabular-nums; }
.award .cash { font-size: 24px; }
.secret { text-align: center; padding: 16px 20px; border-radius: 20px; border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(255, 201, 77, 0.3), rgba(63, 174, 90, 0.28)); box-shadow: 0 0 50px rgba(255, 201, 77, 0.35); animation: pop 0.9s ease-out both; }
.secret h3 { font-size: clamp(24px, 4vw, 38px); font-weight: 700; margin: 4px 0; }
.secret p:last-child { font-size: 16px; }
.secret b { color: #8ee6a0; }
.secret.bust { border-color: #ff8a7a; background: linear-gradient(180deg, rgba(255, 107, 87, 0.3), rgba(40, 20, 60, 0.55)); box-shadow: 0 0 50px rgba(255, 107, 87, 0.3); }
.secret.bust b, .cash.loss { color: #ff8a7a; }
.res-head.lost h2 { color: #ff8a7a; animation: wobble 0.5s ease-in-out 4; }
@keyframes wobble { 25% { transform: translateX(-9px) rotate(-1deg); } 75% { transform: translateX(9px) rotate(1deg); } }
.stars { font-size: 18px; letter-spacing: 2px; background: linear-gradient(90deg, var(--gold) var(--v), rgba(255, 255, 255, 0.25) var(--v)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.standings { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 18px; overflow: hidden; font-size: 15px; }
.standings th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); padding: 12px 10px 8px; }
.standings td { padding: 7px 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); vertical-align: middle; }
.standings .r { text-align: right; font-variant-numeric: tabular-nums; }
.standings td.t { width: 78px; text-align: center; }
.standings td.t img { max-width: 64px; max-height: 28px; vertical-align: middle; }
.standings td small { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.standings tr.mine td { background: rgba(255, 201, 77, 0.2); }
.standings .sv { font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.8); }
.res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- small screens ---------- */

@media (max-width: 920px) {
  .yard-grid { grid-template-columns: 1fr; }
  .hero-ship { opacity: 0.5; width: 80vw; }
}
@media (max-width: 760px) {
  .board { width: 172px; top: 52px; padding: 8px; }
  .brow .thumb { display: none; }
  .leg-banner { top: 52px; left: 12px; }
  .pa { top: auto; bottom: 150px; width: calc(100vw - 24px); }
  .hull-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .leg-card b { font-size: 18px; }
  .leg-card i { display: none; }
  .ticker { left: 12px; bottom: 62px; max-width: 78vw; }
  .tick { font-size: 13px; }
  .race-actions { left: 12px; transform: none; }
  .podium { gap: 8px; }
  .pod { padding: 10px 6px 12px; }
  .pod-ship { height: 56px; }
  .pod-ship img { max-height: 56px; }
  .p1 .pod-ship { height: 80px; }
  .p1 .pod-ship img { max-height: 80px; }
  .pod-name, .p1 .pod-name { font-size: 15px; }
  .award { flex-direction: column; text-align: center; }
  .awards { grid-template-columns: 1fr; }
  .standings td.t { display: none; }
  .standings th:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ocean-wave, .hero-ship, .pod-ship img, .award-ship img { animation: none; }
}
