:root {
  color-scheme: dark;
  --bg: #12151d;
  --panel: #1c222d;
  --panel-2: #252d38;
  --line: #394454;
  --text: #f4f7fb;
  --muted: #a7b1bf;
  --gold: #f0c75e;
  --orc: #d77b45;
  --undead: #a584d6;
  --elf: #6bd48f;
  --dwarf: #61b6ff;
  --mercenary: #f0c75e;
  --none: #a7b1bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top left, #26364b 0, transparent 34rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf2f8;
  color: #111722;
  cursor: pointer;
  font-weight: 700;
  min-height: 32px;
  padding: 0 12px;
}

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

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151a23;
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
}

.shell {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  height: 100vh;
  overflow: visible;
  padding: 10px;
}

.join {
  align-content: center;
  display: grid;
  isolation: isolate;
  justify-items: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.join::before {
  background:
    linear-gradient(90deg, rgb(8 11 17 / 92%) 0%, rgb(8 11 17 / 70%) 42%, rgb(8 11 17 / 88%) 100%),
    url("assets/gitlab-game-icon.png") center / min(92vh, 860px) no-repeat;
  content: "";
  inset: 0;
  opacity: 0.78;
  position: absolute;
  z-index: -2;
}

.join::after {
  background: radial-gradient(circle at 50% 42%, rgb(240 199 94 / 18%) 0, transparent 34rem);
  content: "";
  inset: 0;
  position: absolute;
  z-index: -1;
}

.join-form {
  background: rgb(23 28 38 / 88%);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 46%);
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 18px;
  width: min(420px, calc(100vw - 28px));
}

.join h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 4px;
}

.join p {
  color: var(--muted);
  margin: 0 0 6px;
}

.form-error {
  background: #3b1820;
  border: 1px solid #9f4055;
  border-radius: 7px;
  color: #ffd9e0;
  padding: 9px 10px;
}

.mode-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.mode-tabs label {
  align-items: center;
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: 14px minmax(0, 1fr);
  justify-items: start;
  width: 100%;
  padding: 10px;
  white-space: nowrap;
}

.mode-tabs input[type="radio"] {
  accent-color: var(--gold);
  height: 14px;
  margin: 0;
  min-height: 0;
  width: 14px;
}

.room-fields {
  display: grid;
  gap: 12px;
}

.random-fields {
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  padding: 10px;
}

.secondary-button {
  background: #151a23;
  color: var(--text);
}

.topbar,
.board,
.hand-zone,
.mini-zone,
.pile-viewer,
.side-panel,
.log {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 8px 12px;
}

.side-panel {
  align-content: start;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
}

.table-area {
  display: grid;
  gap: 4px;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  min-height: 0;
  overflow: visible;
}

.room-title {
  display: grid;
  gap: 2px;
}

.room-title strong {
  font-size: 16px;
}

.room-title span {
  color: var(--muted);
  font-size: 13px;
}

.opponent-zone,
.player-zone {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: visible;
}

.player {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 10px;
}

.player.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent);
}

.player.active-self {
  border-color: #5ee08a;
  box-shadow: 0 0 0 2px #5ee08a, 0 0 20px rgb(94 224 138 / 24%);
}

.player.active-opponent {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px #ff6b6b, 0 0 20px rgb(255 107 107 / 24%);
}

.player-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 8px;
}

.big-stat {
  border-radius: 8px;
  display: grid;
  font-size: 26px;
  font-weight: 850;
  gap: 2px;
  line-height: 1;
  min-height: 58px;
  padding: 8px 10px;
}

.big-stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.big-stat.hp {
  font-size: 34px;
  grid-column: 1 / -1;
  position: relative;
}

.stat.hp {
  color: #ff9999;
}

.stat.coins {
  color: var(--gold);
}

.stat.damage {
  color: #ff8585;
}

.attack-target {
  outline: 2px solid #ffeded;
  outline-offset: 3px;
}

.selected-attack-target {
  box-shadow: 0 0 0 3px rgb(255 107 107 / 75%), 0 0 22px rgb(255 107 107 / 35%);
}

.boost-stat {
  border-color: var(--dwarf);
  color: var(--dwarf);
  font-weight: 800;
  grid-column: 1 / -1;
  text-align: center;
}

.icon-stat {
  align-items: center;
  background: #151a23;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  min-height: 0;
  padding: 4px 8px;
  justify-content: center;
}

.icon-stat:hover {
  border-color: var(--gold);
  color: var(--text);
}

.board {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: visible;
  padding: 8px 10px;
  position: relative;
  z-index: 1;
}

.board:has(.card:hover, .card.keyboard-zoom),
.hand-zone:has(.card:hover, .card.keyboard-zoom),
.mini-zone:has(.card:hover, .card.keyboard-zoom),
.pile-viewer:has(.card:hover, .card.keyboard-zoom) {
  z-index: 3000;
}

.market-layout {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: visible;
}

.caravan-column {
  align-content: start;
  display: grid;
  gap: 6px;
  justify-content: end;
  padding-right: 48px;
}

.tavern-title {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  position: relative;
}

.tavern-title h2 {
  font-size: 16px;
  font-weight: 750;
  margin: 0;
  text-align: center;
}

.deck-count {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-height: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.deck-tools {
  align-items: baseline;
  display: flex;
  gap: 10px;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.deck-tools .deck-count {
  position: static;
  transform: none;
}

.deck-count:hover,
.test-card-link:hover {
  color: var(--gold);
}

.test-card-link,
.tavern-discard-link {
  background: transparent;
  border: 0;
  color: #8fb8ff;
  font-size: 13px;
  font-weight: 700;
  min-height: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tavern-discard-link {
  color: #ff6b6b;
}

.tavern-discard-link:hover {
  color: #ff9b9b;
}

.section-title.compact {
  align-items: start;
  display: grid;
  gap: 2px;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.section-title h2 {
  font-size: 12px;
  line-height: 1;
  margin: 0;
}

.section-title h2 .title-note {
  color: var(--muted);
  font-weight: 400;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.cards {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, 124px);
  justify-content: start;
  min-height: 0;
  overflow: visible;
}

.card {
  aspect-ratio: 5 / 7;
  background: linear-gradient(145deg, #2c3340, #171c25);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  grid-template-rows: auto 1fr auto;
  height: 174px;
  overflow: hidden;
  padding: 0 9px 4px;
  position: relative;
  transform-origin: center;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  will-change: transform;
  width: 124px;
  z-index: 1;
}

.card:hover,
.card.keyboard-zoom {
  border-color: #fff3b0;
  box-shadow: 0 0 0 2px rgb(240 199 94 / 70%), 0 18px 45px rgb(0 0 0 / 55%);
  cursor: pointer;
  overflow: visible;
  transform: translateZ(0) scale(1.65);
  z-index: 10000;
}

.card:hover *,
.card.keyboard-zoom * {
  cursor: pointer;
}

.selected-card {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 70%);
}

.actionable-card {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 70%), 0 0 18px rgb(255 255 255 / 24%);
}

.actionable-card.selected-card {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgb(255 255 255 / 95%), 0 0 28px rgb(255 255 255 / 55%);
}

.suicide-only-card {
  border-color: #ff7777;
  box-shadow: 0 0 0 2px rgb(255 107 107 / 72%), 0 0 18px rgb(255 107 107 / 28%);
}

.suicide-only-card.selected-card {
  border-color: #ffe1e1;
  box-shadow: 0 0 0 3px rgb(255 107 107 / 90%), 0 0 30px rgb(255 107 107 / 52%);
}

.card.selected-attack-target {
  border-color: #ffe0e0;
}

.own-hand-zone .card {
  transform-origin: center bottom;
}

.own-hand-zone > .cards {
  grid-auto-columns: 124px;
  grid-auto-flow: column;
  grid-template-columns: none;
  overflow: visible;
}

.opponent-zone .card {
  transform-origin: center top;
}

.card.orc .card-title {
  background: var(--orc);
}

.card.undead .card-title {
  background: var(--undead);
}

.card.elf .card-title {
  background: var(--elf);
  color: #102016;
}

.card.dwarf .card-title {
  background: var(--dwarf);
  color: #0e1822;
}

.card.mercenary .card-title {
  background: var(--mercenary);
  color: #211704;
}

.card.no-faction .card-title {
  background: var(--none);
  color: #111722;
}

.card h3 {
  align-content: start;
  border-radius: 7px 7px 0 0;
  display: grid;
  font-size: 11px;
  grid-template-rows: 22px 10px;
  height: 40px;
  line-height: 1;
  margin: 0 -9px;
  min-height: 40px;
  overflow: hidden;
  padding: 5px 40px 3px 9px;
}

.card-title-name {
  display: -webkit-box;
  line-height: 11px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-title small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 10px;
  opacity: 0.78;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.card .cost {
  align-items: center;
  background: #10141b;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  font-weight: 800;
  font-size: 13px;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 6px;
  width: 28px;
  z-index: 3;
}

.card-title,
.card-body,
.card > button {
  position: relative;
  z-index: 2;
}

.card-art {
  border-radius: 0 0 7px 7px;
  inset: 40px 0 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.card-art::after {
  background: linear-gradient(180deg, rgb(8 11 17 / 28%) 0%, transparent 34%, transparent 72%, rgb(8 11 17 / 28%) 100%);
  content: "";
  inset: 0;
  position: absolute;
}

.card-art img {
  border-radius: inherit;
  display: block;
  filter: saturate(1.16) contrast(1.06) brightness(1.05);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.card.orc .card-art img {
  object-position: 50% 38%;
}

.card.undead .card-art img,
.card.elf .card-art img,
.card.dwarf .card-art img {
  object-position: 50% 32%;
}

.card[data-card-id="starter-coin"] .card-art img {
  object-position: 50% 38%;
}

.card[data-card-id="starter-damage"] .card-art img {
  filter: saturate(1.18) contrast(1.08) brightness(1.08);
  object-position: 50% 34%;
}

.card[data-card-id="caravan"] .card-art img {
  filter: hue-rotate(12deg) saturate(1.48) contrast(1.04) brightness(1.16);
  object-position: 50% 43%;
}

.card[data-card-id="caravan"] .card-art::after {
  background: linear-gradient(180deg, rgb(255 224 82 / 24%) 0%, rgb(255 205 35 / 12%) 52%, rgb(8 11 17 / 22%) 100%);
  mix-blend-mode: screen;
}

.card.has-art {
  background: #10141b;
}

.card.has-art .resource-line {
  background: rgb(9 12 18 / 82%);
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  padding: 2px 5px;
  text-shadow: 0 1px 2px #000;
}

.card-body {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 2px;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.stats-slot {
  align-items: center;
  display: flex;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.primary-slot {
  grid-row: 2;
}

.ally-slot {
  grid-row: 3 / 5;
}

.suicide-slot {
  grid-row: 5;
}

.gold-text {
  color: var(--gold);
  font-weight: 800;
}

.damage-text {
  color: #ff6b6b;
  font-weight: 800;
}

.heal-text {
  color: #73e59a;
  font-weight: 800;
}

.card-stats-row {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: space-between;
  min-height: 16px;
  width: 100%;
}

.resource-line {
  align-items: baseline;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
}

.stat-separator {
  color: var(--muted);
  font-weight: 650;
}

.post-text {
  align-items: center;
  background: #10141b;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  gap: 5px;
  justify-self: start;
  padding: 2px 4px;
}

.post-text {
  border-color: #8fb8ff;
  color: #cfe0ff;
}

.post-text.outpost {
  border-color: #ff9a9a;
  color: #ffd0d0;
}

.shield-icon {
  background: #8fb8ff;
  clip-path: polygon(18% 0, 82% 0, 90% 18%, 78% 72%, 50% 100%, 22% 72%, 10% 18%);
  display: inline-block;
  height: 13px;
  width: 12px;
}

.post-text.outpost .shield-icon {
  background: #ff6b6b;
}

.effect-text {
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  display: -webkit-box;
  font-weight: 750;
  line-height: 1.05;
  overflow: hidden;
  padding: 2px 4px;
  width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.effect-text.orc {
  border-color: var(--orc);
}

.effect-text.undead {
  border-color: var(--undead);
}

.effect-text.elf {
  border-color: var(--elf);
}

.effect-text.dwarf {
  border-color: var(--dwarf);
}

.ally-text {
  border-radius: 4px;
  color: #111722;
  display: grid;
  font-weight: 500;
  gap: 1px;
  grid-auto-rows: min-content;
  line-height: 1;
  overflow: hidden;
  padding: 2px 4px;
  width: 100%;
}

.ally-text strong {
  font-weight: 950;
}

.ally-text span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ally-text.orc {
  background: var(--orc);
}

.ally-text.undead {
  background: var(--undead);
  color: var(--text);
}

.ally-text.elf {
  background: var(--elf);
}

.ally-text.dwarf {
  background: var(--dwarf);
}

.suicide-text {
  align-items: center;
  background: #a92525;
  border-radius: 4px;
  color: #fff4f4;
  display: grid;
  font-size: 8.5px;
  font-weight: 500;
  gap: 4px;
  grid-template-columns: 28px minmax(0, 1fr);
  line-height: 1.05;
  overflow: hidden;
  padding: 2px 4px;
  width: 100%;
}

.suicide-icon {
  align-self: center;
  display: grid;
  font-size: 24px;
  font-weight: 950;
  line-height: 0.8;
  place-items: center;
  transform: translateY(-3px);
}

.suicide-lines {
  display: grid;
  gap: 1px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.suicide-lines span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card button {
  align-self: end;
  margin-top: auto;
}

.hand-zone {
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow: visible;
  padding: 4px 8px;
  position: relative;
  z-index: 1;
}

.mini-zone {
  display: grid;
  gap: 3px;
  overflow: visible;
  padding: 4px 8px;
  position: relative;
  z-index: 1;
}

.pile-viewer {
  display: grid;
  gap: 8px;
  overflow: visible;
  padding: 10px 12px;
  position: relative;
  z-index: 1;
}

.confirm-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgb(0 0 0 / 45%);
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 420px;
  padding: 18px;
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

.modal-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: end;
}

.selected-action {
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgb(240 199 94 / 24%);
  outline: none;
}

.help-button {
  align-items: center;
  background: #151a23;
  border-radius: 999px;
  color: var(--gold);
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 30px;
}

.table-tools {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: end;
}

.settings-button {
  color: var(--text);
}

.ready-button {
  background: #c9ffd9;
  color: #0d2a17;
  min-height: 30px;
  padding: 0 10px;
}

.hurry-button,
.attack-player-button {
  background: #ff4d4d;
  border-color: #ff9a9a;
  color: #fff7f7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  min-height: 22px;
  padding: 0 8px;
  text-transform: uppercase;
}

.attack-player-button {
  background: #ffd7d7;
  border-color: #ff9a9a;
  color: #3b1010;
}

.big-stat.hp .hurry-button,
.big-stat.hp .attack-player-button {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
}

.turn-timer-badge {
  align-items: center;
  background: #111722;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 4px;
  line-height: 1;
  min-height: 24px;
  padding: 0 9px;
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
}

.turn-timer-badge::before {
  color: var(--gold);
  content: "timer";
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.turn-timer-badge.urgent {
  border-color: #ff6b6b;
  color: #ff7d7d;
  box-shadow: 0 0 14px rgb(255 107 107 / 20%);
}

.turn-timer-badge.urgent::before {
  color: #ff9a9a;
}

.help-dialog {
  max-width: 520px;
}

.help-list {
  display: grid;
  gap: 8px;
}

.help-list span {
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  padding: 8px 10px;
}

.help-list strong {
  color: var(--text);
}

.tab-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-row button {
  background: #151a23;
  color: var(--muted);
}

.tab-row .active-tab {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
  color: var(--text);
}

.faction-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sacrifice-heading {
  display: grid;
  gap: 4px;
}

.sacrifice-heading h2 {
  margin: 0;
}

.sacrifice-title-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.sacrifice-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.settings-dialog {
  max-width: 460px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.checkbox-label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.checkbox-label input {
  min-height: 0;
  width: auto;
}

.result-banner {
  align-items: center;
  display: flex;
  flex-direction: column;
  font-size: clamp(48px, 9vw, 120px);
  gap: 18px;
  font-weight: 950;
  letter-spacing: 0;
  left: 0;
  pointer-events: auto;
  position: fixed;
  right: 0;
  text-align: center;
  -webkit-text-stroke: 3px #10141b;
  text-shadow: 0 0 2px #10141b, 0 8px 35px rgb(0 0 0 / 75%);
  top: 34vh;
  z-index: 1200;
}

.result-banner.won {
  color: #79f2a0;
}

.result-banner.lost {
  color: #ff7d7d;
}

.played-cards .card {
  height: 174px;
}

.effect-float {
  animation: effect-float-up 1700ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
  border-radius: 999px;
  filter: drop-shadow(0 7px 12px rgb(0 0 0 / 45%));
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  padding: 4px 7px;
  pointer-events: none;
  position: fixed;
  text-shadow: 0 1px 0 rgb(0 0 0 / 45%);
  transform: translate(-50%, 0) scale(0.88);
  z-index: 20000;
}

.effect-label {
  animation: effect-label-up 1900ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
  background: rgb(16 20 27 / 86%);
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 6px;
  color: #f4f7fb;
  filter: drop-shadow(0 7px 12px rgb(0 0 0 / 45%));
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  max-width: 170px;
  padding: 4px 6px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translate(-50%, 0) scale(0.92);
  z-index: 20001;
}

.effect-card-ghost {
  animation: effect-card-purchase-up 2200ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
  filter: drop-shadow(0 18px 28px rgb(0 0 0 / 55%));
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 20002;
}

.effect-card-ghost .card {
  box-shadow: 0 0 0 2px rgb(255 255 255 / 45%), 0 0 28px rgb(240 199 94 / 34%);
  cursor: default;
}

.effect-card-ghost .card:hover {
  cursor: default;
  overflow: hidden;
  transform: none;
}

.effect-float.damage {
  background: rgb(72 12 19 / 78%);
  color: #ff7474;
}

.effect-float.taken-damage {
  background: rgb(82 8 17 / 84%);
  color: #ff5f5f;
}

.effect-float.player-damage {
  border: 1px solid rgb(255 210 210 / 45%);
  font-size: 24px;
  padding: 6px 10px;
  text-shadow: 0 2px 0 rgb(0 0 0 / 60%), 0 0 12px rgb(255 80 80 / 55%);
}

.effect-float.heal {
  background: rgb(13 61 32 / 78%);
  color: #73e59a;
}

.effect-float.coins {
  background: rgb(68 49 10 / 78%);
  color: var(--gold);
}

.effect-float.spent-gold {
  background: rgb(78 54 8 / 84%);
  border: 1px solid rgb(255 218 121 / 36%);
  color: #ffd36b;
  font-size: 18px;
  padding: 5px 8px;
  text-shadow: 0 1px 0 rgb(0 0 0 / 55%), 0 0 9px rgb(255 196 65 / 38%);
}

.effect-float.utility {
  background: rgb(37 45 56 / 82%);
  color: #d8e4f2;
}

@keyframes effect-float-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.72);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -3px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58px) scale(1.08);
  }
}

@keyframes effect-label-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.86);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -2px) scale(1);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -42px) scale(1);
  }
}

@keyframes effect-card-purchase-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.82);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(0.96);
  }
  58% {
    opacity: 0.9;
    transform: translate(-50%, -92%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -126%) scale(1.03);
  }
}

.field-rows {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.field-card-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(var(--field-row-card-capacity, 4), 124px);
  justify-content: space-between;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.pile-cards {
  grid-template-columns: repeat(auto-fill, 124px);
}

.small-button {
  min-height: 28px;
  padding: 0 10px;
}

.skip-button {
  background: #ffd0a8;
  justify-self: end;
}

.actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.attack {
  background: #ffd7d7;
}

.play-all {
  background: #fff0bb;
}

.end-turn {
  background: #d9edff;
}

.suicide-button {
  background: #ffd0a8;
  font-size: 11px;
  min-height: 22px;
  padding: 0 6px;
}

.post-button {
  background: #d9edff;
  font-size: 11px;
  min-height: 22px;
  padding: 0 6px;
}

.card.post-card {
  box-shadow: inset 0 0 0 2px rgb(143 184 255 / 18%);
}

.card.inactive-card {
  filter: grayscale(0.55);
  opacity: 0.7;
}

.card.post-card.actionable-card {
  box-shadow: inset 0 0 0 2px rgb(143 184 255 / 18%), 0 0 0 2px rgb(255 255 255 / 70%), 0 0 18px rgb(255 255 255 / 24%);
}

.card.post-card.actionable-card.selected-card {
  box-shadow: inset 0 0 0 2px rgb(143 184 255 / 18%), 0 0 0 3px rgb(255 255 255 / 95%), 0 0 28px rgb(255 255 255 / 55%);
}

.card.post-card.suicide-only-card {
  box-shadow: inset 0 0 0 2px rgb(143 184 255 / 18%), 0 0 0 2px rgb(255 107 107 / 72%), 0 0 18px rgb(255 107 107 / 28%);
}

.card.post-card.suicide-only-card.selected-card {
  box-shadow: inset 0 0 0 2px rgb(143 184 255 / 18%), 0 0 0 3px rgb(255 107 107 / 90%), 0 0 30px rgb(255 107 107 / 52%);
}

.card-action-dialog {
  max-width: 460px;
}

.card-action-list {
  display: grid;
  gap: 8px;
}

.card-action-list button {
  align-items: start;
  background: #151a23;
  color: var(--muted);
  display: grid;
  gap: 3px;
  justify-items: start;
  min-height: 48px;
  padding: 8px 10px;
}

.card-action-list strong {
  color: var(--text);
}

.card-action-list .action-suicide strong,
.card-action-list .action-suicide span {
  color: #ff6b6b;
}

.card-action-list .action-ally.orc strong,
.card-action-list .action-ally.orc span,
.card-action-list .action-primary.orc strong,
.card-action-list .action-primary.orc span,
.card-action-list .action-primary-auto.orc strong,
.card-action-list .action-primary-auto.orc span {
  color: #ff9b5e;
}

.card-action-list .action-ally.undead strong,
.card-action-list .action-ally.undead span,
.card-action-list .action-primary.undead strong,
.card-action-list .action-primary.undead span,
.card-action-list .action-primary-auto.undead strong,
.card-action-list .action-primary-auto.undead span {
  color: #c99cff;
}

.card-action-list .action-ally.elf strong,
.card-action-list .action-ally.elf span,
.card-action-list .action-primary.elf strong,
.card-action-list .action-primary.elf span,
.card-action-list .action-primary-auto.elf strong,
.card-action-list .action-primary-auto.elf span {
  color: #70e096;
}

.card-action-list .action-ally.dwarf strong,
.card-action-list .action-ally.dwarf span,
.card-action-list .action-primary.dwarf strong,
.card-action-list .action-primary.dwarf span,
.card-action-list .action-primary-auto.dwarf strong,
.card-action-list .action-primary-auto.dwarf span {
  color: var(--dwarf);
}

.card-action-list span {
  font-size: 12px;
}

.log {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 4px;
  min-height: 88px;
  overflow: auto;
  padding: 8px 10px;
}

.account-stats {
  background: #151a23;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  padding: 8px;
}

.account-stats strong {
  color: var(--text);
}

.empty {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 74px;
  padding: 10px;
}

.compact-empty {
  min-height: 48px;
}

.table-area .compact-empty {
  min-height: 28px;
  padding: 6px 8px;
}

.modal-backdrop {
  align-items: center;
  animation: modalBackdropIn 140ms ease-out;
  background: rgb(5 8 13 / 70%);
  display: grid;
  inset: 0;
  overflow: auto;
  padding: 18px;
  position: fixed;
  z-index: 1000;
}

.modal-backdrop > section {
  animation: modalPanelIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.suppress-modal-animation .modal-backdrop,
.suppress-modal-animation .modal-backdrop > section {
  animation: none;
}

.modal-backdrop:has(.card:hover, .card.keyboard-zoom) {
  z-index: 6000;
}

.pile-viewer {
  box-shadow: 0 18px 60px rgb(0 0 0 / 45%);
  margin: 0 auto;
  max-width: 980px;
  overflow: visible;
  width: min(100%, 980px);
  z-index: 6001;
}

.property-modal {
  border-color: color-mix(in srgb, var(--property-color, var(--line)) 80%, white 8%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--property-color, var(--line)) 48%, transparent),
    0 18px 60px rgb(0 0 0 / 45%);
}

.property-modal.orc {
  --property-color: var(--orc);
}

.property-modal.undead {
  --property-color: var(--undead);
}

.property-modal.elf {
  --property-color: var(--elf);
}

.property-modal.dwarf {
  --property-color: var(--dwarf);
}

.property-modal.mercenary {
  --property-color: var(--mercenary);
}

.property-modal.no-faction {
  --property-color: var(--none);
}

@keyframes modalBackdropIn {
  from {
    background: rgb(5 8 13 / 0%);
  }
  to {
    background: rgb(5 8 13 / 70%);
  }
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-backdrop > section {
    animation: none;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 10px;
  }

  .table-area {
    grid-template-rows: auto;
  }

  .cards,
  .market-layout {
    grid-template-columns: 1fr;
  }

  .own-hand-zone > .cards {
    grid-auto-columns: 124px;
    grid-auto-flow: column;
    grid-template-columns: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
