:root {
    --primary: #ff4757;
    --secondary: #2f3542;
    --accent: #ffa502;
    --background: #1e272e;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --error: #ff7675;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: white;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 5px rgba(255, 71, 87, 0.2)); }
    to { filter: drop-shadow(0 0 15px rgba(255, 165, 2, 0.4)); }
}

p {
    opacity: 0.8;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
}

#team-selection {
    margin-top: 10px;
}

.question {
    font-size: 0.9rem;
    margin-bottom: 10px !important;
}

.team-options {
    display: flex;
    gap: 10px;
}

.team-btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.team-btn.selected {
    border-color: var(--accent);
    background: rgba(255, 165, 2, 0.2);
    box-shadow: 0 0 15px rgba(255, 165, 2, 0.3);
}

button {
    background: linear-gradient(45deg, var(--primary), #ff6b81);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

button:active {
    transform: translateY(0);
}

#power-container {
    position: absolute;
    bottom: -100px; /* Adjusted via transform in JS if needed, or relative in game-info */
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    pointer-events: none;
}

#power-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}

#power-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff4757, #ffa502);
    transition: width 0.1s linear;
}

.controls-hint {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.6;
}

#aim-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

#game-info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 40px; /* Keep space for power bar */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

.footer {
    margin-top: 30px;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Auth Specific Styles */
h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.error-msg {
    color: var(--error);
    background: rgba(255, 118, 117, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 15px;
    border: 1px solid var(--error);
}

p a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

p a:hover {
    text-decoration: underline;
}

.logo-text {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

#auth-screen input, #register-form input {
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#auth-screen, #lobby, #main-menu, #account-screen {
    animation: fadeIn 0.5s ease-out;
}

/* Main Menu Styles */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.menu-btn.secondary {
    background: transparent;
    font-size: 1rem;
    padding: 15px;
}

.menu-btn.logout {
    margin-top: 10px;
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
    border-color: rgba(255, 71, 87, 0.2);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 50px;
    width: fit-content;
    margin: 0 auto 20px;
    border: 1px solid var(--glass-border);
}

.user-profile-mini img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Account Edit Styles */
.profile-upload-section {
    margin-bottom: 25px;
}

.profile-preview-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
}

.profile-preview-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(255, 165, 2, 0.3);
}

.upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.form-section {
    text-align: left;
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.6;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 5px 15px;
    font-size: 0.8rem;
    border-radius: 20px;
    width: auto;
}

.hint {
    font-size: 0.7rem;
    opacity: 0.5;
}

.info-msg {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.info-msg.success {
    background: rgba(46, 213, 115, 0.1);
    border-color: #2ed573;
    color: #2ed573;
}
