:root {
    --bg-color: #050505;
    --primary-glow: #00f3ff;
    --secondary-glow: #ff0055;
    --text-color: #ffffff;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-main);
    color: var(--text-color);
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    touch-action: none;
    /* Prevent pull-to-refresh and scrolling */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to canvas when playing */
}

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

#matching-screen p {
    color: #fff;
    font-size: 18px;
    letter-spacing: 1px;
    margin-top: 10px;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
}

.countdown-anim {
    animation: fadePop 0.8s ease both;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #00f3ff;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: none;
    cursor: pointer;
    user-select: none;
}

.checkbox-inline input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-inline .checkmark {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--primary-glow);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
    background: rgba(0, 243, 255, 0.08);
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-inline .checkmark::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: transparent;
    border-radius: 4px;
    transform: scale(0.6);
    transition: all 0.2s ease;
}

.checkbox-inline input:checked+.checkmark {
    background: var(--primary-glow);
    border-color: var(--primary-glow);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.7);
}

.checkbox-inline input:checked+.checkmark::after {
    background: #3d3d4b;
    box-shadow: 0 0 12px rgba(61, 61, 75, 0.8);
}

.checkbox-inline .checkbox-label {
    color: #00f3ff;
    font-size: 14px;
    letter-spacing: 0.8px;
}

.match-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.match-tab-btn {
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.5);
    border-radius: 10px;
    color: #00f3ff;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.match-tab-btn.active {
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.85), rgba(0, 225, 255, 0.65));
    border-color: var(--primary-glow);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
}

.tab-panel.hidden {
    display: none;
}

@keyframes fadePop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    40% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Game Over Screen */
#game-over-screen {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#game-over-screen .title {
    font-size: 80px;
    color: #ff0055;
    text-shadow: 0 0 30px #ff0055, 0 0 60px #ff0055;
    margin-bottom: 10px;
    letter-spacing: 10px;
    animation: glitch 2s infinite;
}

#final-score {
    font-size: 32px;
    color: #fff;
    margin-bottom: 40px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#game-stats-container {
    margin-top: 28px;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 12px 16px;
    width: 100%;
    max-width: 320px;
}

#game-stats-container .stat-item {
    position: relative;
    background: radial-gradient(circle at 20% 20%, rgba(255, 0, 85, 0.12), rgba(0, 0, 0, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 16px rgba(0, 243, 255, 0.08);
    overflow: hidden;
}

#game-stats-container .label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    margin-bottom: 6px;
    text-align: center;
}

#game-stats-container .value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #00f3ff;
    text-shadow: 0 0 14px rgba(0, 243, 255, 0.5), 0 0 26px rgba(255, 0, 85, 0.35);
    text-align: center;
}

#game-stats-container .stat-item::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1), rgba(255, 0, 85, 0.18));
    mix-blend-mode: screen;
    opacity: 0.7;
    filter: blur(12px);
}

#game-over-screen button {
    width: 300px;
    margin: 10px 0;
    padding: 15px;
    font-size: 18px;
    letter-spacing: 2px;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

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

.active {
    opacity: 1;
    pointer-events: auto;
}

.title {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: 10px;
    text-shadow: 0 0 20px var(--primary-glow), 0 0 40px var(--primary-glow);
    margin-bottom: 10px;
    animation: pulse 6s infinite ease-in-out;
}

/* ... (rest of css) ... */

@keyframes pulse {

    0%,
    100% {
        text-shadow: 0 0 20px var(--primary-glow);
        letter-spacing: 10px;
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 50px var(--primary-glow), 0 0 100px var(--primary-glow);
        letter-spacing: 18px;
        /* Spreads out more */
        opacity: 0.8;
    }
}

.subtitle {
    font-size: 24px;
    color: #aaa;
    margin-bottom: 60px;
    letter-spacing: 8px;
    /* Increased spacing */
}

.subtitle span {
    display: inline-block;
    animation: floatText 6s ease-in-out infinite alternate;
}

@keyframes floatText {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-4px) rotate(var(--rot));
    }
}

.menu-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px 0;
}

.form-group label {
    font-size: 12px;
    color: var(--primary-glow);
    letter-spacing: 2px;
    margin-left: 10px;
    font-weight: 700;
}

.select-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-glow);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    text-align: center;
    border-radius: 30px;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.select-input:hover,
.select-input:focus {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.select-wrapper {
    width: 100%;
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: var(--primary-glow);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.3s;
}

.select-wrapper:hover::after {
    color: #fff;
    transform: translateY(-50%) scale(1.2);
}

#difficulty-select {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-glow);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    text-align: center;
    border-radius: 30px;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

#difficulty-select:hover,
#difficulty-select:focus {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.btn {
    padding: 15px 40px;
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #fff;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
    width: 100%;
}

.btn.primary {
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.btn.primary:hover {
    background: var(--primary-glow);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn.secondary {
    border-color: var(--secondary-glow);
    font-size: 16px;
    padding: 12px 30px;
}

.btn.secondary:hover {
    background: var(--secondary-glow);
    box-shadow: 0 0 20px var(--secondary-glow);
}

.btn.matching {
    width: fit-content;
    margin-top: 30px;
}

/* Profile Modal Styles - Revamped */
.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-glow);
    box-shadow: 0 0 30px var(--primary-glow);
    border: 2px solid #fff;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    text-align: left;
}

.profile-info h3 {
    margin: 0 0 5px 0;
    font-size: 32px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.profile-info span {
    font-size: 14px;
    color: #aaa;
    font-family: 'Courier New', monospace;
}

.profile-level {
    text-align: center;
    background: rgba(0, 243, 255, 0.1);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--primary-glow);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.profile-level .label {
    display: block;
    font-size: 10px;
    color: var(--primary-glow);
    letter-spacing: 2px;
    margin-bottom: 2px;
}

.profile-level .value {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-2px);
    border-color: var(--primary-glow);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stat-box .label {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-box .value {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    font-family: 'Courier New', monospace;
}

.profile-customization {
    text-align: left;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
}

.profile-customization label,
.profile-bio label {
    display: block;
    font-size: 12px;
    color: var(--primary-glow);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.color-picker {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 15px currentColor;
    transform: scale(1.1);
}

.color-swatch.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0.5;
    animation: pulse-border 2s infinite;
}

.profile-bio {
    text-align: left;
    margin-bottom: 30px;
}

.profile-bio textarea {
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    resize: none;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s;
}

.profile-bio textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    background: rgba(0, 0, 0, 0.6);
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-actions button {
    flex: 1;
}

@keyframes pulse-border {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

.modal.hidden {
    display: none;
    pointer-events: none;
}

.room-code {
    color: var(--primary-glow);
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 6px;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
}

.modal-content {
    background: rgba(10, 10, 10, 0.95);
    padding: 3rem 2rem;
    border: 1px solid var(--primary-glow);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.15);
    min-width: 350px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content h2 {
    font-size: 2rem;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--primary-glow);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

.input-group {
    width: 100%;
}

input {
    display: block;
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: #fff;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.auth-message {
    min-height: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-message.visible {
    opacity: 1;
}

.auth-message.error {
    color: #ff4444;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.auth-message.success {
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

.auth-footer {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-glow);
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 5px;
    font-size: 14px;
}

.text-btn:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--primary-glow);
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 10px 20px;
    cursor: pointer;
    opacity: 0.5;
    font-family: var(--font-main);
    font-weight: bold;
    text-transform: uppercase;
}

.tab-btn.active {
    opacity: 1;
    border-bottom: 2px solid var(--primary-glow);
}

#leaderboard-list {
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-1 {
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
    font-weight: bold;
}

.rank-2 {
    color: #C0C0C0;
    text-shadow: 0 0 10px #C0C0C0;
}

.rank-3 {
    color: #CD7F32;
    text-shadow: 0 0 10px #CD7F32;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.score-container {
    position: fixed;
    top: 20px;
    right: 20px;
    text-align: right;
    z-index: 100;
    /* High z-index to ensure visibility */
}

#score-display {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#timer-display {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    color: #00f3ff;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    z-index: 100;
    text-shadow: 0 0 5px #00f3ff;
}

#minimap {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 200px;
    height: 200px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-glow);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

@keyframes pulse {

    0%,
    100% {
        text-shadow: 0 0 20px var(--primary-glow);
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 40px var(--primary-glow), 0 0 80px var(--primary-glow);
        opacity: 0.9;
    }
}

@media (max-width: 600px) {
    .title {
        font-size: 3rem !important;
    }

    .btn {
        padding: 0.8rem 2.5rem;
    }
}

/* Profile Section */
.profile-section {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    pointer-events: auto;
}

#profile-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-glow);
    color: var(--primary-glow);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

#profile-btn:hover {
    background: var(--primary-glow);
    color: #000;
    box-shadow: 0 0 30px var(--primary-glow);
    transform: scale(1.1);
}

#user-greeting {
    color: #fff;
    font-size: 16px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#username-display {
    color: var(--primary-glow);
    font-weight: bold;
}

.d-none {
    display: none !important;
}

/* --- Notification System (Toast) --- */
#notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--primary-glow);
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out forwards;
    pointer-events: auto;
    min-width: 250px;
    backdrop-filter: blur(5px);
}

.notification.success {
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.notification.error {
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
}

.notification.info {
    border-color: #00f3ff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.notification.warning {
    border-color: #ffee00;
    box-shadow: 0 0 10px rgba(255, 238, 0, 0.2);
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* --- Settings Modal --- */
.settings-group {
    text-align: left;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
}

.settings-group h3 {
    font-size: 14px;
    color: var(--primary-glow);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.setting-item label {
    font-size: 14px;
    color: #ccc;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Power-up HUD */
#powerup-display {
    position: absolute;
    bottom: 230px;
    /* Above minimap (200px height + margin) */
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    background: rgba(0, 0, 0, 0.0);
    /* Transparent background */
    padding: 10px;
    pointer-events: none;
}

#powerup-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

#powerup-timer-text {
    font-size: 14px;
    font-weight: 400;
}

#powerup-bar-container {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#powerup-bar {
    height: 100%;
    background: #fff;
    width: 100%;
    transition: width 0.1s linear;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-glow);
    border-color: var(--primary-glow);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: #000;
}

/* Range Slider */
.range-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-glow);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
}

#settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

#settings-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}


@media (max-width: 768px) {
    #minimap {
        width: 120px;
        height: 120px;
        bottom: 20px;
        right: 20px;
    }

    .profile-section {
        bottom: 20px;
    }

    .modal-content h2 {
        font-size: 1.2rem;
    }

    .select-input {
        padding: 5px 15px;
    }

    .match-tab-btn {
        padding: 6px;
    }

    #difficulty-select {
        padding: 5px 15px;
    }
}
