:root {
  --bg-1: #f3f0e7;
  --bg-2: #e1f1ef;
  --ink: #1b2533;
  --muted: #4a5563;
  --accent: #f4a259;
  --accent-strong: #df7b2b;
  --teal: #2a9d8f;
  --card: rgba(255, 255, 255, 0.78);
  --shadow: 0 20px 45px rgba(30, 41, 59, 0.15);
  --board: #1b5e4b;
  --board-dark: #0f3c32;
  --white: #f5f1ea;
  --black: #10151c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(244, 162, 89, 0.22), transparent 45%),
    radial-gradient(circle at 20% 70%, rgba(42, 157, 143, 0.2), transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

h1 {
  margin: 0 0 16px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: 0.02em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hero {
  grid-column: 1 / -1;
  padding: 28px 32px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--teal);
  margin-bottom: 12px;
}

.panel {
  padding: 22px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel--wide {
  grid-column: 1 / -1;
}

.panel__header {
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
}

.status {
  font-size: 1.1rem;
  font-weight: 600;
}

.meta {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(30, 41, 59, 0.15);
}

.btn--apple {
  background: var(--black);
  color: var(--white);
}

.btn--google {
  background: #ffffff;
  color: #1f2937;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.btn--ghost {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.btn--accent {
  background: var(--accent);
  color: #2d1b0a;
}

.board-wrap {
  position: relative;
  margin-top: 10px;
}

.board {
  --cell-size: min(9vw, 56px);
  display: grid;
  grid-template-columns: repeat(8, var(--cell-size));
  grid-template-rows: repeat(8, var(--cell-size));
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--board), var(--board-dark));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
}

.cell {
  position: relative;
  border: none;
  border-radius: 10px;
  background: rgba(15, 60, 50, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.cell:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.cell:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(42, 157, 143, 0.5);
}

.cell::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cell--black::before {
  background: radial-gradient(circle at 30% 30%, #394150, var(--black));
  opacity: 1;
  transform: scale(1);
}

.cell--white::before {
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--white));
  opacity: 1;
  transform: scale(1);
}

.cell--hint::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background: rgba(244, 162, 89, 0.6);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  color: #f9fafb;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.game-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.log {
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.06);
  padding: 12px;
  border-radius: 14px;
}

.log div + div {
  margin-top: 8px;
}


.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.7;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.orb--one {
  width: 220px;
  height: 220px;
  top: -60px;
  right: 10%;
  background: radial-gradient(circle, rgba(244, 162, 89, 0.6), transparent 65%);
}

.orb--two {
  width: 280px;
  height: 280px;
  bottom: -120px;
  left: 6%;
  background: radial-gradient(circle, rgba(42, 157, 143, 0.55), transparent 65%);
  animation-delay: 2s;
}

.orb--three {
  width: 180px;
  height: 180px;
  top: 40%;
  left: -60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent 70%);
  animation-delay: 4s;
}

[data-animate] {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.8s ease forwards;
  animation-delay: var(--delay, 0s);
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(16px);
  }
}

@media (max-width: 720px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 24px;
  }
  .board {
    --cell-size: min(10.5vw, 48px);
  }
}
