/* --- Game Layout --- */
.lobby {
    max-width: 500px;
    margin: 0 auto;
}

.room-code-input {
    text-transform: uppercase;
    font-family: monospace;
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    text-align: center;
}

.room-code-display {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    color: var(--color-primary);
}

.player-list {
    list-style: none;
    padding: 0;
}

.player-list li {
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ready-badge {
    color: var(--color-success);
    font-weight: 600;
}

/* --- Game Screen Layouts --- */
.game-layout {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-layout-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.game-sidebar {
    min-width: 200px;
}

.game-canvas-wrapper {
    position: relative;
    background: var(--color-canvas-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.game-canvas {
    display: block;
}

.opponent-canvas {
    background: var(--color-canvas-bg);
    border-radius: var(--radius);
}

/* --- Score --- */
.score-display {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-primary);
}

.next-marble-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- HUD --- */
.game-hud {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hud-item {
    text-align: center;
}

.hud-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.hud-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.controls-hint {
    text-align: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* --- Scoreboard --- */
.scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 800px;
}

.scoreboard-item {
    background: var(--color-surface);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.scoreboard-item.dead {
    opacity: 0.5;
}

.scoreboard-item .name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.scoreboard-item .score {
    font-size: 1.2rem;
}

.scoreboard-item .lives {
    font-size: 0.8rem;
    color: var(--color-danger);
}

/* --- Game Over --- */
.gameover-card {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
}

.gameover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.gameover-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.gameover-scores {
    font-size: 2rem;
    margin: 20px 0;
}

/* --- Embedded games (self-contained static HTML in an iframe) --- */

.embed-frame {
    width: 100%;
    max-width: 880px;
    margin: 20px auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: #0d0a1a;
}

.embed-frame iframe {
    display: block;
    width: 100%;
    height: 760px;
    border: 0;
}

@media (max-width: 900px) {
    .embed-frame iframe {
        height: 640px;
    }
}

.embed-controls {
    max-width: 880px;
    margin: 0 auto 20px;
}

.embed-controls p {
    white-space: pre-line;
    color: var(--color-text-muted);
}
