/* Ortak tema: koyu lacivert zemin, amber vurgular, bordo son sayı. */
:root {
  /* Sayfa zaten karanlık — tarayıcı force-dark/auto-dark renk çevirisi YAPMASIN */
  color-scheme: dark;
  --bg: #0d2b45;
  --bg-panel: #123a5c;
  --bg-deep: #0a2136;
  --amber: #ffc107;
  --amber-dark: #b28704;
  --bordo: #9b1b1b;
  --text: #eaf2fa;
  --text-dim: #8fa9c0;
  --green: #2e9e4f;
  --red: #e05252;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button {
  font-family: inherit;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-panel);
  color: var(--text);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
/* TV kumandası / klavye navigasyonu: odak nerede belli olsun */
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 1px;
}
button.primary {
  background: var(--amber);
  color: #1a1a1a;
}
button.danger {
  background: var(--bordo);
  color: #fff;
}
button.toggled {
  background: var(--green);
  color: #fff;
}

input {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a5580;
  background: var(--bg-deep);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* ---------- 1-90 panosu ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.4em;
}
.board-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12%;
  background: var(--bg-deep);
  color: var(--text-dim);
  font-weight: 800;
  font-size: 1em;
  transition: background 0.2s;
}
.board-cell.drawn {
  background: var(--amber);
  color: #111;
}
.board-cell.last {
  background: var(--bordo);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0.5em rgba(155, 27, 27, 0.8);
}
.board-cell.pop {
  animation: pop 0.4s ease-out;
}
@keyframes pop {
  0% {
    transform: scale(1.6);
  }
  100% {
    transform: scale(1.12);
  }
}

/* ---------- tombala kartı (3x9) ---------- */
.tcard {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.25em;
  background: var(--bg-panel);
  padding: 0.4em;
  border-radius: 0.6em;
}
.tcard-cell {
  aspect-ratio: 1 / 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15%;
  background: #f7f3e8;
  color: #222;
  font-weight: 800;
  font-size: 1em;
}
.tcard-cell.empty {
  background: rgba(255, 255, 255, 0.08);
}
.tcard-cell.marked {
  background: var(--amber);
  color: #111;
}
.tcard-cell.last {
  background: var(--bordo);
  color: #fff;
}
.tcard.mini {
  font-size: 7px;
  gap: 1px;
  padding: 2px;
  border-radius: 4px;
}
.tcard.mini .tcard-cell {
  border-radius: 2px;
}

/* ---------- son çekilen sayı topu ---------- */
.lastball {
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  background: var(--bordo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 2em;
  box-shadow: 0 0 0.4em rgba(0, 0, 0, 0.5);
}
.recent {
  display: flex;
  gap: 0.4em;
}
.recent span {
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--amber);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ---------- duyuru overlay ---------- */
.announce-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 15, 26, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  text-align: center;
}
.announce-stage {
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 900;
  color: var(--amber);
  text-shadow: 0 0 30px rgba(255, 193, 7, 0.5);
}
.announce-winner {
  font-size: clamp(1.5rem, 6vw, 4rem);
  font-weight: 700;
}
.announce-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: confetti-fall linear infinite;
}
@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
  }
}

/* ---------- skor renkleri / rozetler ---------- */
.score-pos {
  color: var(--amber);
}
.score-neg {
  color: var(--red);
}
.badge {
  display: inline-block;
  background: var(--amber);
  color: #111;
  font-size: 0.7em;
  font-weight: 800;
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* ---------- bağlantı durumu ---------- */
.conn-status {
  position: fixed;
  top: 6px;
  right: 6px;
  z-index: 200;
  background: var(--bordo);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}
