:root {
  --paper: #f5f2e9;
  --ink: #24332f;
  --muted: #687970;
  --line: #d9dfd3;
  --green: #375e4c;
  --lime: #d9edb6;
  --violet: #7953af;
  --teal: #188475;
  --orange: #aa4c23;
  --blue: #275d94;
  --shadow: 0 12px 35px #26342c09;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #bd864b;
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
svg {
  display: block;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100svh;
}
.sidebar {
  background: #202c2b;
  color: #eef1e4;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100svh;
}
.logo {
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -1.1px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo img {
  width: 34px;
  height: 34px;
}
.logo small {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 1px;
  display: block;
}
.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 52px;
}
.navlink {
  border-radius: 12px;
  padding: 13px 15px;
  color: #bcc8bf;
  min-height: 48px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.navlink span {
  font-size: 21px;
  min-width: 23px;
}
.navlink.active {
  background: #d9edb6;
  color: #202c2b;
  font-weight: 650;
}
.sidebar .side-foot {
  margin-top: auto;
  font-size: 12px;
  color: #a5b9ab;
  border-top: 1px solid #ffffff20;
  padding-top: 20px;
}
.side-foot strong {
  color: #eef1e4;
  display: block;
}
.main {
  padding: 0 44px 40px;
  min-width: 0;
}
.topbar {
  min-height: 94px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 36px;
}
.topbar .crumb {
  font-size: 13px;
  color: var(--muted);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: #e6eadf;
  padding: 7px 13px;
  border-radius: 24px;
  font-size: 13px;
  min-height: 44px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #d9edb6;
  color: #37513f;
  font-weight: 750;
}
.content {
  max-width: 1120px;
  margin: auto;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 35px;
  align-items: center;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(36px, 4.1vw, 64px);
  line-height: 1.06;
  letter-spacing: -2.7px;
  font-weight: 650;
  margin: 15px 0 22px;
}
.hero p {
  max-width: 440px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.hero-art {
  background: #e5e9dc;
  border-radius: 28px;
  padding: 32px;
  transform: rotate(-3deg);
  max-width: 365px;
  justify-self: center;
  position: relative;
}
.mini-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 250px;
  aspect-ratio: 1;
}
.mini-board i {
  border-radius: 12px;
  background: #f1cdae;
  border-bottom: 5px solid #c6a282;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-style: normal;
  font-size: 34px;
  box-shadow: 0 5px 10px #24332f10;
}
.mini-board i.b {
  background: #d1e2ec;
  border-color: #9db7ca;
  color: var(--blue);
}
.mini-board i.e {
  background: #d8dfcd;
  border: 1px dashed #acb9a3;
  box-shadow: inset 0 2px 4px #24332f08;
}
.hero-art .art-note {
  position: absolute;
  bottom: 8px;
  right: -15px;
  background: #202c2b;
  color: white;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  transform: rotate(6deg);
  box-shadow: 0 7px 20px #24332f30;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.button {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: #f7f6eb;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.button.lime {
  background: var(--lime);
  color: var(--ink);
}
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #cbd4c4;
}
.button.danger {
  background: #a34e38;
}
.button.small {
  min-height: 40px;
  font-size: 12px;
  padding: 8px 13px;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 17px;
}
.section-title h2 {
  font-size: 25px;
  letter-spacing: -0.8px;
  margin: 0;
}
.section-title p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card {
  border: 1px solid var(--line);
  background: #fbfaf5;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.mode-card {
  position: relative;
  overflow: hidden;
}
.mode-card .tag {
  font-size: 10px;
  letter-spacing: 1px;
  background: #e8ecd9;
  padding: 5px 8px;
  border-radius: 5px;
  display: inline-block;
}
.mode-card h3 {
  font-size: 29px;
  margin: 14px 0 5px;
  letter-spacing: -1px;
}
.mode-card p {
  font-size: 14px;
  color: var(--muted);
  max-width: 350px;
  min-height: 64px;
}
.mode-card .mode-glyph {
  position: absolute;
  right: 22px;
  top: 22px;
  font-size: 31px;
  letter-spacing: 5px;
  color: #a46942;
  opacity: 0.8;
}
.mode-card .button {
  width: 100%;
  margin-top: 8px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.fact {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 12px;
  color: var(--muted);
}
.fact b {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 3px;
}
.page-head {
  margin-bottom: 25px;
}
.page-head h1 {
  font-size: 38px;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin: 8px 0 13px;
}
.page-head p {
  color: var(--muted);
  max-width: 650px;
}
.tabs {
  display: flex;
  gap: 6px;
  background: #e6e9dd;
  padding: 5px;
  border-radius: 12px;
  margin: 20px 0;
  max-width: 440px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 550;
  font-size: 14px;
}
.tabs button.active {
  background: #fffdf6;
  box-shadow: 0 2px 5px #24332f12;
}
.arena-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.arena-grid h2 {
  margin: 10px 0;
}
.arena-grid p {
  font-size: 14px;
  color: var(--muted);
}
.match-options {
  display: grid;
  gap: 12px;
}
.option {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
  background: #fffdf8;
  text-align: left;
  width: 100%;
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 96px;
}
.option .symbol {
  background: #e6eddc;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
}
.option strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}
.option small {
  color: var(--muted);
  font-size: 13px;
}
.room-form {
  display: flex;
  gap: 8px;
}
.room-form input {
  width: 100%;
  min-width: 0;
  letter-spacing: 1px;
}
.input,
form input {
  border: 1px solid #cbd4c4;
  background: #fffdf8;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 48px;
  color: var(--ink);
}
form label {
  display: block;
  font-size: 13px;
  margin: 16px 0 7px;
}
form input {
  width: 100%;
}
form .button {
  width: 100%;
  margin-top: 22px;
}
.form-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.error {
  color: #a3402a;
  font-size: 13px;
  min-height: 20px;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .big {
  font-size: 44px;
}
.empty-state h3 {
  color: var(--ink);
  font-size: 21px;
}
.queue-state {
  text-align: center;
  padding: 35px;
}
.pulse {
  height: 62px;
  width: 62px;
  border: 3px solid #c3d2b1;
  border-top-color: #375e4c;
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
  margin: 10px auto 22px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
th {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  background: #e9ede1;
}
th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
.me-row {
  background: #edf2e2;
}
.rank {
  font-size: 18px;
  font-weight: 700;
}
.positive {
  color: #267454;
}
.negative {
  color: #a34e38;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}
.stat-grid .card {
  padding: 18px;
}
.stat-grid strong {
  font-size: 30px;
  display: block;
}
.stat-grid span {
  font-size: 12px;
  color: var(--muted);
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.history-item strong {
  font-size: 14px;
}
.history-item small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  padding: 32px;
  width: calc(100% - 32px);
  max-width: 430px;
  max-height: 90svh;
  overflow: auto;
  box-shadow: 0 30px 120px #0004;
}
dialog::backdrop {
  background: #142823a1;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 28px;
  letter-spacing: -1px;
  line-height: 1.2;
  margin: 10px 0;
}
dialog p {
  font-size: 14px;
  color: var(--muted);
}
.dialog-close {
  position: absolute;
  right: 15px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 27px;
  min-width: 40px;
  min-height: 40px;
}
.text-button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  min-height: 44px;
  font-size: 13px;
}
.onboard-art {
  height: 130px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 64px;
  gap: 23px;
  border-radius: 15px;
  background: #e3e9da;
  margin: 12px 0 25px;
}
.dots {
  display: flex;
  gap: 6px;
  margin: 20px 0;
}
.dots i {
  width: 8px;
  height: 8px;
  background: #c9d3be;
  border-radius: 50%;
}
.dots i.active {
  background: #375e4c;
  width: 24px;
  border-radius: 6px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #253c32;
  color: #fffdf5;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 13px;
  z-index: 100;
  font-size: 14px;
  box-shadow: 0 8px 35px #0003;
  transition: transform 0.2s;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
}
.connection {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.connection i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a9670;
}
.connection.off i {
  background: #c17e3e;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, 520px) minmax(220px, 1fr);
  gap: 28px;
  align-items: start;
}
.board-card {
  padding: 20px;
  background: #e5e9dc;
  border: 1px solid #d3dcc9;
  border-radius: 22px;
}
.board {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  aspect-ratio: 1;
  perspective: 800px;
}
.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid #ffffffb8;
  border-bottom: 4px solid #c79e7c;
  border-radius: 12px;
  background: #f5d8bd;
  color: var(--orange);
  box-shadow:
    0 3px 0 #c79e7c,
    0 5px 7px #263e341c;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  padding: 0;
  transform: translateY(-2px);
}
.tile[data-kind="1"] {
  background: #d4e5f3;
  color: var(--blue);
  border-bottom-color: #94b0c6;
  box-shadow:
    0 3px 0 #94b0c6,
    0 5px 7px #263e341c;
}
.tile > svg {
  width: 43%;
  height: 43%;
  pointer-events: none;
}
.tile.empty {
  background: #d9dfcf;
  color: #7d8e72;
  border: 1px dashed #acbaa1;
  box-shadow: inset 0 2px 5px #24332f0a;
  font-size: 26px;
  transform: none;
}
.tile:disabled {
  opacity: 1;
}
.tile[data-owner="0"] {
  outline: 3px solid var(--violet);
  outline-offset: -3px;
}
.tile[data-owner="1"] {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
}
.owner {
  position: absolute;
  top: 4px;
  left: 4px;
  color: white;
  background: var(--violet);
  font-size: 11px;
  line-height: 17px;
  min-width: 17px;
  border-radius: 4px;
  text-align: center;
  font-weight: 700;
  pointer-events: none;
}
.tile[data-owner="1"] .owner {
  background: var(--teal);
}
.tile.selected {
  box-shadow:
    0 0 0 3px #283e2d,
    0 5px 0 #a5af8f;
  z-index: 2;
}
.tile.anchor:after {
  content: "◆";
  position: absolute;
  bottom: 0;
  right: 5px;
  color: #866433;
  font-size: 16px;
}
.tile.flip {
  outline: 3px solid #b98a37;
  outline-offset: 0;
  z-index: 1;
}
.tile.removed:after {
  content: "×";
  position: absolute;
  top: -1px;
  right: 5px;
  color: #3a4c37;
  font-weight: 800;
  font-size: 21px;
}
.tile .arrow {
  font-size: 16px;
  color: #986f2c;
  padding: 0 3px;
}
.tile.flip svg {
  width: 28%;
  height: 28%;
}
.tile svg[data-kind="0"] {
  color: var(--orange);
}
.tile svg[data-kind="1"] {
  color: var(--blue);
}
.board.own {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.board.own .tile {
  border-radius: 7px;
  border-bottom-width: 3px;
}
.board.own .tile > svg {
  width: 54%;
  height: 54%;
}
.board.own .owner {
  font-size: 8px;
  line-height: 11px;
  min-width: 11px;
  top: 1px;
  left: 1px;
  border-radius: 2px;
}
.board.own .tile.flip svg {
  width: 30%;
  height: 30%;
}
.board.own .tile .arrow {
  font-size: 9px;
  padding: 0;
}
.board.own .tile.empty {
  border: 0;
  font-size: 0;
}
.board.own .tile.removed:after {
  font-size: 14px;
  right: 2px;
}
.game-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 17px;
}
.score-box {
  border: 2px solid #d1c7e3;
  background: #eee8f4;
  padding: 12px;
  border-radius: 12px;
}
.score-box.side-1 {
  border-color: #b6d5ce;
  background: #e0ece5;
}
.score-box.active {
  border-color: var(--violet);
}
.score-box.side-1.active {
  border-color: var(--teal);
}
.score-box .score-name {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 7px;
}
.score-box b {
  font-size: 29px;
  line-height: 1.1;
}
.score-box small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.game-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 1px 12px;
  font-size: 13px;
}
.game-side h2 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 10px 0;
}
.game-side p {
  font-size: 14px;
  color: var(--muted);
}
.face-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.face-picker button {
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #f3d6bc;
  color: var(--orange);
  font-size: 14px;
}
.face-picker button + button {
  background: #d4e5f3;
  color: var(--blue);
}
.face-picker button[aria-pressed="true"] {
  border-color: currentColor;
  font-weight: 650;
}
.move-status {
  font-size: 14px;
  min-height: 72px;
  line-height: 1.6;
  padding: 12px 0;
  color: #526856;
}
.move-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}
.legend {
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.8;
}
.legend b:first-child {
  color: var(--violet);
}
.legend b:last-child {
  color: var(--teal);
}
.game-side .card {
  padding: 20px;
  margin-bottom: 18px;
}
.room-code {
  font-family: ui-monospace, monospace;
  letter-spacing: 2px;
  font-size: 24px;
  display: block;
  margin: 15px 0;
  overflow-wrap: anywhere;
}
.round-banner {
  background: #edf2dd;
  border: 1px solid #c2d3a6;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.round-banner h2 {
  margin: 0 0 7px;
  font-size: 23px;
}
.round-banner p {
  font-size: 14px;
  color: var(--muted);
}
.tutorial-layout {
  display: grid;
  grid-template-columns: minmax(260px, 440px) 1fr;
  gap: 28px;
  align-items: start;
}
.lesson-list {
  display: grid;
  gap: 10px;
}
.lesson {
  padding: 18px;
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14px;
}
.lesson.active {
  border-color: #64885a;
  background: #edf2e3;
}
.lesson strong {
  display: block;
  margin-bottom: 4px;
}
.lesson p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.turning .flip-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: flop 0.32s cubic-bezier(0.35, 0.05, 0.25, 1) both;
  border-radius: inherit;
  pointer-events: none;
}
.turning {
  background: none !important;
  border: 0;
  box-shadow: none !important;
  outline: 0 !important;
  perspective: 350px;
}
.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
  background: #f5d8bd;
  border: 1px solid #fff9;
  border-bottom: 4px solid #c79e7c;
  box-shadow:
    inset 0 0 0 3px var(--ring),
    0 3px 0 #c79e7c;
}
.flip-face[data-kind="1"] {
  background: #d4e5f3;
  border-bottom-color: #94b0c6;
}
.flip-face svg {
  width: 43%;
  height: 43%;
}
.flip-back {
  transform: rotateY(180deg);
}
@keyframes flop {
  0% {
    transform: rotateY(0);
  }
  45% {
    transform: translateY(-4px) rotateY(80deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}
.mobile-brand {
  display: none;
}
.muted {
  color: var(--muted);
}
.spaced {
  margin-top: 20px;
}
.wide {
  width: 100%;
}
.code-input {
  text-transform: lowercase;
}
.hidden {
  display: none !important;
}
@media (min-width: 1500px) {
  .main {
    padding-inline: 70px;
  }
}
@media (max-width: 1050px) {
  .sidebar {
    padding: 24px 14px;
  }
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .main {
    padding-inline: 25px;
  }
  .hero {
    gap: 20px;
  }
  .hero-art {
    padding: 23px;
  }
  .mini-board {
    width: 210px;
  }
  .game-layout {
    grid-template-columns: minmax(280px, 1.3fr) 1fr;
    gap: 18px;
  }
  .game-side .card {
    padding: 15px;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    height: auto;
    padding: 5px 9px calc(5px + env(safe-area-inset-bottom));
    background: #202c2bf7;
    backdrop-filter: blur(10px);
  }
  .sidebar > .logo,
  .side-foot {
    display: none;
  }
  .sidebar nav {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }
  .navlink {
    display: flex;
    flex-direction: column;
    gap: 1px;
    justify-content: center;
    padding: 7px 2px;
    font-size: 10px;
    min-height: 54px;
    border-radius: 10px;
  }
  .navlink span {
    font-size: 20px;
    line-height: 1.2;
    text-align: center;
  }
  .main {
    padding: 0 20px 100px;
  }
  .mobile-brand {
    display: flex;
    font-size: 22px;
  }
  .mobile-brand img {
    width: 28px;
    height: 28px;
  }
  .topbar {
    min-height: 75px;
    margin-bottom: 25px;
  }
  .crumb {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .hero h1 {
    font-size: 39px;
    letter-spacing: -1.7px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-art {
    padding: 17px;
    border-radius: 20px;
  }
  .mini-board {
    width: 195px;
    gap: 7px;
  }
  .mini-board i {
    font-size: 27px;
    border-radius: 8px;
  }
  .hero-art .art-note {
    font-size: 10px;
    right: -6px;
    padding: 8px 10px;
  }
  .page-head h1 {
    font-size: 32px;
  }
  .arena-grid {
    grid-template-columns: 1fr;
  }
  .game-layout {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: auto;
  }
  .game-side {
    display: contents;
  }
  .game-side > .card {
    order: 2;
  }
  .game-side > .card.controls {
    order: 0;
    margin-bottom: 0;
    padding: 17px;
  }
  .game-primary {
    order: 1;
  }
  .game-side .explain {
    order: 3;
  }
  .game-side .controls h2 {
    display: none;
  }
  .game-side .controls .eyebrow {
    display: none;
  }
  .game-side .controls .move-status {
    min-height: 56px;
    padding-top: 0;
  }
  .tutorial-layout {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: auto;
  }
  .board-card {
    padding: 15px;
  }
  .game-score {
    margin-bottom: 12px;
  }
  .face-picker {
    margin-bottom: 9px;
  }
  .section-title h2 {
    font-size: 23px;
  }
  .card {
    padding: 20px;
  }
}
@media (max-width: 520px) {
  .main {
    padding: 0 16px 95px;
  }
  .topbar {
    margin-bottom: 22px;
    min-height: 68px;
  }
  .hero {
    display: block;
    position: relative;
    margin-bottom: 30px;
  }
  .hero h1 {
    max-width: 270px;
    font-size: 43px;
    margin-bottom: 17px;
  }
  .hero p {
    max-width: 100%;
    font-size: 14px;
    margin-bottom: 21px;
  }
  .hero-art {
    display: none;
  }
  .hero .eyebrow {
    font-size: 10px;
  }
  .hero .row .button {
    flex: 1;
    font-size: 13px;
    padding: 12px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .mode-card h3 {
    font-size: 27px;
  }
  .mode-card p {
    min-height: 0;
    font-size: 14px;
    max-width: 90%;
  }
  .mode-card {
    padding: 20px;
  }
  .mode-card .mode-glyph {
    font-size: 27px;
  }
  .facts {
    gap: 15px;
  }
  .fact {
    font-size: 11px;
  }
  .fact b {
    font-size: 13px;
  }
  .section-title p {
    display: none;
  }
  .game-layout {
    gap: 12px;
  }
  .game-side .controls {
    padding: 13px;
  }
  .board-card {
    padding: 11px;
    border-radius: 16px;
  }
  .board {
    gap: 7px;
  }
  .board.own {
    gap: 5px;
  }
  .tile {
    border-radius: 10px;
  }
  .board.own .tile {
    border-radius: 5px;
  }
  .score-box {
    padding: 9px;
  }
  .score-box .score-name {
    font-size: 12px;
  }
  .score-box b {
    font-size: 25px;
  }
  .game-side .move-status {
    font-size: 13px;
  }
  .legend {
    font-size: 10px;
  }
  .room-form {
    flex-wrap: wrap;
  }
  .room-form .button {
    width: 100%;
  }
  .stat-grid .card {
    padding: 13px;
  }
  .stat-grid strong {
    font-size: 25px;
  }
  .page-head h1 {
    font-size: 31px;
  }
  .user-chip {
    padding: 5px 10px;
  }
  .connection {
    font-size: 11px;
  }
  td,
  th {
    padding: 12px;
    font-size: 12px;
  }
  dialog {
    padding: 26px 22px;
  }
  .game-side > .explain {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    transition: none !important;
  }
  .turning .flip-body {
    transform: rotateY(180deg);
  }
}
.board-card {
  overflow: auto;
}
.board.zoomed {
  min-width: 480px;
}
.game-primary {
  min-width: 0;
}
@media (max-width: 800px) {
  .game-side > .card.controls {
    order: 2;
    position: sticky;
    bottom: 80px;
    z-index: 10;
    box-shadow:
      0 0 0 4px var(--paper),
      0 -8px 28px #24332f18;
  }
  .game-primary {
    order: 1;
  }
  .game-side .controls .move-status {
    min-height: 42px;
    margin: 0 0 6px;
  }
  .game-side > .button {
    order: 4;
  }
  .game-side .controls .face-picker {
    margin-bottom: 8px;
  }
}
.lesson-mobile {
  display: none;
}
.lesson-controls .move-status {
  min-height: 48px;
}
.tutorial-play {
  min-width: 0;
}
.tutorial-play .face-picker {
  margin-bottom: 15px;
}
@media (max-width: 800px) {
  .lesson-mobile {
    display: block;
    margin-bottom: 12px;
  }
  .tutorial-layout .lesson-list {
    display: none;
  }
  .tutorial-head {
    margin-bottom: 15px;
  }
  .tutorial-head h1 {
    font-size: 27px;
  }
  .tutorial-head > p {
    display: none;
  }
  .lesson-controls {
    position: sticky;
    bottom: 78px;
    background: var(--paper);
    padding: 4px 0 9px;
    z-index: 11;
    box-shadow: 0 4px 0 4px var(--paper);
  }
  .lesson-controls .move-status {
    min-height: 36px;
    margin: 0 0 6px;
  }
  .lesson-controls .row .button {
    flex: 1;
    padding-inline: 8px;
    font-size: 13px;
  }
}
@media (max-width: 800px) {
  .own-match .game-side > .card.controls {
    padding: 10px;
  }
  .own-match .controls .move-status {
    min-height: 32px;
    line-height: 1.4;
    font-size: 12px;
  }
  .own-match .move-actions .button {
    min-height: 44px;
    padding: 10px 12px;
  }
}
.room-lobby {
  max-width: 700px;
}
.room-seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.room-seats article {
  display: grid;
  gap: 8px;
  background: #e8edde;
  padding: 20px;
  border-radius: 14px;
}
.room-seats small {
  color: var(--muted);
}
@media (max-width: 520px) {
  .room-seats {
    gap: 9px;
  }
  .room-seats article {
    padding: 15px;
  }
}
