/* Mobile-first responsive design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    background: rgba(30, 30, 50, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-card {
    text-align: center;
}

/* Title Row */
.title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.badge-success {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    color: white;
    margin: 12px auto;
    width: 120px;
    height: 32px;
    border-radius: 16px;
    font-size: 14px;
}

.title-content {
    flex: 1;
}

.title {
    font-size: 24px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.4;
}

/* Crash Counter Overlay */
.crash-counter-overlay {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    color: #ff6b6b;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
}

.crash-counter-overlay.visible {
    display: block;
}

/* Instructions */
.instructions {
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid #ffd700;
}

.instruction-text {
    font-size: 14px;
    color: #e0e0e0;
    margin-bottom: 8px;
    line-height: 1.5;
}

.hint-text {
    font-size: 12px;
    color: #a0a0a0;
    font-style: italic;
}

/* Maze Container */
.maze-container {
    margin-bottom: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.maze-canvas {
    width: 100%;
    max-width: 100%;
    height: 400px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    cursor: crosshair;
    touch-action: none;
    background: rgba(20, 20, 35, 0.8);
}

/* Status Text */
.status-container {
    margin-bottom: 20px;
    min-height: 40px;
}

.status-text {
    font-size: 13px;
    color: #b0b0b0;
    text-align: center;
    line-height: 1.5;
    transition: color 0.3s;
}

.status-text.error {
    color: #ff6b6b;
}

.status-text.success {
    color: #4caf50;
}

/* Map Section (Hidden Initially) */
.map-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease-in, max-height 0.5s ease-in;
    pointer-events: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

.map-section.revealed {
    opacity: 1;
    max-height: 2000px;
    pointer-events: auto;
}

.map-section-title {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 12px;
    text-align: center;
}

.map-preview-container {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.map-preview {
    width: 100%;
    height: auto;
    display: block;
}

/* Map Card (Solved State) */
.map-title {
    font-size: 28px;
    color: #ffd700;
    margin-bottom: 24px;
}

.map-container {
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

.map-text {
    margin-top: 20px;
    font-size: 14px;
    color: #b0b0b0;
    font-style: italic;
}

/* Responsive adjustments */
@media (min-width: 480px) {
    .card {
        padding: 32px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .maze-canvas {
        height: 450px;
    }
}

