:root {
  color-scheme: dark;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  --bg: #201711;
  --panel: #35251b;
  --line: #72543f;
  --text: #f8e9d6;
  --muted: #d5bba5;
  --accent: #f6ca82;
  --ink: #211511;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.discard-piles { display: flex; gap: 10px; grid-column: 1 / -1; padding: 8px 0; }
.discard-pile { position: relative; width: 88px; padding: 0; border: 1px dashed #b59872; border-radius: 7px; aspect-ratio: 640 / 873; background: #23191188; }
.discard-pile .card-face { pointer-events: none; }
.discard-empty { display: block; font-size: .72rem; padding: 6px; color: var(--muted); }
.discard-count { position: absolute; right: 3px; bottom: 3px; min-width: 23px; padding: 2px 4px; border-radius: 5px; background: #241710; color: #fff2dd; font-size: .8rem; }
.discard-preview { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
.discard-preview::backdrop { background: #120b09c9; }
.discard-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.discard-preview-header h2 { font-size: 1.1rem; }
.discard-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 10px; }
body { background: var(--bg); color: var(--text); margin: 0; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.15; }
ol, ul { list-style: none; padding: 0; margin: 0; }
button, input { font: inherit; }
button, input, summary { min-height: 44px; }
button, input { border: 1px solid var(--line); border-radius: 8px; }
button { background: #493224; color: var(--text); cursor: pointer; padding: 8px 13px; font-weight: 650; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input { background: #2a1d16; color: var(--text); padding: 8px 12px; min-width: 0; }
.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.primary:hover:not(:disabled) { background: #ffd097; }
.muted { color: var(--muted); font-size: .875rem; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px clamp(16px, 4vw, 52px); border-bottom: 1px solid var(--line); }
.table-preferences { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
#response-mode { font-size: .8rem; }
#response-mode[aria-pressed="true"] { color: var(--ink); background: var(--accent); }
.brand { font: 700 1.4rem Georgia, serif; text-decoration: none; }
.brand span { color: var(--accent); margin-inline-end: 5px; }
main { max-width: 1400px; margin: 0 auto; padding: clamp(12px, 3vw, 36px); }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.entry { max-width: 440px; margin: min(12vh, 100px) auto 0; padding: clamp(20px, 5vw, 36px); }
.entry p { color: var(--muted); margin: 12px 0 24px; }
.entry form { display: grid; gap: 8px; }
.entry button { margin-top: 10px; }
.entry-back { display: inline-block; margin-top: 16px; color: var(--accent); }
#notice:not(:empty) { margin: 12px 0; font-size: .9rem; color: var(--accent); }
.room-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
#room-code { font-family: ui-monospace, monospace; font-size: clamp(1.1rem, 2vw, 1.65rem); margin-top: 4px; }
.invite { display: flex; gap: 8px; }
.invite input { max-width: 260px; width: 24vw; }

.wooden-table { background: #2c1d15; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.table-status, .table-controls { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px clamp(12px, 2vw, 24px); flex-wrap: wrap; }
.table-status { border-bottom: 1px solid var(--line); }
.lobby-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 12px clamp(12px, 2vw, 24px); background: #39261a; border-bottom: 1px solid var(--line); }
.lobby-controls > p { flex: 1 1 270px; color: var(--muted); }
.table-status h2 { margin-top: 4px; font: 700 clamp(1.35rem, 3vw, 1.9rem) Georgia, serif; }
#prompt { color: var(--accent); overflow-wrap: anywhere; }
.table-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2.55fr) minmax(150px, 1fr);
  grid-template-areas: ". north ." "west board east" ". south .";
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: clamp(12px, 2vw, 24px);
  min-height: 402px;
  background:
    repeating-linear-gradient(0deg, transparent 0 69px, #1b0d0865 70px 72px, #d69c6b26 73px 74px, transparent 75px 84px),
    repeating-linear-gradient(1deg, transparent 0 11px, #421e131c 12px 13px, transparent 14px 24px),
    radial-gradient(ellipse at 50% 40%, #8b5a3f, #4a2a1d 86%);
}
#seats { display: contents; }
.seat { min-width: 0; display: flex; align-items: flex-start; align-self: center; gap: 9px; padding: 12px; border: 1px solid #9a7557; border-radius: 9px; background: #39261a; overflow-wrap: anywhere; }
.seat[data-place="north"] { grid-area: north; }
.seat[data-place="west"] { grid-area: west; }
.seat[data-place="east"] { grid-area: east; }
.seat[data-place="south"] { grid-area: south; }
.seat.vacant { border-style: dashed; background: #442a20; color: var(--muted); }
.seat.has-turn { border-color: #d8a66a; }
.seat.has-priority { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.seat-number { display: grid; place-items: center; background: #583c2a; border-radius: 6px; color: var(--accent); flex: 0 0 27px; height: 27px; font-size: .8rem; }
.seat-details { min-width: 0; flex: 1; }
.seat-details small { display: block; font-size: .76rem; margin-top: 4px; color: var(--muted); }
.seat-details .seat-status { color: var(--accent); }
.you { color: var(--muted); font-size: .75rem; padding-inline-start: 6px; }

.battle { grid-area: board; display: grid; align-content: center; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow-wrap: anywhere; }
.battle h3 { font-size: .95rem; }
.monster { padding: 8px; margin-top: 7px; border: 1px solid #a48060; border-radius: 9px; background: #efdbb6; color: #352017; }
.monster.target { outline: 2px solid var(--accent); outline-offset: 2px; }
.monster-art { display: grid; place-items: center; min-height: 60px; border-radius: 5px; color: #562724; background: radial-gradient(ellipse, #e3ae92, #a45846); font-size: 1.9rem; }
.monster h4 { margin-top: 7px; font-size: 1.02rem; }
.monster dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin: 9px 0 0; }
.monster dt { color: #674932; font-size: .75rem; }
.monster dd { font-weight: 720; margin: 3px 0 0; }
.monster-protection { margin-top: 8px; color: #4b4022; font-size: .78rem; font-weight: 650; }
.actions, .hand { display: flex; flex-wrap: wrap; gap: 8px; }
.table-controls { border-top: 1px solid var(--line); align-items: flex-end; }
.hand-section h3 { font-size: 1rem; }
.hand { margin-top: 8px; }
.loot-card { border: 1px solid #9e7c58; display: block; padding: 8px; border-radius: 6px; font-size: .85rem; background: #efdbb6; color: #382419; }
.loot-card summary { min-height: 26px; cursor: pointer; align-content: center; font-weight: 650; }
.loot-card p { margin: 6px 0; }
.loot-card button { margin-top: 4px; }
#loot-count { margin-top: 4px; }
.seat-cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seat-card { flex: 1 1 108px; max-width: 190px; min-width: 0; border: 1px solid #a48060; border-radius: 6px; background: #efdbb6; color: #382419; }
.seat-card--item { background: #dfbe80; }
.seat-card[open] { flex-basis: 100%; max-width: none; }
.seat-card summary { list-style: none; position: relative; cursor: pointer; padding: 6px 20px 6px 8px; }
.seat-card summary::-webkit-details-marker { display: none; }
.seat-card summary::after { position: absolute; top: 6px; right: 8px; content: '+'; }
.seat-card[open] summary::after { content: '−'; }
.seat-card summary:hover { background: #fff4dc55; }
.seat-card summary span { display: block; }
.seat-card-type, .seat-card-status { color: #69492d; font-size: .68rem; }
.seat-card-name { font-weight: 700; font-size: .86rem; }
.seat-card-description { padding: 7px 8px; border-top: 1px solid #a48060; font-size: .8rem; }
.seat-card-description p + p { margin-top: 5px; }

.log-panel { margin-top: 12px; padding-inline: 14px; }
.log-panel summary { align-content: center; cursor: pointer; font-weight: 650; }
#log { max-height: 300px; overflow: auto; margin-bottom: 10px; }
#demo { margin-top: 10px; }
#log li { padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: .86rem; overflow-wrap: anywhere; }
#log li:last-child { border-bottom: 0; }

@media (max-width: 740px) {
  .room-bar { align-items: stretch; flex-direction: column; margin-bottom: 14px; gap: 10px; }
  .invite input { flex: 1; width: auto; }
  .table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "north east" "board board" "south west";
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    gap: 8px;
  }
  .seat { align-self: stretch; padding: 8px; gap: 6px; }
  .seat-number { flex-basis: 20px; height: 24px; }
  .seat-card { flex-basis: 100%; }
  .battle { gap: 8px; }
  .table-controls { align-items: stretch; flex-direction: column-reverse; }
}

@media (max-width: 360px) {
  .battle { grid-template-columns: minmax(0, 1fr); }
}

.field-card { margin-top: 8px; padding: 8px; border: 1px solid #a48060; border-radius: 7px; background: #efdbb6; color: #352017; }
.field-card h4 { margin: 0 0 5px; }
.field-card p { font-size: .82rem; margin: 5px 0; }
.field-card summary { cursor: pointer; min-height: 32px; }
.field-card button { margin-top: 5px; }
.field-card.target { outline: 2px solid #8d4a27; outline-offset: 1px; }
.field-card.selected-target { box-shadow: inset 0 0 0 3px #7b371e; }
.field-card .selected-label { font-weight: 700; color: #71331f; }
.monster > h4 { margin-top: 12px; }

/* Карты лежат на деревянном столе, а их русский текст доступен в увеличенном виде. */
.seat-card { border: 0; background: transparent; }
.seat-card summary { padding: 0; }
.seat-card summary::after { content: none; }
.seat-card[open] summary::after { content: none; }
.seat-card-description { background: #efdbb6; border: 1px solid #a48060; border-radius: 0 0 7px 7px; color: #382419; }
.seat-card-description button { margin-top: 8px; }
.seat-card-status { display: block; color: #f8e9d6; padding: 3px 2px; }
.card-face {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 7px;
  border: 3px solid #79563b;
  border-radius: 9px;
  background: #ead2a4;
  color: #322117;
  text-align: left;
  box-shadow: 0 3px 8px #160d0870;
}
.card-face--monster { background: #d9b2a4; border-color: #6e382d; }
.card-face--loot { background: #d4c8aa; border-color: #665a42; }
.card-face--character { background: #eed7b2; border-color: #855c48; }
.card-face-type { font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; color: #62472f; }
.card-face-name { font-family: Georgia, serif; font-size: .92rem; line-height: 1.12; }
.card-face-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 640 / 365;
  border: 1px solid #a17c5d;
  border-radius: 3px;
  background: radial-gradient(ellipse, #dfc39e, #9f7658);
}
.card-face-art img {
  position: absolute;
  top: -35%;
  left: 0;
  width: 100%;
  height: auto;
}
.card-face-fallback { text-align: center; color: #593c2c; font: italic .75rem Georgia, serif; }
.card-face-art img + .card-face-fallback { visibility: hidden; }
.card-face-stats, .card-face-note { font-size: .72rem; font-weight: 700; }
.card-face-text { font-size: 1rem; line-height: 1.4; white-space: pre-wrap; }
.card-preview-button { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; font-weight: inherit; }
.card-preview-button:hover:not(:disabled) { background: transparent; }
.card-preview-button:hover .card-face { border-color: #b77e37; }
.field-card { background: transparent; color: var(--text); border-color: #9a7557; }
.field-card .card-preview-button { max-width: 190px; }
.field-card p { color: var(--text); }
.field-card details { margin-top: 4px; }
.loot-card { width: 120px; padding: 0; border: 0; background: transparent; color: var(--text); }
.loot-card[open] { width: min(240px, 100%); }
.loot-card summary { list-style: none; }
.loot-card summary::-webkit-details-marker { display: none; }
.loot-card p { padding: 4px; }
.loot-card button { margin: 4px; }
.card-preview {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 12px;
  border: 1px solid #a48060;
  border-radius: 12px;
  background: #35251b;
  color: var(--text);
}
.card-preview::backdrop { background: #120b09c9; }
.card-preview-close { display: block; margin: 0 0 10px auto; }
.card-preview .card-face { gap: 10px; padding: 14px; border-width: 5px; }
.card-preview .card-face-name { font-size: 1.55rem; }
.card-preview .card-face-type, .card-preview .card-face-stats { font-size: .9rem; }
.card-preview .card-face-text { color: #322117; }
.log-panel { background: transparent; border-color: #72543f80; }

.table-grid { grid-template-columns: minmax(205px, 1fr) minmax(0, 2fr) minmax(205px, 1fr); }
.seat-card { flex: 1 1 165px; max-width: 220px; }
.seat-card .card-preview-button { margin: 0; }
.card-face-text { font-size: .83rem; line-height: 1.35; white-space: pre-wrap; font-weight: 400; }
.card-face-note { line-height: 1.3; white-space: pre-line; }
.field-card .card-face-text, .field-card .card-face-note { color: #322117; margin: 0; }
.field-card .card-preview-button { max-width: 220px; }
.loot-card { width: 170px; }
.loot-card .card-preview-button { margin: 0; }
.loot-card > button:not(.card-preview-button) { margin: 6px 0 0; width: 100%; }
.soul-zone { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.soul-zone > strong { color: var(--accent); font-size: .85rem; }
.deck-zone { margin-top: 10px; }
.deck-zone button { margin-top: 6px; }
.deck-zone small { display: block; margin-top: 4px; }
.deck-back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: min(160px, 100%);
  min-height: 100px;
  padding: 12px;
  border: 3px double #c39a66;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #493124 0 8px, #533729 8px 16px);
  color: #f8e9d6;
  text-align: center;
  box-shadow: 3px 3px 0 #2c1d15, 5px 5px 0 #9a7557;
}
.deck-back span { font-size: .8rem; }
.deck-back--treasure-deck { background: repeating-linear-gradient(45deg, #705126 0 8px, #80602d 8px 16px); }
.deck-back--loot { display: inline-flex; width: 120px; min-height: 76px; margin-top: 8px; background: repeating-linear-gradient(45deg, #62513b 0 8px, #706047 8px 16px); }
.card-preview .card-face-text { font-size: 1rem; }
.battle { grid-template-columns: minmax(0, 1fr); }
.monster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  background: #39261a;
  border-color: #9a7557;
  color: var(--text);
}
.monster > h4, .monster > .deck-zone, .monster > [data-slot-id="revealed-monster"] { grid-column: 1 / -1; }
.monster > h4, .monster > .deck-zone, .monster > .field-card { margin-top: 0; }
.monster > .field-card { min-width: 0; padding: 4px; }
.monster .card-preview-button { max-width: none; margin-top: 0; }
.monster .field-card > button[data-action] { width: 100%; }
.monster .deck-zone { padding: 5px 1px; }
.monster .deck-back { min-height: 60px; }
@media (max-width: 620px) {
  .battle { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 740px) {
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seat-card { flex-basis: 100%; }
  .loot-card { width: min(170px, 100%); }
}

/* Лицевая сторона сохраняет пропорции печатной карты и локализованные области. */
@font-face {
  font-family: 'FontSouls Title';
  src: url('/art/font-title.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'FontSouls Body';
  src: url('/art/font-body.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'Four Souls Cyrillic';
  src: url('/art/font-cyrillic.woff') format('woff');
  font-weight: 300 800;
  font-display: swap;
}
.card-face {
  --card-paper: linear-gradient(174deg, #d6d2cd, #eeeae3 28%, #f0ece5 50%, #d8d1c7 85%, #e5ded4);
  position: relative;
  display: block;
  container-type: inline-size;
  aspect-ratio: 640 / 873;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 5% / 3.7%;
  background: #ddc3a1;
  color: #281b16;
}
.card-face-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.card-face-name {
  position: absolute;
  inset: 7.4% 11.6% 87%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1%;
  background: linear-gradient(174deg, #dbd9d3, #f1eee8 43%, #e1ddd5);
  color: #191410;
  text-align: center;
  font: 800 6.6cqw/.95 'FontSouls Title', 'Four Souls Cyrillic', sans-serif;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.card-face-name--long { font-size: 5.1cqw; }
.card-face-rules {
  position: absolute;
  inset: 62.5% 11.6% 7.6%;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 3%;
  overflow: auto;
  padding: 2.3%;
  background: var(--card-paper);
  color: #191410;
  text-align: center;
  scrollbar-width: none;
}
.card-face--monster .card-face-rules { inset-block: 66.6% 14.7%; }
.card-face--character .card-face-rules { inset-block-start: 66.6%; }
.card-face--soul .card-face-rules {
  inset-block: 67% 15.4%;
  background: linear-gradient(172deg, #d8e0e5, #eef1ef 48%, #dce6eb);
}
.card-face-rules--tap { padding-inline-start: 10%; }
.card-face-tap { position: absolute; inset: 2% auto auto 1%; width: 12%; height: auto; }
.card-face-text, .field-card .card-face-text {
  margin: 0;
  padding: 0;
  color: #191410;
  font: 750 5.15cqw/1.13 'FontSouls Body', 'Four Souls Cyrillic', sans-serif;
  white-space: pre-wrap;
  text-transform: uppercase;
}
.card-face-text.card-face-text--long { font-size: 3.95cqw; }
.card-face .card-face-text, .card-face .card-face-note { color: #080604; }
.card-face-reward {
  position: absolute;
  inset: 84.6% 10% 7.1%;
  display: grid;
  place-content: center;
  padding-inline: 3%;
  background: #ebd6a1;
  color: #080604;
  text-align: center;
  font: 800 4.6cqw/1.05 'Four Souls Cyrillic', sans-serif;
}
.card-face-stats, .card-face-note, .field-card .card-face-note {
  margin: 0;
  color: #2f2b28;
  font: 750 3.8cqw/1.15 'FontSouls Body', 'Four Souls Cyrillic', sans-serif;
  white-space: pre-line;
  text-transform: uppercase;
}
.card-face-rule-divider { border-top: solid 1px #77756c; padding-top: 2%; }
.card-face-stats {
  position: absolute;
  inset: 58.3% 18.9% 34.7%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  background: var(--card-paper);
  font: 800 6.3cqw/.95 'FontSouls Title', 'Four Souls Cyrillic', sans-serif;
  white-space: nowrap;
}
.card-face--character .card-face-stats { inset-inline: 29% 29.5%; }
.card-stat { display: inline-flex; align-items: center; gap: .18em; }
.card-stat + .card-stat { border-left: .065em solid #96938e; padding-inline-start: .27em; }
.card-stat img { width: 1.05em; height: 1.05em; object-fit: contain; }
.card-preview { width: min(440px, calc(100vw - 24px), calc((100dvh - 126px) * .733 + 26px)); }
.card-preview .card-face { padding: 0; border: 0; }
.card-preview .card-face-name { font-size: 6.6cqw; }
.card-preview .card-face-name--long { font-size: 5.1cqw; }
.card-preview .card-face-stats { font-size: 6.3cqw; }
.card-preview .card-face-text { font-size: 5.15cqw; }
.card-preview .card-face-text--long { font-size: 3.95cqw; }
.card-face--character .card-face-text, .card-face--soul .card-face-text { font-size: 4.15cqw; }
.card-face--character .card-face-note { font-size: 3.3cqw; }
.card-preview-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-preview .card-preview-close { margin: 0; }
.card-preview-back { display: block; width: 100%; aspect-ratio: 640 / 873; object-fit: cover; border-radius: 5% / 3.7%; }
.card-preview :is(.card-face, .card-preview-back)[hidden] { display: none; }
.card-preview-meta { margin: 8px 0 0; font-size: .85rem; text-align: center; }
.deck-back, .deck-back--loot, .monster .deck-back {
  position: relative;
  display: flex;
  width: min(160px, 100%);
  min-height: 0;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.deck-back img {
  width: 100%;
  aspect-ratio: 640 / 873;
  object-fit: cover;
  border-radius: 5% / 3.7%;
  box-shadow: 3px 3px 0 #2c1d15, 5px 5px 0 #9a7557;
}
.deck-back strong, .deck-back span {
  color: #fff0dc;
}
.deck-back strong { margin-top: 5px; }

.seat-stats { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 6px; }
.seat-stat { display: inline-flex; align-items: center; gap: 3px; color: #f8e9d6; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.seat-stat-icon { width: 1.05rem; height: 1.05rem; background-position: center; background-size: contain; background-repeat: no-repeat; }
.seat-stat-icon--heart { background-image: url('/art/icon-heart.webp'); }
.seat-stat-icon--sword { background-image: url('/art/icon-sword.webp'); }
.seat-stat-icon--coin { border: 2px solid #ffc66f; border-radius: 50%; background: #9a5c32; box-shadow: inset 0 0 0 2px #704124; }
.seat-stat-icon--soul { background-image: url('/art/back-soul.webp'); background-size: 175%; border-radius: 50%; }
.seat-stat-icon--hand { width: .8rem; border-radius: 2px; background-image: url('/art/back-loot.webp'); box-shadow: 2px -1px #6aafac; }
.card-face-stats { inset-inline: 15% 15%; gap: .08em; font-size: 5.7cqw; }
.card-face--character .card-face-stats { inset-inline: 29% 29.5%; }
.card-stat { gap: .08em; min-width: 0; }
.card-stat + .card-stat { padding-inline-start: .16em; }
.card-preview .card-face-stats { font-size: 5.7cqw; }

.table-grid { grid-template-areas: ". north ." "west board east" "south south south"; }
.monster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.monster > .deck-zone { grid-column: auto; }
.monster .card-preview-button, .monster .deck-back { max-width: 132px; margin-inline: auto; }
.seat .seat-card { flex: 1 1 100px; max-width: 118px; }
.seat--self {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(140px, 1fr) minmax(0, 1.65fr) minmax(90px, auto);
  grid-template-areas: "left cards hand right";
  align-items: start;
  gap: 10px;
  width: 100%;
}
.seat--self .seat-number { display: none; }
.seat--self .seat-details { grid-area: cards; min-width: 0; }
.seat--self .table-controls { display: contents; }
#actions-left { grid-area: left; }
#actions-right { grid-area: right; }
.seat--self .player-actions { display: flex; flex-direction: column; align-items: stretch; }
.seat--self .hand-section { grid-area: hand; min-width: 0; }
.seat--self .hand { margin: 0; }
.seat--self .loot-card { width: 130px; }
.pass-priority { color: var(--accent); min-width: 48px; font-size: .9rem; line-height: 1.2; }
.card-preview-button--ready .card-face { box-shadow: 0 0 0 2px #e1a74e, 0 0 14px #e1a74e80; }
.loot-deck-zone { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; }
#throw-die-button { align-self: center; }
.deck-back { position: relative; }
.deck-back .deck-count {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: block;
  min-width: 1.6em;
  padding: .1em .35em;
  border-radius: 5px;
  background: #211610e8;
  color: #fff0dc;
  text-align: center;
  font-weight: 700;
}
.card-preview .card-face-rules { overflow-y: auto; scrollbar-width: thin; }
.card-preview .card-face-rules:focus-visible { outline-offset: -2px; }
@media (max-width: 740px) {
  .table-grid { grid-template-areas: "north east" "board board" "west west" "south south"; }
  .seat--self { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "left right" "cards cards" "hand hand"; }
  .seat--self .player-actions { flex-direction: row; flex-wrap: wrap; }
  .seat--self .loot-card { width: clamp(80px, 25vw, 112px); }
}

