@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700;800&family=Noto+Serif+JP:wght@700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #090d19;
  --panel: rgba(19, 25, 43, 0.88);
  --line: rgba(196, 207, 233, 0.12);
  --line-strong: rgba(196, 207, 233, 0.21);
  --text: #f5f1e8;
  --muted: #929bad;
  --sente: #ffb45e;
  --sente-soft: rgba(255, 180, 94, 0.16);
  --gote: #59dfcf;
  --gote-soft: rgba(89, 223, 207, 0.14);
  --danger: #fb6b73;
  --board: #ddb575;
  --board-line: rgba(64, 40, 19, 0.58);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 20px;
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 32% 18%, rgba(43, 66, 120, 0.13), transparent 34rem),
    radial-gradient(circle at 78% 78%, rgba(37, 133, 128, 0.08), transparent 30rem), var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.11;
}
.ambient-a { top: 16%; left: -180px; background: var(--sente); }
.ambient-b { right: -170px; bottom: 5%; background: var(--gote); }

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 25, 0.78);
  backdrop-filter: blur(20px);
}
.brand { display: flex; gap: 13px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid rgba(255, 180, 94, 0.32);
  border-radius: 12px;
  color: var(--sente);
  background: var(--sente-soft);
  font-size: 20px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: 0.18em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.07em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.match-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 600;
}
.match-status i { width: 7px; height: 7px; border-radius: 50%; background: #6d7586; }
.match-status.is-live { color: #c8fff5; border-color: rgba(89, 223, 207, 0.26); background: var(--gote-soft); }
.match-status.is-live i { background: var(--gote); box-shadow: 0 0 10px var(--gote); animation: pulse 1.8s ease-in-out infinite; }

.icon-button, .secondary-button, .primary-button {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.icon-button:hover, .secondary-button:hover, .primary-button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.34); }
.icon-button { width: 38px; height: 38px; padding: 0; }
.icon-button.is-muted { color: #626a7a; }
.secondary-button { padding: 10px 15px; font-size: 12px; font-weight: 700; }
.primary-button {
  padding: 11px 18px;
  border-color: #ffd29d;
  color: #18120d;
  background: linear-gradient(135deg, #ffd29d, var(--sente));
  font-weight: 800;
  box-shadow: 0 9px 30px rgba(255, 180, 94, 0.16);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(620px, 880px) minmax(310px, 370px);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  width: min(1350px, calc(100% - 48px));
  margin: 34px auto 60px;
}
.game-column { min-width: 0; }
.player-strip {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  gap: 26px;
  align-items: center;
  min-height: 76px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(105deg, rgba(24, 31, 52, 0.92), rgba(14, 19, 34, 0.9));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.player-strip--gote { margin-bottom: 14px; }
.player-strip--sente { margin-top: 14px; }
.player-strip--sente.is-active { border-color: rgba(255, 180, 94, 0.42); box-shadow: inset 4px 0 0 var(--sente), 0 12px 32px rgba(0, 0, 0, 0.16); }
.player-strip--gote.is-active { border-color: rgba(89, 223, 207, 0.42); box-shadow: inset 4px 0 0 var(--gote), 0 12px 32px rgba(0, 0, 0, 0.16); }
.player-identity { display: flex; align-items: center; gap: 12px; }
.player-orb { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-size: 19px; font-weight: 800; }
.player-strip--sente .player-orb { color: var(--sente); background: var(--sente-soft); }
.player-strip--gote .player-orb { color: var(--gote); background: var(--gote-soft); }
.eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.19em; }
.player-identity h2, .card-heading h2 { margin: 0; }
.player-identity h2 { font-size: 17px; }
.player-identity h2 small { margin-left: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
.hand-area { display: flex; min-width: 0; align-items: center; gap: 13px; }
.hand-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.hand-pieces { display: flex; min-height: 38px; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.hand-pieces::-webkit-scrollbar { display: none; }
.hand-empty { color: #5e6678; font-size: 11px; }
.hand-piece {
  position: relative;
  display: grid;
  width: 34px;
  height: 38px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0 0 2px;
  border: 0;
  color: #372719;
  background: linear-gradient(145deg, #f2d39b, #c99a5e);
  clip-path: polygon(50% 0, 92% 18%, 86% 100%, 14% 100%, 8% 18%);
  font-family: "Noto Serif JP", serif;
  font-size: 16px;
  font-weight: 800;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.22));
  transition: transform 140ms ease, filter 140ms ease;
}
.hand-piece:hover, .hand-piece.is-selected { transform: translateY(-3px); filter: drop-shadow(0 0 7px currentColor); }
.player-strip--sente .hand-piece.is-selected { outline: 2px solid var(--sente); }
.player-strip--gote .hand-piece.is-selected { outline: 2px solid var(--gote); }
.hand-piece sup {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: #332619;
  font-family: "DM Sans", sans-serif;
  font-size: 9px;
}
.player-focus-button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, 0.025); font-size: 10px; font-weight: 700; }
.player-strip.is-active .player-focus-button { color: var(--text); border-color: var(--line-strong); }

.board-frame {
  position: relative;
  padding: clamp(18px, 3vw, 31px) clamp(18px, 3vw, 34px) clamp(22px, 3.4vw, 38px);
  border: 1px solid rgba(255, 210, 157, 0.12);
  border-radius: 22px;
  background: linear-gradient(rgba(9, 13, 25, 0.42), rgba(9, 13, 25, 0.42)), repeating-linear-gradient(45deg, #1b2131, #1b2131 3px, #171d2c 3px, #171d2c 6px);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
}
.coordinates--files { display: grid; grid-template-columns: repeat(9, 1fr); width: calc(100% - 28px); margin-bottom: 7px; }
.coordinates span { color: #7e8490; font-family: "Noto Serif JP", serif; font-size: 10px; text-align: center; }
.board-wrap { display: flex; align-items: stretch; gap: 8px; }
.board {
  position: relative;
  display: grid;
  width: calc(100% - 28px);
  aspect-ratio: 1;
  flex: 0 0 calc(100% - 28px);
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  overflow: hidden;
  border: 2px solid #a37442;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.11), transparent 24%, rgba(123, 75, 28, 0.08) 79%), var(--board);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), inset 0 0 28px rgba(105, 60, 21, 0.12);
}
.board::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: repeating-linear-gradient(8deg, transparent 0 13px, rgba(83, 50, 21, 0.018) 14px 15px), linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 12%, transparent 90%, rgba(75, 43, 14, 0.05));
  content: "";
  pointer-events: none;
}
.coordinates--ranks { display: grid; flex: 1; grid-template-rows: repeat(9, 1fr); align-items: center; }
.board-cell {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--board-line);
  border-bottom: 1px solid var(--board-line);
  color: #281a10;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.board-cell:nth-child(9n) { border-right: 0; }
.board-cell:nth-last-child(-n + 9) { border-bottom: 0; }
.board-cell::before { position: absolute; z-index: -1; inset: 4px; border-radius: 5px; background: transparent; content: ""; transition: background 100ms ease, box-shadow 100ms ease; }
.board-cell:hover::before { background: rgba(255, 255, 255, 0.11); }
.board-cell.is-selected-sente::before { background: rgba(255, 180, 94, 0.26); box-shadow: inset 0 0 0 2px var(--sente); }
.board-cell.is-selected-gote::before { background: rgba(49, 210, 194, 0.2); box-shadow: inset 0 0 0 2px var(--gote); }
.board-cell.is-legal::after { position: absolute; z-index: 3; width: 12%; min-width: 6px; aspect-ratio: 1; border-radius: 50%; background: rgba(50, 35, 23, 0.46); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); content: ""; }
.board-cell.is-legal.has-piece::after { width: auto; inset: 4px; border: 3px solid rgba(122, 25, 28, 0.52); border-radius: 6px; background: rgba(196, 33, 40, 0.08); box-shadow: none; }
.board-cell.is-last-move::before { background: rgba(255, 246, 167, 0.2); }
.board-cell.is-pending::before { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
.board-cell.is-pending::after { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #fff7c6; box-shadow: 0 0 6px white; content: ""; }
.piece {
  position: relative;
  z-index: 4;
  display: grid;
  width: 72%;
  height: 82%;
  place-items: center;
  padding-bottom: 4%;
  color: #2a1c12;
  background: linear-gradient(140deg, #f8dda8, #d5a665 88%);
  clip-path: polygon(50% 0, 94% 18%, 87% 100%, 13% 100%, 6% 18%);
  font-family: "Noto Serif JP", serif;
  font-size: clamp(17px, 3.2vw, 31px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px rgba(255, 255, 255, 0.28);
  filter: drop-shadow(0 3px 2px rgba(53, 34, 19, 0.28));
  transition: transform 130ms ease;
  pointer-events: none;
}
.board-cell:hover .piece { transform: translateY(-2px); }
.piece--gote { transform: rotate(180deg); }
.board-cell:hover .piece--gote { transform: rotate(180deg) translateY(2px); }
.piece--promoted { color: #b4242e; }
.piece.is-arriving { animation: piece-arrive 360ms cubic-bezier(0.22, 1.25, 0.5, 1); }
.selection-hint { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 11px; transition: color 160ms ease; }
.selection-hint.is-sente { color: var(--sente); }
.selection-hint.is-gote { color: var(--gote); }
.hint-icon { font-size: 16px; }

.board-overlay, .result-overlay {
  position: absolute;
  z-index: 10;
  display: grid;
  inset: 0;
  place-items: center;
  padding: 28px;
  border-radius: inherit;
  background: rgba(8, 12, 23, 0.72);
  backdrop-filter: blur(6px);
  transition: opacity 260ms ease, visibility 260ms ease;
}
.board-overlay.is-hidden, .result-overlay.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.overlay-card, .result-card { width: min(410px, 94%); padding: clamp(25px, 4vw, 40px); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 21px; text-align: center; background: rgba(19, 25, 43, 0.95); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); }
.overlay-kicker { color: var(--sente); font-size: 9px; font-weight: 800; letter-spacing: 0.24em; }
.overlay-card h1 { margin: 13px 0 14px; font-family: "Noto Serif JP", serif; font-size: clamp(32px, 6vw, 51px); letter-spacing: 0.02em; }
.overlay-card h1 em { color: var(--sente); font-style: normal; }
.overlay-card p, .result-card p { margin: 0 auto 23px; color: #aeb5c4; font-size: 12px; line-height: 1.9; }
.primary-button--large { display: flex; width: min(260px, 100%); align-items: center; justify-content: space-between; margin: 0 auto 13px; padding: 15px 18px; }
.primary-button--large b { font-size: 19px; }
.overlay-card > small { color: #737b8d; font-size: 9px; }
.result-symbol { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: var(--sente); background: var(--sente-soft); font-size: 28px; }
.result-card.is-gote .result-symbol { color: var(--gote); background: var(--gote-soft); }
.result-card h2 { margin: 10px 0 9px; font-family: "Noto Serif JP", serif; font-size: 29px; }

.control-column { display: grid; gap: 14px; }
.control-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15); backdrop-filter: blur(16px); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-heading h2 { font-size: 15px; }
.apply-note { color: #6f788b; font-size: 9px; }
.delay-control { display: grid; grid-template-columns: 41px 1fr 41px; gap: 10px; align-items: center; margin: 17px 0 13px; }
.delay-control > button { width: 41px; height: 41px; border: 1px solid var(--line); border-radius: 11px; color: #bfc5d1; background: rgba(255, 255, 255, 0.035); font-size: 18px; }
.delay-control > button:hover { border-color: rgba(255, 180, 94, 0.45); color: var(--sente); }
.delay-control label { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.delay-control input { width: 76px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 45px; font-weight: 700; line-height: 1; text-align: right; -moz-appearance: textfield; }
.delay-control input::-webkit-inner-spin-button, .delay-control input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.delay-control label span { color: var(--sente); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; }
.quick-delays { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick-delays button { padding: 7px 4px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: rgba(255, 255, 255, 0.035); font-size: 10px; }
.quick-delays button.is-selected { border-color: rgba(255, 180, 94, 0.31); color: var(--sente); background: var(--sente-soft); }
.operator-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.operator-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.operator-switch button:first-child.is-active { border-color: rgba(255, 180, 94, 0.4); color: var(--sente); background: var(--sente-soft); }
.operator-switch button:last-child.is-active { border-color: rgba(89, 223, 207, 0.4); color: var(--gote); background: var(--gote-soft); }
.operator-switch button span { font-size: 16px; }
.operator-switch button b { font-size: 12px; }
.microcopy { margin: 10px 0 0; color: #6f788a; font-size: 9px; line-height: 1.6; }
.queue-count { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--sente); background: var(--sente-soft); font-size: 11px; font-weight: 800; }
.queue-list { display: grid; max-height: 278px; gap: 8px; margin-top: 14px; overflow-y: auto; scrollbar-color: #323a4e transparent; scrollbar-width: thin; }
.empty-state { display: grid; min-height: 116px; place-items: center; align-content: center; color: #596174; text-align: center; }
.empty-state span { font-size: 25px; }
.empty-state p { margin: 6px 0 1px; color: #828b9d; font-size: 11px; }
.empty-state small { font-size: 9px; }
.queue-item { position: relative; display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; min-height: 57px; padding: 9px 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.queue-item::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; transform: scaleX(var(--progress, 1)); transform-origin: left; background: var(--item-color); content: ""; transition: transform 80ms linear; }
.queue-item--sente { --item-color: var(--sente); }
.queue-item--gote { --item-color: var(--gote); }
.queue-piece { display: grid; width: 31px; height: 34px; place-items: center; padding-bottom: 2px; color: #332216; background: linear-gradient(145deg, #f0d09a, #c89b61); clip-path: polygon(50% 0, 92% 18%, 86% 100%, 14% 100%, 8% 18%); font-family: "Noto Serif JP", serif; font-size: 15px; font-weight: 800; }
.queue-item--gote .queue-piece { transform: rotate(180deg); }
.queue-copy { min-width: 0; }
.queue-copy b, .queue-copy small { display: block; }
.queue-copy b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.queue-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.queue-time { min-width: 44px; color: var(--item-color); font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.queue-time small { margin-left: 2px; font-size: 8px; font-weight: 500; }
.log-card { min-height: 160px; }
.event-log { display: grid; max-height: 152px; gap: 9px; margin: 14px 0 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: none; }
.event-log li { display: grid; grid-template-columns: 38px 1fr; gap: 8px; color: #abb2c0; font-size: 10px; line-height: 1.45; }
.event-log time { color: #5f687a; font-size: 9px; font-variant-numeric: tabular-nums; }
.event-log .log-sente span::before, .event-log .log-gote span::before, .event-log .log-fail span::before { margin-right: 6px; }
.event-log .log-sente span::before { color: var(--sente); content: "▲"; }
.event-log .log-gote span::before { color: var(--gote); content: "△"; }
.event-log .log-fail { color: #e78e94; }
.event-log .log-fail span::before { content: "×"; }
.reset-button { padding: 12px; border: 1px solid transparent; color: #767f91; background: transparent; font-size: 10px; }
.reset-button:hover { color: var(--text); }
.reset-button span { margin-right: 5px; font-size: 14px; }

.game-dialog { width: min(440px, calc(100% - 34px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; color: var(--text); background: #171d30; box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55); }
.game-dialog::backdrop { background: rgba(4, 7, 14, 0.76); backdrop-filter: blur(5px); }
.game-dialog form { position: relative; padding: 34px; text-align: center; }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: rgba(255, 255, 255, 0.04); }
.game-dialog h2 { margin: 10px 0 8px; font-family: "Noto Serif JP", serif; font-size: 23px; }
.game-dialog p { margin: 0 0 23px; color: var(--muted); font-size: 11px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rules-dialog { width: min(680px, calc(100% - 34px)); }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 23px; text-align: left; }
.rules-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.rules-grid article > b { color: var(--sente); font-size: 9px; letter-spacing: 0.12em; }
.rules-grid h3 { margin: 7px 0 6px; font-size: 13px; }
.rules-grid p { margin: 0; font-size: 10px; line-height: 1.65; }
.rule-note { margin: 12px 0; padding: 10px; border-radius: 9px; color: #929bad; background: rgba(255, 180, 94, 0.07); font-size: 9px; }
.dialog-wide-button { width: 100%; }
.toast-region { position: fixed; z-index: 50; right: 24px; bottom: 24px; display: grid; width: min(330px, calc(100% - 48px)); gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: #dbe0e9; background: rgba(24, 31, 51, 0.96); box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3); font-size: 10px; animation: toast-in 200ms ease; }
.toast::before { color: var(--sente); content: "●"; }
.toast.is-error::before { color: var(--danger); }

@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes piece-arrive { from { transform: scale(0.45) rotate(-8deg); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .control-column { grid-template-columns: 1fr 1fr; }
  .queue-card, .log-card, .reset-button { grid-column: span 2; }
}

@media (max-width: 680px) {
  .topbar { height: 66px; padding: 0 15px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand strong { font-size: 12px; }
  .brand small, .match-status, .topbar .secondary-button { display: none; }
  .app-shell { width: calc(100% - 18px); margin-top: 12px; }
  .player-strip { grid-template-columns: auto 1fr; gap: 10px 14px; padding: 10px; }
  .player-identity { gap: 8px; }
  .player-orb { width: 36px; height: 36px; }
  .player-identity h2 { font-size: 14px; }
  .player-strip .eyebrow, .player-focus-button { display: none; }
  .hand-area { grid-column: 1 / -1; gap: 8px; }
  .hand-pieces { min-height: 33px; }
  .hand-piece { width: 30px; height: 33px; flex-basis: 30px; font-size: 14px; }
  .board-frame { padding: 12px 7px 17px 13px; border-radius: 15px; }
  .coordinates--files { width: calc(100% - 20px); }
  .board { width: calc(100% - 20px); flex-basis: calc(100% - 20px); }
  .piece { width: 79%; height: 84%; font-size: clamp(16px, 5.8vw, 25px); }
  .coordinates span { font-size: 8px; }
  .board-overlay, .result-overlay { padding: 12px; }
  .overlay-card { padding: 20px; }
  .overlay-card h1 { margin: 8px 0; font-size: 31px; }
  .overlay-card p { margin-bottom: 14px; font-size: 10px; }
  .primary-button--large { padding: 12px 15px; }
  .selection-hint { min-height: 31px; }
  .control-column { grid-template-columns: 1fr; }
  .queue-card, .log-card, .reset-button { grid-column: auto; }
  .rules-grid { grid-template-columns: 1fr; }
  .rules-dialog form, .game-dialog form { padding: 28px 20px 20px; }
}

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