/* SOB Sobvival Theme CSS */
:root {
    --sob-gold: #fbbf24;
    --sob-dark-gold: #d4a017;
    --sob-blue: #3b82f6;
    --sob-dark-blue: #1e40af;
    --sob-green: #10b981;
    --sob-purple: #a855f7;
    --sob-red: #ef4444;
    --sob-dark: #1a1a2e;
    --sob-darker: #16213e;
    --sob-darkest: #0f172a;
    --white: #ffffff;
    --muted: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--sob-dark) 0%, var(--sob-darker) 50%, var(--sob-darkest) 100%);
    overflow: hidden;
    height: 100vh;
    color: var(--white);
}

.home-link {
    text-decoration: none;
    color: inherit;
}

.home-link:hover .game-title {
    text-decoration: underline;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 3px solid var(--sob-gold);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-left {
    display: flex;
    align-items: center;
}

.game-title {
    color: var(--sob-gold);
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.nav-right {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: rgba(251, 191, 36, 0.2);
    color: var(--white);
    border: 2px solid var(--sob-gold);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s;
}

.nav-btn:hover {
    background: rgba(251, 191, 36, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(251, 191, 36, 0.4);
}

.btn {
    background: linear-gradient(135deg, var(--sob-gold), var(--sob-dark-gold));
    color: var(--sob-dark);
    border: 2px solid rgba(255, 255, 255, 0.06);
    padding: 10px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
}

.btn-large {
    padding: 15px 50px;
    font-size: 1.2rem;
}

.btn-start {
    background: linear-gradient(135deg, var(--sob-gold), #FFB84D);
    color: var(--sob-dark);
    border: 2px solid rgba(0, 0, 0, 0.08);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-start:hover {
    filter: brightness(1.02);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
}

.health-bar-container,
.xp-bar-container {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 20px;
    background: rgba(26, 26, 46, 0.55);
    border-radius: 12px;
    border: 2px solid var(--sob-gold);
    overflow: hidden;
    z-index: 10;
}

.xp-bar-container {
    top: 125px;
    height: 10px;
}

.health-bar,
.xp-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.health-bar {
    background: linear-gradient(90deg, var(--sob-green), #059669);
}

.xp-bar {
    background: linear-gradient(90deg, var(--sob-blue), var(--sob-dark-blue));
}

.abilities-hud {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--sob-gold);
    z-index: 10;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.abilities-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.abilities-row:last-child {
    margin-bottom: 0;
}

.abilities-label {
    color: var(--sob-gold);
    font-size: 0.8rem;
    font-weight: 900;
    min-width: 70px;
    letter-spacing: 0.4px;
}

.abilities-container {
    display: flex;
    gap: 10px;
}

.ability-icon {
    width: 50px;
    height: 50px;
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid var(--sob-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s;
    box-shadow: inset 0 0 18px rgba(251, 191, 36, 0.1);
}

.ability-icon:hover {
    transform: scale(1.1);
    background: rgba(251, 191, 36, 0.25);
}

.ability-icon.empty {
    opacity: 0.3;
    border-style: dashed;
}

.ability-emoji {
    font-size: 1.5rem;
}

.ability-level {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: var(--sob-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.5);
}

.powerup-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

#levelUpModal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
}

.levelup-content {
    background: rgba(26, 26, 46, 0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid var(--sob-gold);
    text-align: center;
    color: var(--white);
    box-shadow: 0 20px 60px rgba(251, 191, 36, 0.4);
}

.powerup-choices {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.powerup-choice {
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid var(--sob-gold);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.25s;
    min-width: 180px;
    color: var(--white);
    box-shadow: 0 10px 28px rgba(251, 191, 36, 0.3);
}

.powerup-choice:hover {
    background: rgba(251, 191, 36, 0.25);
    transform: scale(1.05);
}

.powerup-name {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--sob-gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.powerup-desc {
    font-size: 0.95rem;
    color: var(--muted);
}

.powerup-type {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 10px;
}

.game-over-content {
    text-align: center;
    color: var(--white);
    background: rgba(26, 26, 46, 0.9);
    padding: 50px;
    border-radius: 20px;
    border: 3px solid var(--sob-gold);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.game-over-title {
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--sob-red);
    text-shadow: 0 0 22px rgba(239, 68, 68, 0.5);
}

.game-over-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--sob-gold);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.game-over-content .btn {
    margin: 10px;
}

.side-menu {
    position: fixed;
    top: 60px;
    right: -300px;
    width: 300px;
    height: calc(100vh - 60px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    transition: right 0.3s ease;
    z-index: 99;
    border-left: 2px solid var(--sob-gold);
}

.side-menu.active {
    right: 0;
}

.menu-header {
    padding: 20px;
    border-bottom: 2px solid rgba(251, 191, 36, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h2 {
    color: var(--white);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--sob-gold);
}

.menu-content {
    padding: 20px;
}

.menu-item {
    width: 100%;
    background: rgba(251, 191, 36, 0.15);
    color: var(--white);
    border: 2px solid var(--sob-gold);
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.25s;
}

.menu-item:hover {
    background: rgba(251, 191, 36, 0.25);
    transform: translateX(5px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.86);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--sob-darker) 0%, var(--sob-darkest) 100%);
    border: 2px solid var(--sob-gold);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(251, 191, 36, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid rgba(251, 191, 36, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
}

.modal-header h2 {
    color: var(--white);
    margin: 0;
}

.leaderboard-list {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.leaderboard-item.top-1 {
    background: rgba(251, 191, 36, 0.2);
    border: 2px solid var(--sob-gold);
}

.leaderboard-item.top-2 {
    background: rgba(192, 192, 192, 0.2);
    border: 2px solid #c0c0c0;
}

.leaderboard-item.top-3 {
    background: rgba(205, 127, 50, 0.2);
    border: 2px solid #cd7f32;
}

.leaderboard-rank {
    color: var(--white);
    font-weight: 900;
    font-size: 1.2rem;
    margin-right: 15px;
}

.top-1 .leaderboard-rank {
    color: var(--sob-gold);
}

.top-2 .leaderboard-rank {
    color: #c0c0c0;
}

.top-3 .leaderboard-rank {
    color: #cd7f32;
}

.leaderboard-name {
    color: var(--white);
    font-size: 0.95rem;
    flex: 1;
}

.leaderboard-score {
    color: var(--white);
    font-weight: 900;
    font-size: 1.2rem;
}

.instructions-content {
    padding: 20px;
    color: var(--white);
}

.instructions-content ul {
    list-style: none;
}

.instructions-content li {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 10px;
    border-left: 4px solid var(--sob-gold);
}

.game-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
}

.center-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.start-content {
    text-align: center;
    color: var(--white);
}

.game-logo {
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--sob-gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.sob-emoji-large {
    font-size: 120px;
    margin: 20px 0;
    animation: cry 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
}

@keyframes cry {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-10px) scale(1.05);
    }
    50% {
        transform: translateY(0px) scale(1);
    }
    75% {
        transform: translateY(-5px) scale(0.98);
    }
}

.game-description {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 30px;
}

.username-section {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.username-label {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.username-input {
    padding: 15px 20px;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 2px solid var(--sob-gold);
    background: rgba(251, 191, 36, 0.15);
    color: var(--white);
    text-align: center;
    width: 300px;
    font-family: inherit;
    transition: all 0.25s;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
}

.username-input:focus {
    outline: none;
    border-color: var(--sob-gold);
    background: rgba(251, 191, 36, 0.25);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
}

.username-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.tip {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.55);
}

.game-screen {
    width: 100%;
    height: 100%;
    position: relative;
}

.hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 15px;
    border: 2px solid var(--sob-gold);
    z-index: 10;
}

.hud-item {
    text-align: center;
}

.hud-label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.hud-value {
    display: block;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 900;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--sob-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 1.2rem;
    }

    .nav-btn,
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .hud {
        gap: 15px;
        padding: 10px 20px;
    }

    .hud-value {
        font-size: 1.2rem;
    }

    .game-logo {
        font-size: 2rem;
    }

    .powerup-choices {
        flex-direction: column;
        align-items: center;
    }

    .powerup-choice {
        width: 100%;
        max-width: 300px;
    }

    .username-input {
        width: 90%;
        max-width: 300px;
        font-size: 1rem;
        padding: 12px 15px;
    }

    .username-label {
        font-size: 1rem;
    }

    /* Fixed ability HUD for mobile - properly centered and visible */
    .abilities-hud {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px;
        width: auto;
        max-width: 90vw;
    }

    .abilities-row {
        gap: 8px;
        margin-bottom: 8px;
        flex-wrap: nowrap;
    }

    .abilities-label {
        font-size: 0.7rem;
        min-width: 50px;
    }

    .abilities-container {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .ability-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .ability-emoji {
        font-size: 1.1rem;
    }

    .ability-level {
        font-size: 0.6rem;
        padding: 1px 3px;
        bottom: 1px;
        right: 2px;
    }
}