:root {
  --text: #ebf5ff;
  --muted: #9eb4cb;
  --accent: #68dfd7;
  --accent2: #8d76ff;
  --danger: #d35f78;
  --good: #8dd88f;
  --green: #48d17d;
  --poison: #7c9b27;
  --fire: #d98b2b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(104, 223, 215, 0.10), transparent 24%),
    radial-gradient(circle at bottom right, rgba(141, 118, 255, 0.09), transparent 25%),
    linear-gradient(180deg, #050c13, #071018 28%, #08111a 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
}

.screen-vignette,
.screen-hit-flash,
.screen-turn-veil,
.screen-green-flash,
.screen-wound {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.screen-vignette {
  z-index: 1;
  background:
    radial-gradient(circle at center, transparent 45%, rgba(0,0,0,0.18) 78%, rgba(0,0,0,0.36) 100%);
}

.screen-hit-flash {
  z-index: 6;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(211, 95, 120, 0.26), rgba(141, 118, 255, 0.08), transparent 66%);
}

.screen-hit-flash.active { animation: screenHit 0.35s ease; }

@keyframes screenHit {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.screen-turn-veil {
  z-index: 5;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(141, 118, 255, 0.10), rgba(5, 12, 19, 0.15), rgba(0,0,0,0.35));
}

.screen-turn-veil.force-daughter {
  background: radial-gradient(circle at center, rgba(72, 209, 125, 0.14), rgba(5, 12, 19, 0.16), rgba(0,0,0,0.34));
}
.screen-turn-veil.force-daughter-corrupt {
  background: radial-gradient(circle at center, rgba(124, 155, 39, 0.18), rgba(5, 12, 19, 0.18), rgba(0,0,0,0.38));
}
.screen-turn-veil.force-keeper {
  background: radial-gradient(circle at center, rgba(217, 139, 43, 0.20), rgba(5, 12, 19, 0.16), rgba(0,0,0,0.34));
}
.screen-turn-veil.force-tecknomancer {
  background: radial-gradient(circle at center, rgba(124, 155, 39, 0.18), rgba(5, 12, 19, 0.18), rgba(0,0,0,0.38));
}

.screen-turn-veil.active { animation: turnVeil 2.1s ease; }

@keyframes turnVeil {
  0% { opacity: 0; }
  24% { opacity: 1; }
  100% { opacity: 0; }
}

.screen-green-flash {
  z-index: 6;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(72, 209, 125, 0.22), rgba(72, 209, 125, 0.06), transparent 68%);
}
.screen-green-flash.active { animation: screenGreen 0.7s ease; }

@keyframes screenGreen {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

.screen-wound {
  z-index: 7;
  opacity: 0;
  background:
    radial-gradient(circle at 32% 30%, rgba(190, 30, 60, 0.18), transparent 18%),
    radial-gradient(circle at 68% 62%, rgba(190, 30, 60, 0.14), transparent 16%),
    linear-gradient(135deg, transparent 44%, rgba(255,255,255,0.05) 45%, transparent 46%),
    linear-gradient(35deg, transparent 52%, rgba(255,255,255,0.04) 53%, transparent 54%);
  mix-blend-mode: screen;
}
.screen-wound.active { animation: woundAppear 0.7s ease; }

@keyframes woundAppear {
  0% { opacity: 0; }
  20% { opacity: 0.9; }
  100% { opacity: 0; }
}

.page {
  position: relative;
  z-index: 2;
  width: min(1580px, 96vw);
  margin: 0 auto;
  padding: 24px 0 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

h1 {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: 0.05em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.state-pill {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid rgba(104, 223, 215, 0.28);
  background: rgba(104, 223, 215, 0.10);
  font-weight: 700;
}

.music-toggle {
  padding: 10px 14px;
  border-radius: 999px;
  color: #071018;
  background: linear-gradient(180deg, #e6c26e, #b88632);
  border: 1px solid rgba(255, 224, 143, 0.34);
  box-shadow: 0 0 20px rgba(230, 194, 110, 0.10);
}

.music-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, #74e69d, #47b96f);
  box-shadow: 0 0 24px rgba(72, 209, 125, 0.22);
}

.main-stack {
  display: grid;
  gap: 20px;
}

.board-shell,
.panel {
  background:
    linear-gradient(180deg, rgba(22, 34, 49, 0.96), rgba(13, 21, 31, 0.98));
  border: 1px solid rgba(93, 126, 160, 0.28);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.board-shell {
  padding: 20px;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.board-head h2,
.panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.board-head p {
  margin: 0;
  color: var(--muted);
}

.board-head-right {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.board-frame {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(104, 223, 215, 0.12);
  background:
    radial-gradient(circle at center, rgba(104, 223, 215, 0.04), transparent 44%),
    linear-gradient(180deg, #0f1823, #0b121b);
  overflow: hidden;
  min-height: 860px;
}

.board-frame.hit {
  box-shadow:
    0 0 0 1px rgba(211, 95, 120, 0.35),
    0 0 26px rgba(211, 95, 120, 0.16);
}

.birth-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(72, 209, 125, 0.12), rgba(5, 12, 19, 0.62) 45%, rgba(0,0,0,0.86) 100%);
  backdrop-filter: blur(8px);
}

.birth-card-overlay.hidden {
  display: none;
}

.birth-card-panel {
  width: min(1120px, 96vw);
  background:
    radial-gradient(circle at 50% 0%, rgba(104, 223, 215, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(10,16,24,0.94), rgba(5,10,16,0.98));
  border: 1px solid rgba(104, 223, 215, 0.24);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.54), 0 0 40px rgba(72, 209, 125, 0.08);
  padding: 22px;
}

.birth-card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.birth-card-head span {
  color: #d9bd75;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.birth-card-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
}

.birth-card-head p {
  margin: 0;
  color: var(--muted);
}

.birth-card-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.birth-card-choice {
  position: relative;
  min-height: 246px;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #070d13;
  border: 1px solid rgba(104, 223, 215, 0.18);
  box-shadow: 0 16px 34px rgba(0,0,0,0.36);
  color: var(--text);
}

.birth-card-choice:hover {
  transform: translateY(-5px);
  filter: saturate(1.08);
  border-color: rgba(104, 223, 215, 0.52);
  box-shadow: 0 18px 42px rgba(0,0,0,0.44), 0 0 20px rgba(104, 223, 215, 0.16);
}

.birth-card-choice:disabled {
  cursor: default;
}

.birth-card-choice.is-muted {
  opacity: 0.34;
  filter: grayscale(0.8) brightness(0.74);
  transform: scale(0.96);
}

.birth-card-choice.is-resolving .birth-card-face {
  filter: saturate(1.16) brightness(1.08);
  animation: cardResolvePulse 1s ease-in-out infinite;
}

.birth-card-choice.is-spinning .birth-card-face {
  animation: cardSpin 0.52s ease;
}

.birth-card-face {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 246px;
}

.birth-card-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 246px;
  object-fit: cover;
}

.birth-card-count,
.birth-card-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  border-radius: 12px;
  background: rgba(5, 10, 16, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(235,245,255,0.92);
  padding: 8px;
  text-align: center;
}

.birth-card-count {
  font-weight: 800;
  font-size: 1rem;
}

.birth-card-label {
  display: grid;
  gap: 2px;
}

.birth-card-label strong {
  font-size: 0.88rem;
}

.birth-card-label span {
  color: var(--muted);
  font-size: 0.72rem;
}

.birth-card-choice.is-revealed {
  border-color: rgba(230, 194, 110, 0.68);
  box-shadow: 0 22px 54px rgba(0,0,0,0.48), 0 0 34px rgba(230, 194, 110, 0.15);
}

.birth-card-choice.is-enemy,
.birth-card-choice.is-trap {
  border-color: rgba(211, 95, 120, 0.72);
  box-shadow: 0 22px 54px rgba(0,0,0,0.48), 0 0 34px rgba(211, 95, 120, 0.17);
}

.birth-card-choice.is-heal,
.birth-card-choice.is-flame {
  border-color: rgba(72, 209, 125, 0.72);
  box-shadow: 0 22px 54px rgba(0,0,0,0.48), 0 0 34px rgba(72, 209, 125, 0.17);
}

@keyframes cardResolvePulse {
  0%, 100% { transform: scale(1); opacity: 0.88; }
  50% { transform: scale(1.025); opacity: 1; }
}

@keyframes cardSpin {
  0% { transform: rotateY(0deg); }
  48% { transform: rotateY(88deg); }
  100% { transform: rotateY(0deg); }
}

.turn-banner {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  color: #efe9ff;
  background: rgba(141, 118, 255, 0.18);
  border: 1px solid rgba(141, 118, 255, 0.35);
  box-shadow: 0 0 20px rgba(141, 118, 255, 0.14);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.turn-banner.force-daughter {
  background: rgba(72, 209, 125, 0.18);
  border-color: rgba(72, 209, 125, 0.38);
  box-shadow: 0 0 20px rgba(72, 209, 125, 0.18);
}
.turn-banner.force-daughter-corrupt {
  background: rgba(124, 155, 39, 0.22);
  border-color: rgba(124, 155, 39, 0.44);
  box-shadow: 0 0 20px rgba(124, 155, 39, 0.20);
}
.turn-banner.force-keeper {
  background: rgba(217, 139, 43, 0.22);
  border-color: rgba(217, 139, 43, 0.44);
  box-shadow: 0 0 20px rgba(217, 139, 43, 0.18);
}
.turn-banner.force-tecknomancer {
  background: rgba(124, 155, 39, 0.22);
  border-color: rgba(124, 155, 39, 0.44);
  box-shadow: 0 0 20px rgba(124, 155, 39, 0.20);
}

.turn-banner.active { animation: bannerPulse 1.9s ease; }

@keyframes bannerPulse {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  22% { opacity: 1; transform: translateX(-50%) translateY(0); }
  84% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

.board {
  display: grid;
  grid-template-columns: repeat(9, 82px);
  grid-template-rows: repeat(9, 82px);
  gap: 10px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.tile {
  position: relative;
  border: 1px solid rgba(88, 118, 149, 0.34);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.tile.wall {
  background:
    linear-gradient(180deg, rgba(10, 15, 21, 0.96), rgba(7, 11, 16, 0.98));
  opacity: 0.32;
  border-color: rgba(54, 71, 88, 0.14);
}

.tile.hidden-room {
  background:
    linear-gradient(180deg, #111820, #0b1016);
  border-color: rgba(73, 92, 110, 0.18);
  filter: saturate(0.65);
}

.tile.hidden-room::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: rgba(158, 180, 203, 0.25);
}

.tile.hidden-room.path-available {
  cursor: pointer;
  border-color: rgba(104, 223, 215, 0.62);
  background:
    radial-gradient(circle at 50% 45%, rgba(104, 223, 215, 0.13), transparent 34%),
    linear-gradient(180deg, #14212c, #0b1219);
  box-shadow:
    0 0 0 1px rgba(104, 223, 215, 0.18),
    0 0 20px rgba(104, 223, 215, 0.14);
  filter: saturate(0.95);
}

.tile.hidden-room.path-available::after {
  color: rgba(104, 223, 215, 0.48);
  text-shadow: 0 0 14px rgba(104, 223, 215, 0.35);
  animation: mysteryPulse 1.8s ease-in-out infinite;
}

.tile.hidden-room.path-available .tile-label,
.tile.hidden-room.path-available .tile-pressure {
  color: rgba(235,245,255,0.70);
  z-index: 1;
}

@keyframes mysteryPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

.tile.locked {
  filter: grayscale(1) brightness(0.72);
}

.tile.locked::before {
  content: "LOCK";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.6rem;
  color: rgba(230, 236, 243, 0.75);
  background: rgba(0,0,0,0.28);
  border-radius: 999px;
  padding: 2px 6px;
  z-index: 2;
}

.tile.room {
  background:
    radial-gradient(circle at 30% 24%, rgba(104, 223, 215, 0.06), transparent 26%),
    radial-gradient(circle at 70% 78%, rgba(141, 118, 255, 0.05), transparent 24%),
    linear-gradient(180deg, #182637, #0f1824);
}

.tile.room::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(104, 223, 215, 0.16), rgba(141, 118, 255, 0.16));
}

.tile.has-card-result {
  box-shadow:
    inset 0 0 0 1px rgba(230, 194, 110, 0.16),
    0 0 16px rgba(230, 194, 110, 0.08);
}

.tile.is-camp {
  box-shadow:
    inset 0 0 0 1px rgba(230, 194, 110, 0.30),
    0 0 22px rgba(230, 194, 110, 0.18),
    0 0 34px rgba(72, 209, 125, 0.10);
}

.tile-camp-marker {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(230, 194, 110, 0.48);
  background: rgba(7, 16, 24, 0.82);
  color: #f4d783;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 0 14px rgba(230, 194, 110, 0.18);
  z-index: 3;
}

.tile.result-enemy,
.tile.result-trap {
  box-shadow:
    inset 0 0 0 1px rgba(211, 95, 120, 0.18),
    0 0 16px rgba(211, 95, 120, 0.10);
}

.tile.result-heal,
.tile.result-flame {
  box-shadow:
    inset 0 0 0 1px rgba(72, 209, 125, 0.18),
    0 0 16px rgba(72, 209, 125, 0.10);
}

.tile-result-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(230, 194, 110, 0.36);
  background: rgba(0,0,0,0.36);
  box-shadow: 0 8px 18px rgba(0,0,0,0.30), 0 0 14px rgba(230, 194, 110, 0.10);
  z-index: 1;
}

.tile-result-marker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile.path-available {
  cursor: pointer;
  border-color: rgba(104, 223, 215, 0.68);
  box-shadow:
    0 0 0 1px rgba(104, 223, 215, 0.22),
    0 0 18px rgba(104, 223, 215, 0.10);
}

.tile.path-available:hover {
  transform: translateY(-2px);
  filter: saturate(1.06);
}

.tile.start {
  background: radial-gradient(circle at 50% 35%, rgba(104, 223, 215, 0.17), transparent 32%), linear-gradient(180deg, #173245, #10202f);
}
.tile.hall {
  background: radial-gradient(circle at 70% 25%, rgba(255,255,255,0.03), transparent 18%), linear-gradient(180deg, #182637, #111b28);
}
.tile.sanctum {
  background: radial-gradient(circle at 50% 38%, rgba(141,216,143,0.12), transparent 28%), radial-gradient(circle at 60% 60%, rgba(104,223,215,0.08), transparent 22%), linear-gradient(180deg, #183025, #101a16);
}
.tile.nexus {
  background: radial-gradient(circle at 50% 40%, rgba(104,223,215,0.12), transparent 26%), radial-gradient(circle at 52% 56%, rgba(141,118,255,0.12), transparent 26%), linear-gradient(180deg, #1a2840, #101827);
}
.tile.trap {
  background: radial-gradient(circle at 72% 26%, rgba(213,176,109,0.14), transparent 20%), linear-gradient(180deg, #302516, #18120c);
}
.tile.echo_whisper,
.tile.echo_test {
  background: radial-gradient(circle at 34% 34%, rgba(141,118,255,0.16), transparent 26%), linear-gradient(180deg, #26193b, #130f1d);
}
.tile.cache {
  background: radial-gradient(circle at 50% 36%, rgba(141,216,143,0.15), transparent 26%), linear-gradient(180deg, #1a3120, #111913);
}
.tile.rift {
  background: radial-gradient(circle at 48% 35%, rgba(141,118,255,0.16), transparent 24%), radial-gradient(circle at 58% 63%, rgba(104,223,215,0.12), transparent 24%), linear-gradient(180deg, #211938, #11121e);
}
.tile.vault {
  background: radial-gradient(circle at 50% 35%, rgba(213,176,109,0.16), transparent 26%), linear-gradient(180deg, #322716, #17110c);
}
.tile.les {
  background: radial-gradient(circle at 50% 35%, rgba(213,176,109,0.12), transparent 26%), radial-gradient(circle at 68% 62%, rgba(104,223,215,0.08), transparent 24%), linear-gradient(180deg, #2f2716, #17130c);
}
.tile.heart {
  background: radial-gradient(circle at 50% 44%, rgba(211,95,120,0.20), transparent 28%), radial-gradient(circle at 55% 56%, rgba(104,223,215,0.08), transparent 26%), linear-gradient(180deg, #431f2a, #231018);
}

.tile-label {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.68rem;
  color: rgba(235,245,255,0.72);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile-pressure {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.72rem;
  color: rgba(235,245,255,0.72);
  background: rgba(0,0,0,0.20);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 2px 7px;
}

.player-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.90);
  background: linear-gradient(180deg, rgba(104,223,215,0.95), rgba(141,118,255,0.95));
  box-shadow: 0 0 0 4px rgba(104,223,215,0.14), 0 0 16px rgba(104,223,215,0.32);
}

.player-core.hit { animation: playerHit 0.34s ease; }

@keyframes playerHit {
  0% { box-shadow: 0 0 0 4px rgba(211,95,120,0.08), 0 0 0 rgba(211,95,120,0); }
  35% { box-shadow: 0 0 0 10px rgba(211,95,120,0.28), 0 0 18px rgba(211,95,120,0.58); }
  100% { box-shadow: 0 0 0 4px rgba(104,223,215,0.14), 0 0 16px rgba(104,223,215,0.32); }
}

.center-event-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 3;
  padding: 24px;
}

.center-event {
  width: min(540px, calc(100% - 40px));
  min-height: 180px;
  background: linear-gradient(180deg, rgba(8,14,22,0.88), rgba(11,18,28,0.96));
  border: 1px solid rgba(104,223,215,0.22);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.38);
  padding: 18px;
  display: grid;
  gap: 14px;
  pointer-events: auto;
}

.center-event-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.center-event-text {
  line-height: 1.55;
  font-size: 1rem;
}

.center-actions {
  display: grid;
  gap: 10px;
}

.below-board {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.stats-grid,
.combat-grid,
.inventory-grid {
  display: grid;
  gap: 12px;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.combat-grid {
  grid-template-columns: repeat(2, 1fr);
}

.inventory-grid {
  grid-template-columns: repeat(6, 1fr);
}

.stat-box,
.combat-box,
.inventory-slot {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,113,142,0.26);
  border-radius: 16px;
  padding: 12px;
}

.stat-box span,
.combat-box span,
.slot-name {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.stat-box strong,
.combat-box strong {
  font-size: 1.16rem;
}

.inventory-slot {
  min-height: 86px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.slot-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.slot-qty {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 700;
}

.slot-empty {
  color: rgba(158,180,203,0.36);
  font-size: 0.86rem;
}

.combat-status {
  margin-top: 12px;
  min-height: 44px;
  line-height: 1.42;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(85,113,142,0.26);
  border-radius: 16px;
  padding: 12px;
}

button {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #061018;
  background: linear-gradient(180deg, var(--accent), #58bcb5);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

button.secondary {
  background: linear-gradient(180deg, #7e8faa, #62728b);
  color: #eef5ff;
}

button.green {
  background: linear-gradient(180deg, #65d68b, #47b96f);
  color: #081018;
}

button.fire {
  background: linear-gradient(180deg, #e3a24e, #c97c25);
  color: #081018;
}

button.poison {
  background: linear-gradient(180deg, #9ab43a, #738a20);
  color: #081018;
}

@media (max-width: 1100px) {
  .birth-card-grid {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
  }

  .birth-card-choice,
  .birth-card-face,
  .birth-card-img {
    min-height: 220px;
  }

  .board {
    grid-template-columns: repeat(9, 64px);
    grid-template-rows: repeat(9, 64px);
    gap: 8px;
  }

  .board-frame {
    min-height: 700px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .inventory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .page {
    width: min(98vw, 98vw);
  }

  .board {
    grid-template-columns: repeat(9, 42px);
    grid-template-rows: repeat(9, 42px);
    gap: 5px;
  }

  .board-frame {
    min-height: 520px;
    padding: 10px;
  }

  .tile-label,
  .tile-pressure {
    display: none;
  }

  .tile-result-marker {
    width: 24px;
    height: 32px;
    border-radius: 5px;
  }

  .tile-camp-marker {
    top: 3px;
    padding: 1px 4px;
    font-size: 0.42rem;
  }

  .center-event {
    width: calc(100% - 12px);
    min-height: 170px;
    padding: 14px;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .birth-card-overlay {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  .birth-card-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .birth-card-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
  }

  .birth-card-choice,
  .birth-card-face,
  .birth-card-img {
    min-height: 198px;
  }
}
