:root {
    --bg-color: #0d0d12;
    --card-bg: #1a1a24;
    --primary: #bb00ff; /* Neon Purple */
    --secondary: #00ffff; /* Neon Cyan */
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --success: #00ff88;
    --danger: #ff0055;
}

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

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

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    text-align: center;
    position: relative; /* Added for absolute positioning if needed */
    display: flex;       /* Added to manage footer layout if needed, though simple block is fine */
    flex-direction: column;
    min-height: 100vh;   /* Ensure container takes full height so footer can push down if we want, or just be at bottom */
    justify-content: center;
}

/* Screens Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
    /* Added relative position for the back button */
    position: relative; 
    flex: 1; /* Take up available space */
    width: 100%;
    justify-content: center; /* Center content vertically if flex */
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

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

/* Typography */
.neon-text {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(187, 0, 255, 0.5);
    margin-bottom: 2rem;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--secondary);
    letter-spacing: 0.2em;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Inputs & Buttons */
.input-group input {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #333;
    background: var(--card-bg);
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s;
    text-align: center;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(187, 0, 255, 0.2);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), #9d00d6);
    color: white;
    box-shadow: 0 4px 15px rgba(187, 0, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(187, 0, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Back Button */
.btn-back {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

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

/* Game Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 20px;
    margin-top: 30px; /* Space for back button */
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.vs {
    font-size: 1.2rem;
    font-weight: 700;
    color: #444;
}

/* Arena */
.arena {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    margin-bottom: 30px;
}

#game-status {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    width: 100%;
}

.move-btn {
    flex: 1;
    background: var(--card-bg);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
}

.move-btn:hover {
    border-color: var(--secondary);
    background: #222;
    transform: translateY(-5px);
}

.move-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* More transparent to see confetti */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    /* backdrop-filter: blur(5px); Removed blur */
}

.overlay.hidden {
    display: none;
}

.result-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #333;
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#result-message {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: white;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 100%;
}

.footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary);
    text-shadow: 0 0 5px rgba(187, 0, 255, 0.5);
}
