@font-face {
  font-family: Eczar;
  src: url('fonts/eczar-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F;
}
@font-face {
  font-family: Eczar;
  src: url('fonts/eczar-devanagari.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0900-097F, U+200C-200D;
}
:root {
  --ink: #35251d;
  --muted: #685344;
  --accent: #843a2a;
  --paper: #fff8eb;
  --line: #d8bea0;
  --display: Eczar, Georgia, serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: #f4e8d3;
}
* { box-sizing: border-box; }
body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 8%, #fffae9 0%, transparent 55%),
    radial-gradient(ellipse at 97% 100%, #e4c39890 0%, transparent 60%),
    repeating-linear-gradient(113deg, #a1714110 0 1px, transparent 1px 5px);
}
a { color: var(--accent); }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 3px solid #8d4527; outline-offset: 3px; }
[hidden] { display: none !important; }
p { line-height: 1.55; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  width: min(100% - 36px, 1170px);
  margin: auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 700 1.6rem/1 var(--display);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #a45236, #713326);
  border: 1px solid #713326;
  box-shadow: inset 0 0 0 2px #e7a26070, 0 2px 0 #642e22;
  color: #fff5db;
}
.brand-mark { width: 35px; height: 35px; border-radius: 9px; font: 1.6rem/1 Georgia, serif; }
.rules {
  min-height: 44px;
  border: 1px solid #bda284;
  border-radius: 8px;
  background: #fff9ec9c;
  color: var(--ink);
  padding: 0 14px;
  font-size: .875rem;
  font-weight: 650;
}
main { width: min(100% - 36px, 1090px); margin: auto; padding: clamp(28px, 5.5vw, 72px) 0 40px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(26px, 5vw, 68px);
  align-items: center;
}
.side { min-width: 0; }
.intro { margin-bottom: 23px; }
.devanagari {
  color: var(--accent);
  font: 650 1.18rem/1.3 var(--display);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 5px;
}
.devanagari::before { content: ''; width: 24px; height: 1px; background: #b7733e; }
h1, h2 { font-family: var(--display); font-weight: 700; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; letter-spacing: -.055em; margin: 0 0 4px; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 3.1vw, 2.3rem); line-height: 1.12; letter-spacing: -.025em; }
.intro > p:last-child, #status, .note { color: var(--muted); margin: 0; }
.board-wrap {
  padding: clamp(11px, 2.5vw, 25px);
  border: 2px solid #603019;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #f5bc7c47, transparent 32%, #39200b54 72%, #f7bd7729),
    repeating-linear-gradient(97deg, #54250d48 0 2px, #d2834263 3px 5px, #7337193b 8px 13px, transparent 17px 25px),
    linear-gradient(125deg, #a65a31, #6b361d 48%, #a76435 70%, #703a21);
  box-shadow: inset 0 0 0 2px #d69b61a0, inset 0 0 0 5px #552c1c70,
    inset 0 0 0 7px #e2a66b68, 0 5px 0 #542d1c, 0 14px 25px #57331942, 0 28px 55px #57331932;
}
.board {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  background: #f9eacd;
  outline: 1px solid #522b19;
  border-radius: 3px;
  box-shadow: 0 0 0 3px #47201180, 0 2px 4px 3px #2b140cb0;
  overflow: hidden;
}
.board > * { position: absolute; }
.red { --team: #d64127; --bright: #fa7751; --dark: #882715; }
.green { --team: #347138; --bright: #83aa35; --dark: #194e2a; }
.yellow { --team: #eb9c10; --bright: #ffd158; --dark: #a3640a; }
.blue { --team: #674198; --bright: #9764bc; --dark: #472464; }
.cell {
  width: calc(100% / 15);
  height: calc(100% / 15);
  display: grid;
  place-items: center;
  border: 1px solid #563b2d2c;
  background: linear-gradient(155deg, #fff6e1, #eeddbd);
  color: #614034;
  font-size: clamp(8px, 1.8vw, 16px);
}
.cell.colored { background: var(--team); color: #fff3d6; border-color: #311c253f; }
.yard {
  width: 40%;
  height: 40%;
  background: radial-gradient(ellipse at 25% 14%, var(--bright), var(--team) 74%);
  border: 1px solid #3c281968;
  display: grid;
  place-items: center;
}
.yard::before {
  content: '';
  width: 77%;
  height: 77%;
  border-radius: 8%;
  border: 1px solid #fff1ce90;
  box-shadow: inset 0 0 0 3px #311f2520;
}
.socket {
  width: 12%;
  height: 12%;
  transform: translate(-50%, -50%);
  border-radius: 16%;
  border: 1px solid #fff2ca90;
  background: #2d1c2026;
  box-shadow: inset 0 1px 3px #25202155;
}
.home {
  left: 40%;
  top: 40%;
  width: 20%;
  height: 20%;
  background: conic-gradient(from 45deg, #eb9c10 0 25%, #674198 0 50%, #d64127 0 75%, #347138 0);
  display: grid;
  place-items: center;
  font-size: clamp(15px, 3vw, 32px);
}
.home span {
  display: grid;
  place-items: center;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  background: #faebc9;
  color: #66412a;
  box-shadow: 0 0 0 1px #523426, inset 0 0 0 3px #e7c795;
}
.token {
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 6.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #2f172d66;
  background: radial-gradient(circle at 34% 21%, var(--bright), var(--team) 78%);
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff8eb;
  font-size: clamp(8px, 1.4vw, 12px);
  font-weight: 750;
  text-shadow: 0 1px 2px #20111c;
  box-shadow: inset 0 0 0 1px #ffffff55, 0 3px 0 var(--dark), 1px 5px 5px #24141566;
}
.token.yellow { color: #372310; text-shadow: none; }
.token.ready { z-index: 3; outline: 2px solid #fff7db; outline-offset: 1px; }
.token.ready:focus-visible { outline: 3px solid white; box-shadow: 0 0 0 5px #37251c; }
.token.ready:hover { filter: brightness(1.16); }
.panel, dialog {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 12px 28px #623c211c;
}
.panel { padding: clamp(17px, 3vw, 29px); }
.eyebrow { color: var(--accent); font-size: .875rem; font-weight: 750; letter-spacing: .105em; margin: 0 0 7px; }
.panel form { margin-top: 17px; display: grid; gap: 8px; }
label { font-size: .875rem; font-weight: 700; }
input {
  min-height: 47px;
  padding: 10px 12px;
  border: 1px solid #bca582;
  border-radius: 7px;
  width: 100%;
  background: #fffdf6;
  color: var(--ink);
}
.primary, .secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 750;
  padding: 9px 14px;
}
.primary { background: #893f2f; border: 1px solid #6e3124; color: #fff8e7; box-shadow: inset 0 1px 0 #ffffff25; }
.primary:hover:not(:disabled) { background: #753426; }
.secondary { color: #743526; background: #f5e5d0; border: 1px solid var(--line); margin-top: 8px; }
.panel footer { display: flex; gap: 7px 14px; flex-wrap: wrap; margin-top: 15px; padding-top: 11px; border-top: 1px solid #decbb1; }
.panel footer span { font-size: .875rem; color: var(--muted); }
.panel footer span + span::before { content: '✦'; color: var(--accent); margin-right: 10px; font-size: .65rem; }
#feedback { margin: 0; color: #843a2a; overflow-wrap: anywhere; }
#feedback:not(:empty) { margin-top: 12px; }
#players { list-style: none; padding: 0; margin: 13px 0; display: grid; gap: 5px; }
#players li { display: flex; align-items: center; gap: 8px; border-radius: 7px; padding: 5px 7px; overflow-wrap: anywhere; }
#players li.active { background: #f1e0c8; }
.dot { flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--team); border: 1px solid var(--dark); }
.note { font-size: .875rem; margin-top: 8px; }
dialog { max-width: min(440px, calc(100% - 24px)); padding: 22px; color: var(--ink); }
dialog::backdrop { background: #25150cc2; }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
dialog li { margin: 10px 0; line-height: 1.5; }
@media (max-width: 720px) {
  .top { width: calc(100% - 28px); min-height: 58px; }
  main { width: min(100% - 28px, 475px); padding: 17px 0 26px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side { display: contents; }
  .intro { grid-row: 1; margin: 0; }
  .board-wrap { grid-row: 2; }
  .panel { grid-row: 3; }
  .in-game .intro { display: none; }
  .in-game .board-wrap { grid-row: 1; }
  .in-game .panel { grid-row: 2; padding: 12px 15px; }
  .in-game #players { display: flex; flex-wrap: wrap; margin: 5px 0 7px; }
  .in-game #mode { display: none; }
}
.clock { display: flex; align-items: center; gap: 9px; margin-top: 9px; color: var(--muted); font-size: .875rem; }
.clock progress { flex: 1; min-width: 0; height: 7px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #ecdbc1; color: var(--accent); }
.clock progress::-webkit-progress-bar { background: #ecdbc1; }
.clock progress::-webkit-progress-value { background: var(--accent); }
.clock progress::-moz-progress-bar { background: var(--accent); }
#seconds { min-width: 2.3em; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.intro { position: relative; isolation: isolate; }
.rangoli {
  position: absolute;
  z-index: -1;
  width: clamp(100px, 13vw, 174px);
  aspect-ratio: 1;
  inset: -42px -7px auto auto;
  opacity: .32;
  border: 1px dashed #b97038;
  border-radius: 50%;
  background: radial-gradient(circle, #be733d22 0 14%, transparent 15% 57%, #be733d26 58% 59%, transparent 60%);
  pointer-events: none;
}
.rangoli i {
  position: absolute;
  inset: 12% 35%;
  border-radius: 50%;
  border: 1px solid #ac6236;
  background: #d9954130;
}
.rangoli i:nth-child(2) { transform: rotate(45deg); }
.rangoli i:nth-child(3) { transform: rotate(90deg); }
.rangoli i:nth-child(4) { transform: rotate(135deg); }
.yard::before { width: 75%; height: 75%; }
.socket { width: 11.8%; height: 11.8%; }
.home span { background: #ffeac1; }
.travelling { z-index: 5; transition: top 85ms linear, left 85ms linear; }
.dice-controls { float: right; width: 106px; margin: 0 0 8px 11px; text-align: center; }
.dice-tray {
  display: grid;
  place-items: center;
  width: 75px;
  height: 67px;
  margin: 0 auto 9px;
  border-radius: 14px;
  border: 1px solid #d0ad82;
  background: radial-gradient(ellipse at top, #fff4dc, #ead3ae);
  box-shadow: inset 0 2px 4px #6b3a212d;
}
.dice {
  width: 45px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid #8d4b29;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  background: linear-gradient(145deg, #bc733f, #8f462b);
  box-shadow: inset 0 0 0 2px #ffd29665, 0 3px 0 #6c3420, 0 5px 7px #66341f63;
  transform: rotate(8deg);
}
.dice span { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.dice span.lit { background: #fff1d0; box-shadow: 0 1px 1px #552719; }
.dice.rolling { animation: tumble 125ms ease-in-out 3; }
@keyframes tumble {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50% { transform: translateY(-8px) rotate(-33deg); }
}
#dice-result { margin: 5px 0 0; color: var(--muted); font-size: .875rem; }
#note { margin-top: 8px; }
.panel::after { content: ''; display: block; clear: both; }
.ad-slot {
  min-height: 82px;
  margin: 34px 0 22px;
  display: grid;
  place-items: center;
  border: 1px dashed #bb9877;
  border-radius: 10px;
  color: var(--muted);
  background: #fff7ea72;
  font-size: .875rem;
}
.feedback-panel > p, .contact p { margin: 0; color: var(--muted); }
.feedback-panel form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.feedback-panel .full { grid-column: 1 / -1; }
.feedback-panel label { display: block; margin-bottom: 4px; }
.feedback-panel select, .feedback-panel textarea {
  font: inherit;
  color: var(--ink);
  min-height: 47px;
  width: 100%;
  border: 1px solid #bca582;
  border-radius: 7px;
  background: #fffdf6;
  padding: 10px 12px;
}
.feedback-panel textarea { resize: vertical; }
.feedback-panel button { width: fit-content; }
.contact { width: min(100% - 36px, 1090px); margin: 0 auto; padding: 20px 0 35px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .brand { font-size: 1.28rem; gap: 6px; white-space: nowrap; }
  .brand-mark { width: 29px; height: 29px; font-size: 1.25rem; }
  .top .rules { padding-inline: 8px; }
  .rangoli { inset: 0 0 auto auto; }
  .dice-controls { width: 88px; }
  .dice-controls .primary { padding-inline: 6px; }
  .clock { clear: both; }
  .feedback-panel form { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .travelling { transition: none; }
}
#mode-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 13px; }
#mode-picker .rules { padding: 0 9px; }
#mode-picker [aria-pressed="true"] { background: #8b402d; border-color: #713526; color: #fff7e8; }
#local-form select { min-height: 44px; width: 100%; border: 1px solid #bca582; border-radius: 7px; padding: 7px 10px; font: inherit; color: var(--ink); background: #fffdf6; }
#seat-names { display: grid; gap: 5px; }
.dice { cursor: default; }
.dice:disabled { opacity: 1; }
.dice.ready-dice { cursor: pointer; outline: 3px solid #a04a27; outline-offset: 5px; animation: dice-glow 1.3s ease-in-out infinite alternate; }
.dice.ready-dice:focus-visible { outline: 3px solid #3b2212; }
@keyframes dice-glow { to { outline-color: #d89429; box-shadow: 0 0 15px 4px #e9ab4d; } }
.dice-tray { width: 76px; height: 73px; }
.dice { width: 48px; }
#players li strong { color: var(--dark); }
#players li.active { background: color-mix(in srgb,var(--team) 18%, #fff8eb); box-shadow: inset 3px 0 var(--team); }
#move-options, #emoji-buttons, #reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
#move-options, #reactions { clear: both; margin-top: 9px; }
#move-options button { color: var(--dark); border-color: var(--team); }
#emoji-buttons button { min-width: 44px; padding: 0 8px; font-size: 1.16rem; }
#again { display: inline-block; margin-top: 9px; }
.board-wrap { position: relative; }
.reaction-bubble:not(:empty) {
  position: absolute; z-index: 9; left: 50%; top: 12%; transform: translateX(-50%); max-width: 82%;
  box-shadow: 0 4px 15px #48250c55; border: 2px solid var(--team); border-radius: 100px;
  background: var(--paper); padding: 7px 15px; font-weight: 800; overflow-wrap: anywhere;
  animation: reaction-pop 200ms ease-out; pointer-events: none;
}
@keyframes reaction-pop { from { transform: translateX(-50%) scale(.7); opacity: 0; } }
.burst {
  position: absolute; z-index: 8; inset: 0; display: grid; place-content: center;
  justify-items: center; text-align: center; pointer-events: none;
}
.burst i {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 7px; border-radius: 2px;
  background: hsl(var(--hue) 88% 52%); animation: confetti .7s var(--delay) both ease-out;
}
.burst.big { color: #fff3cf; background: #2d160a9e; gap: 4px; }
.burst.big i { width: 10px; height: 13px; animation-duration: 1.7s; }
.burst.big span { font-size: clamp(2rem,7vw,5rem); text-shadow: 0 3px 12px #301707; }
.burst.big strong { max-width: 90%; font: 800 clamp(1.65rem,5vw,3.6rem)/1.01 var(--display); overflow-wrap: anywhere; text-shadow: 1px 3px 5px #321506; }
@keyframes confetti {
  from { transform: scale(.25); opacity: 1; }
  75% { opacity: 1; }
  to { transform: translate(var(--x),var(--y)) rotate(220deg) scale(.7); opacity: 0; }
}
.leaderboard > p { margin: 0; color: var(--muted); }
#scores-status:not(:empty) { margin-top: 8px; }
#scores { padding-inline-start: 1.4em; margin-bottom: 0; }
#scores:empty { display: none; }
.support { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.feedback-panel summary { cursor: pointer; }
.feedback-panel summary h2 { display: inline; }
.feedback-panel > p { margin-top: 9px; }
.support .contact { width: auto; margin: 0; padding: clamp(17px, 3vw, 29px); border: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 565px) {
  .support { grid-template-columns: 1fr; }
  #players li { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dice.ready-dice, .reaction-bubble, .burst i { animation: none; }
  .burst i { display: none; }
  .burst:not(.big)::after { content: '✦'; color: #a9550c; text-shadow: 0 0 8px white; font-size: 2.6rem; }
}
.capture-flight { z-index: 6; pointer-events: none; }
.capture-impact {
  position: absolute;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 9%;
  aspect-ratio: 1;
  border: 2px solid #ffcc68;
  border-radius: 50%;
  color: #fff1a8;
  background: #be5427a0;
  box-shadow: 0 0 13px #ffc453a0;
  font-size: clamp(.85rem, 3vw, 1.65rem);
  transform: translate(-50%,-50%);
  pointer-events: none;
  animation: capture-pop 350ms ease-out both;
}
@keyframes capture-pop {
  0% { transform: translate(-50%,-50%) scale(.55) rotate(-20deg); opacity: 1; }
  38% { transform: translate(-50%,-50%) scale(1.14) rotate(8deg); opacity: .95; }
  100% { transform: translate(-50%,-50%) scale(1.48) rotate(20deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .capture-impact { animation: none; }
}
.yard-name {
  position: absolute;
  z-index: 1;
  width: 40%;
  height: 40%;
  padding: 2px 4px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff8e4;
  text-shadow: 0 1px 2px #21160b;
  font-size: clamp(.63rem, 1.4vw, .98rem);
  font-weight: 800;
  pointer-events: none;
}
.yard-name.yellow { color: #3a220e; text-shadow: none; }
.yard-name.winner-frame {
  box-shadow: inset 0 0 0 3px #ffe589, inset 0 0 22px #ffba30;
  color: #fff6d1;
  text-shadow: 0 1px 3px #372414, 0 0 6px #6b4514;
}
.turn-heading { color: var(--dark); }
#add-player { clear: both; }
.live-chat { margin-bottom: 14px; }
.live-chat summary { cursor: pointer; }
.live-chat summary h2 { display: inline; }
.live-chat > p { color: var(--muted); margin: 8px 0; }
.chat-stream {
  overflow: auto; min-height: 110px; max-height: 280px;
  padding: 10px; background: #fbefd9; border: 1px solid var(--line); border-radius: 8px;
}
#chat-messages { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
#chat-messages li { width: fit-content; max-width: 100%; padding: 6px 11px; border-radius: 8px; background: #fffaf0; overflow-wrap: anywhere; }
#chat-messages li.bot-chat { background: #f1dfc2; }
.chat-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: .875rem; }
.chat-meta time { color: var(--muted); }
.chat-meta small { color: #78311f; font-weight: 750; }
#chat-messages p { margin: 3px 0 0; }
#chat-form { grid-template-columns: minmax(110px, .65fr) minmax(0, 1.35fr) auto; align-items: end; }
#chat-form label { display: block; margin-bottom: 4px; }
.chat-status:empty { display: none; }
@media(max-width: 520px) {
  #chat-form { grid-template-columns: minmax(0, 1fr) auto; }
  #chat-form > div:first-child { grid-column: 1/-1; }
}
.board-wrap {
  background: linear-gradient(131deg,#fbc58754,transparent 33%,#2915066b 75%,#e2a35b44), url('walnut.jpg') center / 100% 43%, #713a21;
  box-shadow: inset 0 0 0 2px #edb6748e, inset 0 0 0 5px #47251583,
    inset 0 0 0 7px #eab77c48, 0 5px 0 #542d1c, 0 24px 48px #57331945;
}
.board::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg,#fff4dc37 0%,#fff5db0d 27%,transparent 42%,#fff7e216 57%,transparent 68%,#38160722);
  box-shadow: inset 0 0 0 1px #fff4d88f, inset 0 0 12px #6336123d;
}
.cell { background: linear-gradient(150deg,#fff8e8,#ece0c4); }
.cell.colored { background: linear-gradient(146deg,var(--bright),var(--team) 74%); }
.yard { background: radial-gradient(ellipse at 18% 8%,var(--bright),var(--team) 62%,var(--dark)); }
.ad-slot { margin-top: 26px; }
#house-ad { padding: 8px 14px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
#house-ad span { font-size: .8rem; color: var(--muted); }
#scores time, #device-scores time { display: inline-block; margin-inline-start: 10px; color: var(--muted); font-size: .875rem; }
.chat-arriving { animation: chat-arrive .32s cubic-bezier(.2,.7,.4,1) both; }
@keyframes chat-arrive { from { transform: translateY(7px); opacity: 0; } }
@media(prefers-reduced-motion: reduce) { .chat-arriving { animation: none; } }
@media(max-width: 440px) {
  .top { flex-wrap: wrap; padding-block: 6px; gap: 4px; }
  .top-actions { margin-inline-start: auto; }
  .top-actions .rules { padding-inline: 6px; }
}
#chat-form { grid-template-columns: minmax(0,1fr) auto; }
#chat-form > div:first-child { grid-column: auto; }
.travelling { transition: top 48ms linear,left 48ms linear; }
.capture-impact { animation-duration: 270ms; }
.dice.rolling { animation-duration: 54ms; }
.star-shield {
 z-index: 6; width: 9%; aspect-ratio: 1; border: 2px solid #e4fffe; border-radius: 50%;
 transform: translate(-50%,-50%); display: grid; place-items: center; color: #fff;
 background: #80e2ff2c; box-shadow: 0 0 12px #aef8ff, inset 0 0 8px #b9f8ff;
 animation: shield-rise .48s ease-out both; pointer-events: none;
}
@keyframes shield-rise {
 from { transform: translate(-50%,-50%) scale(.6); opacity: .3; }
 30% { transform: translate(-50%,-50%) scale(1.13); opacity: 1; }
 to { transform: translate(-50%,-50%) scale(1.34); opacity: 0; }
}
.fluffy-heart {
 z-index: 10; left: 50%; top: 50%; transform: translate(-50%,-50%);
 color: #ff709b; font: bold clamp(6rem,25vw,16rem)/1 system-ui;
 text-shadow: 0 0 10px #ffe4ef,0 0 20px #ffadc8,0 0 32px #ff6296,0 8px 24px #6c163d64;
 pointer-events: none; animation: fluffy-pop 1.65s cubic-bezier(.25,.7,.33,1) both;
}
@keyframes fluffy-pop {
 from { transform: translate(-50%,-50%) scale(.2) rotate(-12deg); opacity: 0; }
 22% { transform: translate(-50%,-50%) scale(1.15) rotate(5deg); opacity: 1; }
 45%,75% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
 to { transform: translate(-50%,-55%) scale(1.07); opacity: 0; }
}
.reaction-glyph { display: inline-block; animation: glyph-bounce .32s ease-out both; }
.emoji-1 .reaction-glyph { animation-name: glyph-wiggle; }
.emoji-2 .reaction-glyph { animation-name: glyph-peek; }
.emoji-3 .reaction-glyph { animation-name: glyph-spark; }
@keyframes glyph-bounce { 40% { transform: translateY(-5px) scale(1.21); } }
@keyframes glyph-wiggle { 30% { transform: rotate(-17deg); } 70% { transform: rotate(14deg); } }
@keyframes glyph-peek { from { opacity: .1; transform: translateY(6px); } }
@keyframes glyph-spark { 50% { transform: scale(1.25); filter: drop-shadow(0 0 5px #ff9828); } }
@media(prefers-reduced-motion: reduce) {
 .travelling { transition: none; }
 .star-shield,.fluffy-heart,.reaction-glyph { animation: none; }
}
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-track {
  position: relative;
  width: 29px;
  height: 16px;
  flex: none;
  border: 1px solid #ad8460;
  border-radius: 12px;
  background: #e9d4b7;
  transition: background-color 240ms ease;
}
.view-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5e351d;
  transition: transform 240ms ease;
}
.view-switch[aria-checked="true"] .view-track { background: #8d412d; }
.view-switch[aria-checked="true"] .view-track::after {
  background: #fff4dd;
  transform: translateX(13px);
}
.board-wrap {
  --view-scale: .76;
  transform-origin: 50% 53%;
  transform: perspective(1100px) rotateX(0deg) rotateZ(0deg) scale(1);
}
.board-wrap.view-ready { transition: transform 480ms cubic-bezier(.24,.72,.26,1), box-shadow 480ms ease; }
.board-wrap.is-3d {
  transform: perspective(1100px) rotateX(39deg) rotateZ(-28deg) scale(var(--view-scale));
  box-shadow: inset 0 0 0 2px #edb674a8, inset 0 0 0 5px #47251583,
    1px 1px 0 #754629, 2px 3px 0 #5e341f, 4px 5px 0 #4f2b1a,
    6px 8px 0 #392012, 11px 20px 24px #4c291b73, 21px 32px 48px #3f21184a;
}
@media(max-width: 720px) {
  .board-wrap { --view-scale: .73; }
}
@media(max-width: 530px) {
  .top { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding-block: 6px; gap: 5px; }
  .top-actions { display: contents; }
  .view-switch { grid-column: 3; grid-row: 1; min-height: 44px; justify-self: end; }
  .top-actions .rules:not(.view-switch) { grid-row: 2; }
  .brand { grid-column: 1 / 3; }
}
@media(prefers-reduced-motion: reduce) {
  .board-wrap.view-ready, .view-track, .view-track::after { transition: none; }
}
.die-cube, .token-layer { display: none; }
.board-wrap.is-3d {
  transform: perspective(1100px) rotateX(39deg) rotateZ(var(--board-angle,-28deg)) scale(var(--view-scale));
  transform-style: preserve-3d;
}
.is-3d .board { overflow: visible; isolation: auto; transform-style: preserve-3d; }
.is-3d .yard-name { z-index: 1; }
.yard-name > span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.is-3d .yard-name > span { transform: rotate(var(--face-angle,28deg)); }
.is-3d .token {
  transform-style: preserve-3d;
  background: var(--dark);
  border-color: transparent;
  box-shadow: 1px 2px 5px #21130bc4;
}
.is-3d .token-layer, .is-3d .token-cap {
  display: grid; place-items: center; position: absolute; inset: -1px;
  border-radius: 50%; pointer-events: none;
}
.is-3d .token-layer {
  background: linear-gradient(110deg,var(--dark) 10%,var(--team) 53%,var(--dark) 86%);
  box-shadow: 0 0 .5px var(--dark);
  transform: translateZ(calc(var(--layer) * 1.6px));
}
.is-3d .token-cap {
  background: radial-gradient(circle at 30% 25%,var(--bright),var(--team) 80%);
  border: 1px solid #fff8d98a;
  box-shadow: inset 0 0 0 2px #35160e28, inset 0 2px 2px #fff6da48;
  transform: translateZ(9px) rotate(var(--face-angle,28deg));
}
.view-3d .dice-tray { perspective: 230px; }
.view-3d .dice {
  padding: 0; width: 49px; background: transparent; border-color: transparent;
  box-shadow: none; transform: none;
  transform-style: preserve-3d;
}
.view-3d .dice > span:not(.die-cube) { display: none; }
.view-3d .dice .die-cube {
  --die-depth: 17px;
  --cube-x: 0deg;
  --cube-y: 0deg;
  display: block; position: absolute; width: 34px; height: 34px;
  left: calc(50% - 17px); top: calc(50% - 17px);
  background: none; box-shadow: none; transform-style: preserve-3d;
  transform: rotateX(-16deg) rotateY(24deg) rotateX(var(--cube-x)) rotateY(var(--cube-y));
}
.view-3d .die-cube[data-value="2"] { --cube-y: -90deg; }
.view-3d .die-cube[data-value="3"] { --cube-x: -90deg; }
.view-3d .die-cube[data-value="4"] { --cube-x: 90deg; }
.view-3d .die-cube[data-value="5"] { --cube-y: 90deg; }
.view-3d .die-cube[data-value="6"] { --cube-y: 180deg; }
.die-face {
  position: absolute; inset: 0; border-radius: 4px; padding: 4px;
  border: 1px solid #9e6137;
  background: radial-gradient(ellipse at 24% 16%,#e4a46a,#a35d35 68%,#71361d);
  box-shadow: inset 0 0 0 1px #f2be8a70;
  display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); place-items: center;
  backface-visibility: hidden;
}
.die-face i { width: 4px; height: 4px; border-radius: 50%; }
.die-face i.lit { background: #ffe9be; box-shadow: 0 1px 1px #512b18; }
.face-1 { transform: translateZ(var(--die-depth)); }
.face-2 { transform: rotateY(90deg) translateZ(var(--die-depth)); }
.face-3 { transform: rotateX(90deg) translateZ(var(--die-depth)); }
.face-4 { transform: rotateX(-90deg) translateZ(var(--die-depth)); }
.face-5 { transform: rotateY(-90deg) translateZ(var(--die-depth)); }
.face-6 { transform: rotateY(180deg) translateZ(var(--die-depth)); }
.view-3d .dice.rolling { animation: none; }
.is-3d .burst {
  transform-style: preserve-3d;
  transform: translateZ(14px);
}
.burst.big i {
  background: linear-gradient(140deg,#fff5b2 0%,var(--gold) 47%,#bd7d10 100%);
  box-shadow: 0 0 4px #ffc74674;
}
.is-3d .burst.big {
  background: radial-gradient(ellipse at center,#41250fe6,#30150e87 56%,transparent 79%);
}
.is-3d .burst.big > span, .is-3d .burst.big > strong {
  transform: translateZ(27px) rotate(var(--face-angle,28deg));
}
.is-3d button.token .token-cap { pointer-events: auto; }
body[data-theme="garden"] {
  background: radial-gradient(ellipse at 12% 5%,#f9fff0,transparent 55%),
    radial-gradient(ellipse at 97% 100%,#a8c59c80,transparent 63%),#dcead6;
}
body[data-theme="dusk"] {
  background: radial-gradient(ellipse at 12% 5%,#fff3ec,transparent 55%),
    radial-gradient(ellipse at 97% 100%,#b68dba80,transparent 63%),#e8d9e7;
}
#settings {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(340px,88vw);
  height: 100dvh; max-height: none; border-radius: 16px 0 0 16px;
  padding: 20px; overflow: auto;
}
#settings[open] { display: grid; align-content: start; gap: 10px; animation: settings-slide .23s ease-out; }
#settings > .rules { text-align: start; }
#theme-choices { display: grid; gap: 6px; }
#theme-choices [aria-pressed="true"] { color: #fff8eb; background: #863e2b; }
@keyframes settings-slide { from { transform: translateX(100%); } }
@media(max-width: 530px) {
  .top { grid-template-columns: minmax(0,1fr) auto; }
  .brand { grid-column: 1; }
  .top-actions { display: flex; grid-column: 2; gap: 4px; }
  .top-actions .rules { padding-inline: 6px; }
}
.board-wrap.is-3d { border-radius: 22px; }
.is-3d .board { border-radius: 10px; }
.is-3d .yard { border-radius: 7px; }
.is-3d .yard::before { border-radius: 14%; }
.is-3d .yard-name { border-radius: 7px; }
.is-3d .socket { border-radius: 21%; }
.is-3d .token-layer { inset: calc(-1px + var(--layer) * .14px); }
.is-3d .token-cap { inset: 0; }
.view-3d .die-face { border-radius: 7px; }
.is-3d .cell:not(.colored) {
  background: linear-gradient(145deg,#ffffff47,#f4ecdf40),url('marble.jpg') center / 170% 170%;
  border-color: #685b4838; color: #705749;
}
.is-3d .yard, .is-3d .cell.colored {
  background: radial-gradient(ellipse at 19% 3%,#ffffff56,transparent 43%),
    linear-gradient(145deg,var(--bright),var(--team) 58%,var(--dark));
}
.is-3d .yard::before { box-shadow: inset 0 0 0 3px #311f251c, inset 0 2px 12px #fff4e43a; }
.board-wrap.view-ready.seat-change { transition: none; }
.view-3d .dice.rolling .die-cube { animation: cube-lift 162ms ease-out both; }
@keyframes cube-lift {
  from, to { translate: 0 0; }
  40% { translate: 0 -7px; }
}
.is-3d .burst.big i { animation-name: gold-rise; }
@keyframes gold-rise {
  from { opacity: 1; transform: translate3d(0,0,2px) scale(.25); }
  58% { opacity: 1; }
  to { opacity: 0; transform: translate3d(var(--x),var(--y),var(--depth)) scale(.7); }
}
.engraved-name {
  display: inline-flex !important;
  align-items: baseline; max-width: 92%; gap: .22em;
  color: #2e180fea;
  text-shadow: 0 1px 0 #fff8d969, 0 -1px 1px #35180d57;
  font-weight: 850;
}
.engraved-name > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.yard-stars, .player-stars { flex: none; color: #ab6806; letter-spacing: .04em; }
.yard-stars { color: #ffe894; text-shadow: 0 1px 2px #442b05; }
.protective-barrier {
  position: absolute; inset: -19%; border-radius: 50%; pointer-events: none;
  border: 1px solid #d7fbffb8;
  box-shadow: 0 0 5px #78dfff, inset 0 0 5px #5edfff75;
}
.protective-barrier::before, .protective-barrier::after {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: #d4fbff;
  border-bottom-color: #5cd5fa; animation: shield-wind 1.3s linear infinite;
}
.protective-barrier::after {
  inset: 1px; border: 1px dashed #eaffff;
  filter: drop-shadow(0 0 2px #4ecfff); animation: shield-glint 1s ease-in-out infinite alternate;
}
.is-3d .protective-barrier { transform: translateZ(10px); }
@keyframes shield-wind { to { rotate: 360deg; } }
@keyframes shield-glint { from { opacity: .23; } to { opacity: 1; } }
@media(prefers-reduced-motion: reduce) {
  #settings[open], .protective-barrier::before, .protective-barrier::after,
  .view-3d .dice.rolling .die-cube, .is-3d .burst.big i { animation: none; }
}
body {
  --page: #f4e8d3;
  --light: #fff9eb;
  --glow: #e0ba865e;
  --ui-accent: #883e2c;
  --button-label: #fff8ec;
  --input-surface: #fffdf6;
  --subtle: #f3e5ce;
  --text-soft: #705746;
  --frame-material: linear-gradient(131deg,#fbc58754,transparent 33%,#2915066b 75%,#e2a35b44), url('walnut.jpg') center / 100% 43%, #713a21;
  --tile-material: linear-gradient(145deg,#ffffff47,#f4ecdf40),url('marble.jpg') center / 170% 170%;
  color: var(--ink);
  isolation: isolate;
}
body[data-theme="garden"] {
  --page: #e3ecd9; --light: #f9fff0; --glow: #8db78163; --ui-accent: #37644a;
  --ink: #233c29; --muted: #405747; --paper: #f5faef; --line: #afc3a9; --subtle: #dcebd9; --input-surface: #fbfef8;
  --frame-material: radial-gradient(ellipse at 18% 0%,#efffea75,transparent 55%),linear-gradient(145deg,#91b597,#34604c 63%,#244b39);
  --tile-material: linear-gradient(135deg,#e7f5e7a0,#f5fcf1b0),url('marble.jpg') center / cover;
}
body[data-theme="dusk"] {
  --page: #ece0ed; --light: #fff3ef; --glow: #ac76b964; --ui-accent: #70427e;
  --ink: #3e2a44; --muted: #604968; --paper: #fbf2fc; --line: #c9aed0; --subtle: #ebd9ef; --input-surface: #fff9ff;
  --frame-material: radial-gradient(ellipse at 20% 0%,#e7b9ff90,transparent 53%),linear-gradient(145deg,#9a67a0,#462c58 72%,#694d75);
  --tile-material: linear-gradient(145deg,#f4e5ff8c,#f9ecfba0),url('marble.jpg') center / cover;
}
body[data-theme="royal"] {
  --page: #e9e6da; --light: #fffae9; --glow: #c6a05265; --ui-accent: #695221;
  --ink: #3d3223; --muted: #5f513a; --paper: #fff9e9; --line: #c7b78d; --subtle: #f0e3c4; --input-surface: #fffcf2;
  --frame-material: repeating-linear-gradient(0deg,#eee2aa13 0 1px,#54360b13 2px 3px), linear-gradient(135deg,#e0bb68,#a77b39 35%,#e8ce86 65%,#8b6025);
  --tile-material: linear-gradient(155deg,#f2d78854,#fff2c986),url('marble.jpg') center / cover;
}
body[data-theme="sand"] {
  --page: #f1e3d5; --light: #fff6e8; --glow: #d7997669; --ui-accent: #934e31;
  --ink: #4a2f24; --muted: #684a3a; --paper: #fff7ef; --line: #d1b29d; --subtle: #f2dece; --input-surface: #fffaf6;
  --frame-material: linear-gradient(135deg,#e8b08bd0,#a9674be0 68%),url('marble.jpg') center / cover;
  --tile-material: linear-gradient(145deg,#ffe1be8c,#f6dcc495),url('marble.jpg') center / cover;
}
body[data-appearance="dark"] {
  color-scheme: dark;
  --page: color-mix(in srgb,var(--ui-accent) 24%,#15121b);
  --light: color-mix(in srgb,var(--ui-accent) 27%,#241d29);
  --glow: color-mix(in srgb,var(--ui-accent) 35%,transparent);
  --ink: #fff5e8; --muted: #e0cfbf;
  --paper: color-mix(in srgb,var(--ui-accent) 18%,#241e27);
  --line: color-mix(in srgb,var(--ui-accent) 43%,#635866);
  --subtle: color-mix(in srgb,var(--ui-accent) 37%,#2c2531);
  --input-surface: color-mix(in srgb,var(--ui-accent) 14%,#1e1921);
  --button-label: #201521;
}
body[data-theme], body[data-appearance] {
  background: radial-gradient(ellipse at 13% 4%,var(--light),transparent 55%),
    radial-gradient(ellipse at 97% 100%,var(--glow),transparent 63%),var(--page);
  --accent: var(--ui-accent);
}
body::before {
  content: ''; position: fixed; inset: -12px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at center,var(--ui-accent) 0 1px,transparent 1.5px) 0 0 / 24px 24px;
  opacity: .065; animation: drift-pattern 24s linear infinite;
}
@keyframes drift-pattern { to { transform: translate(12px,12px); opacity: .095; } }
body[data-appearance="dark"] a, body[data-appearance="dark"] .eyebrow,
body[data-appearance="dark"] .devanagari, body[data-appearance="dark"] h1 span,
body[data-appearance="dark"] #feedback { color: color-mix(in srgb,var(--ui-accent) 52%,#fff0df); }
.brand-mark, .primary, #mode-picker [aria-pressed="true"], #theme-choices [aria-pressed="true"], #dark-switch[aria-checked="true"] {
  background: var(--ui-accent); border-color: var(--ui-accent); color: #fff8ec;
}
.primary:hover:not(:disabled) { background: color-mix(in srgb,var(--ui-accent) 78%,black); }
body[data-appearance="dark"] .primary, body[data-appearance="dark"] #mode-picker [aria-pressed="true"],
body[data-appearance="dark"] #theme-choices [aria-pressed="true"], body[data-appearance="dark"] #dark-switch[aria-checked="true"] {
  background: color-mix(in srgb,var(--ui-accent) 54%,#ffe6db); color: var(--button-label);
}
.rules, .secondary, .ad-slot, .dice-tray, .chat-stream {
  background: var(--subtle); border-color: var(--line); color: var(--ink);
}
input, #local-form select, .feedback-panel :is(select,textarea) {
  background: var(--input-surface); border-color: var(--line); color: var(--ink);
}
#chat-messages li { background: var(--paper); }
#chat-messages li.bot-chat { background: var(--input-surface); }
body[data-appearance="dark"] .chat-meta small { color: #efca99; }
.view-switch[aria-checked="true"] .view-track { background: var(--ui-accent); }
body[data-appearance="dark"] :is(#players li strong,.turn-heading,#move-options button) {
  color: color-mix(in srgb,var(--bright) 56%,#fff5e8);
}
body[data-appearance="dark"] #players li.active {
  background: color-mix(in srgb,var(--team) 24%,var(--paper));
}
.settings-section { border-top: 1px solid var(--line); padding-top: 12px; }
.settings-section h3 { margin: 0 0 8px; font-size: 1rem; }
#theme-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
#theme-choices button { white-space: normal; padding: 7px; }
.board-space { min-width: 0; }
#board-info { margin-top: 12px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
#board-info #players { display: flex; flex-wrap: wrap; margin: 0; gap: 5px; }
#board-info #players:empty { display: none; }
#tilt-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
#players:not(:empty) + #tilt-controls { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 7px; }
#tilt-controls label { display: grid; flex: 1 1 95px; gap: 2px; }
#tilt-controls input { padding: 0; min-height: 30px; accent-color: var(--ui-accent); }
#tilt-controls button { padding-inline: 8px; }
.board-wrap { background: var(--frame-material); border-color: color-mix(in srgb,var(--ui-accent) 75%,#211407); }
.board-wrap .cell:not(.colored) { background: var(--tile-material); }
body[data-theme]:not([data-theme="classic"]) .board-wrap :is(.yard,.cell.colored) {
  background: radial-gradient(ellipse at 18% 6%,#ffffff58,transparent 56%),
    linear-gradient(142deg,color-mix(in srgb,var(--bright) 88%,var(--ui-accent)),var(--team) 57%,var(--dark));
}
.board-wrap.is-3d {
  --adjusted-scale: calc(var(--view-scale) - .035);
  transform: perspective(1100px) rotateX(var(--tilt-pitch,39deg)) rotateY(var(--tilt-yaw,0deg)) rotateZ(var(--board-angle,-28deg)) scale(var(--adjusted-scale));
  touch-action: none;
  cursor: grab;
}
.board-wrap.is-3d.tilt-dragging { transition: none; cursor: grabbing; }
.board-wrap.is-3d .board::after { display: none; }
.is-3d .board { outline: 0; }
.is-3d .cell, .is-3d .yard { transform: translateZ(.75px); }
.is-3d .socket, .is-3d .home, .is-3d .yard-name { transform-origin: center; }
.is-3d .socket { transform: translate3d(-50%,-50%,1.25px); }
.is-3d .home, .is-3d .yard-name { translate: 0 0 1.5px; }
.board-wrap .board { -webkit-tap-highlight-color: transparent; }
@media(max-width: 720px) {
  .board-space { grid-row: 2; }
  .in-game .board-space { grid-row: 1; }
  .board-wrap.is-3d { --adjusted-scale: .69; }
}
@media(prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
.board-wrap .cell:not(.colored) {
  background: radial-gradient(ellipse at 22% 14%,#fff 0%,#fffff8 25%,transparent 65%),
    linear-gradient(149deg,#f5ead9 0%,#fbf8ee 34%,#eadccd 70%,#f8f3e9 100%);
  color: #64513d;
  border-color: #8e765638;
}
.board-wrap.is-3d {
  transform: perspective(2300px) rotateX(var(--tilt-pitch,39deg)) rotateY(var(--tilt-yaw,0deg))
    rotateZ(var(--board-angle,-28deg)) scale(var(--adjusted-scale));
  background-clip: border-box;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px #e6b78070, inset 0 0 0 5px #47251555,
    0 5px 0 #644126, 0 8px 0 #462e21, 0 12px 0 #342219, 0 18px 21px #38261967;
}
.is-3d .board { border-radius: 5px; }
.is-3d .cell, .is-3d .yard { transform: translateZ(1.1px); }
.view-3d .die-face { border-radius: 5px; transform-style: preserve-3d; }
.view-3d .die-face::before {
  content: ''; position: absolute; inset: -1px; border-radius: 2px;
  background: #854d2d; transform: translateZ(-1px); pointer-events: none;
}
.die-face i { position: relative; }
.is-3d .yard-name > .engraved-name { transform: rotate(var(--engraving-angle,0deg)); }
.yard-name .engraved-name { justify-content: center; width: max-content; }
.player-reaction {
  display: inline-grid; place-items: center; min-width: 2rem; min-height: 1.75rem; padding: 1px 5px;
  border: 1px solid #b481526e; border-radius: 20px; background: var(--paper);
  font-size: 1.15rem; line-height: 1; text-shadow: none;
}
.yard-name .player-reaction {
  position: absolute; z-index: 2; top: 12%; left: 50%; overflow: visible;
  transform: translateX(-50%) rotate(var(--face-angle,0deg));
}
#players .player-reaction { margin-inline-start: auto; }
.yard-name .player-reaction { top: auto; bottom: 2%; }
#difficulty { width: 100%; min-height: 44px; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 6px; background: var(--input-surface); color: var(--ink); font: inherit; }
.star-shield,.protective-barrier {
  color: #fff6ca; border-color: #fff5cab8; box-shadow: 0 0 5px #ffc878, inset 0 0 5px #ffcf8d75;
  background: transparent;
}
.protective-barrier::before { border-top-color: #fff9d9; border-bottom-color: #ffcc82; }
.protective-barrier::after { border-color: #fff3ce; filter: drop-shadow(0 0 2px #ffd18e); }
.board .cell { transition: box-shadow 80ms ease, translate 65ms ease; }
.board .tile-depressed { translate: 0 1px; box-shadow: inset 0 2px 6px #4a312b83, inset 0 -1px 0 #fff7dbaa; }
.is-3d .board .tile-depressed { translate: 0 0 -.75px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--line); }
.info-page { max-width: 780px; }
.info-page .panel { padding: clamp(22px,5vw,45px); }
.info-page h1 { font-size: clamp(2.6rem,6vw,4rem); }
.info-page h2 { margin-top: 19px; font-size: 1.5rem; }
.info-page li { line-height: 1.6; margin-bottom: 5px; }
.community-layout {
  display: grid;
  grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
  gap: 14px;
  align-items: start;
}
.community-layout .live-chat { margin: 0; min-width: 0; }
.community-layout .leaderboard { min-width: 0; }
.live-chat > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  list-style: none;
}
.live-chat > summary::-webkit-details-marker { display: none; }
.live-chat > summary h2 { margin: 0; }
.chat-disclosure {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle);
  font-size: .875rem;
  font-weight: 650;
}
.live-chat[open] .chat-expand, .live-chat:not([open]) .chat-collapse { display: none; }
#chat-empty { margin: 0; color: var(--muted); }
#scores li, #device-scores li { overflow-wrap: anywhere; }
@media(max-width: 720px) {
  .community-layout { grid-template-columns: minmax(0,1fr); }
}
#username-form { display:grid; gap:6px; margin-top:12px; }
#username-backup button { margin-top:8px; }
#offsite-download { white-space: nowrap; }
.next-page { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; font-size:1rem; }
.next-page span { font-size:1.3rem; line-height:1; }
body[data-community] :is(#game-stage,.ad-slot,#live-chat,.community-shortcut) { display:none; }
#community-page { max-width:1090px; margin:auto; }
.community-shortcut { display:none; }
@media(max-width:720px) {
 .community-shortcut { display:inline-flex; align-items:center; text-decoration:none; }
}
@media(max-width:365px) {
 .top { gap:3px; }
 .brand { font-size:1.08rem; }
 .top-actions { gap:3px; }
 .top-actions .rules { padding-inline:5px; font-size:.8rem; }
}
#invite-link-wrap { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px; margin-top:8px; }
#invite-link-wrap label { grid-column:1 / -1; }
#invite-link-wrap input { min-width:0; }
#join-link-form { padding-top:10px; border-top:1px solid var(--line); }
#capture-total { margin:0 0 5px; font-size:.875rem; color:var(--muted); }
#board-info.active-dashboard {
 border:2px solid var(--team);
 background:color-mix(in srgb,var(--team) 15%,var(--paper));
}
#board-info.your-turn { box-shadow:0 0 0 3px color-mix(in srgb,var(--bright) 32%,transparent); }
#board-info #players li.active {
 background:color-mix(in srgb,var(--team) 33%,var(--paper));
 box-shadow:inset 4px 0 var(--team);
}
.player-stats { display:block; color:var(--muted); font-size:.75rem; font-weight:600; }
.yard-stats { flex:none; color:#fff5d4; text-shadow:0 1px 2px #442b05; font-size:.72em; }
.board .token { width:7.5%; }
.board .token.edge-token { width:6.5%; }
.travelling { transition:top 105ms linear,left 105ms linear; }
.capture-impact { animation-duration:540ms; }
.board .safe-occupied { box-shadow:inset 0 0 0 2px #f3cb62,inset 0 0 12px #ffd778d0; }
.safe-occupied::after {
 content:'✦'; position:absolute; right:3%; top:1%; color:#df9a22; font-size:.67em;
 text-shadow:0 0 4px #ffe7a7; pointer-events:none; animation:gold-flare 1.8s ease-in-out infinite;
}
@keyframes gold-flare {
 0%,100% { transform:translate(0,1px) scale(.7); opacity:.3; }
 48% { transform:translate(1px,-4px) scale(1.13); opacity:1; }
}
.dice.rolling { animation:flat-smooth-roll 925ms cubic-bezier(.26,.72,.28,1) both; }
@keyframes flat-smooth-roll {
 0%,100% { transform:rotate(8deg) translateY(0); }
 22% { transform:rotate(-22deg) translateY(-8px); }
 53% { transform:rotate(24deg) translateY(-4px); }
 80% { transform:rotate(-5deg) translateY(-2px); }
}
.view-3d .dice .die-cube[hidden] { display:none; }
.view-3d .dice.rolling { animation:none; }
.view-3d .dice.rolling .die-cube {
 animation:slow-cube-lift 925ms cubic-bezier(.26,.72,.28,1) both;
 transition:transform 110ms ease-in-out;
}
@keyframes slow-cube-lift {
 0%,100% { translate:0 0; }
 22% { translate:0 -8px; }
 55% { translate:0 -4px; }
 79% { translate:0 -2px; }
}
@media(prefers-reduced-motion:reduce) {
 .travelling,.view-3d .dice.rolling .die-cube { transition:none; }
 .dice.rolling,.view-3d .dice.rolling .die-cube,.safe-occupied::after { animation:none; }
}
.load-status {
  width: min(100% - 28px, 650px);
  margin: 16px auto;
  padding: 14px 18px;
  border: 1px solid currentColor;
  border-radius: 14px;
  text-align: center;
}
.load-status p { margin: 0 0 10px; }
