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

body {
    font-family: ui-monospace, monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0f0f23 100%);
    color: #fff;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Game Title */
.game-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 60px #00ffff;
    margin-bottom: 0.5rem;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff; }
    50% { text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff, 0 0 90px #00ffff; }
}

.gameover-title {
    color: #ff0044;
    text-shadow: 0 0 20px #ff0044, 0 0 40px #ff0044;
}

.victory-title {
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88;
}

.game-tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #ff66cc;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px #ff66cc;
}

/* Buttons */
.primary-btn {
    font-family: inherit;
    font-size: 1.5rem;
    padding: 1.2rem 3.5rem;
    margin: 0.5rem;
    background: linear-gradient(135deg, #00ffff 0%, #0088ff 100%);
    border: none;
    border-radius: 15px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.primary-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.9);
}

.secondary-btn {
    font-family: inherit;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
    margin: 0.5rem;
    background: transparent;
    border: 3px solid #ff66cc;
    border-radius: 15px;
    color: #ff66cc;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.secondary-btn:hover {
    background: rgba(255, 102, 204, 0.3);
    box-shadow: 0 0 40px rgba(255, 102, 204, 0.7);
}

/* Controls Info */
.controls-info {
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #00ffff;
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0;
    min-width: 320px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
}

.controls-info h3 {
    color: #00ffff;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.control-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
}

.control-item:last-child {
    border-bottom: none;
}

.control-key {
    color: #ff66cc;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(255, 102, 204, 0.5);
}

/* Item Info */
.item-info {
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #00ffff;
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem 0;
    min-width: 320px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
}

.item-info h3 {
    color: #00ffff;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.item-info p {
    color: #ffcc00;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* HUD */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud.hidden {
    display: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
}

.score-container, .time-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    min-width: 120px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    animation: hudPulse 3s ease-in-out infinite;
}

@keyframes hudPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.5); }
}

.score-label, .time-label {
    display: block;
    font-size: 0.7rem;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
}

.score-value, .time-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    font-family: ui-monospace, monospace;
    letter-spacing: 4px;
    line-height: 1;
}

.hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
}

.friend-status, .enemy-status {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff66cc;
    border-radius: 15px;
    padding: 0.8rem 1.2rem;
    min-width: 150px;
    box-shadow: 0 0 30px rgba(255, 102, 204, 0.3);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 102, 204, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 102, 204, 0.5); }
}

.friend-label, .enemy-label {
    display: block;
    font-size: 0.7rem;
    color: #ff66cc;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
}

.friend-value, .enemy-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: ui-monospace, monospace;
    letter-spacing: 2px;
    line-height: 1;
}

.friend-value.safe {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

.enemy-value.safe {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

.enemy-value.suspicious {
    color: #ffcc00;
    text-shadow: 0 0 10px #ffcc00;
    animation: suspiciousPulse 0.5s ease-in-out infinite;
}

.enemy-value.danger {
    color: #ff0044;
    text-shadow: 0 0 15px #ff0044;
    animation: dangerPulse 0.3s ease-in-out infinite;
}

@keyframes suspiciousPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Enemy Compass */
.enemy-compass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: rgba(255, 0, 68, 0.2);
    border: 3px solid #ff0044;
    border-radius: 50%;
    animation: compassPulse 0.5s ease-in-out infinite;
}

@keyframes compassPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 68, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 68, 0.8); }
}

.compass-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 50px solid #ff0044;
    position: absolute;
    top: 5px;
    left: 50%;
    transform-origin: bottom center;
    transition: transform 0.3s ease;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(10, 10, 30, 0.98);
    border: 3px solid #00ffff;
    border-radius: 25px;
    padding: 2.5rem;
    text-align: center;
    min-width: 380px;
    box-shadow: 0 0 60px rgba(0, 255, 255, 0.4);
    animation: modalAppear 0.4s ease;
}

@keyframes modalAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-size: 2rem;
    color: #00ffff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 3px;
}

.modal-message {
    font-size: 1.3rem;
    color: #ff66cc;
    margin-bottom: 1.5rem;
}

.modal-desc {
    color: #aaa;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.friend-emoji {
    font-size: 6rem;
    margin: 1rem 0;
    animation: friendPulse 1s ease-in-out infinite;
}

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

/* Final Score */
.final-score {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.final-label {
    font-size: 1rem;
    color: #00ffff;
    text-transform: uppercase;
}

.final-value {
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px #00ffff;
}

.high-score {
    color: #ffcc00;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hud-top {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hud-bottom {
        flex-direction: column;
        gap: 0.5rem;
    }

    .controls-info, .item-info {
        min-width: 250px;
    }

    .game-title {
        font-size: 2rem;
    }

    .modal-content {
        min-width: 280px;
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }
}

/* Fallback for non-canvas browsers */
.no-canvas {
    display: none;
}
