:root {
  --p1: #ef4444;
  --p2: #f59e0b;

  --hero-start: #4c628a;
  --hero-end: #30425f;
}

.setup {
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(12px, 2vw, 16px);
  overflow: hidden;
}

.hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, #d96862, #aa403e);
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.heroInner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.heroTitle {
  margin: 0;
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 400;
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.2px;
  color: #f7f9f2;
  text-shadow: 0 1px 0 rgba(8, 20, 14, 0.45);
}

.heroDesc {
  margin: 0;
  max-width: 60ch;
  font-weight: 750;
  line-height: 1.35;
  color: #f7f9f2;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  background: #fff;
  outline: none;
  touch-action: manipulation;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.spacer {
  flex: 1 1 auto;
  min-height: 10px;
}

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

.game {
  height: 100%;
  display: grid;
  grid-template-columns: 1.7fr 0.6fr;
  gap: clamp(12px, 2vw, 16px);
  overflow: hidden;
  align-items: stretch;
}

.boardWrap {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.metaTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.metaStrong {
  color: var(--text);
  font-weight: 950;
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
}

.boardArea {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-radius: 16px;
  padding: 14px;
}

.board {
  --cell: 72px;
  --gap: 10px;

  display: grid;
  grid-template-columns: repeat(7, var(--cell));
  grid-template-rows: repeat(6, var(--cell));
  gap: var(--gap);

  padding: calc(var(--gap) * 1.1);
  border-radius: 18px;
  background:
    radial-gradient(760px 520px at 25% 18%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow:
    inset 0 -18px 30px rgba(0, 0, 0, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
}

.cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 12px 20px rgba(0, 0, 0, 0.25),
    inset 0 -10px 18px rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
}

.piece {
  width: 84%;
  height: 84%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.22),
    inset 0 -16px 22px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.piece.p1 {
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 44%), var(--p1);
}

.piece.p2 {
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 44%), var(--p2);
}

.piece.show {
  opacity: 1;
  animation: drop 0.18s ease-out;
}

@keyframes drop {
  from {
    transform: translateY(-18px) scale(0.98);
  }

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

.colHits {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--gap);
  padding: calc(var(--gap) * 1.1);
  pointer-events: auto;
}

.colBtn {
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 14px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.colBtn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.colBtn:active {
  background: rgba(255, 255, 255, 0.12);
}

.colBtn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.winRing {
  outline: 4px solid #000;
  outline-offset: 0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.side {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.pillRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.turnPill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 900;
  font-size: 13px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.12);
}

.dot.p1 {
  background: var(--p1);
}

.dot.p2 {
  background: var(--p2);
}

.infoBox {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fafafa;
  padding: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.3;
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.sideButtons {
  display: grid;
  gap: 10px;
  margin-top: auto;
  flex: 0 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  border-radius: 16px;
  z-index: 5;
  padding: 12px;
  pointer-events: auto;
}

.overlay.active {
  display: flex;
}

.overlayCard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
  padding: 14px 16px;
  text-align: center;
  max-width: 520px;
  width: min(520px, 92%);
}

.overlayCard h2 {
  margin: 0 0 8px 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.overlayCard p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
  font-size: 13px;
}

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

  .row2 {
    grid-template-columns: 1fr;
  }

  .game {
    grid-template-columns: 1fr;
  }

  .side {
    min-height: 220px;
  }
}

@media (max-height: 700px) {

}
