/* styles.css — Bush vs Wolves game styles */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Canvas container */
#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ── Back button ─────────────────────────────────────────── */

.back-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Sound button ────────────────────────────────────────── */

.sound-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.sound-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Screen system ───────────────────────────────────────── */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
}

.screen.active {
    display: flex;
}

/* ── Menu box ────────────────────────────────────────────── */

.menu-box, .modal-box {
    background: rgba(20, 30, 10, 0.95);
    border: 2px solid #4a8c3f;
    border-radius: 12px;
    padding: 32px 40px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.game-title {
    font-size: 36px;
    font-weight: 900;
    color: #4a9c3f;
    text-shadow: 2px 2px 0 #1a3310;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 13px;
    color: #8ab880;
    margin-bottom: 24px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #4a8c3f;
    border-radius: 8px;
    background: rgba(45, 80, 22, 0.5);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.menu-btn:hover {
    background: rgba(74, 140, 63, 0.6);
    transform: translateY(-1px);
}

.menu-btn.primary {
    background: #3a7030;
    border-color: #5ab84f;
}

.menu-btn.primary:hover {
    background: #4a9040;
}

/* ── Instructions ────────────────────────────────────────── */

.instructions {
    text-align: left;
    margin: 16px 0 20px;
}

.instruction-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: #ccc;
    border-bottom: 1px solid rgba(74, 140, 63, 0.2);
}

.instruction-icon {
    width: 28px;
    text-align: center;
    font-size: 18px;
    color: #4a9c3f;
    flex-shrink: 0;
}

/* ── Score display ───────────────────────────────────────── */

.final-score-label {
    font-size: 13px;
    color: #8ab880;
    margin-top: 8px;
}

.final-score {
    font-size: 32px;
    font-weight: 900;
    color: #ffcc00;
    margin: 4px 0 16px;
}

/* ── Name input ──────────────────────────────────────────── */

#name-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.name-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #4a8c3f;
    border-radius: 8px;
    padding: 12px;
    color: #ffcc00;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 8px;
    outline: none;
    width: 100%;
    font-family: monospace;
}

.name-input::placeholder {
    color: rgba(255, 204, 0, 0.3);
}

.name-input:focus {
    border-color: #5ab84f;
}

/* ── Leaderboard ─────────────────────────────────────────── */

.leaderboard-list {
    margin: 16px 0;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(74, 140, 63, 0.2);
    font-family: monospace;
}

.lb-rank {
    width: 30px;
    color: #8ab880;
    font-size: 14px;
}

.lb-name {
    flex: 1;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
}

.lb-score {
    color: #ffcc00;
    font-size: 16px;
    font-weight: 700;
}

.leaderboard-empty {
    padding: 24px;
    color: #666;
    font-style: italic;
}

/* ── D-Pad (mobile only) ─────────────────────────────────── */

.dpad {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 120px;
    height: 120px;
    z-index: 60;
}

.dpad-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(74, 140, 63, 0.3);
    border: 1px solid rgba(74, 140, 63, 0.5);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
    background: rgba(74, 140, 63, 0.6);
}

.dpad-up    { top: 0;    left: 40px; }
.dpad-down  { bottom: 0; left: 40px; }
.dpad-left  { top: 40px; left: 0; }
.dpad-right { top: 40px; right: 0; }

/* Show d-pad on touch devices */
@media (pointer: coarse) {
    .dpad {
        display: block;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .menu-box, .modal-box {
        padding: 24px 20px;
    }

    .game-title {
        font-size: 28px;
    }

    .back-btn, .sound-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ── Modal heading ───────────────────────────────────────── */

.modal-box h2 {
    font-size: 22px;
    color: #4a9c3f;
    margin-bottom: 12px;
}

.modal-box h2 i {
    color: #ffcc00;
    margin-right: 6px;
}
