/* Orc Run - 2D Side-Scrolling Endless Runner */

/* Game-specific variables */
:root {
    --bg-primary: var(--color-bg, #1e2520);
    --bg-secondary: var(--color-bg-dark, #161c18);
    --bg-panel: rgba(10, 10, 15, 0.95);
    --border-primary: #8a6a3a;
    --border-secondary: #6a4a2a;
    --accent-gold: #D4A017;
    --accent-gold-dim: #b08a18;
    --text-primary: #f0e6d0;
    --text-secondary: #b8a68e;
    --danger: #8b2020;
    --danger-light: #8b2c2c;
    --success: #2d5a27;
    --success-light: #3d7a37;
}

/* Game-specific body overrides */
body {
    overflow: hidden;
}

/* Hide noise texture over game canvas */
body::before {
    display: none;
}

/* Site nav override for game page */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
}

/* Screens */
.screen {
    position: fixed;
    top: 33px;
    left: 0;
    width: 100%;
    height: calc(100% - 33px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: rgba(10, 10, 15, 0.9);
    overflow-y: auto;
    padding: 20px 0;
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.screen-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-panel);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    margin: auto;
}

/* Typography */
.game-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

h2, h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 15px;
}

/* Buttons */
.primary-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    padding: 15px 40px;
    background: linear-gradient(180deg, var(--border-primary), var(--border-secondary));
    border: 2px solid var(--accent-gold);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.primary-btn:hover {
    background: linear-gradient(180deg, var(--accent-gold-dim), var(--border-primary));
    transform: scale(1.05);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    padding: 10px 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
}

/* Tutorial Section */
.tutorial-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    max-width: 500px;
}

.tutorial-section h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
    text-align: center;
}

.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: rgba(138, 106, 58, 0.15);
    border-radius: 5px;
    border-left: 3px solid var(--accent-gold);
}

.step-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
}

.step-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 3px;
    font-family: 'Cinzel', serif;
}

.step-text p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.step-text .highlight {
    color: var(--accent-gold);
    font-weight: bold;
}

.powerup-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.powerup-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.powerup-item.shield { color: #4ab8e8; }
.powerup-item.speed { color: #e85544; }
.powerup-item.magnet { color: #b366dd; }
.powerup-item.double { color: #44bb66; }

.tutorial-step.nft-bonus {
    border-left-color: var(--accent-gold);
    background: rgba(212, 160, 23, 0.15);
}

/* High Scores / Leaderboard */
.high-scores {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-secondary);
}

.high-scores h3 {
    margin-bottom: 15px;
    color: var(--accent-gold);
}

.leaderboard {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 10px;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-secondary);
    gap: 10px;
}

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

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

.score-entry .player-name {
    flex: 1;
    color: var(--text-primary);
}

.score-entry .distance-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.score-entry .score-value {
    color: var(--accent-gold);
    font-weight: bold;
    font-family: 'Cinzel', serif;
}

/* High Score Entry Form */
.highscore-entry {
    margin: 20px 0;
    padding: 15px;
    background: rgba(212, 160, 23, 0.1);
    border: 2px solid var(--accent-gold);
    border-radius: 5px;
    text-align: center;
}

.new-highscore {
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    animation: pulse 1s ease-in-out infinite;
}

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

.highscore-entry input {
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    padding: 10px 15px;
    border: 1px solid var(--border-primary);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    border-radius: 3px;
    margin-right: 10px;
    width: 150px;
}

.highscore-entry input::placeholder {
    color: var(--text-secondary);
}

/* NFT Section */
.nft-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-secondary);
}

.wallet-btn {
    font-family: 'Cinzel', serif;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallet-btn:hover {
    background: rgba(212, 160, 23, 0.2);
}

#wallet-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Game Screen */
#game-screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: #000;
    padding: 0;
}

#game-screen.hidden {
    display: none;
}

/* HUD Bar */
#hud-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--border-primary);
    min-height: 44px;
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 600;
}

.hud-stat .label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hud-stat .value {
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
}

.hud-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    border-color: var(--accent-gold);
    background: var(--border-secondary);
}

/* Canvas container */
#game-canvas {
    display: block;
    width: 100%;
    flex: 1;
    background: #1c1e1a;
    touch-action: none;
}

/* Power-up indicators */
#powerup-bar {
    display: flex;
    gap: 8px;
    padding: 0 10px;
    position: absolute;
    top: 50px;
    left: 10px;
    z-index: 10;
}

.powerup-indicator {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    opacity: 0.9;
}

/* Game Over */
#gameover-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--danger-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.final-stat {
    text-align: center;
}

.final-stat .label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.final-stat span:last-child {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
}

.final-stat.highlight {
    background: rgba(212, 160, 23, 0.2);
    border: 1px solid var(--accent-gold);
    border-radius: 5px;
    padding: 10px 15px;
}

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

/* Pause Overlay */
.overlay {
    position: fixed;
    top: 33px;
    left: 0;
    width: 100%;
    height: calc(100% - 33px);
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-panel);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.overlay-content button {
    display: block;
    width: 200px;
    margin: 10px auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold-dim); }

/* Responsive */
@media (max-width: 900px) {
    .screen-content {
        padding: 30px 20px;
    }
}

@media (max-width: 600px) {
    .game-title {
        font-size: 2rem;
    }

    .final-stats {
        flex-direction: column;
        gap: 15px;
    }

    .screen-content {
        padding: 20px;
    }

    #hud-bar {
        padding: 6px 10px;
    }

    .hud-stat {
        font-size: 0.9rem;
    }

    .hud-left, .hud-right {
        gap: 10px;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        min-height: 44px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    .game-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .hud-stat .label {
        display: none;
    }

    .hud-stat {
        font-size: 0.85rem;
    }

    .hud-left, .hud-right {
        gap: 6px;
    }
}

/* Tournament Banner */
.tournament-banner {
    margin-bottom: 20px;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    overflow: hidden;
}

.tournament-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
}

.tournament-badge {
    background: var(--accent-gold);
    color: #1a1a1a;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.tournament-timer {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--accent-gold);
    flex: 1;
}

.tournament-chevron {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tournament-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 15px;
    background: rgba(0, 0, 0, 0.3);
}

.tournament-panel.open {
    max-height: 200px;
    padding: 12px 15px;
}

.tournament-prize {
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.tournament-rules {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.tournament-lb-link {
    color: var(--accent-gold);
    font-size: 0.85rem;
    text-decoration: underline;
}

.tournament-banner.live {
    border-color: #2ecc71;
}

.tournament-banner.live .tournament-badge {
    background: #2ecc71;
    animation: tournament-pulse 2s ease-in-out infinite;
}

@keyframes tournament-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tournament-banner.ended {
    border-color: #666;
}

.tournament-banner.ended .tournament-badge {
    background: #666;
}

/* Tournament wallet warning on start screen */
.tournament-wallet-warning {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    text-align: center;
}

.tournament-wallet-warning p {
    color: #e74c3c;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* Tournament Game Over Section */
.tournament-submit {
    margin: 20px 0;
    padding: 15px;
    background: rgba(46, 204, 113, 0.1);
    border: 2px solid #2ecc71;
    border-radius: 5px;
    text-align: center;
}

.tournament-submit-title {
    color: #2ecc71;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tournament-connect-msg {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.tournament-result {
    font-size: 0.95rem;
    padding: 8px;
    margin-bottom: 8px;
}

.tournament-result.success {
    color: #2ecc71;
}

.tournament-result.error {
    color: #e74c3c;
}

/* Game wrapper */
#game-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
