:root {
  --bg: #201611;
  --bg-deep: #0f0a08;
  --panel: rgba(248, 240, 228, 0.92);
  --panel-strong: rgba(255, 250, 241, 0.98);
  --ink: #231712;
  --muted: #6e5a4c;
  --accent: #b34b2e;
  --accent-strong: #7d2614;
  --shadow: rgba(0, 0, 0, 0.28);
  --table-edge: #5e3527;
  --table-surface: #b78659;
  --felt: #28463e;
  --point-light: #e9bf7c;
  --point-dark: #7d2f1d;
  --bar: #57362a;
  --checker-white: #f8f1e7;
  --checker-black: #222124;
  --highlight: #ffdf72;
  --move: rgba(255, 223, 114, 0.22);
  --line: rgba(35, 23, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: #f7ecdf;
  background:
    radial-gradient(circle at top left, rgba(255, 184, 122, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(179, 75, 46, 0.18), transparent 28%),
    linear-gradient(140deg, var(--bg), var(--bg-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.app-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: grid;
  gap: 1.5rem;
}

.hero,
.control-bar,
.table-card,
.panel {
  background: rgba(255, 246, 233, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 42px var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  border-radius: 28px;
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  animation: rise-in 420ms ease-out both;
}

.eyebrow,
.label,
.stat__label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: #ffc690;
}

.hero h1,
.table-card h2,
.panel h2 {
  margin: 0.35rem 0 0;
  color: #fff3e5;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 0.95;
}

.hero__lede,
.status-copy,
.board-note,
.move-log li,
.panel--rules li {
  color: rgba(255, 238, 219, 0.82);
  line-height: 1.55;
}

.hero__lede {
  max-width: 60ch;
  margin-top: 1rem;
}

.hero__badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge,
.pill,
.turn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.badge,
.pill {
  color: #241712;
  background: rgba(255, 236, 209, 0.88);
}

.turn-chip {
  background: linear-gradient(180deg, #c35a39, #7d2614);
  color: #fff7ef;
}

.control-bar {
  border-radius: 24px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: end;
  animation: rise-in 520ms ease-out both;
}

.control {
  display: grid;
  gap: 0.4rem;
  min-width: 180px;
}

.control select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.92rem 1rem;
  background: rgba(255, 247, 235, 0.14);
  color: #fff4e3;
  font: inherit;
  font-weight: 700;
  appearance: none;
}

.control option {
  color: var(--ink);
}

.control--buttons {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.button,
.bear-off {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  background: rgba(255, 247, 235, 0.14);
  color: #fff4e3;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled),
.bear-off:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.18);
}

.button:disabled,
.bear-off:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button--primary {
  background: linear-gradient(180deg, #d57452, #8c2d19);
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 1.5rem;
  align-items: start;
}

.table-card {
  border-radius: 32px;
  padding: 1.4rem;
  animation: rise-in 620ms ease-out both;
}

.table-card__header,
.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.table-card__header h2,
.panel h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.table-scroll {
  margin-top: 1rem;
  overflow-x: auto;
}

.board-grid {
  min-width: 980px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-template-rows: 1fr 1fr;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(140deg, var(--table-edge), #7d543b);
}

.point,
.bar-slot,
.off-slot {
  position: relative;
  min-height: 310px;
  border: 0;
  border-radius: 18px;
  padding: 0.4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.1));
  overflow: hidden;
}

.point {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
}

.point--bottom {
  align-items: flex-end;
}

.point::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 100%, 4% 0, 96% 0);
  opacity: 0.94;
}

.point--bottom::before {
  clip-path: polygon(50% 0, 4% 100%, 96% 100%);
}

.point--light::before {
  background: linear-gradient(180deg, #f2d39e, var(--point-light));
}

.point--dark::before {
  background: linear-gradient(180deg, #9f4c35, var(--point-dark));
}

.point--origin::after,
.point--target::after,
.bar-slot--origin::after,
.bar-slot--target::after,
.off-slot--target::after {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 16px;
}

.point--origin::after,
.bar-slot--origin::after {
  border: 2px dashed rgba(255, 223, 114, 0.72);
}

.point--target::after,
.bar-slot--target::after,
.off-slot--target::after {
  background: var(--move);
}

.point__label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 247, 235, 0.7);
  letter-spacing: 0.08em;
}

.point--top .point__label {
  top: 0.5rem;
}

.point--bottom .point__label {
  bottom: 0.5rem;
}

.stack {
  position: relative;
  z-index: 1;
  width: min(90%, 70px);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.point--bottom .stack {
  flex-direction: column-reverse;
}

.checker {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    inset 0 8px 16px rgba(255, 255, 255, 0.18),
    inset 0 -12px 16px rgba(0, 0, 0, 0.22),
    0 8px 12px rgba(0, 0, 0, 0.22);
}

.checker--white {
  background: radial-gradient(circle at 32% 24%, #fffdf9, var(--checker-white));
}

.checker--black {
  background: radial-gradient(circle at 32% 24%, #5b5960, var(--checker-black));
}

.checker__count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  font-size: 0.92rem;
}

.checker--black .checker__count {
  color: #fff6ec;
}

.bar-slot,
.off-slot {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.16)), var(--bar);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.35rem;
}

.bar-slot__section,
.off-slot__section {
  width: 100%;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.bar-slot__title,
.off-slot__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 247, 235, 0.74);
  text-transform: uppercase;
}

.bar-token,
.off-token {
  min-width: 2.2rem;
  min-height: 2.2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.16), inset 0 -8px 10px rgba(0, 0, 0, 0.2);
}

.bar-token--white,
.off-token--white {
  background: var(--checker-white);
  color: var(--ink);
}

.bar-token--black,
.off-token--black {
  background: var(--checker-black);
  color: #fff6ec;
}

.side-panel {
  display: grid;
  gap: 1rem;
  animation: rise-in 720ms ease-out both;
}

.panel {
  border-radius: 24px;
  padding: 1.15rem 1.15rem 1.25rem;
}

.dice-strip {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.die {
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.2rem;
  background: rgba(255, 245, 228, 0.9);
  color: var(--ink);
}

.die--used {
  opacity: 0.4;
}

.bear-off {
  width: 100%;
  margin-top: 1rem;
  background: linear-gradient(180deg, rgba(255, 232, 192, 0.24), rgba(125, 38, 20, 0.38));
}

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

.stat {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat strong {
  display: block;
  margin-top: 0.3rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2rem;
  color: #fff7ea;
}

.move-log {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
}

.move-log li strong {
  color: #fff6ea;
}

.panel--rules ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, 760px);
    padding-top: 1rem;
  }

  .hero,
  .table-card,
  .panel {
    border-radius: 22px;
  }

  .hero {
    flex-direction: column;
  }

  .hero__badges {
    justify-content: flex-start;
  }

  .control {
    width: 100%;
  }

  .control--buttons {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  .button,
  .bear-off {
    width: 100%;
  }

  .stats-panel {
    grid-template-columns: 1fr 1fr;
  }
}
