@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&family=Press+Start+2P&display=swap');

:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-accent: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --neon-green: #34d399;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #5dc8ff; /* Fallback Top Sky Blue */
    background-image: url('clouds.png');
    background-repeat: repeat-x;
    background-position: 0 bottom;
    background-size: auto 100%;
    color: var(--text-main);
    overflow: hidden; /* Hide scrollbars for full screen app */
    width: 100vw;
    height: 100vh;
    animation: driftClouds 60s ease-in-out infinite alternate;
}

@keyframes driftClouds {
    from { background-position: 0 bottom; }
    to { background-position: -2880px bottom; } /* Move left endlessly */
}

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

h1, h2, h3 {
    font-family: 'Press Start 2P', 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.25rem;
    color: var(--neon-green);
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
    margin-bottom: 3rem;
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-accent);
    margin-top: 2.25rem;
    border-bottom: 1.5px solid var(--glass-border);
    padding-bottom: 0.75rem;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 37.5px 75px -18px rgba(0, 0, 0, 0.5);
}

.overlay-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.8); max-width: 1200px;
    padding: 3.75rem;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Scrollbar for setup-ui */
#setup-ui::-webkit-scrollbar { width: 12px; }
#setup-ui::-webkit-scrollbar-track { background: transparent; }
#setup-ui::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 6px; }

.setup-columns {
    display: flex;
    gap: 3rem;
}

.setup-column {
    flex: 1 1 0;
}

.setup-section {
    margin-bottom: 2.25rem;
}

.row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.125rem;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 22.5px;
    margin-bottom: 1.125rem;
}
.slider-row label {
    width: 210px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.slider-val {
    display: inline-block;
    color: var(--neon-green);
    font-weight: 700;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 22.5px;
    margin-bottom: 1.125rem;
}
.input-row label {
    width: 255px;
    text-align: left;
}

label {
    font-size: 1.35rem;
    color: var(--text-muted);
}

input[type="text"], input[type="number"], textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid var(--glass-border);
    color: white;
    padding: 1.125rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.5rem;
    transition: all 0.2s;
    outline: none;
}

input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.short-input {
    width: 120px !important;
    padding: 0.75rem !important;
    text-align: center;
}

input[type="range"] {
    flex-grow: 1;
    accent-color: var(--neon-green);
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--neon-green);
    width: 1.8rem;
    height: 1.8rem;
    cursor: pointer;
}

.primary-btn {
    width: fit-content;
    min-width: 375px;
    display: block;
    margin: 3rem auto 0 auto;
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-hover));
    color: white;
    border: none;
    padding: 1.5rem;
    font-size: 1.65rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 22.5px -4.5px rgba(37, 99, 235, 0.4);
}

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

.small-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--neon-green);
    text-decoration: none;
    font-size: 1.275rem;
}
.small-link:hover { text-decoration: underline; }

/* In-Game HUD */
#hud-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-top {
    font-family: 'Press Start 2P', cursive;
    color: white;
    text-shadow: 3px 3px 0 #000;
}

.hud-top h2 { font-size: 2.25rem; color: #fbbf24; margin-bottom: 0.75rem;}
.hud-top p { font-size: 1.5rem; }

.hud-bottom {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 1.5px 1.5px 6px rgba(0,0,0,0.8);
}

/* CSS2D Object floating names */
.player-name-tag {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 21px;
    color: white;
    text-shadow: 3px 3px 0 #000, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
    pointer-events: none;
    white-space: nowrap;
}

/* Top Bar */
#hud-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 3px solid var(--primary-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
    z-index: 100;
}
.top-bar-left {
    display: flex;
    flex-direction: column;
    width: 30%;
}
#hud-streamer-controls {
    display: flex;
    gap: 15px;
}
#hud-streamer-controls button {
    font-family: 'Press Start 2P', cursive;
    font-size: 15px;
    padding: 12px 18px;
    pointer-events: auto;
    cursor: pointer;
}
#hud-timer-overlay {
    text-align: center;
    color: white;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000;
}
#hud-timer-text { font-size: 48px; margin: 0; color: var(--neon-yellow); }
#hud-timer-label { font-size: 18px; margin-top: 7.5px; font-family: 'Outfit', sans-serif; font-weight: 700; letter-spacing: 1.5px; }

.top-bar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 40%;
}

.commands-panel {
    display: flex;
    flex-direction: column;
    padding: 15px 22.5px;
    background: rgba(15, 23, 42, 0.85);
    font-size: 18px;
    border: 1.5px inset var(--primary-accent);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
    margin-right: 330px; /* Offset to not underlap the absolutely positioned big compass */
    white-space: nowrap; /* Forcibly prevent wrapping onto 3 lines */
}
.cmd-phase { margin-bottom: 6px; color: var(--text-main); text-shadow: 1.5px 1.5px 3px black; font-family: 'Outfit', sans-serif; white-space: nowrap;}
.cmd-phase strong { color: #fbbf24; }
.cmd-phase:last-child { margin-bottom: 0; }
.cmd-text { color: var(--neon-green); font-family: 'Press Start 2P', cursive; font-size: 13.5px; margin: 0 6px; }

#hud-compass {
    position: absolute;
    top: 15px;
    right: 1.5rem;
    width: 330px;
    height: 330px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    font-size: 20px;
    font-weight: 800;
    font-family: 'Press Start 2P', cursive; /* Use retro pixel font */
    color: white;
    background: rgba(15, 23, 42, 0.98); 
    backdrop-filter: blur(6px);
    border: 4.5px solid rgba(52, 211, 153, 0.4);
    box-shadow: inset 0 0 30px rgba(52, 211, 153, 0.2), 0 30px 60px rgba(0,0,0,0.6);
    z-index: 200;
}
.compass-ring {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        repeating-conic-gradient(
            from -0.5deg,
            rgba(52, 211, 153, 0.4) 0deg 1deg,
            transparent 1deg 45deg
        ),
        repeating-conic-gradient(
            from -0.5deg,
            rgba(52, 211, 153, 0.08) 0deg 1deg,
            transparent 1deg 15deg
        );
}

.compass-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    line-height: 1.5;
    color: var(--primary-accent);
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    white-space: nowrap;
    background: rgba(15, 23, 42, 1);
    padding: 9px 15px;
    border-radius: 6px;
    z-index: 10;
}
.compass-ring span { position: absolute; transform: translate(-50%, -50%); text-shadow: 1.5px 1.5px 4.5px black; }
.deg-0 { top: 12%; left: 50%; }
.deg-45 { top: 22%; left: 78%; }
.deg-90 { top: 50%; left: 88%; }
.deg-135 { top: 78%; left: 78%; }
.deg-180 { top: 88%; left: 50%; }
.deg-225 { top: 78%; left: 22%; }
.deg-270 { top: 50%; left: 12%; }
.deg-315 { top: 22%; left: 22%; }

/* Live Notifications */
#hud-notifications {
    position: absolute;
    top: 525px;
    left: 3rem;
    width: 450px;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
}
#notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.notif-item {
    background: rgba(15, 23, 42, 0.6);
    border-left: 6px solid var(--neon-green);
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 21px;
    text-shadow: 1.5px 1.5px 3px black;
    animation: fadein 0.3s ease-out, fadeout 0.5s ease-in 4.5s forwards;
}

@keyframes fadein { from { opacity: 0; transform: translateX(-15px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }

/* Hanging Scorecard */
#hud-scorecard {
    position: absolute;
    top: 180px;
    left: 3rem;
    width: 300px;
    background: rgba(15, 23, 42, 0.4);
    border: 3px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
}
#hud-scorecard h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    border-bottom: 1.5px solid var(--glass-border);
    padding-bottom: 7.5px;
    text-align: center;
}
#scorecard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 21px;
}
#scorecard-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    text-shadow: 1.5px 1.5px 3px black;
}
.scorecard-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 195px;
}

.final-scorecard-container {
    max-height: 600px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px inset var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    margin-top: 22.5px;
}
#final-scorecard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 27px;
}
#final-scorecard-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    text-shadow: 1.5px 1.5px 3px black;
    border-bottom: 1.5px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
}



