/**
 * Guess the Primarch - Warhammer 40K Gothic Styling
 * Within CRT arcade cabinet framework
 */

/* ============================================
   WARHAMMER 40K COLOR PALETTE
   ============================================ */
:root {
    --w40k-background: #1a0a0a;
    --w40k-background-alt: #2a1515;
    --w40k-gold: #d4af37;
    --w40k-gold-dim: #c9a227;
    --w40k-parchment: #f5f0e1;
    --w40k-bone: #e8dcc8;
    --w40k-blood: #8b0000;
    --w40k-blood-bright: #a52a2a;
    --w40k-imperial: #c9a227;
    --w40k-shadow: rgba(0, 0, 0, 0.8);
}

/* ============================================
   MAIN CONTAINER OVERRIDES
   ============================================ */
main[data-page="games"] {
    width: 100%;
    max-width: none;
    align-self: stretch;
}

.game-container {
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(180deg, var(--w40k-background) 0%, #0d0505 100%);
    font-family: 'Crimson Text', Georgia, serif;
    overflow-y: auto;
}

/* ============================================
   TYPOGRAPHY - GOTHIC HEADERS
   ============================================ */
.gothic-title {
    font-family: 'Cinzel', 'Times New Roman', serif;
    color: var(--w40k-gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
        0 0 10px rgba(212, 175, 55, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.8);
}

.gothic-text {
    color: var(--w40k-parchment);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ============================================
   AQUILA WATERMARK
   ============================================ */
.aquila-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 200px;
    color: rgba(201, 162, 39, 0.03);
    pointer-events: none;
    z-index: 0;
    font-family: 'Cinzel', serif;
}

/* ============================================
   MENU SCREEN
   ============================================ */
.menu-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.4s ease;
    width: 100%;
    max-width: 500px;
    min-height: 0;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Game Header */
.game-header {
    margin-bottom: 25px;
}

.game-title {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 28px;
    color: var(--w40k-gold);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 10px 0;
    text-shadow:
        0 0 15px rgba(212, 175, 55, 0.6),
        3px 3px 6px rgba(0, 0, 0, 0.9);
}

.game-title-sub {
    font-size: 14px;
    color: var(--w40k-bone);
    font-style: italic;
    letter-spacing: 2px;
}

.header-sub {
    font-size: 14px;
    color: var(--w40k-parchment);
    opacity: 0.8;
    margin-top: 10px;
}

/* Imperial Divider */
.imperial-divider {
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--w40k-gold-dim) 20%,
        var(--w40k-gold) 50%,
        var(--w40k-gold-dim) 80%,
        transparent 100%
    );
    margin: 20px auto;
    position: relative;
}

.imperial-divider::before {
    content: '\2726';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--w40k-background);
    padding: 0 10px;
    color: var(--w40k-gold);
    font-size: 16px;
}

/* Menu Options */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 350px;
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    white-space: nowrap;
    background: linear-gradient(180deg, var(--w40k-background-alt) 0%, var(--w40k-background) 100%);
    border: 2px solid var(--w40k-gold-dim);
    color: var(--w40k-parchment);
    padding: 14px 24px;
    font-size: 14px;
    font-family: 'Cinzel', 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.menu-btn:hover {
    border-color: var(--w40k-gold);
    color: var(--w40k-gold);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn.primary {
    background: linear-gradient(180deg, var(--w40k-gold) 0%, var(--w40k-gold-dim) 100%);
    color: var(--w40k-background);
    border-color: var(--w40k-gold);
    font-weight: bold;
}

.menu-btn.primary:hover {
    background: linear-gradient(180deg, var(--w40k-gold-dim) 0%, var(--w40k-imperial) 100%);
    color: var(--w40k-background);
}

/* Difficulty Label */
.difficulty-label {
    color: var(--w40k-gold);
    font-weight: bold;
}

/* Info Panel */
.menu-info {
    margin-bottom: 25px;
    width: 100%;
}

.info-panel {
    background: linear-gradient(180deg, rgba(42, 21, 21, 0.9) 0%, rgba(26, 10, 10, 0.95) 100%);
    border: 1px solid var(--w40k-gold-dim);
    border-radius: 2px;
    padding: 15px;
    text-align: left;
    position: relative;
}

.info-panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--w40k-gold);
}

.info-title {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: var(--w40k-gold);
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.info-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--w40k-bone);
}

.info-text p {
    margin: 5px 0;
}

/* High Scores / Leaderboard */
.high-scores {
    width: 100%;
    background: linear-gradient(180deg, rgba(42, 21, 21, 0.9) 0%, rgba(26, 10, 10, 0.95) 100%);
    border: 1px solid var(--w40k-gold-dim);
    border-radius: 2px;
    padding: 15px;
}

.scores-title {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: var(--w40k-gold);
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
}

.scores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(201, 162, 39, 0.2);
    color: var(--w40k-bone);
}

.score-row:last-child {
    border-bottom: none;
}

.score-row .rank {
    color: var(--w40k-gold);
    min-width: 25px;
    font-weight: bold;
}

.score-row .name {
    flex: 1;
    margin-left: 10px;
}

.score-row .score {
    color: var(--w40k-parchment);
    min-width: 70px;
    text-align: right;
}

.score-row.loading {
    justify-content: center;
    color: var(--w40k-bone);
    opacity: 0.7;
}

/* ============================================
   GAME SCREEN
   ============================================ */
.game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.3s ease;
    min-height: 0;
    position: relative;
    z-index: 1;
}

/* Game Stats Bar */
.game-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background: rgba(42, 21, 21, 0.8);
    border: 1px solid var(--w40k-gold-dim);
    min-width: 70px;
}

.stat-box .stat-label {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    color: var(--w40k-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-box .stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--w40k-parchment);
}

.stat-box .stat-value.small {
    font-size: 12px;
}

/* Progress Display */
.progress-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--w40k-bone);
    font-size: 14px;
}

.progress-bar {
    width: 150px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--w40k-gold-dim);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--w40k-blood) 0%, var(--w40k-gold) 100%);
    transition: width 0.3s ease;
}

/* ============================================
   CLUE PANEL - PARCHMENT SCROLL STYLE
   ============================================ */
.clue-panel {
    width: 100%;
    max-width: 550px;
    background: linear-gradient(180deg,
        var(--w40k-bone) 0%,
        var(--w40k-parchment) 5%,
        var(--w40k-parchment) 95%,
        var(--w40k-bone) 100%
    );
    border: 3px solid var(--w40k-gold-dim);
    border-radius: 3px;
    padding: 20px 25px;
    margin-bottom: 20px;
    position: relative;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(139, 0, 0, 0.05);
}

/* Wax seal decoration */
.clue-panel::before {
    content: '\2726';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: var(--w40k-blood);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--w40k-gold);
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    line-height: 24px;
    text-align: center;
}

.clue-header {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--w40k-blood);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
    padding-bottom: 10px;
}

.clues-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clue-item {
    display: flex;
    gap: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #2a1515;
    padding: 8px;
    background: rgba(139, 0, 0, 0.03);
    border-left: 3px solid var(--w40k-gold-dim);
    transition: all 0.3s ease;
}

.clue-item.locked {
    color: #999;
    font-style: italic;
    background: rgba(0, 0, 0, 0.05);
    border-left-color: #999;
}

.clue-item.revealed {
    animation: revealClue 0.5s ease;
}

@keyframes revealClue {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.clue-number {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: var(--w40k-blood);
    min-width: 24px;
}

.clue-text {
    flex: 1;
}

/* Legion Number Badge */
.legion-badge {
    display: inline-block;
    background: var(--w40k-blood);
    color: var(--w40k-gold);
    padding: 2px 8px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 2px;
    margin-left: 10px;
}

/* ============================================
   GUESS INPUT AREA
   ============================================ */
.guess-area {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
}

.guess-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.guess-input {
    flex: 1;
    background: rgba(42, 21, 21, 0.9);
    border: 2px solid var(--w40k-gold-dim);
    color: var(--w40k-parchment);
    padding: 12px 15px;
    font-size: 16px;
    font-family: 'Crimson Text', Georgia, serif;
    outline: none;
    transition: all 0.3s ease;
}

.guess-input::placeholder {
    color: rgba(245, 240, 225, 0.4);
    font-style: italic;
}

.guess-input:focus {
    border-color: var(--w40k-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.guess-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--w40k-gold) 0%, var(--w40k-gold-dim) 100%);
    border: none;
    color: var(--w40k-background);
    padding: 12px 28px;
    min-width: 100px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.guess-btn:hover {
    background: linear-gradient(180deg, var(--w40k-gold-dim) 0%, var(--w40k-imperial) 100%);
}

.guess-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback Messages */
.feedback-message {
    text-align: center;
    font-size: 14px;
    min-height: 20px;
    transition: all 0.3s ease;
}

.feedback-message.correct {
    color: #2ecc71;
    font-weight: bold;
}

.feedback-message.incorrect {
    color: var(--w40k-blood-bright);
}

.feedback-message.hint {
    color: var(--w40k-gold);
    font-style: italic;
}

/* ============================================
   GAME CONTROLS
   ============================================ */
.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-controls .menu-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 11px;
}

/* Timer Display */
.timer-display {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--w40k-gold);
    margin-bottom: 10px;
}

.timer-display.warning {
    color: var(--w40k-blood-bright);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   PRIMARCH CHECKLIST
   ============================================ */
.primarch-checklist {
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(42, 21, 21, 0.6);
    border: 1px solid var(--w40k-gold-dim);
    border-radius: 2px;
}

.checklist-title {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--w40k-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 10px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--w40k-bone);
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.checklist-item .primarch-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checklist-item .copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: var(--w40k-gold-dim);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 10px;
}

.checklist-item .copy-btn:hover {
    opacity: 1;
    color: var(--w40k-gold);
}

.checklist-item .copy-btn.copied {
    color: #2ecc71;
    opacity: 1;
}

.checklist-item.revealed .copy-btn {
    display: none;
}

.checklist-item .legion-num {
    color: var(--w40k-gold-dim);
    font-weight: bold;
    margin-right: 4px;
}

.checklist-item.revealed {
    text-decoration: line-through;
    opacity: 0.5;
    color: var(--w40k-gold-dim);
}

.checklist-item.revealed.correct {
    background: rgba(46, 204, 113, 0.15);
    border-left: 2px solid #2ecc71;
}

.checklist-item.revealed.skipped {
    background: rgba(139, 0, 0, 0.15);
    border-left: 2px solid var(--w40k-blood);
}

/* Responsive: 3 columns on smaller screens */
@media (max-width: 600px) {
    .checklist-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .checklist-item {
        font-size: 10px;
        padding: 3px 5px;
    }
}

/* Responsive: 2 columns on mobile */
@media (max-width: 400px) {
    .checklist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   GAME OVER OVERLAY
   ============================================ */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 10, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(180deg, rgba(42, 21, 21, 0.95) 0%, rgba(26, 10, 10, 0.98) 100%);
    border: 3px solid var(--w40k-gold);
    max-width: 400px;
    position: relative;
}

.overlay-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--w40k-gold-dim);
    pointer-events: none;
}

.overlay-content h2 {
    font-family: 'Cinzel', serif;
    color: var(--w40k-gold);
    margin: 0 0 20px 0;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.overlay-content p {
    color: var(--w40k-parchment);
    margin: 0 0 10px 0;
    font-size: 16px;
}

.overlay-content p span {
    color: var(--w40k-gold);
    font-weight: bold;
}

.final-score {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    color: var(--w40k-gold);
    margin: 20px 0;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.6),
        0 0 40px rgba(212, 175, 55, 0.3);
}

.overlay-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

/* ============================================
   ALLEGIANCE BADGES
   ============================================ */
.allegiance-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px;
}

.allegiance-badge.loyalist {
    background: linear-gradient(180deg, #1a3d5c 0%, #0d2030 100%);
    color: #7fb3d5;
    border: 1px solid #3498db;
}

.allegiance-badge.traitor {
    background: linear-gradient(180deg, #5c1a1a 0%, #300d0d 100%);
    color: #e74c3c;
    border: 1px solid #c0392b;
}

.allegiance-badge.unknown {
    background: linear-gradient(180deg, #3d3d3d 0%, #1a1a1a 100%);
    color: #888;
    border: 1px solid #555;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 600px) {
    .game-container {
        padding: 15px;
    }

    .game-title {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .clue-panel {
        padding: 15px 18px;
    }

    .clue-item {
        font-size: 13px;
    }

    .guess-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .stat-box {
        padding: 6px 10px;
        min-width: 60px;
    }

    .stat-box .stat-value {
        font-size: 16px;
    }

    .final-score {
        font-size: 36px;
    }
}

@media (max-width: 400px) {
    .game-title {
        font-size: 18px;
    }

    .clue-item {
        font-size: 12px;
        padding: 6px;
    }

    .game-controls .menu-btn {
        padding: 8px 12px;
        font-size: 10px;
    }
}

/* ============================================
   GOOGLE FONTS IMPORT (inline fallback)
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Crimson+Text:ital@0;1&display=swap');
