/* Wordle, Riddles, Old Words, Live Sketch, Quiz, Four in a Row, Dots and Boxes, Sea Battle. */

/* Home cards: 3D art from scripts/make-art.js until painted card art exists. */
.game[data-game="wordle"] { --card-art: url("art3d/wordle.svg"); --card-bg: linear-gradient(180deg, hsl(118 45% 42%) 0%, hsl(96 55% 68%) 62%, hsl(48 90% 45%) 100%); }
.game[data-game="riddle"] { --card-art: url("art3d/riddle.svg"); --card-bg: linear-gradient(180deg, hsl(38 85% 52%) 0%, hsl(44 90% 72%) 62%, hsl(24 90% 48%) 100%); }
.game[data-game="oldword"] { --card-art: url("art3d/oldword.svg"); --card-bg: linear-gradient(180deg, hsl(28 45% 40%) 0%, hsl(34 55% 68%) 62%, hsl(18 60% 36%) 100%); }
.game[data-game="quiz"] { --card-art: url("art3d/quiz.svg"); --card-bg: linear-gradient(180deg, hsl(212 75% 50%) 0%, hsl(200 80% 72%) 62%, hsl(228 75% 46%) 100%); }
.game[data-game="sketch"] { --card-art: url("art3d/sketch.svg"); --card-bg: linear-gradient(180deg, hsl(336 75% 56%) 0%, hsl(350 85% 76%) 62%, hsl(280 60% 50%) 100%); }
.game[data-game="connect4"] { --card-art: url("art3d/connect4.svg"); --card-bg: linear-gradient(180deg, hsl(222 70% 46%) 0%, hsl(214 75% 68%) 62%, hsl(350 75% 52%) 100%); }
.game[data-game="dots"] { --card-art: url("art3d/dots.svg"); --card-bg: linear-gradient(180deg, hsl(262 55% 50%) 0%, hsl(256 70% 74%) 62%, hsl(276 60% 44%) 100%); }
.game[data-game="battleship"] { --card-art: url("art3d/battleship.svg"); --card-bg: linear-gradient(180deg, hsl(198 70% 38%) 0%, hsl(192 65% 64%) 62%, hsl(210 70% 30%) 100%); }
html body #home :is(#games, #favouriteGames) .game-card .game:is([data-game="wordle"], [data-game="riddle"], [data-game="oldword"], [data-game="quiz"], [data-game="sketch"], [data-game="connect4"], [data-game="dots"], [data-game="battleship"]) {
  background: var(--card-bg);
  box-shadow: inset 0 0 0 2px #ffffff40, inset 0 -60px 50px -40px #0a0a3a66, 0 14px 24px -14px #1b0f3a88;
}
html body #home :is(#games, #favouriteGames) .game-card .game:is([data-game="wordle"], [data-game="riddle"], [data-game="oldword"], [data-game="quiz"], [data-game="sketch"], [data-game="connect4"], [data-game="dots"], [data-game="battleship"])::after {
  inset: 4% 8% 24% 8%;
  background: var(--card-art) center / contain no-repeat;
}

/* Shared. The new games show whose turn it is themselves. */
.stage-card:has(.mg) .room-turn { display: none; }
.mg { --mg-ink: var(--ink, #252046); --mg-panel: var(--ui-panel, #fffdf7); --mg-text: var(--ui-text, #252046); }
.mg-lead { margin: 6px 0 12px; font-weight: 700; }
.mg-result { font-size: 20px; }
.mg-count { margin: 10px 0 0; font-size: 13px; opacity: .8; }
.mg-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--seat); border: 2px solid var(--mg-ink); vertical-align: -2px; }
.mg-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 6px; }
.mg-seats span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 2px solid transparent; border-radius: 999px; font-weight: 700; }
.mg-seats .mg-turn { border-color: var(--mg-ink); background: var(--ui-active, #dbcbff); }
.mg-options { display: grid; gap: 8px; max-width: 560px; margin: 10px auto; }
html body .mg-option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; width: 100%; padding: 12px 16px; text-align: left; border-radius: 14px; }
.mg-option > span:only-child, .mg-option > span:first-child:nth-last-child(2) { grid-column: 1 / -1; }
.mg-option b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ui-active, #dbcbff); color: var(--mg-ink); }
.mg-option small { grid-column: 1 / -1; font-size: 12px; opacity: .75; }
html body .mg-option:disabled { opacity: 1; cursor: default; }
html body .mg-option.mg-picked { outline: 3px solid #7a4fc1; outline-offset: 1px; }
html body .mg-option.mg-right { background: #b7ecc5; color: #17361f; }
html body .mg-option.mg-wrong { background: #ffc7cf; color: #4a1520; }
.mg-results { display: grid; gap: 6px; max-width: 460px; margin: 12px auto; padding: 0; list-style: none; }
.mg-results li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--mg-panel); color: var(--mg-text); }
.mg-results li > span:first-child { flex: 1; text-align: left; font-weight: 700; }

/* Wordle: the classic look — square tiles, flat grey / yellow / green, a light keyboard. */
.mg-wordle, .wordle-board, .wordle-keys { --w-g: #6aaa64; --w-y: #c9b458; --w-x: #787c7e; --w-key: #d3d6da; --w-key-text: #1a1a1b; --w-line: #d3d6da; --w-typed: #878a8c; --w-tile: #fff; --w-text: #1a1a1b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.wordle-board, .wordle-keys) { --w-g: #538d4e; --w-y: #b59f3b; --w-x: #3a3a3c; --w-key: #818384; --w-key-text: #fff; --w-line: #3a3a3c; --w-typed: #565758; --w-tile: #121213; --w-text: #fff; } }
:root[data-theme="dark"] :is(.wordle-board, .wordle-keys) { --w-g: #538d4e; --w-y: #b59f3b; --w-x: #3a3a3c; --w-key: #818384; --w-key-text: #fff; --w-line: #3a3a3c; --w-typed: #565758; --w-tile: #121213; --w-text: #fff; }
.wordle-board { display: grid; gap: 5px; justify-content: center; margin: 6px auto 16px; padding: 10px; border-radius: 12px; background: var(--w-tile); width: max-content; max-width: 100%; }
.wordle-row { display: grid; grid-template-columns: repeat(5, clamp(48px, 15vw, 62px)); gap: 5px; justify-content: center; }
.wt { display: grid; place-items: center; aspect-ratio: 1; border: 2px solid var(--w-line); border-radius: 0; background: var(--w-tile); color: var(--w-text); font-family: "Helvetica Neue", Arial, sans-serif; font-size: clamp(24px, 7.5vw, 32px); font-weight: 700; line-height: 1; text-transform: uppercase; }
.wt-typed { border-color: var(--w-typed); animation: wt-pop 100ms ease-out; }
.wt.wt-g, .wordle-answer .wt-g { background: var(--w-g, #6aaa64); border-color: var(--w-g, #6aaa64); color: #fff; }
.wt.wt-y { background: var(--w-y); border-color: var(--w-y); color: #fff; }
.wt.wt-x { background: var(--w-x); border-color: var(--w-x); color: #fff; }
.wordle-mini .wt-g { background: #6aaa64; }
.wordle-mini .wt-y { background: #c9b458; }
.wordle-answer { margin: 6px auto 12px; }
.wt-flip .wt { animation: wt-flip 500ms ease-in both; animation-delay: calc(var(--k) * 220ms); }
@keyframes wt-pop { 50% { transform: scale(1.1); } }
@keyframes wt-flip { 0% { transform: rotateX(0); background: var(--w-tile); border-color: var(--w-typed); color: var(--w-text); } 49% { transform: rotateX(-90deg); background: var(--w-tile); border-color: var(--w-typed); color: var(--w-text); } 50%, 100% { transform: rotateX(0); } }
.wordle-keys { display: grid; gap: 8px; max-width: 500px; margin: 0 auto 12px; user-select: none; }
.wordle-keys > div { display: flex; justify-content: center; gap: 5px; }
html body .wk { flex: 1 1 0; min-width: 0; max-width: 44px; min-height: 58px; padding: 0; border: 0; border-radius: 4px; background: var(--w-key); color: var(--w-key-text); font-family: "Helvetica Neue", Arial, sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase; box-shadow: none; transform: none; }
html body .wk:hover { filter: brightness(.95); transform: none; }
html body .wk.wk-wide { flex: 1.5 1 0; max-width: 66px; display: grid; place-items: center; font-size: 11px; letter-spacing: 0; }
html body .wk.wk-enter { background: var(--w-key); color: var(--w-key-text); }
html body .wk.wt-g { background: var(--w-g); color: #fff; }
html body .wk.wt-y { background: var(--w-y); color: #fff; }
html body .wk.wt-x { background: var(--w-x); color: #fff; }
.wordle-others { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.wordle-others > div { display: grid; justify-items: center; gap: 4px; font-size: 12px; }
.wordle-mini { display: inline-grid; gap: 2px; }
.wordle-mini i { display: flex; gap: 2px; }
.wordle-mini b { width: 10px; height: 10px; border-radius: 2px; background: #8a8698; }

/* Old Words */
.oldword-word { display: grid; justify-items: center; gap: 2px; margin: 4px auto 14px; }
.oldword-word small { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; opacity: .7; }
.oldword-word b { font-size: clamp(32px, 9vw, 48px); line-height: 1.1; }
.mg-oldword textarea { width: 100%; max-width: 560px; }

/* Live Sketch */
.sketch-top { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.sketch-top .timer { margin: 0; font-size: 32px; }
.sketch-word { display: grid; justify-items: center; }
.sketch-word small { font-size: 12px; font-weight: 800; opacity: .7; }
.sketch-word b { font-size: 24px; }
.sketch-hint { letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; }
.sketch-slot { max-width: 640px; margin: 10px auto; }
.sketch-canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border: 3px solid var(--mg-ink); border-radius: 14px; background: #fff; touch-action: none; }
.sketch-canvas.sketch-live { cursor: crosshair; }
.sketch-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 auto 8px; }
html body .sketch-ink, html body .sketch-size { width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; box-shadow: none; }
html body .sketch-ink { background: var(--ink); color: #252046; }
html body .sketch-ink.on, html body .sketch-size.on { outline: 3px solid #7a4fc1; outline-offset: 2px; }
.sketch-size i { display: block; width: var(--w); height: var(--w); margin: auto; border-radius: 50%; background: currentColor; }
.sketch-guess { display: flex; gap: 6px; max-width: 460px; margin: 6px auto; }
.sketch-guess input { flex: 1; min-width: 0; font-size: 16px; }
.sketch-guess button { flex: none; width: 48px; padding: 0; }
.sketch-feed { display: grid; gap: 4px; max-width: 460px; max-height: 180px; margin: 8px auto 0; padding: 0; overflow: auto; list-style: none; text-align: left; font-size: 14px; }
.sketch-feed li { padding: 4px 10px; border-radius: 10px; background: var(--mg-panel); color: var(--mg-text); }
.sketch-feed li.ok { background: #b7ecc5; color: #17361f; font-weight: 700; }

/* Four in a Row */
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: min(100%, 460px); margin: 10px auto; padding: 10px; border: 3px solid var(--mg-ink); border-radius: 18px; background: #3a6fd8; }
html body .c4-cell { display: grid; place-items: center; aspect-ratio: 1; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #dfe9ff; box-shadow: inset 0 3px 0 #0003; }
html body .c4-board:not(.c4-live) .c4-cell { cursor: default; pointer-events: none; }
html body .c4-live .c4-cell:hover { background: #fff6c8; }
.c4-cell .mg-dot { width: 86%; height: 86%; border-width: 2px; box-shadow: inset 0 -4px 0 #0003; animation: c4-drop 260ms ease-in; }
.c4-cell:not(.c4-last) .mg-dot { animation: none; }
.c4-win .mg-dot { outline: 4px solid #fff; outline-offset: -8px; }
@keyframes c4-drop { from { transform: translateY(-260%); } }

/* Dots and Boxes */
.dots-board { display: block; width: min(100%, 420px); margin: 10px auto; }
.dots-dot { fill: var(--ui-text, #252046); }
.dots-free { stroke: #25204622; stroke-width: 4; stroke-dasharray: 2 8; stroke-linecap: round; }
.dots-hit { stroke: transparent; stroke-width: 22; stroke-linecap: round; }
.dots-live .dots-hit { cursor: pointer; }
.dots-live .dots-hit:hover { stroke: #7a4fc155; }
.dots-board:not(.dots-live) .dots-hit { pointer-events: none; }
.dots-taken { stroke-width: 7; stroke-linecap: round; }
.dots-last { stroke-width: 9; }

/* Sea Battle */
.sea-boards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 2.5vw, 20px); align-items: start; max-width: 760px; margin: 0 auto; }
.sea-side { min-width: 0; }
.sea-boards h4 { margin: 4px 0; font-size: clamp(11px, 3.2vw, 16px); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sea-side.sea-aim h4 { color: #c78a00; }
.sea-side.sea-aim .sea-grid { border-color: #ffcf3a; box-shadow: 0 0 0 3px #ffcf3a66; }
.sea-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: clamp(1px, .5vw, 3px); width: min(100%, 340px); margin: 4px auto; padding: clamp(3px, 1vw, 6px); border: 3px solid var(--mg-ink); border-radius: 12px; background: #1e5f8a; }
.sea-grid.sea-fog { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; color: #fff8; font-size: 40px; font-weight: 900; }
/* Water squares ("holes") sit underneath; boats float on top; hit and miss marks sit on top of the boats. */
.sea-grid { position: relative; overflow: hidden; gap: 1px !important; padding: 0 !important; border-radius: 4px !important; background: #3d86b5 !important; }
@keyframes sea-tide { 50% { filter: brightness(1.06); } }
.sea-cell, html body button.sea-cell { display: grid; place-items: center; aspect-ratio: 1; min-height: 0; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: #8fcbed; color: #12324a; font-size: clamp(9px, 2.6vw, 15px); font-weight: 900; box-shadow: none; transform: none; }
html body button.sea-cell:hover { background: #fff6c8; transform: none; }
html body .sea-live button.sea-cell { cursor: crosshair; }
html body .sea-live button.sea-cell:hover { background: radial-gradient(circle, #fff6c8 0 22%, #ffcf3a 23% 30%, #fff6c8 31%); }
.sea-miss { background: #cfe8f6 !important; }
.sea-cell.sea-miss .sea-mark { width: 28%; height: 28%; border-radius: 50%; background: #5e8fae; }
.sea-mark { position: relative; z-index: 3; display: grid; place-items: center; width: 100%; height: 100%; font-style: normal; pointer-events: none; }
.sea-hit .sea-mark, .sea-sunk .sea-mark { color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000a; }
.sea-hit { background: #ff8a4c !important; }
.sea-hit .sea-mark { animation: sea-flicker 0.9s ease-in-out infinite alternate; }
.sea-sunk { background: #b8323f !important; }
@keyframes sea-flicker { from { filter: drop-shadow(0 0 2px #ffcf3a); } to { filter: drop-shadow(0 0 6px #ff6a3d); transform: scale(1.12); } }
.sea-last { outline: 3px solid #ffcf3a; outline-offset: -2px; }
/* A fresh shot: a splash ring for a miss, an explosion for a hit. */
.sea-boom { position: relative; }
.sea-boom::after { content: ""; position: absolute; inset: -30%; z-index: 4; border-radius: 50%; pointer-events: none; }
.sea-boom.sea-miss::after { border: 3px solid #fff; animation: sea-splash .7s ease-out both; }
.sea-boom:is(.sea-hit, .sea-sunk)::after { background: radial-gradient(circle, #fff 0 15%, #ffe066 25%, #ff7b2e 50%, transparent 70%); animation: sea-blast .6s ease-out both; }
@keyframes sea-splash { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes sea-blast { from { transform: scale(.2); opacity: 1; } 60% { opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.sea-boom .sea-mark { animation: sea-pop .35s ease-out both; }
@keyframes sea-pop { from { transform: scale(0); } 70% { transform: scale(1.3); } }
/* Boats */
.sea-boat { position: relative; z-index: 2; min-width: 0; min-height: 0; margin: 1px; pointer-events: none; filter: drop-shadow(0 3px 2px #0007); animation: sea-bob 3.2s ease-in-out infinite; animation-delay: calc(var(--d, 0s) * -1); }
.sea-boat.sea-up { animation-name: sea-bob-up; }
.sea-boat svg { display: block; width: 100%; height: 100%; }
@keyframes sea-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-.6deg); } }
@keyframes sea-bob-up { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(1.5px) rotate(.6deg); } }
.sea-boat-sunk { animation: none; filter: grayscale(.7) brightness(.55) drop-shadow(0 2px 1px #0006); opacity: .75; }
.sea-sinking { animation: sea-sink 1.4s ease-in both; }
@keyframes sea-sink { 0% { transform: none; filter: none; opacity: 1; } 25% { transform: rotate(-4deg) scale(1.03); } 100% { transform: rotate(3deg) scale(.92); filter: grayscale(.7) brightness(.55); opacity: .75; } }
.sea-boat.sea-sel { filter: drop-shadow(0 0 4px #ffcf3a) drop-shadow(0 0 2px #ffcf3a); }
.sea-drop { animation: sea-drop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes sea-drop { from { transform: scale(1.25) translateY(-6px); opacity: .6; } }
.sea-edit { touch-action: none; }
.sea-edit .sea-boat { transition: none; }
.sea-dragging { z-index: 5; animation: none; transform: scale(1.08); filter: drop-shadow(0 8px 6px #0008) drop-shadow(0 0 4px #ffcf3a); }
.sea-dragging.sea-bad { filter: drop-shadow(0 8px 6px #0008) drop-shadow(0 0 5px #ff3b3b) saturate(.4); }
.sea-side.sea-aim .sea-grid { animation: sea-aim 1.4s ease-in-out infinite; }
@keyframes sea-aim { 50% { box-shadow: 0 0 0 6px #ffcf3a55; } }
@media (prefers-reduced-motion: reduce) { .sea-grid, .sea-boat, .sea-hit .sea-mark, .sea-side.sea-aim .sea-grid { animation: none !important; } }
.sea-fleet { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 6px auto 0; padding: 0; list-style: none; width: min(100%, 340px); }
.sea-fleet li { display: flex; align-items: center; gap: 6px; font-size: clamp(9px, 2.5vw, 12px); line-height: 1.2; }
.sea-fleet small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sea-mini { display: inline-grid; gap: 1px; flex: none; }
.sea-mini i { width: clamp(5px, 1.6vw, 9px); height: clamp(5px, 1.6vw, 9px); border-radius: 2px; background: #5b6a7a; }
.sea-fleet .sea-gone { opacity: .5; text-decoration: line-through; }
.sea-fleet .sea-gone i { background: #b8323f; }
.sea-dock { max-width: 640px; margin: 12px auto 0; }
.sea-dock-ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
html body .sea-pick { display: grid; justify-items: start; gap: 2px; margin: 0; padding: 8px 10px; border: 2px solid transparent; border-radius: 10px; background: var(--mg-panel); color: var(--mg-text); text-align: left; box-shadow: none; }
html body .sea-pick.sea-sel { border-color: #ffcf3a; background: #fff6c8; color: #1a1a1b; }
.sea-pick-art { display: block; width: 100%; height: 18px; }
.sea-pick-art svg { width: 100%; height: 100%; }
.sea-pick b { font-size: 12px; }
.sea-pick small { font-size: 11px; opacity: .7; }
.sea-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
html body .sea-tools button { margin: 0; padding: 8px 14px; font-size: 14px; }
.sea-guide { max-width: 640px; margin: 14px auto 4px; padding: 10px 14px; border-radius: 12px; background: var(--mg-panel); color: var(--mg-text); text-align: left; }
.sea-guide summary { cursor: pointer; font-weight: 800; }
.sea-guide ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.sea-guide p { margin: 8px 0 0; font-size: 13px; }
.sea-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.sea-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sea-legend i.sea-cell { width: 20px; font-size: 11px; font-style: normal; border-radius: 4px; }

/* Quiz and riddles: big question, draining time bar, four coloured shape tiles, answer chart and leaderboard. */
.kq { --kq0: #e21b3c; --kq1: #1368ce; --kq2: #d89e00; --kq3: #26890c; max-width: 680px; margin: 0 auto; }
.kq-question { display: grid; place-items: center; min-height: 96px; margin: 4px 0 12px; padding: 18px 16px; border-radius: 10px; background: #fff; color: #1a1a1b; font-size: clamp(19px, 5vw, 26px); font-weight: 800; line-height: 1.3; text-align: center; box-shadow: 0 3px 0 rgb(0 0 0 / .12); }
.kq-clock { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.kq-bar { flex: 1; height: 10px; border-radius: 99px; background: rgb(0 0 0 / .1); overflow: hidden; }
.kq-bar i { display: block; height: 100%; border-radius: inherit; background: #864cbf; transform-origin: left; animation-name: kq-drain; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes kq-drain { from { transform: scaleX(1); } 75% { background: #864cbf; } to { transform: scaleX(0); background: #e21b3c; } }
.kq-clock .timer { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #864cbf; color: #fff; font-size: 20px; font-weight: 900; }
.kq-answered { min-width: 52px; text-align: center; font-size: 12px; line-height: 1.1; }
.kq-answered b { display: block; font-size: 20px; }
.kq-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html body .kq-tile { position: relative; display: flex; align-items: center; gap: 12px; min-height: 92px; margin: 0; padding: 12px 14px; border: 0; border-radius: 6px; color: #fff; font-size: clamp(15px, 4vw, 19px); font-weight: 800; line-height: 1.25; text-align: left; box-shadow: inset 0 -5px 0 rgb(0 0 0 / .2); transition: opacity .2s, transform .12s, filter .2s; }
html body .kq-tile:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.06); }
html body .kq-tile:not(:disabled):active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .2); }
html body .kq-tile:disabled { opacity: 1; cursor: default; }
.kq-tile svg { flex: none; width: 34px; height: 34px; fill: #fff; filter: drop-shadow(0 2px 0 rgb(0 0 0 / .15)); }
.kq-tile span { overflow-wrap: anywhere; }
.kq-tile em { position: absolute; top: 6px; right: 10px; font-size: 24px; font-style: normal; }
html body .kq-c0 { background: var(--kq0); } html body .kq-c1 { background: var(--kq1); } html body .kq-c2 { background: var(--kq2); } html body .kq-c3 { background: var(--kq3); }
html body .kq-tile.kq-off { opacity: .28; filter: saturate(.6); }
html body .kq-tile.kq-mine { outline: 4px solid #1a1a1b; outline-offset: 2px; }
.kq-revealed .kq-tile.kq-good { animation: kq-pop .4s ease-out; }
@keyframes kq-pop { 50% { transform: scale(1.04); } }
.kq-wait { margin: 14px 0 0; text-align: center; font-weight: 800; animation: kq-breathe 1.6s ease-in-out infinite; }
@keyframes kq-breathe { 50% { opacity: .55; } }
.kq-chart { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 10px; height: 150px; margin: 0 auto 12px; max-width: 420px; }
.kq-col { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; height: 100%; background: none !important; }
.kq-col b { font-size: 18px; }
.kq-col i { width: 100%; height: calc(6px + var(--h) * 86px); border-radius: 4px 4px 0 0; background: var(--c); animation: kq-grow .6s ease-out both; transform-origin: bottom; }
.kq-col span { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; padding: 4px 0; border-radius: 0 0 4px 4px; background: var(--c); color: #fff; font-weight: 900; }
.kq-col span svg { width: 16px; height: 16px; fill: #fff; }
.kq-col.kq-c0 { --c: var(--kq0); } .kq-col.kq-c1 { --c: var(--kq1); } .kq-col.kq-c2 { --c: var(--kq2); } .kq-col.kq-c3 { --c: var(--kq3); }
.kq-col:not(.kq-good) { opacity: .45; }
@keyframes kq-grow { from { transform: scaleY(0); } }
.kq-result { margin: 14px auto 10px; padding: 12px; max-width: 420px; border-radius: 8px; color: #fff; font-size: 22px; font-weight: 900; text-align: center; animation: kq-pop .4s ease-out; }
.kq-result.kq-yes { background: #26890c; } .kq-result.kq-no { background: #e21b3c; }
.kq-result b { margin-left: 6px; padding: 2px 10px; border-radius: 99px; background: rgb(0 0 0 / .2); }
.kq-board { display: grid; gap: 6px; max-width: 420px; margin: 0 auto 8px; padding: 0; list-style: none; counter-reset: kq; }
.kq-board li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 6px; background: #fff; color: #1a1a1b; font-weight: 800; counter-increment: kq; box-shadow: 0 2px 0 rgb(0 0 0 / .1); }
.kq-board li::before { content: counter(kq); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #864cbf; color: #fff; font-size: 13px; }
.kq-board li span { flex: 1; text-align: left; }
.kq-board li em { color: #26890c; font-style: normal; font-size: 14px; }
.kq-board li.kq-me { outline: 3px solid #864cbf; }
@media (max-width: 420px) { html body .kq-tile { min-height: 80px; flex-direction: column; justify-content: center; text-align: center; gap: 6px; } .kq-tile svg { width: 26px; height: 26px; } }

.sea-mini i.sea-mini-gap { background: transparent; }
.sea-legend .sea-miss .sea-mark { width: 28%; height: 28%; border-radius: 50%; background: #5e8fae; }
.sea-grid:not(.sea-fog) { grid-template-rows: repeat(var(--n), 1fr); }
.sea-boat svg { position: absolute; inset: 0; }
html body .sea-pick { overflow: hidden; }
html body .sea-pick .sea-pick-art { width: calc(var(--w) * 22px); height: calc(var(--h) * 22px); max-width: 100%; }

/* Polish: marks are small badges so the ships under them stay visible; sunk ships stay on show, tinted red. */
.sea-cell.sea-hit { background: #ffd3bd !important; }
.sea-cell.sea-sunk { background: #f3b1b6 !important; }
.sea-hit .sea-mark, .sea-sunk .sea-mark { width: 62%; height: 62%; border-radius: 50%; font-size: clamp(8px, 2.2vw, 13px); }
.sea-hit .sea-mark { background: radial-gradient(circle at 40% 35%, #ffd166, #ff6b2c 55%, #d9381e); box-shadow: 0 0 6px #ff8a3c; }
.sea-sunk .sea-mark { background: #b8323f; box-shadow: 0 0 0 2px #fff6; animation: none; }
.sea-boat-sunk { opacity: 1; filter: sepia(.6) saturate(2.2) hue-rotate(-35deg) brightness(.75) drop-shadow(0 2px 1px #0006); }
@keyframes sea-sink { 0% { transform: none; filter: none; } 20% { transform: rotate(-3deg) translateY(-2px); } 45% { transform: rotate(2deg) translateY(1px); } 100% { transform: none; filter: sepia(.6) saturate(2.2) hue-rotate(-35deg) brightness(.75) drop-shadow(0 2px 1px #0006); } }
.sea-sinking::after { content: ""; position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(circle, #ffffffcc, #8fcbed66 50%, transparent 70%); animation: sea-splash 1s ease-out both; pointer-events: none; }
.sea-wait { color: var(--mg-text); opacity: .8; }
.sea-wait .dots i { animation: sea-dot 1.2s infinite; opacity: .2; font-style: normal; }
.sea-wait .dots i:nth-child(2) { animation-delay: .2s; } .sea-wait .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes sea-dot { 30% { opacity: 1; } }
.sea-last { outline-width: 2px; }
