:root {
  color-scheme: light;
  --paper: #fff9e8;
  --paper-2: #f7edcf;
  --ink: #252525;
  --muted: #665f52;
  --line: #222;
  --table: #e8d8ad;
  --blue: #65a7d8;
  --green: #7fc77e;
  --red: #e76f61;
  --yellow: #f2c85b;
  --violet: #9b86d5;
  --orange: #e69b4d;
  --shadow: 6px 8px 0 rgba(37, 37, 37, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1380px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.36), transparent 26%),
    linear-gradient(135deg, #ead9ab 0%, #d8bd7f 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Comic Sans MS", ui-rounded, system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.paper-button,
.primary {
  border: 2px solid var(--line);
  background: #fffef4;
  color: var(--ink);
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 16px 12px 18px 11px;
  box-shadow: 3px 4px 0 rgba(37, 37, 37, 0.18);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

button:hover,
.paper-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 5px 0 rgba(37, 37, 37, 0.2);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: var(--yellow);
}

input,
select {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  background: #fffef6;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  font-size: 2.25rem;
  line-height: 1.05;
  margin-bottom: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
}

.tabletop {
  width: 1380px;
  margin: 0 auto;
  padding: 18px 22px 40px;
}

.tabletop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.tabletop-tools,
.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 900;
}

.helper {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.92rem;
}

.paper-card {
  position: relative;
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: 22px 16px 24px 15px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.paper-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(37, 37, 37, 0.18);
  border-radius: inherit;
  pointer-events: none;
}

.welcome-table {
  min-height: 720px;
  display: grid;
  grid-template-columns: 420px 420px;
  gap: 28px;
  align-items: start;
  justify-content: center;
  padding-top: 70px;
  background: url("/assets/board-tabletop.png") center/cover no-repeat;
  border: 3px solid var(--line);
  border-radius: 34px 28px 36px 24px;
  box-shadow: var(--shadow);
}

.setup-card {
  display: grid;
  gap: 14px;
}

.lobby-board {
  width: 760px;
  margin: 60px auto 0;
}

.lobby-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.lobby-player,
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid var(--line);
  background: #fffef7;
  padding: 10px 12px;
  border-radius: 14px;
}

.board-shell {
  display: grid;
  gap: 14px;
}

.opponent-row {
  height: 176px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.board-row {
  display: grid;
  grid-template-columns: 248px 1fr 260px;
  gap: 14px;
  align-items: stretch;
}

.left-rail,
.right-rail {
  display: grid;
  gap: 12px;
}

.central-board {
  position: relative;
  height: 548px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 34px 22px 36px 28px;
  background: #f5edda;
  box-shadow: var(--shadow);
}

.board-art {
  position: absolute;
  inset: 0;
  background: url("/assets/board-tabletop.png") center/cover no-repeat;
  opacity: 0.34;
}

.board-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.round-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.round-banner > div,
.gap-explainer,
.world-map {
  background: rgba(255, 249, 232, 0.92);
  border: 2px solid var(--line);
  border-radius: 18px 12px 20px 14px;
  padding: 12px;
}

.track-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.track-card {
  background: rgba(255, 254, 247, 0.94);
  border: 2px solid var(--line);
  border-radius: 18px 12px 20px 14px;
  padding: 12px;
  min-height: 160px;
}

.track-card h3 {
  font-size: 0.95rem;
}

.track-meter {
  position: relative;
  height: 88px;
  margin: 10px auto;
  width: 22px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: #fffdf3;
  overflow: hidden;
}

.track-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--green);
  border-top: 2px solid var(--line);
}

.track-value {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 34px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 900;
}

.gap-explainer {
  display: grid;
  gap: 4px;
}

.world-regions,
.region-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.world-token,
.region-button {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffef7;
  padding: 7px 10px;
  font-weight: 800;
}

.world-token.on {
  background: var(--green);
}

.phase-card,
.token-guide-card,
.feed-card {
  min-height: 0;
}

.phase-path {
  display: grid;
  gap: 7px;
}

.phase-step {
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fffdf4;
  font-weight: 800;
}

.phase-step.on {
  background: var(--yellow);
}

.token-guide {
  display: grid;
  gap: 8px;
}

.token-rule {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
}

.token {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  box-shadow: 2px 3px 0 rgba(37, 37, 37, 0.16);
  font-weight: 900;
}

.token.capital {
  background: var(--yellow);
}

.token.compute {
  background: var(--blue);
}

.token.talent {
  background: var(--green);
}

.token.trust {
  background: var(--red);
}

.token.policy {
  background: var(--violet);
}

.feed {
  display: grid;
  gap: 8px;
  max-height: 482px;
  overflow: auto;
  font-size: 0.86rem;
}

.feed-line {
  border-left: 4px solid var(--blue);
  background: #fffdf4;
  padding: 8px;
  border-radius: 8px;
}

.feed-line.ai {
  border-left-color: var(--orange);
  background: #fff3df;
}

.player-table {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 14px;
}

.mat-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.mission-note {
  width: 230px;
  border: 2px solid var(--line);
  border-radius: 15px;
  padding: 8px;
  background: #fffef7;
  font-size: 0.84rem;
  color: var(--muted);
}

.token-tray {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.token-pile {
  min-height: 98px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fffdf4;
  padding: 9px;
}

.token-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
}

.mini-token {
  width: 18px;
  height: 18px;
  border: 1.8px solid var(--line);
  border-radius: 50%;
  display: inline-block;
}

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

.stat-box,
.mini-stat {
  border: 2px solid var(--line);
  border-radius: 14px 10px 16px 11px;
  background: #fffef7;
  padding: 8px;
}

.stat-box strong,
.mini-stat strong {
  display: block;
  font-size: 1.25rem;
}

.action-board {
  min-height: 388px;
}

.action-guide {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.guide-note {
  background: #fffdf4;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  font-size: 0.78rem;
}

.guide-note strong {
  display: block;
  margin-bottom: 3px;
}

.action-clusters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.action-cluster {
  display: grid;
  gap: 7px;
  align-content: start;
}

.action-cluster button,
.deploy-actions button {
  width: 100%;
  min-height: 0;
  justify-content: flex-start;
  text-align: left;
  font-size: 0.82rem;
}

.deploy-actions {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}

.cards-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.project-card {
  position: relative;
  min-height: 310px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  background: #fffef7;
  border: 2.5px solid var(--line);
  border-radius: 18px 12px 20px 14px;
  padding: 10px;
  box-shadow: 3px 4px 0 rgba(37, 37, 37, 0.14);
}

.card-art {
  position: relative;
  height: 76px;
  border: 2px solid var(--line);
  border-radius: 14px 10px 16px 11px;
  overflow: hidden;
  background: #e9f2ff;
}

.card-art::before,
.card-art::after,
.art-grid,
.art-sun,
.art-path,
.art-focus {
  position: absolute;
  content: "";
  pointer-events: none;
}

.card-art::before {
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 254, 246, 0.58), transparent 48%),
    repeating-linear-gradient(0deg, rgba(37, 37, 37, 0.1) 0 2px, transparent 2px 14px);
}

.card-art::after {
  right: 8px;
  bottom: 8px;
  width: 58px;
  height: 24px;
  border: 2px solid rgba(37, 37, 37, 0.45);
  border-radius: 999px;
  background: rgba(255, 254, 246, 0.36);
}

.art-grid {
  left: 9px;
  top: 9px;
  width: 60px;
  height: 42px;
  border: 2px solid rgba(37, 37, 37, 0.52);
  border-radius: 8px 6px 9px 5px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(37, 37, 37, 0.34) 31% 35%, transparent 35% 65%, rgba(37, 37, 37, 0.34) 65% 69%, transparent 69%),
    linear-gradient(0deg, transparent 47%, rgba(37, 37, 37, 0.34) 47% 53%, transparent 53%);
}

.art-sun {
  right: 19px;
  top: 10px;
  width: 23px;
  height: 23px;
  border: 2px solid rgba(37, 37, 37, 0.62);
  border-radius: 50%;
  background: #fff3a8;
}

.art-path {
  left: 44px;
  right: 38px;
  bottom: 13px;
  height: 18px;
  border-top: 3px solid rgba(37, 37, 37, 0.55);
  border-radius: 50%;
  transform: rotate(-7deg);
}

.art-focus {
  left: 28px;
  top: 24px;
  width: 24px;
  height: 24px;
  z-index: 1;
  border: 3px solid var(--line);
  border-radius: 50%;
  box-shadow: 15px 7px 0 -6px rgba(255, 254, 246, 0.72);
}

.art-label {
  position: absolute;
  right: 11px;
  bottom: 10px;
  z-index: 1;
  max-width: 112px;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
}

.card-art-alignment { background: linear-gradient(135deg, #9fdcb9, #e8f5da); }
.card-art-infrastructure { background: linear-gradient(135deg, #8fc7ed, #d8ecff); }
.card-art-consumer { background: linear-gradient(135deg, #ffd36b, #f5ead4); }
.card-art-enterprise { background: linear-gradient(135deg, #c9c1ff, #e7f3ff); }
.card-art-policy { background: linear-gradient(135deg, #d8ccff, #f4e2ff); }
.card-art-capability { background: linear-gradient(135deg, #ff9f8f, #ffe3c4); }
.card-art-algorithm { background: linear-gradient(135deg, #88d8c0, #fff0a8); }

.project-card h3 {
  font-size: 1rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  background: #e9f2ff;
  font-size: 0.68rem;
  font-weight: 900;
}

.card-cost {
  color: #7a4c09;
  font-weight: 900;
}

.card-text {
  color: var(--muted);
  line-height: 1.25;
  font-size: 0.86rem;
}

.card-actions {
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.opponent-card {
  display: grid;
  gap: 7px;
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: 18px 12px 20px 14px;
  padding: 10px;
  box-shadow: 4px 5px 0 rgba(37, 37, 37, 0.15);
}

.opponent-card.active {
  background: #fff2c7;
}

.opponent-card.self {
  outline: 4px solid rgba(101, 167, 216, 0.5);
}

.opponent-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.badge.ai {
  background: var(--orange);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mini-stat {
  padding: 5px;
  font-size: 0.72rem;
}

.mini-stat strong {
  font-size: 0.95rem;
}

.region-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.region-dot {
  border: 2px solid var(--line);
  background: #fffef7;
  border-radius: 999px;
  padding: 2px 5px;
  font-size: 0.68rem;
  font-weight: 900;
}

.region-dot.on {
  background: var(--green);
}

.scores {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  border-radius: 14px;
  z-index: 20;
}

[hidden] {
  display: none !important;
}
