@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Oxanium:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #08090d;
  --panel: rgba(17, 17, 23, .82);
  --panel-solid: #111118;
  --line: rgba(255, 255, 255, .09);
  --line-hot: rgba(255, 109, 37, .35);
  --text: #f8f2e9;
  --muted: #8b8992;
  --ember: #ff5a1f;
  --ember-bright: #ff8b33;
  --gold: #ffc45b;
  --cyan: #52d7dd;
  --cell: clamp(25px, 2.45vw, 38px);
  --radius: 18px;
  --display: "Oxanium", "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--ink); }
body { margin: 0; min-height: 100dvh; color: var(--text); font-family: var(--body); background: radial-gradient(circle at 50% 110%, #32130e 0, var(--ink) 44%); overflow-x: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: #c3bdb5; text-decoration: none; }
a:hover { color: var(--gold); }
[hidden] { display: none !important; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ambient::before { content: ""; position: absolute; inset: -35%; background-image: linear-gradient(rgba(255,255,255,.013) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.013) 1px, transparent 1px); background-size: 38px 38px; transform: perspective(600px) rotateX(58deg) translateY(34%); mask-image: linear-gradient(to bottom, transparent 5%, #000 65%, transparent 92%); }
.flare { position: absolute; width: 42vw; aspect-ratio: 1; border-radius: 50%; filter: blur(80px); opacity: .12; }
.flare-one { left: -25vw; top: 30%; background: var(--ember); }
.flare-two { right: -28vw; bottom: -14%; background: var(--gold); opacity: .08; }
.grid-horizon { position: absolute; left: 50%; bottom: -14rem; width: 50rem; height: 28rem; transform: translateX(-50%); border-radius: 50%; border: 1px solid rgba(255, 92, 31, .16); box-shadow: 0 0 80px rgba(255, 69, 16, .13), inset 0 0 80px rgba(255, 69, 16, .08); }

.app { position: relative; z-index: 1; width: min(1540px, 100%); min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; }
.topbar { min-height: 78px; padding: 14px clamp(18px, 3vw, 52px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 9, 13, .72); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 13px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.brand-copy { display: grid; }
.brand-copy strong { font: 700 20px/1 var(--display); letter-spacing: .075em; }
.brand-copy strong span { color: var(--ember-bright); }
.brand-copy small { margin-top: 6px; color: #76737b; font: 700 8px/1 var(--body); letter-spacing: .24em; }
.phoenix-mark { position: relative; width: 39px; height: 43px; display: inline-block; filter: drop-shadow(0 0 12px rgba(255, 87, 28, .45)); }
.phoenix-mark::before, .phoenix-mark::after { content: ""; position: absolute; top: 9px; width: 27px; height: 18px; border-top: 5px solid var(--ember-bright); }
.phoenix-mark::before { left: 1px; transform: rotate(32deg) skewX(-24deg); border-radius: 70% 0 0; }
.phoenix-mark::after { right: 1px; transform: rotate(-32deg) skewX(24deg); border-radius: 0 70% 0 0; }
.phoenix-mark i { position: absolute; left: 16px; top: 6px; width: 8px; height: 25px; background: linear-gradient(var(--gold), var(--ember)); clip-path: polygon(50% 0, 100% 25%, 67% 100%, 50% 79%, 33% 100%, 0 25%); }
.phoenix-mark b { position: absolute; left: 8px; bottom: 0; width: 24px; height: 13px; border-bottom: 4px solid var(--ember); border-radius: 50%; transform: scaleX(.7); }
.top-actions { display: flex; gap: 8px; }
.icon-button { min-height: 43px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; padding: 0 13px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.03); outline: none; }
.icon-button span { width: 24px; height: 24px; border: 1px solid #56545d; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display); }
.icon-button em { font-style: normal; font-size: 12px; font-weight: 700; }

.arena { flex: 1; padding: 22px clamp(16px, 3vw, 48px) 14px; display: flex; flex-direction: column; }
.command-deck { display: grid; grid-template-columns: minmax(350px, 1fr) auto minmax(350px, 1fr); align-items: center; gap: 20px; margin-bottom: 20px; }
.difficulty-group { justify-self: start; display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.022); }
.difficulty { position: relative; min-width: 86px; padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: #77757e; cursor: pointer; }
.difficulty span, .difficulty small { display: block; }
.difficulty span { font: 650 12px/1.2 var(--display); letter-spacing: .03em; }
.difficulty small { margin-top: 4px; font-size: 8px; color: #55535c; }
.difficulty.active { color: var(--text); background: linear-gradient(135deg, rgba(255, 116, 46, .2), rgba(255,255,255,.045)); box-shadow: inset 0 0 0 1px rgba(255, 121, 50, .26), 0 5px 14px rgba(0,0,0,.22); }
.difficulty.active::before { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 2px; background: var(--ember-bright); box-shadow: 0 0 8px var(--ember); }
.status-strip { display: grid; grid-template-columns: 90px auto 90px; align-items: center; gap: 14px; }
.status-unit { display: grid; }
.status-unit.align-right { text-align: right; }
.status-unit small { color: #68666f; font: 700 8px var(--body); text-transform: uppercase; letter-spacing: .18em; }
.status-unit strong { margin-top: 3px; font: 600 22px var(--display); letter-spacing: .08em; }
.rebirth-button { position: relative; min-width: 118px; height: 50px; border: 1px solid rgba(255, 110, 37, .27); border-radius: 13px; display: grid; grid-template-columns: 32px auto; place-items: center; padding: 0 15px; background: radial-gradient(circle at 30% 50%, rgba(255, 97, 25, .18), transparent 42%), #131218; cursor: pointer; overflow: hidden; }
.rebirth-button:hover { border-color: rgba(255, 127, 54, .55); box-shadow: 0 0 24px rgba(255, 79, 20, .11); }
.rebirth-button > span:last-child { font: 650 10px var(--display); letter-spacing: .06em; }
.phoenix-core { color: var(--gold); font-size: 15px; text-shadow: 0 0 12px var(--ember); animation: breathe 2.7s ease-in-out infinite; }
.assurance-row { justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 13px; }
.assurance { color: #a19da3; font-size: 9px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.assurance i { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 4px; border: 1px solid rgba(82, 215, 221, .3); border-radius: 50%; color: var(--cyan); font-style: normal; font-size: 8px; }
.assurance.muted i { color: var(--ember-bright); border-color: rgba(255, 112, 45, .3); }
.mobile-only, .mobile-stats { display: none; }

.play-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(300px, auto) minmax(170px, 1fr); align-items: center; gap: clamp(18px, 3vw, 54px); }
.side-panel { width: min(220px, 100%); padding: 18px 0; color: var(--muted); }
.left-panel { justify-self: end; }
.stats-panel { justify-self: start; }
.panel-kicker { color: var(--ember-bright); font: 700 8px var(--body); letter-spacing: .2em; text-transform: uppercase; }
.side-panel h2 { margin: 10px 0 8px; font: 600 19px/1.15 var(--display); color: var(--text); }
.side-panel p { margin: 0 0 19px; font-size: 10px; line-height: 1.65; color: #706d75; }
.insight-button { width: 100%; min-height: 59px; display: grid; grid-template-columns: 42px 1fr; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); padding: 9px 10px; text-align: left; cursor: pointer; }
.insight-button:hover:not(:disabled) { border-color: var(--line-hot); background: rgba(255, 88, 23, .05); }
.insight-button:disabled { opacity: .42; cursor: default; }
.insight-gem { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255, 163, 69, .3); border-radius: 50%; color: var(--gold); background: radial-gradient(circle, rgba(255,130,42,.24), transparent 68%); }
.insight-button strong, .insight-button small { display: block; }
.insight-button strong { font: 600 10px var(--display); color: #d7d0c8; }
.insight-button small { margin-top: 4px; font-size: 7px; color: #65636b; }
.keyboard-hints { margin-top: 21px; display: grid; gap: 7px; color: #5c5962; font-size: 8px; }
kbd { min-width: 35px; display: inline-block; margin-right: 5px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: #838089; background: rgba(255,255,255,.025); text-align: center; font: 600 7px var(--body); }
.board-stage { position: relative; min-width: 0; align-self: stretch; display: grid; place-items: center; }
.board-scroll { max-width: calc(100vw - 34px); max-height: calc(100dvh - 235px); overflow: auto; padding: 16px; scrollbar-color: rgba(255,100,35,.35) transparent; scrollbar-width: thin; overscroll-behavior: contain; }
.board { --cols: 9; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: 3px; position: relative; padding: 10px; border: 1px solid rgba(255, 121, 50, .12); border-radius: 14px; background: rgba(5, 6, 9, .62); box-shadow: 0 32px 80px rgba(0,0,0,.42), 0 0 60px rgba(255, 76, 19, .035), inset 0 0 0 5px rgba(255,255,255,.012); touch-action: manipulation; user-select: none; }
.cell { position: relative; width: var(--cell); height: var(--cell); border: 1px solid rgba(255,255,255,.06); border-radius: clamp(5px, .5vw, 8px); display: grid; place-items: center; padding: 0; color: #b9b6bd; background: linear-gradient(145deg, #1c1c23, #121218); box-shadow: inset 1px 1px 0 rgba(255,255,255,.035), 0 3px 6px rgba(0,0,0,.24); font: 700 calc(var(--cell) * .45)/1 var(--display); cursor: pointer; transition: transform .11s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.cell:hover:not(.open) { z-index: 2; transform: translateY(-1px); border-color: rgba(255, 124, 54, .3); background: linear-gradient(145deg, #25242c, #17161c); }
.cell:focus-visible { z-index: 5; outline: 2px solid var(--gold); outline-offset: 1px; }
.cell.open { border-color: rgba(255,255,255,.035); background: rgba(255,255,255,.027); box-shadow: inset 0 0 10px rgba(0,0,0,.16); cursor: default; animation: cell-open .18s ease both; }
.cell.open.zero { color: transparent; }
.cell.flag::before { content: ""; width: 42%; height: 48%; background: linear-gradient(135deg, var(--gold), var(--ember)); clip-path: polygon(20% 0, 100% 24%, 30% 60%, 30% 100%, 15% 100%, 15% 0); filter: drop-shadow(0 0 5px rgba(255, 91, 27, .55)); }
.cell.question::before { content: "?"; color: #817c84; font: 700 45% var(--display); }
.cell.mine { border-color: rgba(255, 75, 22, .5); background: radial-gradient(circle, rgba(255,180,67,.32), rgba(255,58,15,.18) 38%, #171116 74%); }
.cell.mine::before { content: "✦"; color: var(--gold); font-size: 56%; text-shadow: 0 0 9px var(--ember); }
.cell.exploded { animation: detonate .45s ease both; background: radial-gradient(circle, #ffd069, #ff4c16 40%, #3d1110 75%); }
.cell.wrong::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #ff3e3e; font-size: 80%; }
.cell.hint-safe { z-index: 3; animation: safe-pulse 1s ease-in-out 2; border-color: var(--cyan); box-shadow: 0 0 16px rgba(82,215,221,.4), inset 0 0 10px rgba(82,215,221,.14); }
.cell.hint-mine { z-index: 3; animation: fire-pulse 1s ease-in-out 2; border-color: var(--gold); }
.cell[data-number="1"] { color: #65d4ff; }
.cell[data-number="2"] { color: #74e1a3; }
.cell[data-number="3"] { color: #ffb65d; }
.cell[data-number="4"] { color: #bc9bff; }
.cell[data-number="5"] { color: #ff6f62; }
.cell[data-number="6"] { color: #6ce0db; }
.cell[data-number="7"] { color: #ded8cf; }
.cell[data-number="8"] { color: #a29ca5; }
.generation-status { position: absolute; z-index: 10; inset: 50% auto auto 50%; transform: translate(-50%, -50%); min-width: 220px; padding: 25px 24px; display: grid; place-items: center; border: 1px solid var(--line-hot); border-radius: 16px; background: rgba(10,10,15,.94); box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 30px rgba(255,75,19,.09); backdrop-filter: blur(16px); text-align: center; }
.generation-status strong { margin-top: 12px; font: 600 12px var(--display); }
.generation-status small { margin-top: 6px; color: var(--muted); font-size: 8px; }
.forge-spinner { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.08); border-top-color: var(--ember-bright); border-right-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
.stat-block { padding: 11px 0; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); }
.stat-block span { color: #66636c; font-size: 9px; }
.stat-block strong { color: #d7d0c9; font: 600 14px var(--display); }
.heat-meter { margin-top: 18px; }
.heat-label { display: flex; justify-content: space-between; color: #716e76; font-size: 8px; }
.heat-label strong { color: var(--ember-bright); font: 600 11px var(--display); }
.heat-track { height: 3px; margin-top: 8px; background: #202027; border-radius: 9px; overflow: hidden; }
.heat-track i { width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--ember), var(--gold)); box-shadow: 0 0 8px var(--ember); transition: width .35s ease; }
.footer { min-height: 45px; padding: 9px clamp(18px, 3vw, 52px); display: flex; justify-content: center; align-items: center; gap: 12px; border-top: 1px solid var(--line); color: #55525a; font-size: 8px; letter-spacing: .05em; }
.footer-line { width: 40px; height: 1px; background: var(--line); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,3,6,.78); backdrop-filter: blur(10px); }
.modal { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 30px; border: 1px solid rgba(255, 117, 47, .22); border-radius: 20px; background: radial-gradient(circle at 20% 0, rgba(255,82,22,.09), transparent 35%), #111117; box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 50px rgba(255, 70, 12, .07); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #77747b; font-size: 20px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); border-color: var(--line-hot); }
.modal-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 21px; }
.modal-heading h2, .tutorial-modal h2, .result-modal h2 { margin: 5px 0 0; font: 600 23px var(--display); }
.modal-glyph { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line-hot); border-radius: 50%; color: var(--gold); background: rgba(255,95,28,.08); }
.settings-list { border-top: 1px solid var(--line); }
.setting-row { position: relative; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-row span { display: grid; }
.setting-row strong { font-size: 11px; }
.setting-row small { margin-top: 4px; color: #6b6870; font-size: 8px; }
.setting-row input { position: absolute; opacity: 0; }
.setting-row i { flex: 0 0 auto; width: 37px; height: 21px; padding: 3px; border: 1px solid #35343b; border-radius: 99px; background: #1c1c23; transition: .2s; }
.setting-row i::after { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: #77747c; transition: .2s; }
.setting-row input:checked + i { border-color: rgba(255,107,36,.45); background: rgba(255,79,18,.17); }
.setting-row input:checked + i::after { transform: translateX(16px); background: var(--ember-bright); box-shadow: 0 0 8px rgba(255,87,25,.55); }
.privacy-choice { margin: 16px 0 4px; padding: 0; border: 0; color: #77737a; background: none; font-size: 9px; text-decoration: underline; cursor: pointer; }
.button { min-height: 44px; border-radius: 11px; padding: 0 18px; font: 650 10px var(--display); letter-spacing: .04em; cursor: pointer; }
.button.primary { border: 1px solid #ff7d37; background: linear-gradient(135deg, #ff772e, #e64318); color: #fff8ef; box-shadow: 0 8px 22px rgba(235,59,15,.2); }
.button.ghost { border: 1px solid var(--line); background: rgba(255,255,255,.02); color: #918e95; }
.button.full { width: 100%; margin-top: 18px; }
.tutorial-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.tutorial-progress i { width: 28px; height: 2px; background: #2b2a31; }
.tutorial-progress i.active { background: var(--ember-bright); box-shadow: 0 0 7px var(--ember); }
.tutorial-visual { height: 160px; margin-bottom: 23px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(circle, rgba(255,103,35,.1), transparent 52%), rgba(0,0,0,.14); }
.tutorial-visual .demo-board { display: grid; grid-template-columns: repeat(3, 35px); gap: 4px; }
.demo-cell { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #1c1b22; color: #65d4ff; font: 700 14px var(--display); }
.demo-cell.open { background: rgba(255,255,255,.03); }
.demo-cell.hot { border-color: var(--ember); box-shadow: 0 0 14px rgba(255,89,27,.28); }
.demo-cell.flag-demo { color: var(--gold); }
.tutorial-modal p { color: #77747c; font-size: 10px; line-height: 1.65; }
.tutorial-modal .lesson-tip { display: block; margin-top: 13px; padding: 10px 12px; border-left: 2px solid var(--ember-bright); background: rgba(255,91,26,.045); color: #aaa5aa; font-size: 9px; }
.modal-actions { margin-top: 24px; display: flex; justify-content: space-between; gap: 12px; }
.modal-actions .button { min-width: 100px; }
.custom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.custom-grid label { color: #77747c; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.custom-grid input { width: 100%; height: 48px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--text); background: #18181f; font: 600 15px var(--display); outline: none; }
.custom-grid input:focus { border-color: var(--line-hot); }
.form-note { color: #69666e; font-size: 8px; line-height: 1.5; }
.result-modal { text-align: center; }
.result-burst { height: 95px; display: flex; align-items: center; justify-content: center; gap: 13px; }
.result-burst b { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid var(--line-hot); border-radius: 50%; color: var(--gold); background: radial-gradient(circle, rgba(255,157,61,.2), rgba(255,61,15,.06)); box-shadow: 0 0 40px rgba(255,75,16,.2); font-size: 24px; animation: breathe 1.7s ease-in-out infinite; }
.result-burst i { width: 48px; height: 26px; border-top: 3px solid var(--ember-bright); }
.result-burst i:first-child { transform: skewY(-22deg); }
.result-burst i:last-child { transform: skewY(22deg); }
.result-modal > p { color: #77747c; font-size: 10px; }
.result-stats { margin: 22px 0 4px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; }
.result-stats div { padding: 13px; }
.result-stats div + div { border-left: 1px solid var(--line); }
.result-stats small, .result-stats strong { display: block; }
.result-stats small { color: #68656d; font-size: 8px; text-transform: uppercase; letter-spacing: .16em; }
.result-stats strong { margin-top: 5px; font: 600 18px var(--display); }
.web-ad { width: min(720px, calc(100% - 30px)); min-height: 60px; margin: 8px auto; border: 1px solid var(--line); border-radius: 10px; }
.web-ad > span { display: block; color: #4e4b53; font-size: 7px; text-align: center; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body.high-contrast { --muted: #aaa7af; --line: rgba(255,255,255,.16); }
body.high-contrast .cell { border-color: rgba(255,255,255,.13); background: #22222a; }
body.high-contrast .cell.open { background: #101116; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); filter: brightness(1.25); } }
@keyframes cell-open { from { transform: scale(.84); opacity: .45; } to { transform: scale(1); opacity: 1; } }
@keyframes detonate { 35% { transform: scale(1.22); filter: brightness(1.6); } 100% { transform: scale(1); } }
@keyframes safe-pulse { 50% { transform: scale(1.1); filter: brightness(1.35); } }
@keyframes fire-pulse { 50% { box-shadow: 0 0 22px rgba(255,123,40,.65); } }

@media (max-width: 1120px) {
  .command-deck { grid-template-columns: 1fr auto; }
  .assurance-row { grid-column: 1 / -1; justify-self: center; }
  .play-layout { grid-template-columns: 1fr minmax(300px, auto) 1fr; gap: 18px; }
  .side-panel { width: 160px; }
  .left-panel p, .keyboard-hints { display: none; }
}

@media (max-width: 820px) {
  :root { --cell: clamp(27px, 6.6vw, 36px); }
  body { overflow-y: auto; }
  .topbar { min-height: 66px; }
  .icon-button em { display: none; }
  .arena { padding-top: 14px; }
  .command-deck { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
  .difficulty-group { justify-self: auto; max-width: 100%; overflow-x: auto; }
  .difficulty { min-width: 78px; padding-inline: 10px; }
  .status-strip { order: -1; }
  .assurance-row { display: none; }
  .mobile-only { display: grid; }
  .mobile-stats { display: flex; justify-content: center; gap: 8px; margin: 0 auto 5px; padding: 0 8px; }
  .mobile-stats span { min-width: 84px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.02); color: #68666f; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-stats strong { display: block; margin-top: 2px; color: var(--text); font: 600 11px var(--display); letter-spacing: .03em; }
  .play-layout { display: block; }
  .side-panel { display: none; }
  .board-stage { min-height: 420px; }
  .board-scroll { max-height: calc(100dvh - 220px); padding: 9px; }
  .board { gap: 2px; padding: 7px; }
  .footer { display: none; }
}

@media (max-width: 480px) {
  .topbar { padding-inline: 13px; }
  .top-actions { gap: 4px; }
  .icon-button { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 6px; }
  .phoenix-mark { transform: scale(.84); margin-right: -4px; }
  .status-strip { grid-template-columns: 77px auto 77px; gap: 6px; }
  .status-unit strong { font-size: 18px; }
  .rebirth-button { min-width: 106px; height: 45px; }
  .arena { padding-inline: 5px; }
  .mobile-stats { gap: 5px; }
  .mobile-stats span { min-width: 76px; padding-inline: 7px; }
  .difficulty-group { border-left: 0; border-right: 0; border-radius: 0; }
  .board-scroll { max-width: 100vw; }
  .modal { padding: 25px 20px; }
  .custom-grid { grid-template-columns: 1fr; }
}

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