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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 1400px;
}

.screen {
    display: block;
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

h1 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 30px;
    font-size: 3em;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

h2 {
    color: #ffd700;
    font-size: 1.5em;
    margin-bottom: 20px;
}

/* ============ Lobby Screen ============ */
.lobby-container {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    margin: 50px auto;
    color: white;
    text-align: center;
}

.lobby-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.lobby-form input {
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

.lobby-form button {
    padding: 12px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
}

.lobby-form button:hover {
    background: #ffed4e;
}

.status {
    color: #ffed4e;
    font-size: 0.9em;
    min-height: 20px;
}

/* ============ Auth Screen ============ */
.auth-container {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    margin: 50px auto;
    color: white;
    text-align: center;
}

.auth-container h1 {
    margin-bottom: 20px;
}

.auth-container p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.auth-container input {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

.auth-container button {
    width: 100%;
    padding: 12px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
}

.auth-container button:hover {
    background: #ffed4e;
}

.error {
    color: #ff6b6b;
    margin-top: 15px;
    font-size: 0.9em;
}

/* ============ Game Board ============ */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.top-bar h2 {
    flex: 1;
    min-width: 200px;
    color: #ffed4e;
}

.scoreboard {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.player-score {
    background: rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    text-align: center;
    border: 2px solid #ffd700;
    min-width: 150px;
}

.player-score h3 {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #ffed4e;
}

.player-score .score {
    font-size: 1.5em;
    color: #ffd700;
    font-weight: bold;
}

.player-score.active {
    background: rgba(255,215,0,0.3);
    border-color: #ffed4e;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.category {
    background: #0a3d62;
    border: 3px solid #ffd700;
    color: #ffd700;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 5px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clue-cell {
    background: #0a3d62;
    border: 3px solid #ffd700;
    padding: 15px;
    text-align: center;
    color: #ffd700;
    font-weight: bold;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clue-cell:hover:not(.used) {
    background: #ffd700;
    color: #0a3d62;
    transform: scale(1.05);
}

.clue-cell.used {
    background: #444;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

.clue-cell.selected {
    background: #ffed4e;
    color: #0a3d62;
    border-color: #ffed4e;
    box-shadow: 0 0 15px rgba(255, 237, 74, 0.6);
}

.clue-cell.player-selected {
    background: #90ee90;
    color: #0a3d62;
    border-color: #90ee90;
    box-shadow: 0 0 12px rgba(144, 238, 144, 0.6);
}

.clue-cell.daily-double {
    border-color: #ff6b35;
    border-width: 4px;
    font-size: 1.8em;
}

/* ============ Question Overlay ============ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.overlay.hidden {
    display: none;
}

.overlay:not(.hidden) {
    display: flex;
}

.question-box {
    background: #0a3d62;
    padding: 40px;
    border-radius: 10px;
    border: 3px solid #ffd700;
    max-width: 600px;
    width: 90%;
    color: white;
}

.question-box p {
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

.daily-double {
    font-size: 3em;
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
}

.daily-double.hidden {
    display: none;
}

.daily-double-wager {
    display: none;
    text-align: center;
}

.daily-double-wager:not(.hidden) {
    display: block;
}

.daily-double-wager h2 {
    font-size: 2.5em;
    color: #ffed4e;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.daily-double-wager p {
    font-size: 1.3em;
    color: white;
    margin-bottom: 15px;
}

.wager-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.wager-input-group input {
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #ffd700;
    border-radius: 5px;
    background: white;
    color: #0a3d62;
    font-weight: bold;
    min-width: 150px;
    text-align: center;
}

.wager-input-group button {
    padding: 12px 30px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
}

.wager-input-group button:hover {
    background: #ffed4e;
}

.wager-max {
    color: #ffed4e;
    font-size: 0.95em;
}

.question-content {
    display: block;
}

.question-content.hidden {
    display: none;
}

.buzz-button {
    display: block;
    width: 90%;
    max-width: 400px;
    margin: 30px auto 0;
    padding: 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.3em;
    transition: all 0.2s;
}

.buzz-button:hover:not(:disabled) {
    background: #ff8787;
    transform: scale(1.05);
}

.buzz-button:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.buzz-button.hidden {
    display: none;
}

.buzzer-status {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.buzzer-status.hidden {
    display: none;
}

/* ============ Host Panel ============ */
.host-container {
    max-width: 1400px;
    margin: 0 auto;
}

.host-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.reset-btn {
    background: #ff6b6b;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}

.reset-btn:hover {
    background: #ff8787;
}

.host-content {
    background: rgba(255,255,255,0.05);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.phase-section {
    display: none;
}

.phase-section:not(.hidden) {
    display: block;
}

.phase-section.hidden {
    display: none;
}

.player-list {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: white;
}

.player-item {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255,215,0,0.1);
    border-left: 3px solid #ffd700;
    border-radius: 3px;
}

.player-item:last-child {
    margin-bottom: 0;
}

.current-player {
    background: rgba(255,215,0,0.2);
    border: 2px solid #ffd700;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.current-player p {
    font-size: 1.3em;
    font-weight: bold;
}

.board-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.board-controls select,
.board-controls button {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

.board-controls select {
    background: white;
    color: #0a3d62;
    font-weight: bold;
}

.board-controls button {
    background: #ffd700;
    color: #0a3d62;
    font-weight: bold;
    cursor: pointer;
}

.board-controls button:hover {
    background: #ffed4e;
}

.question-display {
    background: rgba(255,215,0,0.1);
    border: 2px solid #ffd700;
    padding: 30px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: white;
}

.question-display p {
    font-size: 1.8em;
    text-align: center;
    line-height: 1.4;
}

.wager-section,
.judging-section {
    display: none;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 5px;
    color: white;
}

.wager-section:not(.hidden),
.judging-section:not(.hidden) {
    display: block;
}

.wager-section.hidden,
.judging-section.hidden {
    display: none;
}

.wager-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.wager-section input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

.wager-section button {
    width: 100%;
    padding: 10px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
}

.wager-section button:hover {
    background: #ffed4e;
}

.judging-section p {
    font-size: 1.3em;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,215,0,0.2);
    border-radius: 5px;
}

.judging-section button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    margin-right: 10px;
}

.judging-section button:last-child {
    margin-right: 0;
}

.btn-correct {
    background: #90ee90;
    color: #0a3d62;
}

.btn-correct:hover {
    background: #a8f5a8;
}

.btn-incorrect {
    background: #ff6b6b;
    color: white;
}

.btn-incorrect:hover {
    background: #ff8787;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 20px;
}

.btn-primary:hover {
    background: #ffed4e;
}

.scoreboard-display {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 5px;
    color: white;
}

.scoreboard-display h3 {
    margin-bottom: 15px;
    color: #ffd700;
}

/* ============ Game Over ============ */
.game-over-container {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    margin: 50px auto;
    color: white;
    text-align: center;
}

.game-over-container h1 {
    margin-bottom: 30px;
}

.final-scores {
    margin-bottom: 30px;
}

.final-score-entry {
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 1.2em;
    border-left: 4px solid #ffd700;
}

.final-score-entry:last-child {
    margin-bottom: 0;
}

.game-over-container button {
    padding: 15px 30px;
    background: #ffd700;
    color: #0a3d62;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
}

.game-over-container button:hover {
    background: #ffed4e;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .board-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    h1 {
        font-size: 2em;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .scoreboard {
        justify-content: flex-start;
        width: 100%;
    }

    .board-controls {
        flex-direction: column;
    }

    .board-controls select,
    .board-controls button {
        width: 100%;
    }

    .judging-section button {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
}
