:root {
    --primary-color: #00ff88;
    --p1-color: #ff4d4d;
    --p2-color: #4d79ff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
}

* {
    box-sizing: border-box;
    user-select: none;
}

/* Privacy Modal */
#privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: none; /* Toggled by JS */
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.privacy-content {
    width: 500px;
    background: rgba(30, 30, 35, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.privacy-header {
    padding: 25px 30px;
    background: linear-gradient(to right, #1a1a1a, #252525);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.privacy-header h2 {
    margin: 0;
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.mini-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    content: url("../assets/logo.svg");
}

.privacy-body {
    padding: 30px;
    color: #ccc;
    line-height: 1.6;
}

.policy-points {
    background: rgba(255,255,255,0.03);
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.policy-points p {
    margin: 10px 0;
    font-size: 0.95rem;
}

.privacy-footer {
    padding: 20px 30px 30px;
    background: #151515;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
}

.toggle-label {
    color: #fff;
    font-weight: 500;
}

/* Apple Style Switch */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.apple-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

#privacy-confirm {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary-color);
    color: #000;
}

#privacy-confirm.disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

#privacy-confirm:not(.disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    background: #111;
    backdrop-filter: blur(0px);
    transition: filter 0.3s ease;
}

#start-screen .split {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s ease;
}

#start-screen .left {
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
    color: white;
    border-right: 1px solid #333;
}

#start-screen .right {
    background: #0a0a0a;
    color: #aaa;
}

#start-screen .content {
    text-align: center;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.game-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 30px;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.15);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

#start-screen h1 {
    font-size: 4rem;
    margin: 0;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#start-screen .subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

#start-btn {
    padding: 15px 50px;
    font-size: 1.5rem;
    background: var(--primary-color);
    border: none;
    border-radius: 30px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--primary-color);
}

#start-screen .right h2 {
    color: var(--p2-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.credits {
    list-style: none;
    padding: 0;
    margin: 30px 0;
    text-align: left;
    display: inline-block;
}

.credits li {
    margin: 10px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.rules-container {
    text-align: left;
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    line-height: 1.6;
}

.rules-container p {
    margin: 10px 0;
    font-size: 1rem;
    color: #ccc;
}

.rules-container strong {
    color: var(--primary-color);
}

/* Game UI */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 40px;
    width: 100%;
}

.player-score {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-color);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.player-score.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.player-score.p1.active { border-color: var(--p1-color); box-shadow: 0 0 20px rgba(255, 77, 77, 0.3); }
.player-score.p2.active { border-color: var(--p2-color); box-shadow: 0 0 20px rgba(77, 121, 255, 0.3); }

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #111);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 2px solid rgba(255,255,255,0.2);
}

.p1 .avatar { background: linear-gradient(135deg, var(--p1-color), #330000); }
.p2 .avatar { background: linear-gradient(135deg, var(--p2-color), #000033); }

.info .name { font-size: 0.9rem; color: #aaa; text-transform: uppercase; letter-spacing: 1px; }
.info .score { font-size: 2rem; font-weight: 700; line-height: 1; margin: 5px 0; }
.info .type { font-size: 0.8rem; opacity: 0.8; }

.game-status {
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
    transform: translateY(10px);
}

#controls-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 30px;
}

#controls-hint span {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 5px;
}

/* Power Bar (Dynamic) */
#power-bar-container {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    height: 300px;
    width: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    display: none; /* Hidden by default */
}

#power-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #00ff88, #ffff00, #ff0000);
    transition: height 0.1s linear;
}

/* General Polish */
body {
    background: #0a0a0a !important;
}

/* Secondary Button */
.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #888;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Media Controls */
#media-controls {
    position: absolute;
    top: 160px; /* Moved down to avoid overlap with Scoreboard */
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: #fff;
    font-size: 0.9rem;
    min-width: 150px;
}

/* Subtitle Overlay */
#subtitle-overlay {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sub-badge {
    background: rgba(0, 255, 136, 0.9);
    color: #000;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

#sub-text {
    background: rgba(0, 0, 0, 0.7);
    color: #ffff00;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}
