:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #101116;
  --panel-2: #15171d;
  --ink: #f4f2ec;
  --muted: #777982;
  --line: rgba(255,255,255,.09);
  --accent: #d9ff4f;
  --cols: 8;
  --rows: 8;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; background: var(--bg); }

body {
  min-height: 100dvh;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(84,93,120,.12), transparent 42%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

.game-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  min-height: 78px;
  padding: max(16px, env(safe-area-inset-top)) clamp(18px, 4vw, 58px) 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,9,13,.82);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
  z-index: 10;
}

.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(239,228,194,.48); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 1px; color: #f1e8d2; box-shadow: inset 0 0 0 3px rgba(239,228,194,.035); font: 600 12px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.08em; position: relative; }
.brand-mark::after { content:""; position:absolute; inset:-4px; border:1px solid rgba(239,228,194,.12); border-radius:50%; }
.brand-mark i { margin: 0 1px; color: #bba978; font-size: 8px; font-weight: 500; }
.brand-wordmark { display: grid; grid-template-columns: auto 14px auto; align-items: baseline; color: #f1eee7; font: 600 17px/.8 "Cormorant Garamond", Georgia, serif; letter-spacing: .12em; }
.brand-wordmark > i { color: #a99a73; font-size: 11px; text-align:center; font-weight:500; }
.brand-wordmark > small { grid-column: 1 / -1; margin-top: 6px; color: #6f6b62; font: 500 5px/1 DM Mono, monospace; letter-spacing: .38em; }

.hud { display: flex; align-items: center; gap: clamp(17px, 3.2vw, 44px); }
.hud-item { min-width: 54px; text-align: center; }
.hud-label { display: block; margin-bottom: 3px; color: #656872; font: 500 8px/1 DM Mono, monospace; letter-spacing: .2em; }
.hud-item strong { font: 500 clamp(16px, 2vw, 22px)/1 DM Mono, monospace; letter-spacing: -.05em; }
.timer-item strong { color: var(--accent); }
.combo-item strong { color: #fff; transition: color .2s, transform .2s; }
.combo-item.hot strong { color: var(--accent); transform: scale(1.12); }
.timer-item.danger strong { color: #ff5d5f; animation: timerPulse .55s ease infinite alternate; }
.hud-divider { width: 1px; height: 28px; background: var(--line); }

.top-actions { justify-self: end; display: flex; gap: 7px; }
.icon-button { width: 38px; height: 38px; color: #94969e; background: transparent; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.icon-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }
.muted .sound-off { display: block; }
.muted .sound-on { display: none; }
.sound-button { width: auto; min-width: 38px; padding: 0 12px; border-radius: 20px; display: flex; gap: 7px; }
.sound-button span { font: 500 7px/1 DM Mono, monospace; letter-spacing: .12em; white-space: nowrap; }
.mode-button { height: 38px; padding: 0 13px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(142,240,207,.28); border-radius: 20px; background: rgba(142,240,207,.055); color: #9bafa9; font: 600 8px/1 DM Mono, monospace; letter-spacing: .13em; cursor: pointer; transition: .2s ease; }
.mode-button:hover { border-color: #8ef0cf; color: #c8fff0; }
.mode-button.active { border-color: #8ef0cf; background: rgba(142,240,207,.15); color: #c8fff0; box-shadow: 0 0 20px rgba(142,240,207,.11); }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: #555d5b; box-shadow: 0 0 0 3px rgba(255,255,255,.025); }
.mode-button.active .mode-dot { background: #8ef0cf; box-shadow: 0 0 9px #8ef0cf; }
.relaxed-short { display:none; }
.catalogue-button { border-color:rgba(217,255,79,.25); color:#a9af91; }
.catalogue-button b { min-width:18px; padding:3px 5px; border-radius:9px; background:rgba(217,255,79,.12); color:var(--accent); font-size:7px; }

.game-stage { width: min(1030px, 94vw); margin: auto; padding: clamp(23px, 3.5vh, 45px) 0 max(20px, env(safe-area-inset-bottom)); }
.stage-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 17px; }
.eyebrow { margin: 0 0 7px; color: #6f727c; font: 500 8px/1.2 DM Mono, monospace; letter-spacing: .24em; }
h1 { margin: 0; font-size: clamp(20px, 3vw, 33px); font-weight: 500; letter-spacing: -.045em; }
.round-flavour { margin:5px 0 0; color:#6f727c; font:500 8px/1.3 DM Mono,monospace; letter-spacing:.06em; }
.progress-wrap { width: min(270px, 32vw); }
.progress-copy { margin-bottom: 7px; display: flex; justify-content: space-between; color: #777a83; font: 500 8px/1 DM Mono, monospace; letter-spacing: .14em; }
.progress-track { height: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width .35s ease; }

.board-wrap { position: relative; isolation: isolate; }
.board-glow { position: absolute; z-index: -1; inset: 8%; border-radius: 20%; background: radial-gradient(ellipse, rgba(178,255,89,.08), transparent 68%); filter: blur(35px); }
.board {
  width: 100%;
  height: min(64vh, var(--board-h, 680px));
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
  gap: clamp(3px, .52vw, 7px);
  perspective: 1000px;
}

.tile {
  --tile-color: #ccc;
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: clamp(4px, .55vw, 8px);
  background: linear-gradient(145deg, rgba(28,30,38,.94), rgba(16,17,22,.98));
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 5px 14px rgba(0,0,0,.18);
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, background .2s ease, opacity .25s ease;
  animation: tileIn .42s cubic-bezier(.2,.8,.2,1) both;
}
.tile::before { content: ''; position: absolute; inset: 0; opacity: .2; background: radial-gradient(circle at 50% 40%, var(--tile-color), transparent 62%); transition: opacity .2s; }
.tile:hover { transform: translateY(-2px) scale(1.025); border-color: color-mix(in srgb, var(--tile-color) 45%, transparent); z-index: 2; }
.tile:hover::before { opacity: .32; }
.tile:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.tile.selected { transform: translateY(-2px) scale(1.04); border-color: var(--tile-color); background: color-mix(in srgb, var(--tile-color) 10%, #111319); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tile-color) 35%, transparent), 0 0 24px color-mix(in srgb, var(--tile-color) 22%, transparent), inset 0 0 18px color-mix(in srgb, var(--tile-color) 12%, transparent); z-index: 3; }
.tile.matched { opacity: 0; transform: scale(.68); pointer-events: none; }
.tile.wrong { animation: wrongShake .32s ease; border-color: #ff565b; }

.shape { position: absolute; width: 48%; aspect-ratio: 1; left: 26%; top: 50%; transform: translateY(-50%); background: var(--tile-color); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tile-color) 25%, transparent)); }
.shape::after { content: ''; position: absolute; inset: 8%; background: linear-gradient(135deg, rgba(255,255,255,.32), transparent 45%, rgba(0,0,0,.15)); clip-path: inherit; border-radius: inherit; }
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 3px; transform: translateY(-50%) rotate(45deg) scale(.76); }
.shape-triangle { clip-path: polygon(50% 3%, 97% 91%, 3% 91%); }
.shape-pentagon { clip-path: polygon(50% 0, 98% 36%, 80% 96%, 20% 96%, 2% 36%); }
.shape-hexagon { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.shape-septagon { clip-path: polygon(50% 0, 89% 19%, 100% 61%, 72% 95%, 28% 95%, 0 61%, 11% 19%); }

.board-footer { min-height: 49px; position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.selection-status { min-height: 36px; padding: 7px 12px; display: flex; align-items: center; gap: 10px; opacity: .78; border: 1px solid transparent; border-radius: 7px; transition: .2s ease; }
.status-swatch { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: #363840; box-shadow: 0 0 11px currentColor; }
.status-label { color: #7d8089; font: 500 8px/1 DM Mono, monospace; letter-spacing: .18em; }
.selection-status strong { color: #c7c9cf; font: 600 clamp(10px, 1.1vw, 13px)/1 DM Mono, monospace; letter-spacing: .07em; }
.selection-status.active { opacity: 1; background: rgba(255,255,255,.045); border-color: color-mix(in srgb, currentColor 24%, rgba(255,255,255,.12)); box-shadow: 0 6px 22px rgba(0,0,0,.2); }
.selection-status.active strong { color: #fff; text-shadow: 0 0 14px rgba(255,255,255,.18); }
.penalty { position: absolute; left: 50%; transform: translateX(-50%) translateY(3px); opacity: 0; color: #ff5b5f; font: 500 10px/1 DM Mono, monospace; letter-spacing: .1em; white-space: nowrap; }
.penalty.show { animation: penaltyBlink 1s ease; }
.tip { justify-self: end; margin: 0; color: #686b73; font: 500 8px/1 DM Mono, monospace; letter-spacing: .09em; }
.tip span { color: var(--accent); margin-right: 4px; }
.utility-bar { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.powerups { display:flex; gap:5px; }
.powerups button { min-height:28px; padding:5px 8px; display:flex; align-items:center; gap:5px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.025); color:#8b8e96; font:500 7px/1 DM Mono,monospace; letter-spacing:.08em; cursor:pointer; }
.powerups button:hover:not(:disabled) { border-color:rgba(217,255,79,.5); color:#fff; }
.powerups button:disabled { opacity:.35; cursor:not-allowed; }
.powerups button b { min-width:14px; color:var(--accent); }
.combo-praise { color:var(--accent); font:600 8px/1 DM Mono,monospace; letter-spacing:.14em; text-align:right; }
.tile.hint-pulse { border-color:#fff; box-shadow:0 0 0 2px var(--tile-color),0 0 28px var(--tile-color); animation:hintPulse .65s ease 3; }
.board.hide-shapes .shape { opacity:0; }

.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5,6,9,.78); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transition: .32s ease; }
.modal-layer.active { opacity: 1; visibility: visible; }
.modal-card { width: min(480px, 92vw); padding: clamp(34px, 5vw, 60px); text-align: center; background: linear-gradient(145deg, rgba(24,26,33,.98), rgba(13,14,18,.98)); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; box-shadow: 0 35px 100px rgba(0,0,0,.55); transform: translateY(18px) scale(.97); transition: .4s cubic-bezier(.2,.8,.2,1); }
.active .modal-card { transform: none; }
.modal-card h2 { margin: 7px 0 16px; font-size: clamp(44px, 8vw, 72px); font-weight: 600; line-height: .85; letter-spacing: -.07em; text-transform: uppercase; }
.modal-card h2 span { color: var(--accent); }
.modal-card > p:not(.eyebrow) { max-width: 330px; margin: 0 auto 27px; color: #8b8e97; font-size: 13px; line-height: 1.7; }
.intro-crest { width: 72px; height: 72px; margin: 0 auto 22px; border: 1px solid rgba(231,218,180,.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 3px; color: #f1e8d2; box-shadow: inset 0 0 0 5px rgba(231,218,180,.035), 0 0 0 1px rgba(231,218,180,.05); font: 600 25px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.1em; position: relative; }
.intro-crest::before, .intro-crest::after { content:""; position:absolute; top:50%; width:25px; height:1px; background:linear-gradient(90deg,transparent,rgba(231,218,180,.35)); }
.intro-crest::before { right:calc(100% + 13px); }
.intro-crest::after { left:calc(100% + 13px); transform:scaleX(-1); }
.intro-crest i { margin:0 2px; color:#b9a978; font-size:15px; font-weight:500; }
.intro-kicker { margin-bottom:12px; color:#8e856f; letter-spacing:.34em; }
.modal-card h2.intro-wordmark { margin:0 auto 7px; display:flex; align-items:baseline; justify-content:center; gap:clamp(9px,2vw,16px); color:#f4efe5; font:600 clamp(53px,9vw,82px)/.8 "Cormorant Garamond", Georgia, serif; letter-spacing:-.065em; text-transform:none; }
.modal-card h2.intro-wordmark span { color:inherit; }
.modal-card h2.intro-wordmark i { color:#b6a675; font-size:.46em; font-weight:500; }
.intro-rule { width:min(270px,78%); margin:18px auto 23px; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:11px; color:#68645a; font:500 6px/1 DM Mono,monospace; letter-spacing:.25em; }
.intro-rule i { height:1px; background:linear-gradient(90deg,transparent,rgba(231,218,180,.28)); }
.intro-rule i:last-child { transform:scaleX(-1); }
.intro-card { max-height:94vh; overflow:auto; }
.primary-button { width: 100%; padding: 17px 20px; border: 0; border-radius: 7px; background: var(--accent); color: #11130b; font: 700 10px/1 DM Mono, monospace; letter-spacing: .18em; cursor: pointer; box-shadow: 0 10px 35px rgba(217,255,79,.13); transition: .2s ease; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 14px 40px rgba(217,255,79,.2); }
.primary-button span { float: right; font-size: 16px; margin-top: -3px; }
.splash-option { width:100%; min-height:58px; margin-top:12px; padding:10px 13px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:11px; text-align:left; border:1px solid rgba(142,240,207,.2); border-radius:7px; background:rgba(142,240,207,.035); color:#a1aaa8; cursor:pointer; transition:.2s ease; }
.splash-option:hover { border-color:rgba(142,240,207,.55); background:rgba(142,240,207,.07); }
.splash-option.active { border-color:#8ef0cf; background:rgba(142,240,207,.13); color:#e3fff7; box-shadow:0 0 24px rgba(142,240,207,.09); }
.splash-option-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:50%; background:rgba(255,255,255,.05); color:#8ef0cf; font:500 21px/1 DM Mono,monospace; }
.splash-option > span:nth-child(2) { display:grid; gap:4px; }
.splash-option strong { font:600 9px/1 DM Mono,monospace; letter-spacing:.13em; }
.splash-option small { color:#6f747b; font:500 8px/1 DM Mono,monospace; }
.splash-option i { min-width:31px; padding:5px 6px; border-radius:12px; background:#292c32; color:#858891; text-align:center; font:normal 600 7px/1 DM Mono,monospace; letter-spacing:.1em; }
.splash-option.active i { background:#8ef0cf; color:#102019; }
.text-button { margin: 14px auto 0; padding: 5px; display: block; border: 0; background: transparent; color: #858892; font: 500 8px/1 DM Mono, monospace; letter-spacing: .16em; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.optional-note { margin: 10px auto 0 !important; color: #666a73 !important; font: 500 7px/1.4 DM Mono, monospace !important; letter-spacing: .1em; text-transform: uppercase; }
.start-meta { margin-top: 20px; display: flex; justify-content: space-between; color: #5e616a; font: 500 7px/1 DM Mono, monospace; letter-spacing: .16em; }
.splash-choices { margin-top:14px; display:grid; gap:12px; text-align:left; }
.splash-choices fieldset { margin:0; padding:0; border:0; }
.splash-choices legend,.mode-select > span { margin-bottom:7px; display:block; color:#6d7079; font:500 7px/1 DM Mono,monospace; letter-spacing:.17em; }
.choice-row { display:grid; grid-template-columns:repeat(4,1fr); gap:4px; }
.choice-row button { min-height:29px; padding:5px 2px; border:1px solid var(--line); border-radius:5px; background:rgba(255,255,255,.02); color:#70737c; font:500 6px/1 DM Mono,monospace; letter-spacing:.06em; cursor:pointer; }
.choice-row button.active { border-color:var(--accent); background:rgba(217,255,79,.1); color:var(--accent); }
.mode-select select { width:100%; height:35px; padding:0 10px; border:1px solid var(--line); border-radius:5px; background:#111319; color:#d1d3d8; font:500 9px DM Mono,monospace; }
.compact-card h2 { font-size: clamp(42px, 7vw, 64px); text-transform: none; }
.result-rank { margin:0 0 13px; padding:11px; display:grid; gap:4px; border:1px solid rgba(217,255,79,.25); border-radius:7px; background:rgba(217,255,79,.055); }
.result-rank small { color:#74786a; font:500 7px DM Mono; letter-spacing:.18em; }
.result-rank strong { color:var(--accent); font-size:14px; }
.result-stats { display: grid; grid-template-columns: repeat(4,1fr); margin: 0 0 18px; border: 1px solid var(--line); border-radius: 7px; }
.result-stats span { padding: 13px; }
.result-stats span + span { border-left: 1px solid var(--line); }
.result-stats small { display: block; color: #666973; font: 500 7px DM Mono; letter-spacing: .18em; }
.result-stats strong { font: 500 clamp(12px,2vw,18px) DM Mono; }
.share-button { margin-top:10px; }
.share-status { min-height:13px; display:block; color:#8ef0cf; text-align:center; font:500 7px DM Mono; letter-spacing:.08em; }

.catalogue-card { width:min(980px,95vw); max-height:90vh; padding:clamp(24px,4vw,42px); text-align:left; overflow:hidden; }
.catalogue-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.catalogue-heading h2 { margin:3px 0 0; font-size:clamp(32px,5vw,54px); text-transform:none; }
.catalogue-copy { margin:10px 0 18px !important; color:#7e8189 !important; font-size:11px !important; }
.catalogue-grid { max-height:58vh; overflow:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(205px,1fr)); gap:8px; padding-right:5px; }
.paint-card { min-height:126px; padding:12px; border:1px solid var(--line); border-radius:8px; background:#111319; }
.paint-swatch { height:30px; margin-bottom:10px; border-radius:5px; box-shadow:inset 0 1px rgba(255,255,255,.25); }
.paint-card strong { display:block; color:#eee; font-size:9px; line-height:1.35; letter-spacing:.04em; }
.paint-card p { margin:6px 0 !important; color:#777b83 !important; font-size:9px !important; line-height:1.45 !important; }
.paint-card small { color:var(--accent); font:500 7px DM Mono; letter-spacing:.08em; }
.empty-catalogue { grid-column:1/-1; padding:60px 20px; color:#6f727a; text-align:center; }

#round-badge { color: var(--accent); }
.feedback-layer { position: absolute; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.float-feedback { position: absolute; min-width: 100px; text-align: center; color: #fff; font: 600 11px/1.3 DM Mono, monospace; text-shadow: 0 2px 12px #000; transform: translate(-50%,-50%); animation: floatReward .9s ease-out forwards; }
.float-feedback strong { display: block; color: var(--accent); font-size: 15px; }
.float-feedback.penalty-copy strong { color: #ff5b5f; }
.board.tutorial-board { width: min(520px, 100%); margin-inline: auto; }
.tutorial-note { color: var(--accent); }

.settings-card { width: min(540px, 94vw); text-align: left; }
.settings-card h2 { margin-bottom: 25px; font-size: clamp(36px, 6vw, 56px); text-transform: none; }
.settings-list { margin-bottom: 25px; border-top: 1px solid var(--line); }
.settings-list label { min-height: 67px; padding: 12px 2px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.settings-list label > span { display: grid; gap: 4px; }
.settings-list label strong { font-size: 12px; font-weight: 600; }
.settings-list label small { color: #757881; font-size: 10px; }
.settings-list input { position: absolute; opacity: 0; pointer-events: none; }
.settings-list label > i { width: 38px; height: 21px; flex: 0 0 auto; position: relative; border-radius: 20px; background: #292b33; border: 1px solid var(--line); transition: .2s; }
.settings-list label > i::after { content:''; position:absolute; width:15px; height:15px; left:2px; top:2px; border-radius:50%; background:#777a83; transition:.2s; }
.settings-list input:checked + i { background: color-mix(in srgb, var(--accent) 35%, #1a1d12); border-color: var(--accent); }
.settings-list input:checked + i::after { left:18px; background:var(--accent); }
.settings-list input:focus-visible + i { outline:2px solid white; outline-offset:3px; }

body.high-contrast .tile { border-width: 2px; border-color: rgba(255,255,255,.22); background: #11131a; }
body.high-contrast .shape { filter: brightness(1.18) saturate(1.2) drop-shadow(0 0 9px var(--tile-color)); }
body.patterns .tile::after { content:''; position:absolute; inset:7px; z-index:0; opacity:.17; border-radius:4px; background: repeating-linear-gradient(var(--pattern-angle,45deg), var(--tile-color) 0 2px, transparent 2px 8px); }
body.patterns .shape { z-index:1; }
body.reduced-motion .tile, body.reduced-motion .modal-card, body.reduced-motion .board { transition-duration:.01ms; animation-duration:.01ms; }
body.reduced-motion .tile.wrong { animation:none; border-color:#ff565b; }
body.relaxed .timer-item strong { color:#8ef0cf; }

@keyframes floatReward { 0% { opacity:0; transform:translate(-50%,-30%) scale(.8); } 18% { opacity:1; } 100% { opacity:0; transform:translate(-50%,-140%) scale(1.05); } }
@keyframes hintPulse { 50% { transform:scale(1.055); filter:brightness(1.35); } }

@keyframes tileIn { from { opacity: 0; transform: scale(.75) translateY(8px); } }
@keyframes wrongShake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes penaltyBlink { 0% { opacity: 0; transform: translateX(-50%) translateY(7px); } 18%, 60% { opacity: .7; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
@keyframes timerPulse { to { opacity: .55; } }

@media (max-width: 700px) {
  .topbar { min-height: 108px; padding-inline: 14px; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; row-gap: 9px; }
  .brand-wordmark { display: none; }
  .brand-mark { width: 28px; height: 28px; flex-basis:28px; font-size:10px; }
  .hud { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 14px; }
  .top-actions { grid-column: 3; grid-row: 1; }
  .hud-divider { height: 24px; }
  .hud-item { min-width: 43px; }
  .hud-item strong { font-size: 14px; }
  .timer-item { min-width: 68px; }
  .icon-button { width: 33px; height: 33px; }
  .sound-button { width: auto; min-width: 72px; padding-inline: 9px; }
  .sound-button span { font-size: 6px; }
  .mode-button { height: 33px; padding-inline: 10px; }
  .relaxed-long { display:none; }
  .relaxed-short { display:inline; }
  .catalogue-button { padding-inline:8px; }
  .catalogue-button { font-size:0; }
  .catalogue-button::before { content:'PAINTS'; font-size:6px; }
  .game-stage { width: 96vw; padding-top: 19px; }
  .stage-heading { margin-inline: 2px; align-items: center; }
  .stage-heading h1 { font-size: 19px; }
  .progress-wrap { width: 34vw; }
  .progress-copy span:first-child { display: none; }
  .progress-copy { justify-content: flex-end; }
  .board { height: min(68vh, var(--board-h, calc(100dvh - 205px))); gap: 3px; }
  .shape { width: 54%; left: 23%; }
  .board-footer { grid-template-columns: 1fr auto; min-height: 43px; }
  .tip { display: none; }
  .selection-status { padding-left: 2px; }
  .selection-status.active { padding-inline: 8px; }
  .status-label { display:none; }
  .selection-status strong { font-size: 9px; letter-spacing: .03em; }
  .combo-divider { display:none; }
  .combo-item { min-width:38px; }
  .utility-bar { align-items:flex-start; flex-direction:column; padding-block:7px; }
  .powerups { width:100%; display:grid; grid-template-columns:repeat(4,1fr); }
  .powerups button { justify-content:center; padding-inline:3px; }
  .powerups button span { display:none; }
  .combo-praise { min-height:10px; }
  .result-stats { grid-template-columns:1fr 1fr; }
  .result-stats span:nth-child(3) { border-left:0; border-top:1px solid var(--line); }
  .result-stats span:nth-child(4) { border-top:1px solid var(--line); }
}

@media (max-height: 700px) and (min-width: 701px) {
  .topbar { min-height: 62px; padding-block: 11px; }
  .game-stage { padding-block: 18px 10px; }
  .stage-heading { margin-bottom: 11px; }
  .board { height: calc(100dvh - 190px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
