/* Neon Wavelength - Modern Cyberpunk UI */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Roboto:wght@300;400;700&display=swap');

:root {
    --neon-blue: #00f3ff;
    --neon-green: #00ff8d;
    --neon-orange: #ff9e00;
    --neon-pink: #ff00e4;
    --neon-purple: #8c00ff;
    --dark-bg: #0a0a10;
    --darker-bg: #050508;
    --panel-bg: rgba(15, 15, 25, 0.9);
    --left-team-color: var(--neon-orange);
    --right-team-color: var(--neon-green);
    --glow-intensity: 4px;
    --text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.07) 0%, transparent 80%),
        radial-gradient(circle at 80% 20%, rgba(140, 0, 255, 0.07) 0%, transparent 70%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Grid effect for background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(30, 30, 40, 0.1) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(30, 30, 40, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

h1, h2, h3, .room-info, .score {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

h1 {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--neon-blue);
    text-shadow: 0 0 var(--glow-intensity) var(--neon-blue), 0 0 2px #fff;
    position: relative;
    font-weight: 700;
    /* Animation only on home page */
}

.home-page h1 {
    animation: neonPulse 3s infinite alternate;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--neon-purple);
    text-shadow: 0 0 3px var(--neon-purple), 0 0 1px #fff;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: var(--text-shadow);
    font-weight: 600;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 1rem 1.8rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    color: var(--darker-bg);
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

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

.primary-btn {
    background-color: var(--neon-blue);
    color: var(--darker-bg);
    box-shadow: 0 0 8px var(--neon-blue);
}

.primary-btn:hover {
    box-shadow: 0 0 15px var(--neon-blue);
}

.team-btn {
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
    margin-top: 1rem;
}

.left-team-btn {
    background-color: var(--left-team-color);
    color: #000;
    box-shadow: 0 0 8px var(--left-team-color);
    font-weight: 700;
}

.left-team-btn:hover {
    box-shadow: 0 0 15px var(--left-team-color);
}

.right-team-btn {
    background-color: var(--right-team-color);
    color: #000;
    box-shadow: 0 0 8px var(--right-team-color);
    font-weight: 700;
}

.right-team-btn:hover {
    box-shadow: 0 0 15px var(--right-team-color);
}

.danger-btn {
    background-color: var(--neon-pink);
    color: white;
    box-shadow: 0 0 8px var(--neon-pink);
    font-weight: 700;
}

.danger-btn:hover {
    box-shadow: 0 0 15px var(--neon-pink);
}

/* Leave Game Button */
.leave-game-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: bold;
    color: var(--neon-blue);
    font-size: 1.1rem;
    text-shadow: 0 0 2px var(--neon-blue);
}

.input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--neon-blue);
    border-radius: 5px;
    color: white;
    box-shadow: 0 0 5px var(--neon-blue);
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    box-shadow: 0 0 15px var(--neon-blue);
    background-color: rgba(0, 0, 0, 0.8);
}

.error-message {
    color: var(--neon-pink);
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-pink);
    font-size: 1.1rem;
}

/* NEW: Style for the row containing join button and error */
.join-action-row {
    display: flex;
    align-items: center; /* Vertically align button and text */
    gap: 1rem; /* Space between button and error */
    margin-top: 1.5rem; /* Space above this row */
}

.join-action-row .error-message {
    margin-top: 0; /* Remove default top margin */
    text-align: left; /* Align error text to the left */
}

/* Game Layout Styles */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.room-info {
    background-color: var(--panel-bg);
    color: var(--neon-purple);
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 12px rgba(140, 0, 255, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.room-info h2 {
    margin: 0;
    font-size: 1.6rem;
    text-shadow: 0 0 5px var(--neon-purple), 0 0 2px white;
}

.game-section {
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
    margin-bottom: 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.game-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
}

/* Players & Teams */
.players-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.player-list ul,
.team-list {
    list-style: none;
    margin-top: 0.8rem;
}

.player-list li,
.team-list li {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    text-shadow: var(--text-shadow);
    background-color: rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
    border-radius: 4px;
}

.player-list li:hover,
.team-list li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.teams-container {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.team {
    flex: 1;
    border-radius: 10px;
    padding: 1.8rem;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.team:first-child {
    background-color: rgba(255, 158, 0, 0.15);
    border-left: 4px solid var(--left-team-color);
    box-shadow: inset 0 0 30px rgba(255, 158, 0, 0.1);
}

.team:last-child {
    background-color: rgba(0, 255, 141, 0.15);
    border-left: 4px solid var(--right-team-color);
    box-shadow: inset 0 0 30px rgba(0, 255, 141, 0.1);
}

.left-team-header {
    color: var(--left-team-color);
    text-shadow: 0 0 5px var(--left-team-color), 0 0 2px #fff;
    font-size: 1.6rem;
}

.right-team-header {
    color: var(--right-team-color);
    text-shadow: 0 0 5px var(--right-team-color), 0 0 2px #fff;
    font-size: 1.6rem;
}

.host-controls {
    text-align: center;
    margin-top: 2.5rem;
}

/* Game Screen Styles */
.scores-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.team-score {
    text-align: center;
    padding: 1.8rem;
    border-radius: 12px;
    width: 48%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
}

.left-team {
    background-color: rgba(255, 158, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 158, 0, 0.3);
}

.right-team {
    background-color: rgba(0, 255, 141, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 141, 0.3);
}

.score {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 0.8rem 0;
    position: relative;
    display: inline-block;
}

.left-team .score {
    color: var(--left-team-color);
    text-shadow: 0 0 10px var(--left-team-color), 0 0 3px white;
}

.right-team .score {
    color: var(--right-team-color);
    text-shadow: 0 0 10px var(--right-team-color), 0 0 3px white;
}

.current-team {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.2rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.current-team h3 {
    margin-bottom: 0;
    font-size: 1.7rem;
}

#current-team {
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-left: 0.5rem;
    display: inline-block;
    color: white;
    text-shadow: 0 0 5px currentColor;
}

/* Spectrum Bar Styling */
.spectrum-container {
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.spectrum-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.left-label,
.right-label {
    font-weight: bold;
    padding: 1rem;
    border-radius: 8px;
    min-width: 130px;
    text-align: center;
    font-size: 1.3rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.left-label {
    background-color: rgba(255, 158, 0, 0.3);
    color: white;
    text-shadow: 0 0 5px var(--left-team-color), 0 0 2px white;
    border-left: 4px solid var(--left-team-color);
}

.right-label {
    background-color: rgba(0, 255, 141, 0.3);
    color: white;
    text-shadow: 0 0 5px var(--right-team-color), 0 0 2px white;
    border-right: 4px solid var(--right-team-color);
}

.spectrum-bar {
    position: relative;
    height: 3rem;
    background: linear-gradient(to right, var(--left-team-color), #f5f5f5, var(--right-team-color));
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.target-indicator,
.guess-indicator {
    position: absolute;
    top: -20px;
    width: 8px;
    height: calc(100% + 40px);
    transform: translateX(-50%);
    z-index: 2;
    border-radius: 4px;
}

.target-indicator {
    background-color: var(--left-team-color);
    box-shadow: 0 0 10px var(--left-team-color);
    border: 1px solid white;
}

.guess-indicator {
    background-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    border: 1px solid white;
}

.spectrum-marks {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 0.5rem;
    font-weight: 600;
    text-shadow: var(--text-shadow);
}

/* Game Controls */
.game-controls > div {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.game-controls p {
    margin: 1rem 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: var(--text-shadow);
    font-weight: 500;
}

.slider {
    width: 100%;
    margin: 2rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    background: rgba(0, 0, 0, 0.7);
    outline: none;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: var(--neon-blue);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 12px var(--neon-blue);
    border: 1px solid white;
}

.slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: var(--neon-blue);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 12px var(--neon-blue);
    border: 1px solid white;
}

/* Waiting Info Styling */
.waiting-info {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.8rem 1.2rem;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    border: 2px solid var(--neon-purple);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: var(--text-shadow);
}

/* Current Clue Styling */
.current-clue-container {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 2px solid var(--neon-purple);
}

.current-clue-label {
    font-size: 1.3rem;
    color: var(--neon-purple);
    text-shadow: 0 0 3px var(--neon-purple), 0 0 1px white;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.current-clue {
    font-size: 2rem;
    color: white;
    text-shadow: var(--text-shadow);
    font-weight: 600;
}

/* Animations - Only for home page or special events */
@keyframes neonPulse {
    0% {
        text-shadow: 0 0 5px var(--neon-blue), 0 0 10px var(--neon-blue), 0 0 1px white;
    }
    100% {
        text-shadow: 0 0 15px var(--neon-blue), 0 0 25px var(--neon-blue), 0 0 35px var(--neon-blue), 0 0 3px white;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .players-container {
        flex-direction: row;
    }
    
    .player-list {
        width: 35%;
    }
    
    .teams-container {
        width: 65%;
    }
}

/* Home page specific styles */
#create-room-title, #join-room-title {
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple), 0 0 2px white;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    margin: 2rem 0;
    position: relative;
}

.how-to-play {
    color: var(--neon-purple);
    text-align: center;
    text-shadow: 0 0 10px var(--neon-purple), 0 0 2px white;
    margin: 2rem 0 1rem;
    font-size: 2.5rem;
    font-family: 'Orbitron', sans-serif;
}

.game-description {
    color: white;
    text-shadow: var(--text-shadow);
    font-size: 1.3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.8;
} 