:root {
  --bg: #120f0a;
  --panel: rgba(27, 20, 14, 0.86);
  --panel-strong: rgba(38, 28, 20, 0.96);
  --line: rgba(255, 219, 159, 0.18);
  --text: #f6e8d2;
  --muted: #c2b29c;
  --gold: #e0b34d;
  --coral: #db6e57;
  --leaf: #6fb08c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(220, 154, 47, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(77, 144, 119, 0.2), transparent 30%),
    linear-gradient(160deg, #1b150f 0%, #0d0b08 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  color: #24170d;
  background: linear-gradient(135deg, #f1c566, #dd8f4a);
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary,
button.ghost {
  color: var(--text);
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.9rem 1rem;
}

.shell {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem;
}

.hero,
.board-header,
.button-row,
.chat-row,
.room-meta,
.actions-grid {
  display: flex;
  gap: 0.75rem;
}

.hero,
.board-header,
.room-meta {
  justify-content: space-between;
  align-items: center;
}

.hero {
  margin-bottom: 1.5rem;
}

.eyebrow,
.meta-label {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 0.25rem;
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 0.95;
}

.lede {
  margin-top: 0.8rem;
  max-width: 64ch;
  color: var(--muted);
}

.pill {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr 1.2fr;
  gap: 1rem;
}

.game-layout {
  grid-template-columns: minmax(210px, 0.7fr) minmax(620px, 2.15fr) minmax(220px, 0.75fr);
  grid-template-areas:
    "lobby board chat"
    "lobby hand chat";
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.lobby-panel,
.chat-panel {
  grid-column: span 1;
}

.lobby-panel { grid-area: lobby; }
.board-panel { grid-area: board; }
.hand-panel { grid-area: hand; }
.chat-panel { grid-area: chat; }

.board-panel {
  grid-column: span 1;
  background:
    linear-gradient(145deg, rgba(64, 39, 21, 0.95), rgba(24, 18, 12, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 223, 159, 0.035) 31px 32px);
  min-height: 660px;
  overflow: hidden;
}

.hand-panel {
  grid-column: span 1;
}

.form-grid,
.rules-copy,
.pile,
.selection,
.action-help {
  display: grid;
  gap: 0.75rem;
}

.divider {
  height: 1px;
  margin: 1rem 0;
  background: var(--line);
}

.feedback,
.muted,
.action-help {
  color: var(--muted);
}

.host-roster {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid rgba(111, 176, 140, 0.34);
  border-radius: 15px;
  background: rgba(70, 109, 84, 0.13);
}

.host-roster-title {
  color: #b9edcb;
  font-size: 0.76rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.host-roster p {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.roster-row {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 0.45rem;
  align-items: center;
  color: #d9c8ac;
  font-size: 0.72rem;
}

.roster-row input {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
}

.players-board {
  position: relative;
  display: grid;
  grid-template-rows: minmax(210px, 1fr) minmax(210px, 1fr);
  gap: 2.7rem;
  min-height: 410px;
  margin-top: 1rem;
  padding: 1.1rem 0.5rem;
  border: 1px solid rgba(245, 220, 165, 0.23);
  border-radius: 26px;
  background:
    radial-gradient(ellipse at center, rgba(213, 159, 83, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(78, 48, 26, 0.4), rgba(19, 25, 24, 0.54));
}

.players-board::before {
  content: "BATTLE FOR THE KINGDOM";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(242, 205, 110, 0.32);
  border-radius: 999px;
  color: rgba(244, 218, 153, 0.66);
  background: rgba(31, 22, 15, 0.82);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  transform: translate(-50%, -50%);
}

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.16);
}

.board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.game-coach {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.7rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 233, 187, 0.2);
  border-radius: 15px;
  color: #faecd7;
  background: linear-gradient(100deg, rgba(31, 43, 40, 0.92), rgba(24, 22, 16, 0.94));
}

.game-coach > div:last-child {
  display: grid;
  gap: 0.22rem;
}

.game-coach strong { font-size: 0.88rem; }
.game-coach span { color: #d0c4ad; font-size: 0.78rem; line-height: 1.35; }
.game-coach small { color: #ad9b7c; font-size: 0.7rem; }
.game-coach b { color: #ffe19a; }

.coach-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: #fff1c6;
  background: #597e6d;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 0 0 4px rgba(100, 151, 124, 0.12);
}

.coach-challenge {
  border-color: rgba(248, 129, 101, 0.72);
  background: linear-gradient(100deg, rgba(108, 37, 29, 0.96), rgba(48, 22, 17, 0.96));
  animation: coachPulse 1.4s ease-in-out infinite;
}

.coach-challenge .coach-icon {
  background: #d85b43;
  box-shadow: 0 0 0 4px rgba(231, 94, 65, 0.18);
}

.coach-turn { border-color: rgba(113, 210, 151, 0.5); }

.coach-waiting .coach-icon {
  color: #d1e7ef;
  background: #47798d;
}

.game-toast {
  position: fixed;
  z-index: 20;
  right: 1.2rem;
  bottom: 1.2rem;
  width: min(390px, calc(100vw - 2.4rem));
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 223, 149, 0.58);
  border-radius: 14px;
  color: #fff3d3;
  background: linear-gradient(135deg, #5d3d20, #27190e);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.48);
  font-size: 0.86rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.game-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes coachPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 91, 67, 0); }
  50% { box-shadow: 0 0 0 5px rgba(239, 91, 67, 0.18); }
}

.legend-exposed {
  color: #f2cd6e;
}

.player-board {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(66, 44, 26, 0.88), rgba(24, 17, 12, 0.96));
  padding: 1rem;
}

.seat {
  position: relative;
  z-index: 2;
  padding: 0.8rem;
}

.opponent-seat {
  align-self: start;
  transform: perspective(900px) rotateX(2deg);
}

.self-seat {
  align-self: end;
  transform: perspective(900px) rotateX(-2deg);
}

.player-board.your-board {
  border-color: rgba(111, 176, 140, 0.58);
}

.player-board.active-ruler {
  box-shadow: inset 0 0 0 1px rgba(243, 200, 100, 0.65), 0 0 28px rgba(224, 179, 77, 0.13);
}

.player-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.land-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.land {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  padding: 0.75rem;
  min-height: 170px;
  overflow: hidden;
}

.highland-lane {
  background: linear-gradient(155deg, rgba(50, 113, 121, 0.4), rgba(15, 37, 41, 0.72));
}

.lowland-lane {
  background: linear-gradient(155deg, rgba(123, 59, 66, 0.4), rgba(52, 19, 29, 0.72));
}

.land-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #f7e7cf;
  font-size: 0.86rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.land-heading small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: normal;
  letter-spacing: 0;
  text-transform: none;
}

.faction-mark {
  display: inline-grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 50%;
  font-size: 0.73rem;
  font-style: normal;
  font-weight: bold;
}

.highland-mark {
  color: #d9f7ff;
  background: #28778a;
}

.lowland-mark {
  color: #ffe2df;
  background: #a34757;
}

.either-mark,
.wild-mark {
  color: #fff4cf;
  background: #a2702e;
}

.hire-mark {
  color: #f5dcff;
  background: #755095;
}

.mat-stack {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.clan-mat,
.pile-card {
  border-radius: 13px;
  background: rgba(14, 10, 8, 0.58);
  border: 1px solid var(--line);
}

.clan-mat {
  position: relative;
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 0.36rem;
  text-align: left;
  color: var(--text);
}

.clan-mat:disabled {
  opacity: 0.72;
}

.clan-mat.is-covered {
  filter: saturate(0.62);
}

.clan-mat.is-exposed {
  border-color: rgba(242, 205, 110, 0.85);
  box-shadow: inset 0 0 0 1px rgba(242, 205, 110, 0.28);
}

.mat-card-art {
  display: grid;
  width: 3rem;
  height: 3.7rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 235, 196, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.mat-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mat-card-fallback {
  font-size: 1.2rem;
}

.mat-card-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.mat-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mat-card-copy span:last-child,
.clan-status {
  color: var(--muted);
  font-size: 0.73rem;
}

.clan-status {
  color: #f2cd6e;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-mat {
  display: grid;
  min-height: 95px;
  place-items: center;
  gap: 0.4rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pile-card.selectable,
.clan-mat.selectable {
  cursor: pointer;
}

.pile-card.selected,
.clan-mat.selected,
.card.selected {
  outline: 2px solid var(--gold);
  transform: translateY(-2px);
}

.piles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.log-list,
.chat-messages {
  list-style: none;
  padding: 0;
  margin: 0;
}

.log-list {
  display: grid;
  gap: 0.45rem;
  max-height: 180px;
  overflow: auto;
}

.chat-messages {
  display: grid;
  gap: 0.6rem;
  height: 330px;
  overflow: auto;
  margin: 1rem 0;
}

.chat-message {
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hand-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.card:hover {
  transform: translateY(-9px) rotate(-0.6deg);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.48);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(20, 14, 10, 0.84));
}

.card-art {
  width: 100%;
  height: 190px;
  object-fit: contain;
  display: block;
  padding-top: 0.4rem;
}

.card-content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.9rem;
}

.card-view {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(255, 237, 201, 0.28);
  color: #f7e9d3;
  background: rgba(16, 12, 9, 0.58);
  font-size: 0.72rem;
}

.card-view:hover:not(:disabled) {
  background: rgba(97, 71, 43, 0.72);
}

.card-faction {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
  padding: 0.24rem 0.46rem;
  border-radius: 999px;
  color: #fffaf1;
  font-size: 0.66rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-name {
  font-size: 1.05rem;
}

.card-meta {
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-meta span {
  max-width: 72%;
  line-height: 1.18;
}

.pile-card {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  min-height: 86px;
  padding: 0.8rem;
}

.pile-card small {
  color: var(--muted);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.4rem;
}

.turn-beacon {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 238, 196, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.76rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.turn-beacon.is-yours {
  border-color: rgba(123, 218, 160, 0.65);
  color: #c9f9d9;
  background: rgba(52, 142, 94, 0.28);
  box-shadow: 0 0 16px rgba(77, 195, 123, 0.26);
}

.turn-beacon.is-challenge {
  border-color: rgba(240, 128, 103, 0.65);
  color: #ffd5c8;
  background: rgba(161, 66, 47, 0.3);
}

.card-dialog {
  width: min(680px, calc(100vw - 2rem));
  border: 0;
  padding: 0;
  background: transparent;
}

.card-dialog::backdrop {
  background: rgba(5, 5, 4, 0.72);
  backdrop-filter: blur(6px);
}

.card-inspector {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 0.85fr) minmax(220px, 1fr);
  gap: 1rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(246, 216, 148, 0.32);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(145deg, #402b1b, #1d1712);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.card-close {
  position: absolute;
  z-index: 2;
  top: 0.8rem;
  right: 0.8rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
}

.card-inspector-art {
  min-height: 320px;
  overflow: hidden;
  border: 1px solid rgba(255, 235, 196, 0.28);
  border-radius: 17px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 60%);
}

.card-inspector-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-inspector-copy {
  display: grid;
  align-content: center;
  gap: 0.9rem;
  padding: 1rem 0.4rem;
}

.card-inspector-copy h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 0.95;
}

/* Battlefield layout: played clans are face-up pieces on lane rails. */
.players-board {
  grid-template-rows: minmax(235px, 1fr) minmax(235px, 1fr);
  gap: 3.6rem;
  min-height: 510px;
  padding: 0.85rem;
  border: 14px solid transparent;
  border-image: linear-gradient(135deg, #7b542c, #24180f, #9e7040, #291b11) 1;
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(238, 186, 93, 0.14), transparent 46%),
    repeating-linear-gradient(35deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #50351f, #2c2118 49%, #3e2b1b);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.62), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.players-board::before {
  padding: 0.66rem 1.3rem;
  border-color: rgba(255, 211, 117, 0.6);
  color: #f8d986;
  background: linear-gradient(180deg, #50371e, #23170e);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
  font-size: 0.7rem;
}

.seat {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 224, 160, 0.18);
  border-radius: 17px;
  background: linear-gradient(100deg, rgba(9, 9, 8, 0.58), rgba(73, 43, 23, 0.43), rgba(9, 9, 8, 0.58));
}

.seat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 38px;
}

.seat-summary h3 {
  margin: 0.1rem 0 0;
  font-size: 0.97rem;
}

.seat-crown {
  color: #f6ce6c;
  font-size: 0.62rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.seat-score {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 0.7rem;
}

.seat-score strong {
  color: #ffe9ad;
  font-size: 1.06rem;
}

.battle-lanes-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  min-height: 0;
}

.battle-lane {
  position: relative;
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  min-width: 0;
  padding: 0.45rem;
  overflow: hidden;
  border: 1px solid rgba(255, 235, 196, 0.15);
  border-radius: 12px;
}

.battle-lane::after {
  content: "";
  position: absolute;
  right: 0.2rem;
  bottom: 0.25rem;
  left: 2.05rem;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 232, 178, 0.22);
  box-shadow: 0 0 8px rgba(255, 210, 114, 0.14);
}

.battle-lane-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #f8e7c7;
  font-size: 0.61rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.battle-lane-label small {
  display: none;
}

.battle-clans {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.65rem;
}

.battle-clan {
  position: relative;
  flex: 0 0 89px;
  width: 89px;
  height: 125px;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(250, 234, 195, 0.44);
  border-radius: 9px;
  color: #fff7e8;
  text-align: left;
  background: #16100b;
  box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.48);
}

.battle-clan:hover:not(:disabled) {
  transform: translateY(-7px) scale(1.05);
  z-index: 4;
}

.battle-clan:disabled {
  opacity: 0.83;
}

.battle-clan.is-exposed {
  border-color: #f4c85c;
  box-shadow: 0 0 0 2px rgba(244, 200, 92, 0.2), 3px 5px 8px rgba(0, 0, 0, 0.48);
}

.battle-clan.is-covered {
  filter: brightness(0.7) saturate(0.7);
}

.battle-clan.selected {
  outline: 3px solid #8ce2af;
  transform: translateY(-8px);
}

.battle-clan-art,
.battle-clan-art img {
  display: block;
  width: 100%;
  height: 100%;
}

.battle-clan-art img {
  object-fit: cover;
  object-position: center top;
}

.battle-clan-frame {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(13, 10, 7, 0.08) 43%, rgba(11, 8, 5, 0.92) 100%);
  pointer-events: none;
}

.battle-clan .faction-mark {
  position: absolute;
  top: 0.26rem;
  right: 0.26rem;
  width: 1.3rem;
  height: 1.3rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.battle-clan-name,
.battle-clan-stats,
.battle-clan .clan-status {
  position: absolute;
  z-index: 1;
  right: 0.34rem;
  left: 0.34rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-clan-name {
  bottom: 1.65rem;
  font-size: 0.65rem;
  font-weight: bold;
}

.battle-clan-stats {
  bottom: 0.35rem;
  color: #e8d8bc;
  font-size: 0.55rem;
}

.battle-clan-stats b { color: #ffe18b; }

.battle-clan .clan-status {
  top: 0.33rem;
  left: 0.33rem;
  right: auto;
  padding: 0.16rem 0.25rem;
  border-radius: 3px;
  color: #fff0c3;
  background: rgba(25, 15, 9, 0.78);
  font-size: 0.46rem;
}

.battle-slot {
  display: grid;
  width: 89px;
  height: 125px;
  place-items: center;
  gap: 0.3rem;
  border: 1px dashed rgba(255, 235, 196, 0.22);
  border-radius: 9px;
  color: rgba(244, 227, 193, 0.5);
  font-size: 0.6rem;
  text-align: center;
}

.battle-slot .faction-mark { opacity: 0.55; }

.inspector-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inspector-stats span {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(255, 235, 196, 0.2);
  border-radius: 10px;
  color: #f7e0b5;
  background: rgba(0, 0, 0, 0.17);
  font-size: 0.8rem;
}

.bg-orb {
  position: fixed;
  width: 260px;
  height: 260px;
  filter: blur(30px);
  opacity: 0.28;
  border-radius: 50%;
  pointer-events: none;
}

.orb-a {
  top: 8%;
  left: -3%;
  background: #df9a47;
}

.orb-b {
  right: -4%;
  bottom: 12%;
  background: #56a28c;
}

.rules-dialog {
  width: min(760px, calc(100vw - 2rem));
  border: 0;
  border-radius: 26px;
  padding: 0;
  background: transparent;
}

.rules-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.rules-sheet {
  background: #f5ead7;
  color: #2f251d;
  border-radius: 26px;
  padding: 1.2rem;
}

.rules-sheet .eyebrow,
.rules-sheet .meta-label {
  color: #8b5e2b;
}

@media (max-width: 1100px) {
  .layout,
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .lobby-panel,
  .board-panel,
  .hand-panel,
  .chat-panel { grid-area: auto; }

  .piles {
    grid-template-columns: 1fr;
  }

  .board-panel { min-height: 0; }
}

@media (max-width: 620px) {
  .shell {
    padding: 1rem;
  }

  .hero,
  .board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .land-row {
    grid-template-columns: 1fr;
  }

  .players-board {
    grid-template-rows: auto;
    min-height: 0;
    gap: 1rem;
  }

  .players-board::before { display: none; }

  .opponent-seat,
  .self-seat { transform: none; }

  .hand-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    min-height: 230px;
  }

  .card-art {
    height: 150px;
  }

  .card-inspector {
    grid-template-columns: 1fr;
  }

  .card-inspector-art { min-height: 240px; }
}
