/* Jungle UI: green-felt table, walnut frame, cream cards, ink text.
   Display serif for the title; system sans for controls. */

:root {
  --felt: #1e4632;
  --felt-dark: #163626;
  --walnut: #5a3d24;
  --cream: #f3ead3;
  --ink: #2b2118;
  --gold: #d9b64a;
  --blue: #2456a6;
  --red: #b3372f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--felt-dark);
  color: var(--cream);
  font-family: -apple-system, "Segoe UI", Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.screen {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.screen[hidden] {
  display: none;
}

.menu-card {
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--walnut);
  border-radius: 10px;
  padding: 28px 36px;
  max-width: 460px;
  margin: auto 0;
}

.menu-card h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  margin: 0 0 4px;
  letter-spacing: 1px;
  color: #3d2a18;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 8px;
}

.subtitle {
  margin: 0 0 18px;
  font-style: italic;
}

.setup label {
  display: block;
  margin: 10px 0;
}

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

select,
button {
  font: inherit;
  border-radius: 6px;
  border: 2px solid var(--walnut);
  padding: 6px 12px;
  background: #fffdf6;
  color: var(--ink);
}

button {
  cursor: pointer;
}

button.primary {
  background: var(--gold);
  font-weight: 700;
}

button:hover:not(:disabled) {
  filter: brightness(1.07);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 1px;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.menu-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.info {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.8;
}

#game-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
}

#board-col {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

#board {
  background: var(--felt);
  border: 3px solid var(--walnut);
  border-radius: 8px;
  max-width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

#side-panel {
  flex: 0 0 220px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--walnut);
  border-radius: 8px;
  padding: 12px 14px;
}

#side-panel h2 {
  font-family: Georgia, serif;
  font-size: 17px;
  margin: 12px 0 6px;
}

#turn-label {
  font-weight: 700;
  font-size: 17px;
}

#thinking {
  font-style: italic;
  margin-top: 4px;
}

#status-counts {
  margin: 6px 0;
  font-size: 13px;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.panel-row button {
  padding: 4px 8px;
  font-size: 13px;
}

#move-list {
  max-height: 180px;
  overflow-y: auto;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#captured-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
}

.cap {
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 8px;
  color: #fff8e6;
}

.cap.TOP {
  background: var(--blue);
}

.cap.BOTTOM {
  background: var(--red);
}

.side-chip {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
  border: 2px solid rgba(0, 0, 0, 0.35);
}

.side-chip.TOP {
  background: var(--blue);
}

.side-chip.BOTTOM {
  background: var(--red);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay[hidden] {
  display: none;
}

.dialog {
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--walnut);
  border-radius: 10px;
  padding: 22px 26px;
  max-width: 560px;
  max-height: 84vh;
  overflow-y: auto;
}

.dialog h2 {
  font-family: Georgia, serif;
  margin-top: 0;
}

.dialog button {
  margin: 8px 8px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none;
    animation: none;
  }
}
