:root {
  color-scheme: dark;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  background: #0c1510;
  color: #f4ead2;
  --panel: #21160e;
  --panel-2: #302116;
  --line: #76572c;
  --muted: #c4b99e;
  --gold: #f0c55b;
  --parchment: #ead39d;
  --ink: #3b2613;
  --player-glow: #4aa5ff;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: radial-gradient(circle at 50% 0, #233729, #0c1510 60%); }
button, input, select { font: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { width: 100%; height: 100dvh; padding: 6px; }
.board-panel { position: relative; width: 100%; height: 100%; min-width: 0; overflow: hidden; contain: layout paint; border: 1px solid #9d7633; border-radius: 11px; background: #142019; box-shadow: inset 0 0 70px rgba(0,0,0,.42), 0 12px 36px rgba(0,0,0,.34); }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; }
canvas.dragging { cursor: grabbing; }
.tile-inspector, .map-status, .board-turn-tools, .map-center-controls, .map-end-turn, .map-ledger-toggle { position: absolute; z-index: 4; }
.hud-frame-button { display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; background: none; color: #fff2c2; cursor: pointer; transition: transform .14s ease, filter .14s ease; }
.hud-frame-button:hover:not(:disabled), .hud-frame-button:focus-visible { outline: 0; background: none; transform: translateY(-2px) scale(1.045); filter: brightness(1.14) drop-shadow(0 0 8px var(--player-glow)) drop-shadow(0 5px 4px rgba(0,0,0,.55)); }
.hud-frame-button:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.hud-frame-button:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.6); opacity: .62; }
.ui-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.ui-icon { position: relative; z-index: 2; width: 66%; height: 66%; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.board-turn-tools { left: clamp(10px, 1.35vh, 20px); top: clamp(10px, 1.35vh, 20px); display: flex; gap: clamp(5px, .55vh, 8px); }
.map-control-button { position: relative; width: clamp(58px, 8.2vh, 118px); height: clamp(58px, 8.2vh, 118px); text-align: center; }
.map-control-button[hidden] { display: none; }
.map-view-icon { width: 57%; height: 57%; margin-top: -8%; }
.render-mode-chip { position: absolute; z-index: 3; left: 13%; right: 13%; bottom: 12%; overflow: hidden; color: #fff0bc; font: 900 clamp(7px, .72vh, 10px)/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-align: center; text-shadow: 0 1px 2px #17315a; white-space: nowrap; }
.map-end-turn { right: clamp(10px, 1.35vh, 20px); bottom: clamp(9px, 1.1vh, 16px); width: clamp(210px, 26.5vh, 382px); height: clamp(58px, 7.6vh, 110px); white-space: nowrap; }
.map-end-turn-label { position: relative; z-index: 2; font-size: clamp(17px, 2vh, 29px); font-weight: 900; letter-spacing: .09em; text-transform: uppercase; text-shadow: 0 2px 2px #17315a, 0 -1px #5b370e; }
.map-end-turn.end-turn-ready { animation: endTurnReadyPulse 1.55s ease-in-out infinite; }
@keyframes endTurnReadyPulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 4px rgba(68,151,255,.48)); }
  50% { filter: brightness(1.22) drop-shadow(0 0 13px rgba(255,211,91,.95)) drop-shadow(0 0 24px var(--player-glow)); }
}
.map-center-controls { left: 50%; bottom: clamp(3px, .7vh, 10px); transform: translateX(-50%); pointer-events: none; }
.map-center-controls > * { pointer-events: auto; }
.map-action-dock { position: relative; width: clamp(350px, 52vh, 750px); height: clamp(88px, 12vh, 173px); }
.map-action-dock[hidden] { display: none; }
.map-action-dock-frame { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; object-fit: fill; pointer-events: none; }
.map-action-buttons { position: absolute; z-index: 2; left: 50%; bottom: 10%; display: flex; justify-content: center; gap: clamp(4px, .65vh, 9px); transform: translateX(-50%); }
.map-action-button { position: relative; width: clamp(58px, 9.2vh, 132px); aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 0; padding: clamp(6px, .7vh, 10px); border: 0; border-radius: 0; background: none; color: #fff2bf; text-align: center; transition: transform .14s ease, filter .14s ease; }
.map-action-button:hover:not(:disabled), .map-action-button:focus-visible { z-index: 8; outline: 0; background: none; transform: translateY(-4px) scale(1.045); filter: brightness(1.16) drop-shadow(0 0 8px var(--player-glow)) drop-shadow(0 5px 4px rgba(0,0,0,.55)); }
.map-action-button.active { transform: translateY(-5px); filter: brightness(1.18) drop-shadow(0 0 11px #f7cc56) drop-shadow(0 5px 4px rgba(0,0,0,.62)); }
.map-action-button:disabled { cursor: not-allowed; filter: grayscale(.85) brightness(.58); opacity: .6; }
.action-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.action-glyph { position: relative; z-index: 2; width: 62%; height: 62%; margin-top: -7%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.action-label { position: absolute; z-index: 3; left: 7%; right: 7%; bottom: 13%; overflow: hidden; color: #fff0bc; font-size: clamp(9px, 1.05vh, 15px); font-weight: 900; line-height: 1; text-overflow: ellipsis; text-shadow: 0 1px 2px #17315a; white-space: nowrap; }
.cooldown-badge { position: absolute; z-index: 5; right: -4px; top: -6px; min-width: clamp(27px, 2.7vh, 39px); padding: clamp(2px, .25vh, 4px) clamp(5px, .5vh, 7px); border: 1px solid #d7ad4e; border-radius: 10px; background: #27190d; color: #fff0bd; font: 900 clamp(10px, .95vh, 14px)/1.2 ui-sans-serif, system-ui, sans-serif; }
.tile-inspector { right: clamp(10px, 1.35vh, 20px); top: clamp(10px, 1.35vh, 20px); display: grid; gap: 1px; min-width: clamp(190px, 18vh, 260px); padding: clamp(8px, .8vh, 12px) clamp(11px, 1.05vh, 15px); border: 1px solid #9c7837; border-radius: 6px; color: #422b15; background: rgba(235,211,159,.92); box-shadow: 0 7px 18px rgba(0,0,0,.28); pointer-events: none; }
.tile-inspector strong { font-size: clamp(12px, 1vh, 15px); }
.tile-inspector span { color: #695031; font: clamp(11px, .9vh, 13px)/1.25 ui-sans-serif, system-ui, sans-serif; }
.map-status { left: clamp(8px, 1.1vh, 16px); bottom: clamp(8px, 1vh, 14px); width: clamp(288px, 42vh, 610px); aspect-ratio: 2.85; pointer-events: none; }
.map-status-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-faction-emblem { position: absolute; z-index: 2; left: 2.5%; top: 7%; width: 25%; height: 86%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); }
.map-status-copy { position: absolute; z-index: 3; inset: 16% 7% 14% 31%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; align-items: end; column-gap: clamp(8px, 1vh, 14px); color: var(--ink); text-shadow: 0 1px rgba(255,255,255,.35); }
#mapName { grid-column: 1 / -1; align-self: center; overflow: hidden; padding: 0 0 4px; border-bottom: 1px solid rgba(83,53,24,.25); font-size: clamp(13px, 1.6vh, 23px); line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
#mapPlayer { grid-column: 1 / -1; align-self: center; display: flex; align-items: center; overflow: hidden; color: #5b3b20; font-size: clamp(9px, 1.05vh, 15px); font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
#mapPlayer .dot { width: clamp(8px, .8vh, 12px); height: clamp(8px, .8vh, 12px); margin-right: 4px; }
.map-gold-line { grid-column: 1; align-self: end; display: flex; align-items: center; gap: 2px; min-height: clamp(22px, 2.2vh, 32px); font-size: clamp(12px, 1.5vh, 22px); font-weight: 900; line-height: 1; }
.map-gold-line img { width: clamp(28px, 3.2vh, 46px); height: clamp(20px, 2.3vh, 33px); object-fit: contain; }
#mapTurn { grid-column: 2; align-self: end; justify-self: end; min-height: clamp(22px, 2.2vh, 32px); display: flex; align-items: center; color: #4d321a; font-size: clamp(10px, 1.25vh, 18px); font-weight: 900; line-height: 1; }
.map-ledger-toggle { right: -2px; top: 45%; width: clamp(40px, 5.5vh, 80px); height: clamp(68px, 9.3vh, 134px); }
.map-ledger-toggle .ui-icon { width: 56%; margin-left: 18%; }
.map-action-button { position: relative; }
.has-tooltip::after, .map-action-button::after { content: attr(data-tooltip); position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 9px); width: max-content; max-width: clamp(240px, 23vh, 330px); padding: clamp(7px, .7vh, 10px) clamp(9px, .85vh, 12px); border: 1px solid #c69a44; border-radius: 5px; background: rgba(35,22,11,.97); color: #f6e7bc; font: 600 clamp(12px, 1.05vh, 15px)/1.3 ui-sans-serif, system-ui, sans-serif; text-align: center; white-space: normal; box-shadow: 0 7px 24px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .12s ease, transform .12s ease; }
.has-tooltip:hover::after, .has-tooltip:focus-visible::after, .map-action-button:hover::after, .map-action-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.board-turn-tools .has-tooltip::after { left: 0; top: calc(100% + 8px); bottom: auto; transform: translate(0,-4px); }
.board-turn-tools .has-tooltip:hover::after, .board-turn-tools .has-tooltip:focus-visible::after { transform: translate(0,0); }
.map-ledger-toggle.has-tooltip::after { left: auto; right: calc(100% + 6px); bottom: 23%; transform: translate(4px,0); }
.map-ledger-toggle.has-tooltip:hover::after, .map-ledger-toggle.has-tooltip:focus-visible::after { transform: translate(0,0); }
.sidebar { position: fixed; z-index: 35; top: 10px; right: 10px; bottom: 10px; width: min(360px, calc(100vw - 44px)); display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 12px; border: 2px solid #b88a3a; border-radius: 12px 0 0 12px; background: linear-gradient(145deg, rgba(46,30,19,.99), rgba(19,15,11,.99)); box-shadow: -18px 0 50px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transform: translateX(calc(100% + 20px)); transition: transform .24s ease, opacity .2s ease; }
.sidebar.open { opacity: 1; pointer-events: auto; transform: translateX(0); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 0 7px; color: #f0cc75; font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-heading button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-color: #8c6a34; background: #25180e; color: #f2dca6; font-size: 21px; text-align: center; }
.top-card, .card { padding: 13px; border: 1px solid #75572d; border-radius: 9px; background: linear-gradient(150deg, rgba(54,36,23,.98), rgba(29,22,16,.98)); }
.top-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; }
.eyebrow { margin: 0 0 2px; color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: #f3e7c8; font-size: 22px; letter-spacing: -.02em; }
h2, summary { margin: 0; color: #e0c587; font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
summary { cursor: pointer; }
.resource { display: grid; justify-items: end; align-content: center; }
.resource span { color: var(--gold); font-size: 24px; font-weight: 900; line-height: 1; }
.resource small { color: var(--muted); font-size: 11px; }
.turn-strip { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.player-pill { display: inline-flex; align-items: center; gap: 7px; color: #f3ead5; font-weight: 800; }
.dot { width: 12px; height: 12px; display: inline-block; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.14); }
.notice { grid-column: 1 / -1; min-height: 40px; padding: 9px 10px; border: 1px solid #5e4728; border-radius: 7px; background: #1b140e; color: #ddd0b2; font: 12px/1.4 ui-sans-serif, system-ui, sans-serif; }
.panel-copy, .small, .rules-card p { color: var(--muted); font: 12px/1.45 ui-sans-serif, system-ui, sans-serif; }
.card > h2 { margin-bottom: 11px; }
.selection-title { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.selection-title img { width: 52px; height: 58px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 4px 3px rgba(0,0,0,.45)); }
.selection-title.castle img { height: 52px; }
.selection-title strong, .selection-title span { display: block; }
.selection-title strong { color: #f5ead1; font-size: 16px; }
.selection-title span { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font: 12px/1.35 ui-sans-serif, system-ui, sans-serif; }
.kv span { color: var(--muted); }
.kv b { color: #f0e5cc; }
.ability-copy { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #61472a; color: #c8b99c; font: 12px/1.45 ui-sans-serif, system-ui, sans-serif; }
.ability-copy strong { color: var(--gold); }
.actions { display: grid; gap: 7px; margin-top: 10px; }
button { border: 1px solid #74572f; border-radius: 7px; background: #352518; color: #f1e7d0; padding: 9px 10px; cursor: pointer; text-align: left; }
button:hover:not(:disabled) { border-color: #b58a43; background: #46321f; }
button:disabled { opacity: .42; cursor: not-allowed; }
button.primary { border-color: #bd9142; background: #71501f; font-weight: 900; text-align: center; }
button.accent { border-color: #d0a84b; background: #6d5420; }
.turn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.turn-actions button { text-align: center; }
.turn-actions #endTurn { grid-column: 1 / -1; }
.turn-actions .end-turn-ready { animation: sidebarReadyPulse 1.55s ease-in-out infinite; }
@keyframes sidebarReadyPulse { 50% { border-color: #f4d16b; box-shadow: 0 0 16px rgba(244,209,107,.5); } }
.confirm-dialog { width: min(430px, calc(100vw - 28px)); padding: 0; overflow: hidden; border: 2px solid #a57b35; border-radius: 12px; background: #25180f; color: #f4ead2; box-shadow: 0 24px 80px rgba(0,0,0,.62); }
.confirm-dialog::backdrop { background: rgba(4,8,6,.74); backdrop-filter: blur(3px); }
.dialog-body { padding: 20px; }
.dialog-body h2 { margin: 0 0 12px; color: #f2d693; font-size: 22px; letter-spacing: 0; text-transform: none; }
.dialog-body > p:not(.eyebrow) { margin: 0; color: #c9bda3; font: 14px/1.4 ui-sans-serif, system-ui, sans-serif; }
.dialog-body ul { max-height: 210px; margin: 12px 0 18px; padding: 10px 10px 10px 31px; overflow-y: auto; border: 1px solid #684d2a; border-radius: 7px; background: #17110c; color: #eadfc8; font: 14px/1.6 ui-sans-serif, system-ui, sans-serif; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dialog-actions button { text-align: center; }
.compact-dialog-actions { margin-top: 18px; }
#eventLog { max-height: 180px; margin-top: 9px; overflow-y: auto; color: #c8bca4; font: 12px/1.4 ui-sans-serif, system-ui, sans-serif; }
.log-entry { padding: 5px 0; border-bottom: 1px solid #594126; }
.log-entry:last-child { border-bottom: 0; }
.rules-card p { margin: 9px 0 0; }
@media (max-width: 800px) {
  .tile-inspector { display: none; }
  .map-status { width: 285px; }
  .map-action-dock { width: 350px; }
  .map-action-button { width: clamp(57px, 7.2vh, 65px); }
}
@media (min-width: 801px) and (max-width: 1300px) {
  .map-status { width: clamp(285px, 34vh, 350px); }
  .map-action-dock { width: clamp(380px, 50vh, 500px); }
  .map-action-button { width: clamp(64px, 8vh, 92px); }
}
@media (max-width: 900px) {
  .map-status { bottom: 100px; }
}
@media (max-width: 780px) {
  .map-end-turn { bottom: 100px; }
}
@media (max-width: 620px) {
  .app-shell { padding: 4px; }
  .board-panel { border-radius: 8px; }
  .board-turn-tools { left: 7px; top: 7px; gap: 3px; }
  .map-control-button { width: 49px; height: 49px; }
  .map-end-turn { right: 7px; bottom: 92px; width: 150px; height: 44px; }
  .map-end-turn-label { font-size: 13px; }
  .map-status { left: 6px; bottom: 92px; width: 255px; }
  .map-center-controls { bottom: 3px; }
  .map-action-dock { width: 315px; height: 82px; }
  .map-action-button { width: 57px; }
  .map-ledger-toggle { width: 34px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-end-turn.end-turn-ready, .turn-actions .end-turn-ready, .special-ready { animation: none !important; }
}
.turn-banner {
  --turn-color: #6a8fca;
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: rgba(5, 8, 12, .28);
  opacity: 0;
  transition: opacity .18s ease;
}
.turn-banner[hidden] { display: none; }
.turn-banner.show { opacity: 1; }
.turn-banner-inner {
  width: min(560px, calc(100% - 44px));
  padding: 25px 34px 22px;
  border: 2px solid color-mix(in srgb, var(--turn-color) 78%, white 22%);
  border-radius: 15px;
  background: color-mix(in srgb, var(--turn-color) 72%, #111923 28%);
  box-shadow: 0 22px 70px rgba(0,0,0,.55), 0 0 34px color-mix(in srgb, var(--turn-color) 40%, transparent);
  text-align: center;
  transform: translateY(10px) scale(.97);
  transition: transform .22s ease;
}
.turn-banner.show .turn-banner-inner { transform: translateY(0) scale(1); }
.turn-banner strong { display: block; font-size: clamp(24px, 4vw, 42px); letter-spacing: .08em; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.turn-banner span { display: block; margin-top: 4px; font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .86; }

/* 0.6.5 pre-match configuration */
.setup-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 12, 8, .84);
  backdrop-filter: blur(8px);
}
.setup-overlay[hidden] { display: none; }
.setup-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 2px solid #a77d36;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(57,38,24,.99), rgba(22,17,12,.99));
  box-shadow: 0 30px 100px rgba(0,0,0,.68), inset 0 1px rgba(255,229,166,.08);
}
.setup-heading h2 { margin: 0; color: #f2d48c; font-size: 31px; letter-spacing: -.02em; text-transform: none; text-shadow: 0 2px #1a0f08; }
.setup-heading > p:last-child { max-width: 650px; margin: 9px 0 0; color: #c7b99d; font: 13px/1.5 ui-sans-serif, system-ui, sans-serif; }
.setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.setup-group { min-width: 0; margin: 0; padding: 14px; border: 1px solid #76582f; border-radius: 9px; background: rgba(18,13,9,.52); }
.setup-group legend { padding: 0 7px; color: #efc65f; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.setup-group label { display: grid; gap: 6px; margin-top: 10px; color: #d3c5a8; font: 800 12px/1.3 ui-sans-serif, system-ui, sans-serif; }
.setup-group label:first-of-type { margin-top: 2px; }
.setup-group select { width: 100%; min-height: 42px; padding: 8px 31px 8px 10px; border: 1px solid #88683a; border-radius: 7px; background: #2b1f15; color: #f1e5cb; font: inherit; }
.setup-group option:disabled { color: #867b69; }
.setup-note { margin: 15px 0 0; padding: 10px 12px; border: 1px solid #684e2c; border-radius: 7px; background: rgba(17,12,8,.54); color: #b8aa8f; font: 12px/1.3 ui-sans-serif, system-ui, sans-serif; text-align: center; }
.setup-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.setup-actions button { min-width: 145px; min-height: 44px; text-align: center; }
.setup-start { font-size: 15px; }
@media (max-width: 720px) {
  .setup-grid { grid-template-columns: 1fr; }
  .setup-panel { padding: 18px; }
}

/* Draw attention to a special that can actually be used now. */
.special-ready {
  border-color: #f5c94f !important;
  animation: specialReadyShimmer 1.35s ease-in-out infinite;
}
@keyframes specialReadyShimmer {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245,201,79,.28), 0 0 10px rgba(245,201,79,.18); }
  45% { box-shadow: 0 0 0 2px rgba(255,224,111,.92), 0 0 20px rgba(245,201,79,.64), inset 0 0 12px rgba(255,221,99,.12); }
  65% { box-shadow: 0 0 0 1px rgba(255,242,170,.55), 0 0 13px rgba(245,201,79,.34); }
}
.enemy-inspection-note { margin-top: 10px; color: #d2b8ba; font-size: 12px; font-weight: 700; }

/* 0.6.8 lobby / asynchronous turn handoff / endgame stats */
.lobby-row { display:flex; gap:10px; align-items:end; margin-top:14px; padding:10px 12px; border:1px solid #684e2c; border-radius:8px; background:rgba(17,12,8,.42); }
.lobby-row label { display:grid; gap:5px; color:#d3c5a8; font:800 12px/1.3 ui-sans-serif,system-ui,sans-serif; flex:1; }
.lobby-row input { min-height:40px; padding:8px 10px; border:1px solid #88683a; border-radius:7px; background:#2b1f15; color:#f1e5cb; font:inherit; text-transform:uppercase; letter-spacing:.08em; }
.lobby-row button { min-height:40px; white-space:nowrap; }
.ready-overlay, .stats-overlay { position:fixed; inset:0; z-index:80; display:grid; place-items:center; background:rgba(3,7,11,.72); backdrop-filter:blur(5px); }
.ready-overlay[hidden], .stats-overlay[hidden] { display:none; }
.ready-panel, .stats-panel { width:min(520px, calc(100vw - 32px)); border:2px solid #a77d36; border-radius:14px; background:linear-gradient(150deg,#3a2719,#17110c); padding:24px; box-shadow:0 28px 80px rgba(0,0,0,.55); text-align:center; }
.stats-panel { width:min(780px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow-y:auto; }
.ready-panel h2, .stats-panel h2 { margin:4px 0 8px; color:#f2d48c; font-size:36px; }
.ready-panel p, .stats-panel p { color:#c9bda3; font-family:ui-sans-serif,system-ui,sans-serif; }
.ready-panel button { min-width:190px; min-height:52px; font-size:17px; margin-top:12px; }
.stats-body { display:grid; gap:12px; margin-top:16px; text-align:left; }
.battle-summary { display:flex; justify-content:center; gap:28px; padding:10px 13px; border:1px solid #76582f; border-radius:8px; background:rgba(17,12,8,.58); color:#cfc2a5; font:700 13px/1.3 ui-sans-serif,system-ui,sans-serif; }
.battle-summary b { margin-left:5px; color:#f3c55c; }
.stats-table-wrap { overflow-x:auto; border:1px solid #684e2c; border-radius:9px; background:rgba(17,12,8,.58); }
.battle-stats { width:100%; border-collapse:collapse; color:#e6dac0; font:700 13px/1.25 ui-sans-serif,system-ui,sans-serif; }
.battle-stats th, .battle-stats td { padding:10px 13px; border-right:1px solid rgba(118,88,47,.55); border-bottom:1px solid rgba(118,88,47,.55); text-align:center; }
.battle-stats tr:last-child > * { border-bottom:0; }
.battle-stats tr > *:last-child { border-right:0; }
.battle-stats thead th { color:#f0d792; background:rgba(99,69,31,.30); }
.battle-stats th[scope="row"], .battle-stats thead th:first-child { text-align:left; color:#cdbf9e; }
.battle-stats td { color:#f5ca60; font-size:15px; }
.stats-player-dot { width:9px; height:9px; display:inline-block; margin-right:6px; border-radius:50%; box-shadow:0 0 0 2px rgba(255,255,255,.12); }
.award-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.award-card { display:grid; gap:3px; min-width:0; padding:12px 14px; border:1px solid #71532d; border-radius:9px; background:linear-gradient(145deg,rgba(67,45,25,.82),rgba(27,19,13,.88)); font-family:ui-sans-serif,system-ui,sans-serif; text-align:center; }
.award-card > span { color:#aa9d82; font-size:10px; font-weight:900; letter-spacing:.11em; text-transform:uppercase; }
.award-card strong { overflow-wrap:anywhere; color:#f2cf73; font-family:Georgia,"Palatino Linotype",serif; font-size:17px; }
.award-card small { color:#c4b79b; font-size:11px; }
.award-card.consolation strong { color:#d4c7a7; }
@media (max-width: 760px) { .lobby-row { flex-direction:column; align-items:stretch; } }
@media (max-width: 560px) { .award-grid { grid-template-columns:1fr; } .battle-summary { gap:12px; justify-content:space-between; } }

/* Play Test: use the full plaque and clearly identify online waiting states. */
[hidden] { display: none !important; }
.map-status-copy { grid-template-rows: auto 1fr auto auto; row-gap: 4px; }
#mapPlayer { font-size: clamp(11px, 1.35vh, 19px); }
#mapEconomy { grid-column: 1 / -1; font-size: clamp(9px, 1.1vh, 15px); white-space: nowrap; }
.map-gold-line { grid-row: 4; font-size: clamp(16px, 2vh, 27px); }
#mapTurn { grid-row: 4; }
#opponentStatus { position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 8; padding: 12px 24px; border: 1px solid #c9aa65; border-radius: 8px; background: #182331ed; color: #ffebc1; font-weight: 700; pointer-events: none; }

.setup-group #opponentChoiceLabel { grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 8px; }
#opponentChoiceLabel input { margin: 2px 0 0; width: 14px; height: 14px; }
