/* Let Down Your Nets! - the web game's look: a paper-craft lake that goes from night to sunrise. */

/* colours that can glide from one time of day to the next */
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #7cc8f2; }
@property --sky-bot { syntax: "<color>"; inherits: true; initial-value: #d8f1ff; }
@property --sea-top { syntax: "<color>"; inherits: true; initial-value: #2aa5cf; }
@property --sea-bot { syntax: "<color>"; inherits: true; initial-value: #0f6aa0; }
@property --hill1 { syntax: "<color>"; inherits: true; initial-value: #8bbd6a; }
@property --hill2 { syntax: "<color>"; inherits: true; initial-value: #5fa257; }
@property --hill3 { syntax: "<color>"; inherits: true; initial-value: #d9c08a; }
@property --sand { syntax: "<color>"; inherits: true; initial-value: #f1d79b; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: rgba(255, 220, 140, 0); }

:root {
  --ink: #2b2140;
  --wood: #b5763c;
  --wood-dark: #6e4019;
  --gold: #ffc93c;
  --cw: 150px;
  --font: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 600;
  color: var(--ink);
  background: #0f6aa0;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  transition: --sky-top 2.5s, --sky-bot 2.5s, --sea-top 2.5s, --sea-bot 2.5s, --hill1 2.5s, --hill2 2.5s, --hill3 2.5s, --sand 2.5s, --glow 2.5s;
}
body.scroll { overflow-y: auto; }

/* ---------- times of day: 0 deep night ... 3 dawn, 4 sunrise (haul in), 5 morning ---------- */
body[data-time="0"] { --tint: brightness(0.4) saturate(0.5) sepia(0); --sky-top: #060b2c; --sky-bot: #1b2766; --sea-top: #12306a; --sea-bot: #06173c; --hill1: #1c2a5c; --hill2: #142250; --hill3: #3a3a5e; --sand: #5c5878; --glow: rgba(255, 220, 140, 0); }
body[data-time="1"] { --tint: brightness(0.5) saturate(0.6) sepia(0); --sky-top: #0d1442; --sky-bot: #33378a; --sea-top: #173a7a; --sea-bot: #091d48; --hill1: #262f6a; --hill2: #1b285c; --hill3: #4a4668; --sand: #6d6582; --glow: rgba(255, 220, 140, 0); }
body[data-time="2"] { --tint: brightness(0.66) saturate(0.75) sepia(0.1); --sky-top: #1e2470; --sky-bot: #a35d9e; --sea-top: #24508f; --sea-bot: #0d2758; --hill1: #48407a; --hill2: #2f3468; --hill3: #7a5e78; --sand: #9a7f8e; --glow: rgba(255, 170, 160, 0.15); }
body[data-time="3"] { --tint: brightness(0.86) saturate(0.9) sepia(0.2); --sky-top: #3c58b0; --sky-bot: #ffae7a; --sea-top: #2f74b0; --sea-bot: #123b74; --hill1: #7a6a8e; --hill2: #4f5a7e; --hill3: #c9a07e; --sand: #dbb48c; --glow: rgba(255, 190, 120, 0.3); }
body[data-time="4"] { --tint: brightness(1) saturate(1.05) sepia(0.12); --sky-top: #5ea4e6; --sky-bot: #ffd68c; --sea-top: #2b93c8; --sea-bot: #0f5a92; --hill1: #93a874; --hill2: #6b9460; --hill3: #e3c48e; --sand: #f0cf95; --glow: rgba(255, 210, 120, 0.35); }
body[data-time="5"] { --tint: brightness(1) saturate(1) sepia(0); --sky-top: #6fc0f0; --sky-bot: #dff3ff; --sea-top: #2aa5cf; --sea-bot: #0f6aa0; --hill1: #8bbd6a; --hill2: #5fa257; --hill3: #d9c08a; --sand: #f1d79b; --glow: rgba(255, 220, 140, 0); }

/* ---------- scene ---------- */
#scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-top), var(--sky-bot) 24%, var(--sky-bot)); }
.stars {
  position: absolute; left: 0; right: 0; top: 0; height: 26vh;
  background-image:
    radial-gradient(2px 2px at 8% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 17% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 29% 44%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 38% 18%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 47% 36%, #fffbe0 50%, transparent 51%), radial-gradient(1.5px 1.5px at 56% 10%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 64% 40%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 72% 22%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 34%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 95% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 23% 58%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 81% 54%, #fff 50%, transparent 51%);
  opacity: 0; transition: opacity 2.5s;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { to { filter: brightness(0.6); } }
body[data-time="0"] .stars { opacity: 1; }
body[data-time="1"] .stars { opacity: 0.75; }
body[data-time="2"] .stars { opacity: 0.3; }
/* painted paper layers: each one is tinted for the time of day */
.sky-paper, .hills, .beach, .clouds i, .moon, .sun { filter: var(--tint); transition: filter 2.5s, opacity 2.5s, transform 2.5s, top 2.8s cubic-bezier(.3, .1, .3, 1); }
.sky-paper {
  position: absolute; inset: 0 0 auto 0; height: 34vh;
  background: url(../assets/web/scene/sky.jpg) center top / cover no-repeat;
  mix-blend-mode: multiply; opacity: 0.85;
}
.moon {
  position: absolute; right: 7vw; top: 1vh; width: 15vh; aspect-ratio: 426 / 441;
  background: url(../assets/web/scene/moon.webp) center / contain no-repeat;
  opacity: 0; filter: drop-shadow(0 0 18px rgba(255, 248, 210, 0.45));
}
body[data-time="0"] .moon, body[data-time="1"] .moon { opacity: 1; }
body[data-time="2"] .moon { opacity: 0.45; transform: translateY(5vh); }
.sun {
  position: absolute; left: 12vw; top: 24vh; width: 15vh; aspect-ratio: 1;
  background: url(../assets/web/scene/sun.webp) center / contain no-repeat;
  opacity: 0;
}
.sun .rays {
  position: absolute; inset: -45%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--glow), transparent 62%);
}
body[data-time="3"] .sun { top: 12vh; opacity: 1; }
body[data-time="4"] .sun { top: 2vh; opacity: 1; }
body[data-time="5"] .sun { top: 1.5vh; opacity: 1; }
body[data-time="3"] .sun, body[data-time="4"] .sun { animation: sunbob 6s ease-in-out infinite; }
@keyframes sunbob { 50% { rotate: 6deg; } }
.clouds i {
  position: absolute; display: block; aspect-ratio: 436 / 272;
  background: url(../assets/web/scene/cloud_1.webp) center / contain no-repeat;
  animation: cloud linear infinite;
}
.clouds .c1 { top: 2vh; width: 12vh; animation-duration: 140s; animation-delay: -30s; }
.clouds .c2 { top: 9vh; width: 9vh; animation-duration: 190s; animation-delay: -120s; background-image: url(../assets/web/scene/cloud_2.webp); }
.clouds .c3 { top: 4vh; width: 10vh; animation-duration: 160s; animation-delay: -80s; background-image: url(../assets/web/scene/cloud_3.webp); }
@keyframes cloud { from { left: -16vh; } to { left: 100%; } }
body[data-time="0"] .clouds i, body[data-time="1"] .clouds i { opacity: 0.35; }
.water {
  position: absolute; left: 0; right: 0; top: 21vh; bottom: 0;
  background: linear-gradient(var(--sea-top), var(--sea-bot));
}
.water::after {        /* the sunrise path of light */
  content: ""; position: absolute; left: 4vw; width: 30vw; top: 0; height: 70%;
  background: radial-gradient(ellipse at 50% 0%, var(--glow), transparent 70%);
}
.waves {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60'%3E%3Cpath d='M0 30 q20 -14 40 0 t40 0 t40 0 t40 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 160px 60px;
  opacity: 0.12;
  animation: drift 14s linear infinite;
}
.waves.w2 { background-position: 80px 30px; opacity: 0.08; animation-duration: 22s; animation-direction: reverse; }
@keyframes drift { to { background-position-x: 160px; } }
.waves.w2 { animation-name: drift2; }
@keyframes drift2 { from { background-position: 80px 30px; } to { background-position: -80px 30px; } }
/* hills sit on the far shore, their bottom edge just under the water line */
.hills {
  position: absolute; left: 0; right: 0; top: calc(22vh - 14.2vw); height: 14.2vw; max-height: 26vh;
  background: url(../assets/web/scene/hills.webp) center bottom / 100% auto no-repeat;
}
@media (min-aspect-ratio: 16/9) { .hills { background-size: cover; } }
.beach {
  position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: url(../assets/web/scene/beach.webp) center top / cover no-repeat;
  filter: var(--tint) drop-shadow(0 -3px 6px rgba(0, 0, 0, 0.2));
}

/* ---------- buttons: chunky and friendly ---------- */
button { font: inherit; cursor: pointer; color: inherit; }
.btn {
  border: 3px solid #c47a0c; border-radius: 999px;
  padding: 10px 22px;
  background: linear-gradient(#ffe07a, #ffb82e);
  color: #5a2e00; font-size: 19px; font-weight: 700;
  box-shadow: 0 5px 0 #b06a08, 0 8px 12px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.1s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b06a08, inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn.big { font-size: 24px; padding: 12px 34px; }
.btn.blue { background: linear-gradient(#bfe9ff, #7cc8f2); border-color: #2c7fb8; color: #10395a; box-shadow: 0 5px 0 #2a6f9f, 0 8px 12px rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn.on { background: linear-gradient(#ffe07a, #ffb82e); border-color: #c47a0c; color: #5a2e00; box-shadow: 0 5px 0 #b06a08, inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.round {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #fff; background: rgba(255, 255, 255, 0.25);
  color: #fff; font-size: 28px; font-weight: 700; line-height: 1;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.round:active { transform: translateY(3px); box-shadow: none; }

/* ---------- header: logo + hanging wooden sign ---------- */
header { display: flex; align-items: flex-start; gap: 14px; padding: 8px 16px 0; height: var(--header-h, 118px); position: relative; z-index: 5; }
header .logo { height: 100px; width: auto; flex: none; cursor: pointer; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); animation: bob 4s ease-in-out infinite; }
.corner { display: flex; gap: 10px; flex: none; margin-top: 8px; }
.sign {
  position: relative; margin: 12px auto 0;
  display: flex; align-items: center; gap: 14px;
  min-height: 84px; padding: 8px 20px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(90, 50, 15, 0.13) 9px 11px, rgba(0, 0, 0, 0) 11px 23px),
    linear-gradient(#d39257, #a9662d);
  border: 4px solid var(--wood-dark);
  box-shadow: inset 0 3px 0 rgba(255, 230, 190, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 7px 0 #4d2a0c, 0 12px 18px rgba(0, 0, 0, 0.3);
  color: #fff8e8; text-shadow: 0 2px 0 rgba(70, 35, 5, 0.8);
  animation: sway 6s ease-in-out infinite;
  transform-origin: 50% -30px;
}
.sign:empty { visibility: hidden; }
.sign::before, .sign::after {          /* ropes */
  content: ""; position: absolute; top: -22px; width: 6px; height: 24px;
  background: repeating-linear-gradient(45deg, #e8d3a2 0 4px, #b99a5e 4px 8px);
  border-radius: 3px;
}
.sign::before { left: 30px; } .sign::after { right: 30px; }
@keyframes sway { 0%, 100% { rotate: -0.6deg; } 50% { rotate: 0.6deg; } }
.sign.pop { animation: signpop 0.5s cubic-bezier(.3, 1.6, .5, 1), sway 6s ease-in-out 0.5s infinite; }
@keyframes signpop { from { transform: translateY(-30px) scale(0.9); } }
.sign-boat { height: 62px; width: auto; flex: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.4)); animation: bob 2.4s ease-in-out infinite; }
.sign-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.sign-text b { font-size: 30px; font-weight: 700; }
.sign-text span { font-size: 16px; opacity: 0.95; font-weight: 500; }
.sign .who { color: var(--pcl, #fff); }
.picker { display: flex; gap: 10px; margin-left: 8px; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 92px; padding: 6px 4px 4px;
  border-radius: 16px; border: 3px solid rgba(255, 255, 255, 0.35);
  background: rgba(60, 30, 5, 0.25);
  color: #fff8e8; font-size: 14px; font-weight: 700; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}
.pick .net { width: 50px; font-size: 9px; }
.pick .net .boat { display: none; }
.pick .net .x2 { font-size: 13px; }
.pick.on { background: #fff3cf; color: var(--ink); text-shadow: none; border-color: var(--gold); transform: scale(1.08); box-shadow: 0 0 0 4px rgba(255, 201, 60, 0.5); }
.pick:disabled { opacity: 0.35; cursor: default; }
.sign .btn { text-shadow: none; }
.sign .actions { display: flex; gap: 10px; margin-left: 8px; }

/* ---------- lake ---------- */
main { display: flex; justify-content: center; padding: 6px 16px 0; }
#lake { display: flex; flex-direction: column; gap: calc(var(--cw) * 0.14); }
.water-row { display: flex; align-items: center; gap: 10px; }
.water-tag {
  writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 12px 6px; border-radius: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: 0.06em; color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}
.water-row.deep .water-tag { background: #0b3f78; }
.water-row.shore .water-tag { background: #24a9c9; }
.rows { display: grid; grid-template-columns: repeat(5, var(--cw)); gap: calc(var(--cw) * 0.09) calc(var(--cw) * 0.08); }

/* cards float on the water */
.card {
  width: var(--cw); font-size: calc(var(--cw) * 0.07);
  rotate: var(--tilt, 0deg);
  animation: float 4.5s ease-in-out var(--delay, 0s) infinite;
  transition: scale 0.2s;
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(var(--cw) * -0.03); } }
.card::before {          /* ripple under each card */
  content: ""; position: absolute; left: -7%; right: -7%; bottom: -11%; height: 34%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(ellipse, rgba(0, 20, 50, 0.3), transparent 70%);
  z-index: -1;
}
.card .face { border-width: calc(var(--cw) * 0.025); box-shadow: 0 calc(var(--cw) * 0.03) 0 rgba(0, 0, 0, 0.18), inset 0 0 0 2px var(--keyline); }
.card.shore .back::after {  /* sunlight shimmer on shallow water */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  background-size: 300% 100%;
  animation: shimmer 5s ease-in-out var(--delay, 0s) infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* sailing: the cards this boat can reach glow; the rest go a little dark */
#lake.sailing .card:not(.reach) .face { filter: brightness(0.72) saturate(0.75); transition: filter 0.3s; }
.card.reach { cursor: pointer; z-index: 3; }
.card.reach .face.back { box-shadow: 0 0 0 4px var(--gold), 0 0 20px 6px rgba(255, 201, 60, 0.65); animation: glow 1.4s ease-in-out infinite; }
.card.reach:hover { scale: 1.07; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px #fff3b0, 0 0 30px 10px rgba(255, 201, 60, 0.85); } }
/* a crew's boat sitting on the card where it last dropped a net */
.lake-boat:not(.flying) {
  position: absolute; left: 1%; bottom: 2%; width: 46%; z-index: 4; pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45)); animation: bob 2.6s ease-in-out infinite;
}
#fx .lake-boat.flying { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4)); }
.crew.sailing .crew-boat { opacity: 0.25; filter: grayscale(0.6); }
/* the coin: net side = 1, fish side = 2 */
.coin {
  position: relative; flex: none; width: 76px; height: 76px; margin-left: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; animation: coinwobble 2.2s ease-in-out infinite;
}
.coin .side {
  position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f5c842 45%, #c98d12);
  border: 4px solid #a8700c; box-shadow: inset 0 0 0 3px rgba(255, 240, 180, 0.7), 0 4px 0 #6b4606;
  display: flex; align-items: center; justify-content: center;
}
.coin .side.two { transform: rotateY(180deg); }
.coin .side img { width: 70%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.coin .side.one img { width: 62%; border-radius: 50%; }
.coin .side b, .coin-result b {
  position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink); font-size: 18px; text-shadow: none; border: 3px solid #a8700c;
}
@keyframes coinwobble { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; scale: 1.05; } }
.coin:hover { scale: 1.1; }
.coin.hint { animation: coinhint 0.6s ease-in-out 2; }
@keyframes coinhint { 50% { scale: 1.3; } }
.coin-result {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f5c842 45%, #c98d12); border: 4px solid #a8700c;
  display: flex; align-items: center; justify-content: center; animation: bob 2.4s ease-in-out infinite;
}
.coin-result img { width: 66%; }
.card .spot { position: absolute; left: 50%; top: 50%; width: 40%; transform: translate(-50%, -50%); transition: all 0.6s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; }
.card.revealed .spot { left: 87%; top: 80%; width: 25%; }
.card.next { animation: wiggle 1.1s ease-in-out infinite; cursor: pointer; z-index: 3; }
.card.next .face { box-shadow: 0 0 0 5px var(--gold), 0 0 26px 8px rgba(255, 201, 60, 0.75); }
@keyframes wiggle { 0%, 100% { scale: 1.04; rotate: -1.5deg; } 50% { scale: 1.1; rotate: 1.5deg; } }
.card.missed { opacity: 0.6; filter: saturate(0.55); }
.card.revealed .fish { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(0.2); }
.card.revealed .fish.pop, .card.missed .fish { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(1); transition: all 0.35s cubic-bezier(.3, 1.8, .5, 1); }
.card .fish.pop { animation: flop 0.9s ease-in-out 0.35s 2; }
@keyframes flop { 50% { rotate: 8deg; } }
.card .tally {
  position: absolute; left: 50%; top: 16%;
  transform: translate(-50%, -50%) scale(0);
  min-width: 1.9em; text-align: center;
  background: #fff; color: var(--ink);
  border: 3px solid var(--keyline);
  border-radius: 999px; padding: 0.1em 0.6em;
  font-size: calc(var(--cw) * 0.15); font-weight: 700; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(.3, 1.8, .5, 1);
  z-index: 4; pointer-events: none;
}
.card .tally.show { transform: translate(-50%, -50%) scale(1); }
.card .tally.double { background: linear-gradient(#fff1a8, #ffc93c); border-color: #c47a0c; }
.card .tally.zero { background: #e9eef3; color: #6a7684; border-color: #9aa8b5; font-size: calc(var(--cw) * 0.11); }
.shake { animation: shake 0.35s !important; }
@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.card.big-catch .face.front { box-shadow: 0 0 0 4px #ffc93c, 0 0 30px 10px rgba(255, 201, 60, 0.7); }

/* ---------- the beach: each crew's boat ---------- */
#dock {
  position: fixed; left: 0; right: 0; bottom: 6px; z-index: 4;
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 4vw, 60px);
  padding: 0 12px;
  pointer-events: none;
}
.crew { position: relative; display: flex; flex-direction: column; align-items: center; width: 150px; transition: transform 0.5s cubic-bezier(.3, 1.4, .5, 1); }
.crew-boat { width: 96px; height: auto; filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.35)); animation: bob 3s ease-in-out infinite; }
.crew:nth-child(2) .crew-boat { animation-delay: -0.8s; } .crew:nth-child(3) .crew-boat { animation-delay: -1.6s; } .crew:nth-child(4) .crew-boat { animation-delay: -2.3s; }
.crew-tag {
  margin-top: -10px;
  padding: 3px 14px; border-radius: 999px;
  background: #fff; border: 3px solid var(--pc);
  font-size: 16px; font-weight: 700; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.crew-nets { display: flex; gap: 4px; margin-top: 5px; min-height: 26px; align-items: center; }
.crew-nets .net { width: 24px; font-size: 4px; border-width: 4px; }
.crew-nets .net .boat { display: none; }
.crew-nets .net .x2 { font-size: 9px; right: -30%; top: -30%; }
.crew-score {
  position: absolute; top: -6px; right: 6px;
  min-width: 46px; height: 46px; padding: 0 8px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#fff6c8, #ffc93c); border: 3px solid #c47a0c; color: #5a2e00;
  font-size: 24px; font-weight: 700;
  box-shadow: 0 3px 0 #b06a08;
}
.crew-score.bump { animation: bump 0.45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.45); } }
.crew.active { transform: translateY(-14px) scale(1.12); }
.crew.active .crew-boat { animation: bob 1.4s ease-in-out infinite; filter: drop-shadow(0 0 10px #fff) drop-shadow(0 5px 3px rgba(0, 0, 0, 0.35)); }
.crew.active::before {
  content: "▼"; position: absolute; top: -26px; color: var(--gold); font-size: 26px;
  text-shadow: 0 2px 0 #b06a08; animation: bounce 0.8s ease-in-out infinite;
}
@keyframes bounce { 50% { transform: translateY(6px); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-2deg); } }

.lake-no { position: fixed; right: 12px; bottom: 6px; font-size: 12px; color: rgba(60, 40, 10, 0.55); z-index: 4; }

/* ---------- effects layer ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
#fx .flying { position: absolute; left: 0; top: 0; }
.ring { position: absolute; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 50%; animation: ring 0.8s ease-out forwards; }
@keyframes ring { from { transform: translate(-50%, -50%) scale(0.2); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.drop { position: absolute; width: 10px; height: 13px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #bfeaff; box-shadow: inset -2px -2px 0 rgba(30, 120, 190, 0.4); }
.spark { position: absolute; font-size: 22px; color: #ffd54a; text-shadow: 0 0 8px #fff3b0; }
.plus { position: absolute; padding: 2px 12px; border-radius: 999px; background: #3cb46e; color: #fff; font-size: 24px; font-weight: 700; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.confetti { position: absolute; top: -60px; width: 56px; }

/* ---------- overlays: torn-paper sheets ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  display: none; align-items: center; justify-content: center;
  background: rgba(10, 25, 60, 0.45);
  padding: 16px; overflow-y: auto;
}
.overlay.show { display: flex; }
#menu { background: rgba(10, 40, 80, 0.12); }
.paper { position: relative; isolation: isolate; }
.paper::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 20% 15%, #fffaf0, #fbefd4 55%, #f3e1b8);
  border-radius: 18px;
  filter: url(#rough) drop-shadow(0 14px 20px rgba(0, 0, 0, 0.35));
}
.sheet {
  padding: 22px 30px 26px;
  width: min(680px, 100%);
  margin: auto;
  animation: pop 0.4s cubic-bezier(.3, 1.5, .5, 1);
  text-align: center;
}
@keyframes pop { from { transform: scale(0.75) rotate(-2deg); opacity: 0; } }
.sheet h2 { margin: 4px 0 12px; font-size: 32px; font-weight: 700; color: #1d4f7c; }
.sheet h3 { margin: 12px 0 8px; font-size: 19px; color: #1d4f7c; font-weight: 600; }
.sheet p { font-size: 18px; line-height: 1.45; font-weight: 500; text-align: left; }
.sheet p.center { text-align: center; }
.sheet .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.big-logo { width: min(250px, 50vw); margin-top: -70px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35)); animation: bob 4s ease-in-out infinite; }
#menu .sheet { margin-top: 70px; }
#count { display: flex; gap: 14px; justify-content: center; }
#count .btn { width: 66px; height: 66px; padding: 0; font-size: 30px; border-radius: 50%; }
#setup-crews { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; }
.setup-crew {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 132px; padding: 8px 8px 10px; border-radius: 20px;
  background: linear-gradient(#bfe9ff, #7cc8f2); border: 3px solid var(--pc);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}
.boat-btn { padding: 0; border: 0; background: none; }
.boat-btn img { width: 90px; display: block; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.3)); }
.boat-btn:active img { transform: scale(0.9); }
.setup-crew input {
  width: 100%; text-align: center;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  border: 0; border-radius: 999px; padding: 5px 8px; background: #fff; outline: none;
}
.setup-crew input:focus { box-shadow: 0 0 0 3px var(--gold); }
.setup-crew.cpu input { background: rgba(255, 255, 255, 0.6); font-size: 14px; pointer-events: none; }
.solo-note { margin: 4px 0 0; text-align: center; font-size: 16px; font-weight: 600; }
.coin.cpu { cursor: default; opacity: 1; }
.coin.cpu:hover { scale: none; }
.picker.cpu { pointer-events: none; }
.options { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 16px; }
.options label { display: flex; align-items: center; gap: 6px; cursor: pointer; background: rgba(255, 255, 255, 0.7); padding: 6px 12px; border-radius: 999px; }
.options input { width: 20px; height: 20px; accent-color: #2c7fb8; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.step { background: rgba(255, 255, 255, 0.75); border-radius: 18px; padding: 12px; font-size: 16px; line-height: 1.3; font-weight: 500; border: 3px dashed rgba(29, 79, 124, 0.25); }
.step .pics { display: flex; gap: 8px; justify-content: center; align-items: center; height: 80px; margin-bottom: 8px; }
.step .card { width: 96px; font-size: 6px; animation: none; }
.step .card::before { display: none; }
.step .net { width: 48px; font-size: 9px; }
.step .net .boat { display: none; }
.step .net .x2 { font-size: 12px; }
.step b { color: #1d6fa5; font-weight: 700; }
.step .arrow { font-size: 28px; color: #c47a0c; }

.winner-boat { width: 150px; animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.3)); }
.results { display: flex; flex-direction: column; gap: 10px; margin: 10px auto; max-width: 400px; }
.result { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 4px 18px 4px 6px; border: 4px solid var(--pc); font-size: 20px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12); }
.result img { width: 58px; }
.result span { flex: 1; text-align: left; }
.result b { font-size: 30px; }
.result.win { background: linear-gradient(#fff8d8, #ffe69a); }
.result.win span::after { content: " 🏆"; }
.verse { background: #fff; border-left: 8px solid var(--gold); border-radius: 14px; padding: 12px 16px; font-size: 20px; text-align: left; }
.verse cite { display: block; font-size: 14px; opacity: 0.7; margin-top: 4px; font-style: normal; font-weight: 500; }
.small-print { font-size: 13px !important; opacity: 0.7; }

/* ---------- splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh;
  background: rgba(10, 40, 80, 0.1);
  cursor: pointer; transition: opacity 0.4s;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-bg { position: absolute; inset: 0; z-index: -1; background: url(../assets/web/scene/splash.jpg) center / cover no-repeat; animation: splashzoom 30s ease-in-out infinite alternate; }
@keyframes splashzoom { to { transform: scale(1.06); } }
.story-pic { display: block; width: 100%; max-width: 520px; margin: 4px auto 14px; border-radius: 14px; border: 5px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); rotate: -1deg; }
.splash img { width: min(460px, 78vw, 58vh); filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.4)); animation: bob 3s ease-in-out infinite; }

/* ---------- smaller screens ---------- */
@media (max-width: 700px) {
  header { gap: 8px; padding: 6px 8px 0; flex-wrap: wrap; height: auto; }
  header .logo { height: 56px; }
  .sign { order: 3; width: 100%; margin: 14px 0 0; flex-wrap: wrap; gap: 8px; padding: 8px 12px; min-height: 0; }
  .sign-boat { height: 40px; }
  .sign-text b { font-size: 21px; }
  .sign-text span { font-size: 13px; }
  .picker, .sign .actions { margin-left: 0; width: 100%; justify-content: center; }
  .corner { margin-left: auto; }
  .round { width: 44px; height: 44px; font-size: 22px; }
  main { padding: 10px 8px 0; }
  .water-tag { font-size: 11px; padding: 8px 3px; }
  .water-row { gap: 5px; }
  #dock { position: static; flex-wrap: wrap; gap: 6px 10px; margin-top: 18px; padding-bottom: 20px; }
  .crew { width: 110px; }
  .crew-boat { width: 64px; }
  .crew-tag { font-size: 13px; padding: 2px 10px; }
  .steps { grid-template-columns: 1fr; }
  .sheet { padding: 18px 16px 22px; }
  .beach { height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
