/* Boulder Dash — C64 / CRT tema */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: radial-gradient(circle at center, #1a1208 0%, #08090d 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', cursive;
    padding: 10px;
}

.arcade-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 680px;
}

.game-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.nav-btn {
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #dd8855;
    box-shadow: 0 0 12px rgba(221, 136, 85, 0.6);
    transform: translateX(-2px);
}

.game-heading {
    font-size: 1rem;
    color: #aaffee;
    text-shadow: 0 0 8px rgba(170, 255, 238, 0.5);
    margin: 0;
}

.arcade-tag {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    color: #eeee77;
    letter-spacing: 1px;
}

#game-container {
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(170, 255, 238, 0.15);
    border: 6px solid #664400;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 640px;
    background: #000;
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #0000aa;
    color: #aaffee;
    font-size: 9px;
    padding: 8px 10px;
    text-shadow: 1px 1px 0 #000;
    border-bottom: 3px solid #0088ff;
    z-index: 10;
    position: relative;
}

#status-bar span {
    white-space: nowrap;
}

#diamondLabel { color: #aaffee; }
#timeLabel { color: #eeee77; }
#scoreLabel { color: #ffffff; }
#livesLabel { color: #ff7777; }
#soundLabel { color: #2ed573; cursor: default; }
#soundLabel.muted { color: #777777; }

canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 640 / 384;
    background-color: #000;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 5;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 8, 14, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 1.6rem;
    color: #aaffee;
    text-shadow: 3px 3px 0 #880000;
    margin-bottom: 16px;
}

.screen .subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: #eeee77;
    margin-bottom: 20px;
}

.screen p {
    font-size: 0.65rem;
    line-height: 1.8;
    margin-bottom: 8px;
    color: #ccc;
}

.controls-guide {
    margin-top: 20px;
    text-align: left;
    background: rgba(0, 0, 0, 0.45);
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid rgba(170, 255, 238, 0.25);
}

.controls-guide p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.controls-guide strong {
    color: #aaffee;
}

.cave-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 520px;
    margin: 8px 0 12px;
    max-height: 58%;
    overflow-y: auto;
    padding: 4px;
}

.cave-btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    text-align: left;
    padding: 10px 12px;
    background: rgba(0, 0, 170, 0.45);
    border: 2px solid rgba(170, 255, 238, 0.35);
    border-radius: 6px;
    color: #aaffee;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.cave-btn:hover,
.cave-btn:focus {
    background: rgba(0, 204, 85, 0.35);
    border-color: #eeee77;
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.cave-btn .cave-id {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: #eeee77;
    display: block;
    margin-bottom: 4px;
}

.cave-select-hint {
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
    margin-top: 4px !important;
}

.blink {
    animation: blink 1.1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.gold-text { color: #ffd32a !important; }
.game-over-text { color: #ff4757 !important; text-shadow: 3px 3px 0 #440000 !important; }

.final-score-text {
    font-size: 0.9rem !important;
    color: #aaffee !important;
    margin: 16px 0 !important;
}

#high-score-form input {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    padding: 10px;
    text-align: center;
    background: #000;
    color: #aaffee;
    border: 2px solid #aaffee;
    border-radius: 4px;
    margin: 10px 0;
    width: 200px;
    text-transform: uppercase;
}

#submitScoreBtn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    padding: 10px 18px;
    background: #00cc55;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
}

#submitScoreBtn:hover {
    background: #aaff66;
}

#leaderboard h2 {
    font-size: 0.9rem;
    color: #eeee77;
    margin: 16px 0 10px;
}

#highScoresList {
    list-style: none;
    margin-bottom: 16px;
    min-width: 220px;
}

#highScoresList li {
    font-size: 0.6rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    color: #aaffee;
}

.game-footer {
    margin-top: 14px;
    text-align: center;
}

.game-footer p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #64748b;
}

.hidden {
    display: none !important;
}
