:root {
    --bg-dark: #0a0a0f;
    --primary-color: #ff0055;
    --secondary-color: #0088ff;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --pixel-font: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: var(--pixel-font);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: white;
}

.game-title {
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.2rem;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#controls-hint {
    font-size: 0.7rem;
    color: #444;
}

.canvas-wrapper {
    position: relative;
    width: 800px;
    height: 500px;
    background: #111;
    border: 4px solid #222;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

canvas {
    width: 100%;
    height: 100%;
}

/* HUD */
#hud {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 10px;
    pointer-events: none;
}

.player-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.player-stats.eliminated {
    opacity: 0.3;
    filter: grayscale(1);
    transform: scale(0.9);
}

.p-name {
    font-size: 0.6rem;
    color: #888;
    margin-bottom: 2px;
}

.percent {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.lives {
    font-size: 0.7rem;
    color: #ff4141;
    margin-top: 2px;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 4px;
}

.hidden { display: none; }

.overlay-content {
    text-align: center;
}

.overlay-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #555);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-content p {
    color: #666;
    margin-bottom: 30px;
}

#winner-text {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: winnerBounce 1s ease infinite alternate;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes winnerBounce {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.intro-text#intro-text.finish {
    color: #ff0055;
    font-size: 6rem;
    text-shadow: 0 0 40px rgba(255, 0, 85, 0.6);
}

.pixel-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.pixel-btn:hover {
    transform: scale(1.05);
    background: var(--primary-color);
    color: white;
}

.pixel-btn.outline {
    background: transparent;
    border: 2px solid white;
    color: white;
    margin-left: 10px;
}

/* Character Select */
.select-content {
    max-width: 900px !important;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.char-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.char-slot.active {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.char-preview {
    width: 40px;
    height: 50px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.char-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.toggle-btn {
    background: #222;
    border: 1px solid #444;
    color: #888;
    padding: 5px;
    font-size: 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: white;
}

.toggle-btn.cpu.active {
    background: #0088ff;
}

.toggle-btn.off.active {
    background: #444;
}

.team-group {
    display: flex;
    gap: 2px;
    margin-top: 5px;
    width: 100%;
}

.team-btn {
    flex: 1;
    background: #222;
    border: 1px solid #444;
    color: #666;
    padding: 3px;
    font-size: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: bold;
}

.team-btn.active.red {
    background: #ff0055;
    color: white;
    border-color: white;
}

.team-btn.active.blue {
    background: #0088ff;
    color: white;
    border-color: white;
}

.team-btn.active.none {
    background: #666;
    color: white;
    border-color: white;
}

.team-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.team-btn:active {
    transform: translateY(0);
}

.player-stats .p-name {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.team-badge {
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.5rem;
    font-weight: bold;
    color: white;
}

.team-badge.red { background: #ff0055; }
.team-badge.blue { background: #0088ff; }

.settings-bar {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    color: white;
}

.settings-bar input, .settings-bar select {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 1.1rem;
    text-align: center;
    font-family: inherit;
}

.settings-bar input {
    width: 60px;
}

.settings-bar select {
    cursor: pointer;
    outline: none;
}

.settings-bar select option {
    background: #222;
    color: white;
}
