/* ===== CONNECT FOUR TRIVIA ===== */
/* Neutral board; red and yellow are reserved for the two players */
.c4-container { position: relative; z-index: 1; max-width: 760px; width: 100%; text-align: center; --red: #ef4444; --yellow: #facc15; }
.c4-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }

/* Setup */
.c4-setup { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.c4-setup-names { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.c4-name { display: flex; align-items: center; gap: 8px; background: #111111; border: 2px solid #2e2e2e; border-radius: 12px; padding: 8px 12px; }
.c4-name input { background: transparent; border: none; color: #e5e5e5; font-size: 1rem; width: 140px; outline: none; }
.c4-setup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.c4-setup-label { color: #a3a3a3; font-size: 0.9rem; }
.c4-options { display: flex; gap: 6px; }

/* Player chips: color plus a letter so they read without color */
.c4-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; font-size: 0.72rem; font-weight: 800; color: #111111; }
.c4-chip.small { width: 16px; height: 16px; font-size: 0.58rem; margin-right: 8px; }
.c4-chip.red, .c4-disc.red { background: radial-gradient(circle at 35% 35%, #f87171, #b91c1c); }
.c4-chip.yellow, .c4-disc.yellow { background: radial-gradient(circle at 35% 35%, #fde047, #ca8a04); }
.c4-chip.red { color: #fff; }

/* Scorebar: both players, whose turn, shot clock */
.c4-scorebar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; background: #000000; padding: 6px 0 8px; }
.c4-player { display: flex; align-items: center; gap: 10px; background: #111111; border: 2px solid #1f1f1f; border-radius: 12px; padding: 8px 12px; min-width: 0; text-align: left; transition: border-color 0.15s ease, background 0.15s ease; }
#c4-player-1 { flex-direction: row-reverse; text-align: right; }
.c4-player-text { display: flex; flex-direction: column; min-width: 0; }
.c4-player-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c4-player-state { font-size: 0.75rem; font-weight: 600; min-height: 1em; color: #a3a3a3; }
.c4-player.red.turn { border-color: var(--red); background: rgba(239, 68, 68, 0.12); }
.c4-player.yellow.turn { border-color: var(--yellow); background: rgba(250, 204, 21, 0.1); }
.c4-player.red.turn .c4-player-state { color: #fca5a5; }
.c4-player.yellow.turn .c4-player-state { color: #fde68a; }
.c4-clock-box { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111111; border: 2px solid #1f1f1f; border-radius: 12px; padding: 4px 14px; min-width: 84px; }
.c4-clock { font-size: 1.3rem; font-weight: 800; color: #737373; font-variant-numeric: tabular-nums; }
.c4-clock.running { color: #e5e5e5; }
.c4-clock.low { color: #f87171; }
.c4-clock-label { font-size: 0.68rem; color: #737373; text-transform: uppercase; letter-spacing: 0.06em; }

.c4-turn { color: #a3a3a3; font-size: 0.92rem; margin: 4px 0 12px; min-height: 1.3em; }
.c4-turn.win { font-size: 1.25rem; font-weight: 700; color: #e5e5e5; }

/* Board */
.c4-board-wrap { width: 100%; max-width: 640px; margin: 0 auto; }
.c4-columns, .c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.c4-columns { margin-bottom: 6px; padding: 0 10px; }
.c4-col-btn { background: #111111; border: 1px solid #1f1f1f; color: #737373; border-radius: 8px; padding: 4px 0; cursor: pointer; }
.c4-col-btn:hover:not(:disabled), .c4-col-btn.preview, .c4-col-btn.active { color: var(--turn-color, #e5e5e5); border-color: currentColor; }
.c4-col-btn:disabled { opacity: 0.3; cursor: default; }
.c4-board { background: #111111; border: 1px solid #2e2e2e; padding: 10px; border-radius: 16px; }
.c4-cell { aspect-ratio: 1 / 1; border-radius: 50%; background: #000000; border: 2px solid #262626; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; overflow: hidden; transition: box-shadow 0.12s ease, border-color 0.12s ease; }
.c4-cell.filled { cursor: default; border-color: transparent; }
.c4-cell.playable { border-color: #404040; }
.c4-cell.stat:not(.filled) { border-style: dashed; }
.c4-cell.preview { border: 2px solid var(--turn-color); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
.c4-cell.active { border: 3px solid var(--turn-color); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15), 0 0 18px var(--turn-color); }
.c4-cell.preview .c4-cell-label, .c4-cell.active .c4-cell-label { color: #fafafa; }
.c4-cell.winner { box-shadow: 0 0 0 4px #fafafa; }
.c4-cell-label { font-size: clamp(0.52rem, 1.5vw, 0.76rem); font-weight: 600; line-height: 1.1; padding: 4px; color: #a3a3a3; }
.c4-cell.playable .c4-cell-label { color: #d4d4d4; }
.c4-disc { width: 100%; height: 100%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #111111; }
.c4-disc.red { color: #fff; }
.c4-disc-mark { font-size: clamp(0.85rem, 2.6vw, 1.35rem); font-weight: 800; line-height: 1; }
.c4-disc-name { font-size: clamp(0.45rem, 1.2vw, 0.64rem); font-weight: 700; padding: 0 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Answer prompt */
.c4-prompt { margin: 16px auto 0; max-width: 520px; background: #111111; border: 2px solid #2e2e2e; border-radius: 14px; padding: 14px; text-align: left; }
.c4-prompt.red { border-color: var(--red); }
.c4-prompt.yellow { border-color: var(--yellow); }
.c4-prompt-question { color: #fafafa; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.c4-prompt-meta { color: #a3a3a3; font-size: 0.82rem; margin: 2px 0 10px; }
.c4-prompt-input { display: flex; gap: 8px; }
.c4-prompt-input input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 2px solid #2e2e2e; background: #000000; color: #e5e5e5; font-size: 1rem; }
.c4-prompt-input input:focus { outline: none; border-color: #737373; }
.c4-submit { background: #e5e5e5; color: #000000; border: none; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.c4-submit:hover { background: #fff; }
.c4-prompt-actions { display: flex; justify-content: space-between; margin-top: 8px; gap: 10px; }
.c4-link-btn { background: none; border: none; color: #a3a3a3; cursor: pointer; font-size: 0.85rem; text-decoration: underline; }
.c4-message { min-height: 1.4em; margin: 10px 0; }
.c4-message.success { color: #a3e635; }
.c4-message.error { color: #f87171; }

/* Play log and rules */
.c4-log-wrap, .c4-rules { margin-top: 18px; text-align: left; background: #111111; border: 1px solid #1f1f1f; border-radius: 12px; padding: 10px 16px; }
.c4-log-wrap summary, .c4-rules summary { cursor: pointer; font-size: 0.95rem; font-weight: 600; color: #a3a3a3; }
.c4-log-wrap[open] summary, .c4-rules[open] summary { margin-bottom: 6px; }
.c4-log { list-style: none; max-height: 200px; overflow-y: auto; font-size: 0.88rem; }
.c4-log li { display: flex; align-items: center; padding: 3px 0; }
.c4-rules { max-width: 560px; margin-left: auto; margin-right: auto; }
.c4-rules ul { padding-left: 18px; color: #d4d4d4; font-size: 0.88rem; display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 480px) {
  .c4-scorebar { gap: 6px; }
  .c4-player { padding: 6px 8px; gap: 6px; }
  .c4-player-name { font-size: 0.9rem; }
  .c4-clock-box { min-width: 64px; padding: 4px 8px; }
  .c4-board { padding: 6px; }
  .c4-columns, .c4-board { gap: 4px; }
  .c4-columns { padding: 0 6px; }
}
