:root {
  color-scheme: dark;
  --ink: #e8eee8;
  --muted: #9daaa4;
  --soft: #62726e;
  --bg: #07151b;
  --panel: rgba(15, 32, 37, 0.88);
  --panel-light: #12282d;
  --line: rgba(203, 222, 205, 0.12);
  --gold: #e7bd72;
  --gold-bright: #f5d894;
  --red: #ef7062;
  --blue: #6bc3cf;
  --green: #91c7a6;
  font-family: "DM Sans", "Noto Sans Bengali", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(6, 19, 25, .92), rgba(7, 21, 27, .96)),
    url("/assets/background.webp") center / cover fixed,
    var(--bg);
  color: var(--ink);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
[hidden] { display: none !important; }

.page-glow {
  position: fixed;
  z-index: -1;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  filter: blur(115px);
  opacity: .13;
  pointer-events: none;
}
.page-glow-one { top: -260px; left: 15%; background: #e5b563; }
.page-glow-two { right: -260px; bottom: 8%; background: #1c9b9e; opacity: .11; }

.app-shell { width: min(1190px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid rgba(231, 189, 114, .56); border-radius: 14px; transform: rotate(-8deg); background: linear-gradient(145deg, rgba(231, 189, 114, .15), rgba(231, 189, 114, .035)); box-shadow: inset 0 0 18px rgba(231, 189, 114, .1); }
.brand-mark span { color: var(--gold-bright); font: 700 16px "Space Grotesk", sans-serif; transform: rotate(8deg); }
.brand-name { font: 700 17px "Space Grotesk", sans-serif; letter-spacing: .12em; }
.brand-name > span { color: var(--gold); }
.brand-name small { display: block; margin-top: 3px; color: var(--soft); font: 600 9px "DM Sans", sans-serif; letter-spacing: .24em; }
.topbar-right { display: flex; gap: 20px; align-items: center; }
.online-pill, .connection-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(145, 199, 166, .2); border-radius: 20px; background: rgba(145, 199, 166, .06); color: #b6d6c1; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #8bd19b; box-shadow: 0 0 11px rgba(139, 209, 155, .8); }
.topbar-avatar { width: 39px; height: 39px; overflow: hidden; border: 1px solid rgba(231, 189, 114, .3); border-radius: 50%; background: #183036; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.home-screen { padding-top: 46px; }
.hero { position: relative; min-height: 280px; display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; overflow: hidden; }
.hero-copy { position: relative; z-index: 1; padding: 8px 0 22px 10px; }
.eyebrow { margin: 0; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.eyebrow-line { display: inline-block; width: 24px; height: 1px; margin: 0 9px 3px 0; background: var(--gold); }
h1, h2, p { margin-top: 0; }
.hero h1 { margin: 16px 0 12px; font: 600 clamp(38px, 5.2vw, 61px)/.99 "Space Grotesk", sans-serif; letter-spacing: -.055em; }
.hero h1 span { color: var(--gold-bright); }
.hero-intro { max-width: 370px; margin-bottom: 22px; color: #abb9b3; font-size: 13px; line-height: 1.65; }
.hero-stats { display: flex; gap: 15px; align-items: center; color: #8c9c96; font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.hero-stats strong { margin-right: 4px; color: var(--ink); font: 600 12px "Space Grotesk", sans-serif; }
.hero-stats i { width: 3px; height: 3px; border-radius: 50%; background: #61736e; }
.hero-art { position: relative; height: 267px; display: flex; align-items: center; justify-content: center; }
.art-orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(231, 189, 114, .17); border-radius: 50%; transform: translate(-50%, -50%) rotate(-14deg); }
.orbit-outer { width: 405px; height: 158px; }
.orbit-inner { width: 319px; height: 114px; transform: translate(-50%, -50%) rotate(18deg); border-color: rgba(107, 195, 207, .16); }
.art-halo { position: absolute; width: 235px; height: 160px; border-radius: 50%; background: rgba(43, 107, 105, .27); filter: blur(41px); }
.hero-avatar { position: absolute; z-index: 1; width: 132px; height: 132px; object-fit: cover; border: 3px solid rgba(231, 189, 114, .61); border-radius: 50%; background: #1d3133; box-shadow: 0 14px 40px rgba(0, 0, 0, .34), 0 0 27px rgba(231, 189, 114, .12); }
.hero-avatar-left { left: calc(50% - 124px); top: 59px; }
.hero-avatar-right { right: calc(50% - 124px); bottom: 39px; border-color: rgba(107, 195, 207, .7); }
.hero-versus { position: absolute; z-index: 2; top: 49%; left: 50%; display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid rgba(231, 189, 114, .43); border-radius: 50%; background: #102329; color: var(--gold-bright); font: 700 12px "Space Grotesk", sans-serif; transform: translate(-50%, -50%); }
.hero-art-label { position: absolute; right: 4%; bottom: 5px; display: flex; gap: 8px; align-items: center; color: #82948d; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.hero-art-label .status-dot { width: 5px; height: 5px; }

.play-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(275px, .82fr); gap: 18px; margin-top: 9px; }
.play-panel, .rules-panel { min-width: 0; padding: 25px 27px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(19, 41, 46, .92), rgba(11, 27, 33, .95)); box-shadow: 0 18px 65px rgba(0, 0, 0, .15); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.section-heading h2 { margin: 5px 0 0; font: 600 23px "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.section-number { color: #71817a; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.name-field { display: block; margin-bottom: 12px; }
.field-label { display: block; margin-bottom: 7px; color: #8b9b94; font-size: 8px; font-weight: 800; letter-spacing: .17em; }
.input-wrap { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid rgba(203, 222, 205, .12); border-radius: 10px; background: rgba(3, 14, 18, .38); }
.input-avatar { width: 25px; height: 25px; overflow: hidden; border-radius: 50%; background: #1a3033; }
.input-avatar img { width: 100%; height: 100%; object-fit: cover; }
.input-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.input-wrap input::placeholder { color: #6c7d76; }
.field-edit { color: var(--gold); font-size: 13px; }
.primary-action, .secondary-action { width: 100%; min-height: 57px; display: flex; align-items: center; gap: 13px; padding: 9px 14px; border: 1px solid rgba(231, 189, 114, .34); border-radius: 11px; background: linear-gradient(100deg, rgba(160, 112, 47, .24), rgba(84, 69, 43, .14)); color: var(--ink); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.primary-action:hover, .secondary-action:hover, .join-button:hover { transform: translateY(-2px); border-color: rgba(245, 216, 148, .75); }
.action-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(231, 189, 114, .34); border-radius: 10px; background: rgba(231, 189, 114, .1); color: var(--gold-bright); font: 600 20px "Space Grotesk", sans-serif; }
.action-copy { min-width: 0; display: grid; gap: 3px; }
.action-copy strong { font-size: 12px; font-weight: 700; }
.action-copy small { color: #8e9d96; font-size: 10px; }
.action-arrow { margin-left: auto; color: var(--gold-bright); font-size: 19px; }
.join-room { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 12px 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(4, 17, 21, .29); }
.join-label { display: flex; gap: 10px; align-items: center; }
.join-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(107, 195, 207, .11); color: var(--blue); font-size: 21px; }
.join-label strong, .join-label small { display: block; }
.join-label strong { font-size: 10px; }
.join-label small { margin-top: 3px; color: #81928b; font-size: 9px; }
.join-controls { display: flex; gap: 7px; }
.join-controls input { width: 105px; padding: 9px 7px; border: 1px solid rgba(203, 222, 205, .13); border-radius: 7px; background: rgba(3, 12, 16, .55); color: var(--gold-bright); text-align: center; font: 700 10px "Space Grotesk", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.join-controls input::placeholder { color: #6c7d76; }
.join-button { min-width: 79px; padding: 0 10px; border: 1px solid rgba(107, 195, 207, .26); border-radius: 7px; background: rgba(107, 195, 207, .12); color: #a4dce0; font-size: 9px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: .18s ease; }
.join-button span { margin-left: 5px; font-size: 13px; }
.secondary-action { min-height: 53px; border-color: rgba(203, 222, 205, .11); background: rgba(8, 22, 27, .47); }
.secondary-action .action-icon { border-color: rgba(203, 222, 205, .14); background: rgba(203, 222, 205, .055); color: #b5c5bb; }
.secondary-action .action-arrow { color: #93a69b; }
.local-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(203, 222, 205, .13); border-radius: 10px; color: #aabdb2; font-size: 18px; }
.notice { min-height: 14px; margin: 8px 1px 0; color: #f3a89a; font-size: 10px; }

.rules-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; }
.rules-panel::after { position: absolute; right: -38px; top: -56px; width: 160px; height: 160px; border: 1px solid rgba(231, 189, 114, .09); border-radius: 50%; content: ""; box-shadow: 0 0 0 23px rgba(231, 189, 114, .025), 0 0 0 47px rgba(231, 189, 114, .02); }
.rules-icon { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 11px; border: 1px solid rgba(231, 189, 114, .24); border-radius: 10px; background: rgba(231, 189, 114, .08); color: var(--gold); }
.rules-top h2 { margin: 10px 0 19px; font: 600 22px/1.22 "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.rules-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rules-list li { display: flex; gap: 12px; align-items: flex-start; }
.rules-list li > span { padding-top: 1px; color: var(--gold); font: 600 10px "Space Grotesk", sans-serif; }
.rules-list p { margin: 0; }
.rules-list strong, .rules-list small { display: block; }
.rules-list strong { font-size: 10px; }
.rules-list small { margin-top: 4px; color: #8b9b94; font-size: 9px; line-height: 1.45; }
.rules-foot { display: flex; gap: 10px; align-items: center; margin-top: 21px; color: #87978f; font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.rules-foot-line { height: 1px; flex: 1; background: var(--line); }
.home-footer { display: flex; justify-content: space-between; gap: 15px; padding: 18px 2px 23px; color: #65756e; font-size: 8px; font-weight: 700; letter-spacing: .13em; }

.match-screen { padding: 27px 0 50px; }
.match-heading { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 70px; margin-bottom: 17px; }
.back-button { justify-self: start; padding: 8px 10px 8px 0; border: 0; background: none; color: #94a49c; font-size: 9px; font-weight: 800; letter-spacing: .13em; cursor: pointer; }
.back-button span { margin-right: 7px; color: var(--gold); font-size: 17px; vertical-align: -1px; }
.match-title-wrap { text-align: center; }
.match-title-wrap h1 { margin: 4px 0 0; font: 600 24px "Space Grotesk", sans-serif; letter-spacing: -.05em; }
.connection-pill { justify-self: end; color: #b6d6c1; }
.connection-pill.offline { border-color: rgba(239, 112, 98, .25); background: rgba(239, 112, 98, .08); color: #e49a8f; }
.connection-pill.offline .status-dot { background: var(--red); box-shadow: none; }
.room-share { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto 15px; padding: 11px 15px; border: 1px solid rgba(231, 189, 114, .2); border-radius: 11px; background: rgba(231, 189, 114, .055); }
.share-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(231, 189, 114, .2); border-radius: 9px; color: var(--gold); font-size: 18px; }
.share-copy { display: grid; gap: 3px; }
.share-copy small { color: #8c9b92; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.share-copy strong { color: var(--gold-bright); font: 700 13px "Space Grotesk", sans-serif; letter-spacing: .16em; }
.room-share button { margin-left: auto; padding: 8px 10px; border: 1px solid rgba(231, 189, 114, .25); border-radius: 7px; background: rgba(231, 189, 114, .08); color: var(--gold-bright); font-size: 8px; font-weight: 800; letter-spacing: .09em; cursor: pointer; }
.room-share button span { margin-left: 5px; }
.match-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 17px; align-items: start; }
.arena-panel { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(18, 39, 43, .94), rgba(10, 25, 30, .95)); }
.players-row { display: grid; grid-template-columns: 1fr 46px 1fr; gap: 7px; align-items: center; margin-bottom: 15px; }
.player-card { min-width: 0; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid rgba(239, 112, 98, .18); border-radius: 11px; background: rgba(239, 112, 98, .055); transition: border-color .2s ease, background .2s ease; }
.player-blue { border-color: rgba(107, 195, 207, .17); background: rgba(107, 195, 207, .05); }
.player-card.active { border-color: rgba(245, 216, 148, .56); background: rgba(231, 189, 114, .09); box-shadow: inset 0 0 14px rgba(231, 189, 114, .035); }
.player-avatar { width: 39px; height: 39px; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(239, 112, 98, .35); border-radius: 50%; background: #1d3133; }
.player-blue .player-avatar { border-color: rgba(107, 195, 207, .38); }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-detail { min-width: 0; display: grid; gap: 3px; }
.player-side { color: #df8b7e; font-size: 7px; font-weight: 800; letter-spacing: .11em; }
.player-blue .player-side { color: #86cbd2; }
.player-detail strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.player-detail small { color: #84938c; font-size: 8px; }
.turn-indicator { width: 6px; height: 6px; flex: 0 0 auto; margin-left: auto; border-radius: 50%; background: transparent; }
.player-card.active .turn-indicator { background: var(--gold-bright); box-shadow: 0 0 11px rgba(245, 216, 148, .8); }
.versus-divider { display: grid; place-items: center; }
.versus-divider span { color: #64746d; font: 700 9px "Space Grotesk", sans-serif; }
.board-frame { width: min(100%, 468px); margin: 0 auto; padding: 12px 16px 10px; border: 1px solid rgba(231, 189, 114, .21); border-radius: 15px; background: linear-gradient(145deg, #6e5031 0%, #3b2e23 10%, #27352f 11%, #1b2b2b 90%, #503b29 91%, #765837 100%); box-shadow: 0 13px 35px rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(231, 189, 114, .06); }
.board-caption, .board-foot { display: flex; align-items: center; justify-content: space-between; color: #b9aa89; font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.board-caption { height: 18px; padding: 0 4px 6px; }
.board-caption i { padding: 0 4px; color: var(--gold); font-style: normal; }
.game-board { position: relative; width: 100%; aspect-ratio: 360 / 700; overflow: hidden; border: 1px solid rgba(228, 194, 129, .23); border-radius: 9px; background: radial-gradient(ellipse at 50% 40%, rgba(166, 129, 70, .12), transparent 65%), repeating-linear-gradient(2deg, rgba(194, 148, 87, .025) 0 2px, transparent 2px 8px), #132622; box-shadow: inset 0 0 30px rgba(0, 0, 0, .36); }
.game-board svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.board-edge { stroke: rgba(228, 193, 128, .56); stroke-width: 2.2; stroke-linecap: round; }
.point { position: absolute; z-index: 1; width: clamp(29px, 6vw, 43px); height: clamp(29px, 6vw, 43px); display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.point::before { width: 7px; height: 7px; border: 1px solid rgba(246, 220, 163, .9); border-radius: 50%; background: #ae8d57; box-shadow: 0 0 8px rgba(231, 189, 114, .45); content: ""; transition: transform .15s ease, opacity .15s ease; }
.point:hover::before, .point.target::before { transform: scale(1.7); }
.point.target::before { background: var(--gold-bright); }
.point.selected { background: rgba(245, 216, 148, .15); box-shadow: 0 0 0 1px rgba(245, 216, 148, .58), 0 0 18px rgba(245, 216, 148, .28); }
.point.selected::before { opacity: 0; }
.point.last-move { background: rgba(231, 189, 114, .1); }
.point:disabled { cursor: default; }
.piece { width: 82%; height: 82%; display: block; border: 2px solid rgba(255, 255, 255, .33); border-radius: 50%; box-shadow: 0 3px 7px rgba(0, 0, 0, .45), inset 0 -4px 6px rgba(0, 0, 0, .25), inset 0 2px 4px rgba(255, 255, 255, .25); }
.piece.red { background: radial-gradient(circle at 34% 27%, #ffb49a, #e16858 44%, #9f332a 100%); }
.piece.blue { background: radial-gradient(circle at 34% 27%, #c3f5ed, #65bdc5 45%, #246a78 100%); }
.board-foot { justify-content: center; gap: 10px; height: 22px; padding-top: 6px; color: #95886e; }
.board-foot-gem { color: var(--gold); font-size: 10px; }
.match-status { min-height: 38px; display: flex; justify-content: center; align-items: center; gap: 8px; margin: 13px 0 0; padding: 8px; border: 1px solid rgba(145, 199, 166, .12); border-radius: 9px; background: rgba(145, 199, 166, .04); color: #b6d3bf; font-size: 10px; font-weight: 600; }
.status-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(145, 199, 166, .7); }
.match-notice { text-align: center; }
.match-aside { display: grid; gap: 11px; }
.aside-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(18, 39, 43, .9), rgba(10, 25, 30, .95)); }
.turn-card { text-align: center; }
.turn-card .eyebrow { text-align: left; }
.turn-emblem { width: 74px; height: 74px; display: grid; place-items: center; margin: 13px auto 10px; border: 1px solid rgba(231, 189, 114, .23); border-radius: 50%; background: radial-gradient(circle, rgba(231, 189, 114, .11), rgba(231, 189, 114, .025) 67%); }
.turn-emblem span { width: 30px; height: 30px; border: 2px solid rgba(255, 255, 255, .32); border-radius: 50%; background: radial-gradient(circle at 35% 25%, #f7cc96, #d06a56 53%, #90362f); box-shadow: 0 4px 12px rgba(0, 0, 0, .3), inset 0 -3px 5px rgba(0, 0, 0, .22); }
.turn-emblem.blue span { background: radial-gradient(circle at 35% 25%, #d2f3e8, #64bdc4 53%, #266c79); }
.turn-card h2 { margin: 0 0 5px; font: 600 16px "Space Grotesk", sans-serif; }
.turn-card > p:not(.eyebrow) { margin: 0 auto; max-width: 190px; color: #8e9d96; font-size: 9px; line-height: 1.5; }
.turn-progress { height: 3px; overflow: hidden; margin: 14px 0 8px; border-radius: 3px; background: rgba(231, 189, 114, .12); }
.turn-progress span { display: block; width: 50%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #bd8c4e, var(--gold-bright)); transition: width .3s ease; }
.turn-card > small { color: #788880; font-size: 7px; font-weight: 700; letter-spacing: .14em; }
.capture-card .eyebrow { text-align: left; }
.capture-score { display: flex; justify-content: center; gap: 22px; align-items: center; margin-top: 11px; font: 600 31px "Space Grotesk", sans-serif; }
.capture-score span:first-child { color: var(--red); }
.capture-score span:last-child { color: var(--blue); }
.capture-score i { color: #62746d; font-size: 16px; font-style: normal; }
.capture-labels { display: flex; justify-content: space-between; padding: 0 25px; color: #87978f; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.capture-note { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid var(--line); color: #8d9c95; font-size: 9px; line-height: 1.5; }
.aside-actions { display: grid; gap: 9px; }
.aside-tip { display: flex; gap: 8px; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: #8e9d96; font-size: 9px; line-height: 1.5; }
.aside-tip span { color: var(--gold); }
.rematch-action { min-height: 52px; }
.rematch-action .action-icon { width: 30px; height: 30px; }
.rematch-action .action-copy strong { font-size: 10px; }
.rematch-action .action-copy small { font-size: 8px; }
.restart-action { min-height: 48px; }

.toast { position: fixed; z-index: 5; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid rgba(231, 189, 114, .3); border-radius: 10px; background: #173036; color: var(--ink); box-shadow: 0 10px 35px rgba(0, 0, 0, .35); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (min-width: 1200px) {
  .home-screen { padding-top: 54px; }
  .hero { min-height: 305px; }
  .hero-art { height: 294px; }
  .home-footer { padding-top: 21px; }
}

@media (max-width: 850px) {
  .app-shell { width: min(720px, calc(100% - 36px)); }
  .hero { grid-template-columns: 1fr .9fr; min-height: 240px; }
  .hero h1 { font-size: 46px; }
  .hero-art { transform: scale(.88); transform-origin: center; }
  .play-layout { grid-template-columns: minmax(0, 1.35fr) minmax(235px, .8fr); gap: 12px; }
  .play-panel, .rules-panel { padding: 20px; }
  .join-room { align-items: flex-start; flex-direction: column; gap: 10px; }
  .join-controls { width: 100%; }
  .join-controls input { flex: 1; }
  .match-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 11px; }
  .arena-panel { padding: 11px; }
  .player-card { gap: 7px; padding: 8px 7px; }
  .player-avatar { width: 33px; height: 33px; }
  .board-frame { padding-right: 12px; padding-left: 12px; }
}

@media (max-width: 620px) {
  .app-shell { width: calc(100% - 28px); }
  .topbar { height: 73px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 15px; }
  .topbar-right { gap: 11px; }
  .online-pill { padding: 7px 8px; font-size: 7px; }
  .topbar-avatar { width: 34px; height: 34px; }
  .home-screen { padding-top: 18px; }
  .hero { min-height: 194px; grid-template-columns: 1fr .6fr; }
  .hero-copy { padding-left: 2px; }
  .hero h1 { margin: 11px 0 9px; font-size: clamp(35px, 8.5vw, 46px); }
  .hero-intro { max-width: 270px; margin-bottom: 13px; font-size: 11px; }
  .hero-stats { gap: 7px; font-size: 6px; letter-spacing: .07em; }
  .hero-stats strong { font-size: 10px; }
  .hero-art { position: absolute; right: -48px; width: 220px; opacity: .65; transform: scale(.7); }
  .hero-avatar { width: 116px; height: 116px; }
  .hero-avatar-left { left: calc(50% - 112px); top: 39px; }
  .hero-avatar-right { right: calc(50% - 112px); bottom: 32px; }
  .hero-art-label { display: none; }
  .play-layout { grid-template-columns: 1fr; margin-top: 5px; }
  .play-panel { padding: 19px 16px 11px; }
  .rules-panel { padding: 17px 18px; }
  .rules-top h2 { margin-bottom: 15px; font-size: 20px; }
  .rules-list { grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
  .rules-list li { gap: 6px; }
  .rules-list small { font-size: 8px; }
  .rules-list strong { font-size: 9px; }
  .rules-foot { margin-top: 14px; }
  .home-footer { flex-wrap: wrap; justify-content: center; padding: 16px 0 20px; font-size: 7px; }
  .home-footer span:nth-child(2) { order: 1; width: 100%; text-align: center; }
  .match-screen { padding-top: 15px; }
  .match-heading { grid-template-columns: 1fr auto 1fr; min-height: 55px; margin-bottom: 9px; }
  .match-title-wrap h1 { font-size: 19px; }
  .match-title-wrap .eyebrow { font-size: 7px; }
  .connection-pill { gap: 5px; padding: 7px; font-size: 7px; letter-spacing: .06em; }
  .back-button { font-size: 8px; }
  .room-share { margin-bottom: 10px; padding: 9px 11px; }
  .room-share button { padding: 7px; font-size: 7px; }
  .match-layout { grid-template-columns: 1fr; }
  .players-row { grid-template-columns: 1fr 32px 1fr; gap: 3px; margin-bottom: 10px; }
  .player-card { gap: 6px; padding: 7px 6px; }
  .player-avatar { width: 31px; height: 31px; }
  .player-side { font-size: 6px; letter-spacing: .07em; }
  .player-detail strong { font-size: 10px; }
  .player-detail small { font-size: 7px; }
  .versus-divider span { font-size: 8px; }
  .board-frame { width: min(100%, 374px); padding: 9px 11px 7px; }
  .board-caption, .board-foot { font-size: 6px; }
  .game-board { max-height: 610px; }
  .point { width: clamp(27px, 7.7vw, 38px); height: clamp(27px, 7.7vw, 38px); }
  .point::before { width: 6px; height: 6px; }
  .match-status { margin-top: 10px; }
  .match-aside { grid-template-columns: 1fr 1fr; }
  .turn-card { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
  .aside-card { padding: 13px; }
  .turn-emblem { width: 60px; height: 60px; margin: 10px auto 8px; }
  .turn-emblem span { width: 25px; height: 25px; }
  .turn-card h2 { font-size: 14px; }
  .capture-score { gap: 13px; font-size: 27px; }
  .capture-labels { padding: 0 12px; }
  .capture-note { margin-top: 9px; padding-top: 8px; font-size: 8px; }
  .aside-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: start; }
  .aside-tip { min-height: 48px; align-items: center; font-size: 8px; }
  .toast { right: 14px; bottom: 14px; }
}

@media (max-width: 370px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { right: -81px; opacity: .4; }
  .hero-stats { gap: 5px; }
  .section-heading h2 { font-size: 20px; }
  .join-label strong { font-size: 9px; }
  .join-controls input { width: 80px; }
  .match-aside { grid-template-columns: 1fr; }
  .turn-card { grid-row: auto; }
  .capture-card { text-align: center; }
  .capture-card .eyebrow { text-align: center; }
  .aside-actions { grid-column: auto; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
