/**
 * modals.css — Help, credits, game over overlays
 */

/* ── Modal Overlay ──────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 6, 18, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Modal Content ──────────────────────────────────────────────────────────── */
.modal-content {
    background: var(--bg-board-bg);
    border: 2px solid var(--bg-point-light);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 0 30px var(--bg-checker-player-glow),
        inset 0 0 20px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Modal Title Bar ────────────────────────────────────────────────────────── */
.modal-titlebar {
    background: linear-gradient(90deg, var(--bg-point-light), var(--bg-point-dark));
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-titlebar span {
    font-size: 10px;
    color: var(--bg-bg);
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    color: var(--bg-bg);
    font-size: 14px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.modal-close:hover {
    opacity: 1;
}

/* ── Modal Body ─────────────────────────────────────────────────────────────── */
.modal-body {
    padding: 20px;
}

.modal-body h3 {
    font-size: 12px;
    color: var(--bg-point-light);
    margin-bottom: 15px;
    text-shadow: 0 0 8px var(--bg-checker-player-glow);
}

.modal-body h4 {
    font-size: 10px;
    color: var(--bg-dice);
    margin-top: 15px;
    margin-bottom: 8px;
}

.modal-body p {
    font-size: 9px;
    color: var(--bg-text);
    line-height: 1.8;
    margin-bottom: 10px;
}

.modal-body ul {
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
}

.modal-body li {
    font-size: 9px;
    color: var(--bg-text);
    line-height: 1.8;
    padding-left: 15px;
    position: relative;
}

.modal-body li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--bg-highlight);
}

/* ── Modal Footer ───────────────────────────────────────────────────────────── */
.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--bg-text-dim);
}

.modal-footer button {
    background: var(--bg-point-light);
    border: none;
    color: var(--bg-bg);
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 10px 30px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-footer button:hover {
    background: #ffffff;
    box-shadow: 0 0 15px var(--bg-checker-player-glow);
}

/* ── Game Over Modal ────────────────────────────────────────────────────────── */
.game-over-content {
    text-align: center;
}

.game-over-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.game-over-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.game-over-title.win {
    color: var(--bg-highlight);
    text-shadow: 0 0 15px var(--bg-highlight-glow);
}

.game-over-title.lose {
    color: var(--bg-checker-ai);
    text-shadow: 0 0 15px var(--bg-checker-ai-glow);
}

.game-over-score {
    font-size: 12px;
    color: var(--bg-dice);
    margin-bottom: 20px;
}

.game-over-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 20px;
}

.game-over-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-over-stat-label {
    font-size: 8px;
    color: var(--bg-text-dim);
}

.game-over-stat-value {
    font-size: 14px;
    color: var(--bg-point-light);
}

/* ── Confirmation Modal ─────────────────────────────────────────────────────── */
.confirm-content {
    text-align: center;
}

.confirm-content p {
    font-size: 10px;
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.confirm-btn.accept {
    background: var(--bg-highlight);
    border: none;
    color: var(--bg-bg);
}

.confirm-btn.accept:hover {
    background: #ffffff;
    box-shadow: 0 0 15px var(--bg-highlight-glow);
}

.confirm-btn.reject {
    background: transparent;
    border: 2px solid var(--bg-checker-ai);
    color: var(--bg-checker-ai);
}

.confirm-btn.reject:hover {
    background: var(--bg-checker-ai);
    color: var(--bg-bg);
}

/* ── Board Diagram ─────────────────────────────────────────────────────────── */
.board-diagram {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    overflow-x: auto;
}

.board-diagram pre {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--bg-text);
    line-height: 1.6;
    margin: 0;
}

/* ── Online Button ─────────────────────────────────────────────────────────── */
.start-btn.online {
    border-color: #39ff6e;
    color: #39ff6e;
}
.start-btn.online:hover {
    background: rgba(57, 255, 110, 0.15);
    box-shadow: 0 0 15px rgba(57, 255, 110, 0.3);
}

/* ── Lobby ─────────────────────────────────────────────────────────────────── */
.lobby-status {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #39ff6e;
    margin-bottom: 16px;
    text-align: center;
}

.lobby-room input {
    width: 100%;
    max-width: 220px;
    margin: 0 auto 16px;
    display: block;
    padding: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--bg-text);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.lobby-room input:focus {
    outline: none;
    border-color: #39ff6e;
    box-shadow: 0 0 10px rgba(57, 255, 110, 0.3);
}

.lobby-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.lobby-actions .start-btn {
    font-size: 9px;
}

.lobby-players {
    text-align: center;
}

.lobby-waiting {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--bg-text-dim);
    margin-bottom: 12px;
    animation: blink 1.5s ease-in-out infinite;
}

.lobby-player {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--bg-text);
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lobby-player-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Room Code Display ─────────────────────────────────────────────────────── */
.lobby-room-code {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    color: #ffe03a;
    text-align: center;
    margin: 12px 0;
    padding: 16px;
    border: 2px solid #ffe03a;
    background: rgba(255, 224, 58, 0.1);
    letter-spacing: 4px;
}

.lobby-room-code span {
    font-size: 22px;
    color: #fff;
}

.lobby-room-code small {
    display: block;
    font-size: 8px;
    color: var(--bg-text-dim);
    margin-top: 8px;
    letter-spacing: 0;
}
