

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

:root {
    --bg-color: #1a1a2e;
    --primary-color: #0f3460;
    --accent-color: #e94560;
    --secondary-accent: #00E5FF;
    --text-color: #f6f6f6;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.3);

    --mouse-x: 50%;
    --mouse-y: 50%;

    --hud-bg-color: linear-gradient(135deg, rgba(15, 52, 96, 0.6), rgba(30, 70, 120, 0.4));
    --hud-border-color: rgba(255, 255, 255, 0.15);
    --hud-blur: 10px;
    --hud-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --hud-radius: 12px;
    --label-color: rgba(220, 230, 255, 0.75);
    --value-color: #00E5FF;
    --value-glow: 0 0 8px rgba(0, 229, 255, 0.6);
}

body {
    margin: 0;
    background: linear-gradient(45deg, #1a1a2e, #101020, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
}

@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 1;
}

#start-menu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    backdrop-filter: blur(8px);
    overflow: hidden;
}

#start-menu-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle 450px at var(--mouse-x) var(--mouse-y), rgba(233, 69, 96, 0.12), transparent 80%);
    will-change: background;
    transition: background 0.1s ease-out;
}

#start-menu-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-menu-layout {
    display: flex;
    width: 90%;
    max-width: 880px;
    background: rgba(10, 20, 40, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.menu-panel {
    background: none;
    border: none;
    box-shadow: none;
    padding: 30px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-panel.left {
    flex-basis: 55%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.menu-panel.right {
    flex-basis: 45%;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.title-container {
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}
.game-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}
.title-accent { color: var(--accent-color); }
.game-subtitle {
    margin: 4px 0 0 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input-group label, .menu-panel.right h2 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: left;
}
.menu-panel.right h2 {
    text-align: center;
    width: 100%;
}

#username-input, #room-key-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid #16213e;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#username-input:focus, #room-key-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.4);
}

#private-match-options {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #16213e;
}
.team-fight-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}
.team-fight-toggle label {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}
#team-fight-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-color);
}
.team-select-group {
    display: none;
    flex-direction: column;
    gap: 8px;
}
.team-fight-toggle:has(#team-fight-checkbox:checked) ~ .team-select-group {
    display: flex;
}

.team-select-group label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}
#team-select {
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    border: 1px solid #16213e;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
}
#team-select:focus {
    outline: none;
    border-color: var(--secondary-accent);
}

#character-preview {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
}
#preview-body {
    width: 65px;
    height: 65px;
    background-color: #FFFFFF;
    border-radius: 50%;
    transition: background-color 0.2s;
    border: 3px solid rgba(255,255,255,0.5);
    background-size: cover;
}
.preview-glove {
    width: 32px;
    height: 32px;
    background-color: #e94560;
    border-radius: 50%;
    position: absolute;
    transition: background-color 0.2s;
    border: 2px solid rgba(0,0,0,0.5);
}
#preview-glove-left { top: 40px; left: 0px; }
#preview-glove-right { top: 40px; right: 0px; }

.color-picker-wrapper { display: flex; justify-content: space-around; gap: 30px; width: 100%; }
.color-option { display: flex; flex-direction: column; align-items: center; gap: 8px; }
input[type="color"] { appearance: none; -webkit-appearance: none; width: 50px; height: 50px; background: none; border: none; cursor: pointer; border-radius: 50%; padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 8px rgba(0,0,0,0.4); transition: transform 0.2s; }
input[type="color"]::-webkit-color-swatch:hover { transform: scale(1.1); }
input[type="color"]::-moz-color-swatch { border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 8px rgba(0,0,0,0.4); }

.divider {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 0.1em;
    margin: 10px 0;
}

.divider span {
    background: #0d1a33;
    padding: 0 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

#play-public-button, #join-room-button {
    width: 100%;
    padding: 15px 25px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#play-public-button {
    background: linear-gradient(145deg, var(--accent-color), #c2314a);
    color: var(--text-color);
    font-weight: 900;
}
#play-public-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(233, 69, 96, 0.3);
}

#join-room-button {
    background-color: transparent;
    color: var(--secondary-accent);
    border: 2px solid var(--secondary-accent);
}
#join-room-button:hover {
    background-color: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

#hud-container {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--hud-bg-color);
    backdrop-filter: blur(var(--hud-blur));
    -webkit-backdrop-filter: blur(var(--hud-blur));
    border-radius: var(--hud-radius);
    border: 1px solid var(--hud-border-color);
    box-shadow: var(--hud-shadow);
    z-index: 100;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    padding: 10px 15px;
}
#hud-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#room-key-display {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--hud-border-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
#room-key-display.hidden {
    display: none;
}
.hud-value-small {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
}

.hud-item.main-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}
.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.hud-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--label-color);
}
.hud-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--value-color);
    text-shadow: var(--value-glow);
}

#multiplier-container {
    position: fixed;
    top: 25px;
    left: 210px;
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.7), rgba(233, 69, 96, 0.5));
    border: 1px solid rgba(255, 150, 0, 0.5);
    border-radius: 8px;
    padding: 8px 15px;
    color: white;
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    z-index: 100;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: scale(0.8) translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#multiplier-container:not(.hidden) {
    opacity: 1;
    transform: scale(1) translateX(0);
}

#status-effects-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 200;
    pointer-events: none;
}
.status-effect {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: effect-pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes effect-pop-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.status-effect.buff {
    border-color: #ADFF2F;
    text-shadow: 0 0 10px #ADFF2F;
}
.status-effect.debuff {
    border-color: #FF4500;
    text-shadow: 0 0 10px #FF4500;
}
.effect-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background-color: white;
    transition: width 0.1s linear;
}

#leaderboard-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 250px;
    background: var(--hud-bg-color);
    backdrop-filter: blur(var(--hud-blur));
    -webkit-backdrop-filter: blur(var(--hud-blur));
    border-radius: var(--hud-radius);
    border: 1px solid var(--hud-border-color);
    box-shadow: var(--hud-shadow);
    z-index: 100;
    padding: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
}
#leaderboard-container h3 { text-align: center; margin: 0 0 10px 0; padding-bottom: 8px; border-bottom: 1px solid var(--hud-border-color); font-size: 1rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
#leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-radius: 6px; transition: background-color 0.2s; border: 1px solid transparent; }
.leaderboard-item:nth-child(1) { font-weight: 900; }
.leaderboard-item:nth-child(2) { font-weight: 700; }
.leaderboard-item:nth-child(3) { font-weight: 600; }
.leaderboard-item.is-self {
    background-color: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.5);
}
.leaderboard-info { display: flex; align-items: center; gap: 10px; }
.leaderboard-color-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.8); flex-shrink: 0; }
.leaderboard-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.leaderboard-score { font-weight: 700; color: var(--value-color); text-shadow: var(--value-glow); }

#bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 250;
    background-color: rgba(15, 52, 96, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px;
    box-shadow: var(--shadow);
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}
#bottom-nav.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
.nav-btn { background-color: transparent; border: 2px solid transparent; border-radius: 50%; width: 50px;  height: 50px; font-size: 1.5rem; color: var(--text-color); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, transform 0.2s; }
.nav-btn:hover { background-color: rgba(255, 255, 255, 0.1); border-color: var(--accent-color); transform: scale(1.1); }

.ability-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--hud-border-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}
.ability-btn:hover {
    border-color: var(--secondary-accent);
    transform: scale(1.1);
}
.ability-icon {
    font-size: 2rem;
    line-height: 1;
}
.ability-key {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    position: absolute;
    bottom: 5px;
}
.ability-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 229, 255, 0.5);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.1s linear;
    will-change: transform;
    pointer-events: none;
}
.ability-btn.on-cooldown {
    border-color: var(--accent-color);
    filter: brightness(0.7);
    transform: scale(1);
}

.modal-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 300; opacity: 1; transition: opacity 0.3s ease-out; background-size: cover; background-position: center; }
.modal-container.modal-hidden { opacity: 0; pointer-events: none; }

.modal-content {
    background: var(--hud-bg-color);
    backdrop-filter: blur(var(--hud-blur));
    border: 1px solid var(--hud-border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 900px; /* Widen the modal */
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.modal-title { margin: 0; font-size: 1.8rem; font-weight: 700; }
.modal-close-btn { background: none; border: none; color: var(--text-color); font-size: 2.5rem; line-height: 1; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
.modal-close-btn:hover { opacity: 1; }
.modal-body { padding: 25px; display: flex; flex-direction: column; gap: 20px; }

.currency-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(90deg, rgba(233, 69, 96, 0.2), rgba(0, 229, 255, 0.2));
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-nav {
    display: flex;
    border-bottom: 1px solid var(--hud-border-color);
    margin-bottom: 20px;
}
.nav-tab {
    background: none; border: none; color: var(--label-color); padding: 10px 20px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: color 0.2s, border-bottom-color 0.2s;
    border-bottom: 3px solid transparent;
}
.nav-tab:hover { color: var(--text-color); }
.nav-tab.active { color: var(--secondary-accent); border-bottom-color: var(--secondary-accent); }

.shop-tab-content { display: none; flex-direction: column; gap: 15px; }
.shop-tab-content.active { display: flex; }

.upgrades-layout {
    display: flex;
    gap: 20px;
}
.upgrades-list {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}
.upgrade-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--hud-border-color);
    border-radius: var(--border-radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s, border-left-color 0.2s;
    border-left: 4px solid transparent;
}
.upgrade-card:hover {
    background: rgba(0,0,0,0.4);
}
.upgrade-card.active {
    background: rgba(0, 229, 255, 0.1);
    border-left-color: var(--secondary-accent);
}
.upgrade-card-icon { font-size: 1.8rem; }
.upgrade-card-info { flex-grow: 1; }
.upgrade-card-info h4 { margin: 0; font-size: 1rem; }
.upgrade-card-info p { margin: 2px 0 0 0; font-size: 0.8rem; color: var(--label-color); }

.upgrade-detail-view {
    flex-grow: 1;
    background: rgba(0,0,0,0.2);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#upgrade-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--hud-border-color);
    padding-bottom: 10px;
}
.upgrade-detail-icon { font-size: 2.5rem; }
#upgrade-detail-title { margin: 0; font-size: 1.5rem; }
#upgrade-detail-desc { color: var(--label-color); margin: 0; min-height: 40px; }
.upgrade-detail-stats { display: flex; flex-direction: column; gap: 8px; }
.stat-comparison { display: flex; justify-content: space-between; font-size: 0.9rem; }
.stat-comparison span { font-weight: 700; color: var(--secondary-accent); }
.stat-bar-container { width: 100%; height: 10px; background: rgba(0,0,0,0.4); border-radius: 5px; }
.stat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-color), var(--secondary-accent)); border-radius: 5px; width: 0%; transition: width 0.3s ease; }
#milestone-perks-container { display: flex; flex-direction: column; gap: 8px; }
#milestone-perks-container h4 { margin: 0 0 5px 0; font-size: 0.9rem; text-transform: uppercase; color: var(--label-color); }
.milestone-perk { display: flex; align-items: center; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 6px; font-size: 0.9rem; }
.milestone-perk.unlocked { color: #FFD700; }
.milestone-perk .perk-level { font-weight: 900; margin-right: 10px; color: var(--text-color); }
.milestone-perk .perk-desc { flex-grow: 1; }
.milestone-perk .perk-lock { font-size: 1.2rem; }
.milestone-perk.unlocked .perk-lock { display: none; }

.upgrade-detail-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--hud-border-color);
}
.upgrade-level {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 8px;
}
.upgrade-btn {
    background: var(--secondary-accent);
    color: #000814;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 12px 25px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.upgrade-btn:hover:not(:disabled) {
    background: #40faff;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}
.upgrade-btn:disabled {
    background: #444; color: #888; cursor: not-allowed;
}

/* --- NEW ARENA SHOP STYLES --- */

.arena-cosmetics-layout-new {
    display: flex;
    gap: 25px;
    min-height: 450px;
}

.cosmetic-category-list {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--hud-border-color);
    padding-right: 25px;
}

.cosmetic-category {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    color: var(--label-color);
    text-align: left;
    font-size: 1rem;
    font-weight: 700;
}
.cosmetic-category:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}
.cosmetic-category.active {
    background-color: rgba(0, 229, 255, 0.1);
    border-color: var(--secondary-accent);
    color: var(--text-color);
}
.category-icon {
    font-size: 1.5rem;
}

.cosmetic-item-display {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cosmetic-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--hud-border-color);
    padding-bottom: 15px;
}

#cosmetic-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.cosmetics-preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#shop-character-preview {
    width: 80px; height: 80px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
#shop-preview-body {
    width: 45px; height: 45px; background-color: #FFFFFF;
    border-radius: 50%; border: 3px solid rgba(255,255,255,0.5);
    background-size: cover;
}
#shop-character-preview .preview-glove {
    width: 22px; height: 22px;
}
#shop-preview-glove-left { top: 28px; left: -2px; }
#shop-preview-glove-right { top: 28px; right: -2px; }
.cosmetics-preview-area p {
    display: none;
}

#cosmetic-grids-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 10px;
}

.cosmetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.cosmetic-item {
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.cosmetic-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border-color: rgba(255, 255, 255, 0.3);
}
.cosmetic-item.selected {
    border-color: var(--secondary-accent);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.cosmetic-preview {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,0.2);
}

#border-cosmetics-grid .cosmetic-preview {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}
#border-cosmetics-grid .cosmetic-preview::before {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid;
    border-color: inherit;
}

.cosmetic-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}
.cosmetic-action {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.2s;
}
.cosmetic-action.buy {
    background-color: var(--accent-color);
    color: var(--text-color);
}
.cosmetic-action.equip {
    background-color: var(--secondary-accent);
    color: #000814;
}
.cosmetic-action.equipped {
    background-color: #333;
    color: #888;
    cursor: not-allowed;
}


.quests-timer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--label-color);
    margin-bottom: 10px;
}
#quests-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.quest-item {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.quest-title {
    font-weight: 700;
    font-size: 1.1rem;
}
.quest-reward {
    font-weight: 900;
    color: #FFD700;
}
.quest-progress-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    height: 20px;
    position: relative;
    overflow: hidden;
}
.quest-progress-bar {
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-accent));
    height: 100%;
    width: 0%;
    border-radius: 20px;
    transition: width 0.3s ease-out;
}
.quest-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: 900;
    text-shadow: 0 0 3px black;
}
.quest-claim-btn {
    align-self: flex-end;
    background-color: #FFD700;
    color: #1a1a2e;
    font-weight: 900;
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}
.quest-claim-btn:hover {
    transform: scale(1.05);
}
.quest-claim-btn:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

.login-streak-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}
#login-rewards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.reward-day {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: center;
    opacity: 0.6;
}
.reward-day-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--label-color);
}
.reward-day-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #FFD700;
}
.reward-day.claimable {
    opacity: 1;
    border-color: var(--secondary-accent);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}
.reward-day.claimed {
    opacity: 0.4;
    background-color: rgba(0, 0, 0, 0.6);
    border-style: dashed;
}
.reward-day.claimed .reward-day-value::after {
    content: '✔';
    color: #ADFF2F;
    margin-left: 5px;
    font-size: 1rem;
}

#stats-container { display: flex; flex-direction: column; gap: 15px; }
.stat-item { display: flex; justify-content: space-between; align-items: center; background-color: rgba(0,0,0,0.2); padding: 15px; border-radius: var(--border-radius-md); font-size: 1.2rem; }
.stat-item span:last-child { font-weight: 900; color: #FFFF00; }
#prestige-container { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
#prestige-container h3 { margin: 0 0 10px 0; font-size: 1.5rem; color: var(--accent-color); }
#prestige-container p { font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); line-height: 1.5; margin-bottom: 15px;}
.prestige-btn { width: 100%; padding: 12px; background: linear-gradient(145deg, #ffab00, #ffea00); color: #1a1a2e; border: none; border-radius: var(--border-radius-md); font-size: 1.1rem; font-weight: 900; cursor: pointer; transition: transform 0.2s; }
.prestige-btn:hover { transform: translateY(-2px); } .prestige-btn:disabled { background: #555; color: #999; cursor: not-allowed; }

.menu-button { width: 100%; padding: 15px; font-size: 1.2rem; font-weight: 700; cursor: pointer; border-radius: var(--border-radius-md); border: 2px solid var(--accent-color); background-color: #16213e; color: var(--text-color); transition: background-color 0.2s; }
.menu-button:hover { background-color: var(--accent-color); }

#killstreak-container { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 200; text-align: center; }
.killstreak-text {
    font-size: 3rem; 
    font-weight: 800; 
    color: var(--accent-color); 
    text-shadow: 0 0 10px black, 0 0 20px #e94560; 
    animation: fade-in-out 2s ease-in-out forwards; 
}

.killstreak-text {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-shadow: 0 0 8px rgba(0,0,0,0.7);
    padding: 10px 20px;
    background: linear-gradient(90deg, rgba(233, 69, 96, 0.5), rgba(0, 229, 255, 0.5));
    border-radius: 12px;
    margin-bottom: 10px;
    animation: fade-in-out 4s ease-in-out forwards;
}

.killstreak-text strong {
    color: #FFD700;
    font-weight: 800;
}

@keyframes fade-in-out { 
    0%   { opacity: 0; transform: translateY(20px) scale(.8); } 
    15%  { opacity: 1; transform: translateY(0) scale(1.05); }
    85%  { opacity: 1; transform: translateY(0) scale(1); } 
    100% { opacity: 0; transform: translateY(-20px) scale(.8); } 
}
#scoreboard-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 150; opacity: 0; pointer-events: none; transition: opacity 0.3s ease-out; }
#scoreboard-container.visible { opacity: 1; pointer-events: all; }
.scoreboard-content { background-color: var(--primary-color); border: 2px solid var(--accent-color); border-radius: var(--border-radius-lg); padding: 30px 40px; box-shadow: var(--shadow); text-align: center; min-width: 400px; }

#level-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--hud-border-color);
}
#level-display {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}
#level-display .hud-value {
    font-size: 1.8rem;
    position: absolute;
}
.level-progress-ring {
    transform: rotate(-90deg);
}
.level-progress-ring circle {
    transition: stroke-dashoffset 0.3s ease;
    fill: transparent;
    stroke-width: 6px;
}
.level-progress-ring__bg {
    stroke: rgba(0, 0, 0, 0.4);
}
.level-progress-ring__bar {
    stroke: var(--secondary-accent);
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px var(--secondary-accent));
}
.level-xp-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#xp-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

/* --- Mobile & Controller Support --- */
#mobile-controls-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 250;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 20px;
}

.mobile-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(5px);
}
.mobile-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* --- Controller Support --- */
.controller-focus {
    outline: 3px solid var(--secondary-accent) !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.7) !important;
    border-color: var(--secondary-accent) !important;
    transform: scale(1.05);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}
/* Tweak for specific elements */
input.controller-focus, .cosmetic-item.controller-focus {
    transform: none; /* Scaling inputs can look weird */
}


/* Media Query for Mobile Devices */
@media (pointer: coarse), (max-width: 800px) {
    #bottom-nav {
        display: none;
    }
    #mobile-controls-container {
        display: flex;
    }

    .start-menu-layout {
        flex-direction: column;
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    .menu-panel.left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-panel {
        padding: 20px;
    }

    .modal-content {
        max-width: 90vw;
    }
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
    .upgrades-layout, .arena-cosmetics-layout-new {
        flex-direction: column;
    }
    .cosmetic-category-list {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--hud-border-color);
        padding-right: 0;
        padding-bottom: 15px;
        overflow-x: auto;
        flex: 1 1 auto;
    }
    #leaderboard-container {
        display: none; /* Can be too cluttered on small screens */
    }
}
