/* General styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #05080c;
    font-family: 'Rajdhani', sans-serif;
    color: #e2e8f0;
}

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

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    transition: all 0.1s ease;
}

#crosshair::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background-color: #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* HUD styles */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

.hud-box {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    min-width: 140px;
}

#health-container {
    min-width: 240px;
}

.hud-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.hud-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

#bunny-count-value {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.4);
}

.bar-outer {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
    margin-bottom: 6px;
}

#health-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff3b30, #ff9500);
    border-radius: 4px;
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

#hunger-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffd60a, #ff9f0a);
    border-radius: 4px;
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(255, 214, 10, 0.6);
}

#armor-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.2s ease-out;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.7);
}

/* Transient pickup / event message */
#toast {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 20;
    padding: 12px 22px;
    background: rgba(10, 16, 29, 0.88);
    border: 1px solid rgba(96, 165, 250, 0.6);
    border-radius: 10px;
    color: #eaf2ff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- Multiplayer lobby (start screen) ---- */
#mp-setup {
    margin: 14px auto 6px;
    max-width: 460px;
}

#player-name {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #eaf2ff;
    background: rgba(10, 16, 29, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 10px;
    outline: none;
    text-align: center;
}

#player-name:focus {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.35);
}

#role-cards {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.role-card {
    flex: 1;
    padding: 10px 6px;
    font-size: 1.6rem;
    background: rgba(10, 16, 29, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #eaf2ff;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.role-card span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.role-card small {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    opacity: 0.65;
    letter-spacing: 0.3px;
}

.role-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.6);
}

.role-card.selected {
    border-color: #10b981;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
    background: rgba(16, 60, 40, 0.55);
}

#net-status {
    margin-top: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#net-status.net-on { color: #34d399; }
#net-status.net-wait { color: #fbbf24; }
#net-status.net-off { color: #94a3b8; }

#lobby-box {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(10, 16, 29, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: left;
}

#lobby-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

#lobby-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

#lobby-list li {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

#lobby-list li:last-child { border-bottom: none; }

#lobby-box.lobby-empty #lobby-list li {
    opacity: 0.6;
    font-style: italic;
}

/* Navigation Compass & Day/Night Indicator Layout */
#top-center-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    display: flex;
    gap: 16px;
    align-items: center;
}

#nav-container {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

#day-night-container {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

#cycle-icon {
    font-size: 1.3rem;
}

#cycle-text {
    font-size: 1rem;
    color: #ffffff;
    letter-spacing: 1px;
}

#cycle-timer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0,0,0,0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.gold-text {
    background: linear-gradient(180deg, #ffe066, #b38600) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6) !important;
}

#nav-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

#nav-arrow {
    font-size: 1.4rem;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: transform 0.1s ease-out;
}

.heal-indicator {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #10b981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: healPulse 1s infinite alternate;
}

.hidden {
    display: none !important;
}

@keyframes healPulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Overlays (Start, Game Over, Pause) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10, 15, 30, 0.8) 0%, rgba(3, 5, 10, 0.98) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease, visibility 0.5s;
    backdrop-filter: blur(8px);
}

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

.overlay-content {
    background: rgba(13, 20, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px 60px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    letter-spacing: 4px;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1), 0 5px 15px rgba(0,0,0,0.5);
    background: linear-gradient(180deg, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-title.blood-text {
    background: linear-gradient(180deg, #ff4444, #880000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

.game-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    font-weight: 300;
}

.instructions {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.instructions h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.2);
}

.mouse-icon {
    margin-left: 8px;
    font-size: 1.1rem;
}

.warning-text {
    margin-top: 15px;
    color: #ff6666;
    font-size: 0.85rem;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255,255,255,0.3);
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.5);
}

.overlay-msg {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.stats-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-box p {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
}

.stats-box p:last-child {
    margin-bottom: 0;
}

.highlight {
    color: #ffffff;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

#final-score {
    color: #ffb800;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}

#final-bunnies {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}
