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

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

#ui {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    color: white;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 10;
}

#day-counter {
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    white-space: nowrap;
}

#pause-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 10px;
    pointer-events: auto;
}

#pause-btn:hover {
    background: rgba(0,0,0,0.7);
    border-color: rgba(255,255,255,0.7);
}

#mute-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 10px;
    pointer-events: auto;
}

#mute-btn:hover {
    background: rgba(0,0,0,0.7);
}

#mute-btn.muted {
    opacity: 0.5;
}

#fullscreen-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 10px;
    pointer-events: auto;
}

#fullscreen-btn:hover {
    background: rgba(0,0,0,0.7);
}

#collection {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 15px;
    flex-shrink: 1;
    min-width: 0;
}

#progress-bar {
    width: 60px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffa502);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-fill.complete {
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px #4ade80, 0 0 10px #4ade80; background: linear-gradient(90deg, #4ade80, #22c55e); }
    50% { box-shadow: 0 0 15px #4ade80, 0 0 25px #4ade80; background: linear-gradient(90deg, #86efac, #4ade80); }
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    z-index: 100;
    padding: 20px;
}

.overlay.hidden {
    display: none;
}

.overlay h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255,107,107,0.8);
}

.overlay h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.overlay p {
    font-size: 24px;
    margin-bottom: 10px;
}

.overlay .subtitle {
    font-size: 18px;
    opacity: 0.8;
    margin-bottom: 30px;
}

.overlay button {
    background: linear-gradient(135deg, #ff6b6b, #ffa502);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 40px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.overlay button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255,107,107,0.6);
}

#easter-egg-content {
    max-width: 500px;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

#easter-egg-content h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #ffa502;
}

#finale h1 {
    font-size: 42px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255,107,107,0.8); }
    to { text-shadow: 0 0 40px rgba(255,165,2,1), 0 0 60px rgba(255,107,107,0.6); }
}

#finale-message {
    font-size: 20px;
    max-width: 500px;
    line-height: 1.8;
    margin: 30px 0;
}

/* Confetti animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Pause Menu */
#pause-stats {
    margin: 20px 0 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#pause-stats p {
    font-size: 16px;
    margin: 0;
    white-space: nowrap;
}

#pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#pause-buttons button {
    font-size: 18px;
    padding: 12px 30px;
}

#resume-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e) !important;
}

/* Scrapbook / Collections */
#scrapbook-content, #collections-content {
    max-width: 500px;
    max-height: 50vh;
    overflow-y: auto;
    text-align: left;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.trip-entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

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

.army-man {
    display: inline-block;
    width: 60px;
    height: 60px;
    margin: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    text-align: center;
    line-height: 60px;
    font-size: 24px;
}

.army-man.found {
    background: rgba(34, 197, 94, 0.3);
    border: 2px solid #22c55e;
}

.army-man.missing {
    opacity: 0.3;
}
