/* ══════════════════════════════════════════════════════════════
   VIER OP EEN RIJ — app-specifieke styling
   Thema-variabelen (--bg, --accent, --green-*, etc.) en day-mode
   overrides komen uit /css/ibiza-theme.css. Dit bestand bevat
   alleen layout, componenten en animaties die uniek zijn voor
   deze app.
   ══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
  display: flex;
  flex-direction: column;
}
#global-topbar {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* ── SCREENS ── */
.screen {
  position: absolute;
  top: 57px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}
.topbar-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── START ── */
.start-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--accent) !important;
  border: none !important;
  color: var(--accent-text) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.start-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 8px;
}
.start-sub {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 36px;
  line-height: 1.5;
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  text-align: left;
}
.mode-card:not(.accent):hover {
  border-color: #444;
}
.mode-card.accent {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-text) !important;
}
.mode-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  color: var(--text);
}
.mode-card.accent .mode-card-icon {
  color: var(--accent-text);
}
.mode-card-title {
  font-size: 15px;
  font-weight: 700;
}
.mode-card-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 2px;
}

/* ── SHARE ── */
.share-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.qr-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-url {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  text-align: center;
  max-width: 300px;
  margin-bottom: 24px;
  line-height: 1.6;
}
.room-url span {
  color: var(--accent);
}
.waiting-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── RPS (zelfde patroon als hangman) ── */
.rps-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.rps-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 28px;
}
.rps-choices {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.rps-btn {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  font-size: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s,
    transform 0.1s;
  color: var(--text);
}
.rps-btn:hover {
  border-color: #555;
  transform: scale(1.05);
}
.rps-btn.chosen {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.rps-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.rps-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
}
.rps-result {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 20px;
  display: none;
}
.rps-result.win {
  border-color: var(--green-border);
  color: var(--green-text);
}
.rps-result.lose {
  border-color: var(--red-border);
  color: var(--red-text);
}
.rps-result.draw {
  border-color: #555;
  color: var(--muted);
}

/* ── TOPBAR (game screens) ── */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  color: var(--accent-text);
  cursor: pointer;
}
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.conn-badge {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}
.conn-badge.connected {
  color: var(--green-text);
  border-color: var(--green-border);
  background: var(--green-bg);
}
.topbar-qr-btn {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  font-size: 16px;
}

/* ── GAME ── */
#screen-game {
  justify-content: flex-start;
}
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 10px;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow-y: auto;
}
.turn-pill {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
}
.turn-pill .turn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
[class^="icon-"],
[class*=" icon-"] {
  font-size: inherit;
}
.icon-lg {
  font-size: 28px;
}
.icon-md {
  font-size: 20px;
}
.icon-sm {
  font-size: 16px;
}
.icon-xs {
  font-size: 14px;
}

/* ── BOARD ──
   7 kolommen × 6 rijen, klassieke Vier op een Rij maat.
   Het bord zelf is altijd op een donkere "frame"-tint (--surface),
   onafhankelijk van wiens beurt het is, met ronde "gaten" die de
   achtergrondkleur tonen totdat er een schijf in valt. */
.board-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: clamp(4px, 1.2vw, 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(6px, 2vw, 12px);
  width: 100%;
  max-width: 480px;
  aspect-ratio: 7 / 6;
}
.cell {
  position: relative;
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
}
/* Kolom-highlight via CSS :has() i.p.v. JS mouseenter/mouseleave.
   De browser beheert :hover zelf, dus er kan geen "vastzittende"
   highlight ontstaan zoals bij JS-events (die op touch-devices geen
   betrouwbaar enter/leave-paar geven). Per kolom (0–6) een losse
   regel, omdat CSS geen "zelfde grid-kolom als" relatie kent. */
.board:not(.locked):has(.cell[data-col="0"]:hover) .cell[data-col="0"],
.board:not(.locked):has(.cell[data-col="1"]:hover) .cell[data-col="1"],
.board:not(.locked):has(.cell[data-col="2"]:hover) .cell[data-col="2"],
.board:not(.locked):has(.cell[data-col="3"]:hover) .cell[data-col="3"],
.board:not(.locked):has(.cell[data-col="4"]:hover) .cell[data-col="4"],
.board:not(.locked):has(.cell[data-col="5"]:hover) .cell[data-col="5"],
.board:not(.locked):has(.cell[data-col="6"]:hover) .cell[data-col="6"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.board.locked .cell {
  cursor: not-allowed;
}
.disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.disc.dropped {
  transform: scale(1);
}
.disc.p1 {
  background: var(--accent);
}
.disc.p2 {
  background: var(--muted);
}
.disc.win {
  box-shadow: 0 0 0 3px var(--green-text) inset;
}

/* ── RESULT ── */
.result-banner {
  width: 100%;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.result-banner.win {
  background: var(--green-bg);
  color: var(--green-text);
}
.result-banner.lose {
  background: var(--red-bg);
  color: var(--red-text);
}
.result-banner.draw {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── END ROW ── */
.end-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.end-btn {
  flex: 1;
  height: 48px;
  font-size: 15px;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  font-family: inherit;
}
.btn-primary:hover {
  opacity: 0.85;
}
.btn-ghost {
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.btn-ghost:hover {
  border-color: #555;
}
.btn-copy {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  margin-bottom: 10px;
  font-family: inherit;
}

/* ── QR OVERLAY ── */
#qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#qr-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.qr-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  width: 90%;
}
.qr-modal-title {
  font-size: 14px;
  font-weight: 600;
}
.qr-modal-url {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  line-height: 1.5;
}
.btn-close-overlay {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
