/* Coco Table: shared look for the TV board and the phone hand. */
:root {
  --felt: #0d3b2c;
  --felt-dark: #072519;
  --felt-light: #155a43;
  --ink: #fdf8ec;
  --muted: #a9c7b9;
  --accent: #ffc83d;
  --accent-ink: #231a00;
  --danger: #ff6b5e;
  --tile: #fbf6e9;
  --tile-edge: #d9cfb6;
  --pip: #1b1b1b;
  --card: rgba(0, 0, 0, 0.28);
  --line: rgba(255, 255, 255, 0.14);
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--felt-dark); }
body {
  background: radial-gradient(ellipse at 50% 35%, var(--felt-light), var(--felt) 55%, var(--felt-dark));
  background-attachment: fixed;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

.brand { font-weight: 800; letter-spacing: 0.01em; }
.brand .coco { color: var(--accent); }

.btn {
  appearance: none;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.7em 1.3em;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.btn.small { padding: 0.4em 0.9em; min-height: 36px; font-size: 0.9em; }
.btn.ghost { border-color: var(--line); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* Tiles */
.tile-face { fill: var(--tile); stroke: var(--tile-edge); stroke-width: 0.03; }
.tile-back { fill: #2b2016; stroke: #6b5440; stroke-width: 0.05; }
.tile-line { stroke: #b9ad92; stroke-width: 0.035; stroke-linecap: round; }
.pip { fill: var(--pip); }
.tile-new .tile-face { stroke: var(--accent); stroke-width: 0.09; }
.board-empty { fill: var(--muted); font-size: 0.7px; }

.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--muted); }
.dot.on { background: #5ee08f; }

/* Toast for errors */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2a0d0b; border: 1px solid var(--danger); color: #ffd8d4;
  padding: 0.7em 1.1em; border-radius: 12px; max-width: calc(100% - 32px);
  z-index: 50; font-weight: 600;
}

/* Confetti (game over) */
.confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}
