:root {
    --brand-red: #ea580c;     /* Brand Orange */
    --brand-navy: rgb(14, 23, 43); /* Brand Navy */
    --brand-white: #f5e0e0;   /* Brand Off-white */
    --brand-gold: #ffd700;    /* Victory Gold */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --brand-gold: #ffd700;    /* Victory Gold */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --font-main: 'Inter', 'Share Tech Mono', monospace, sans-serif; 
    --font-cyber: 'Hackd', sans-serif;
    
    --title-size-prep: 6vw;
    --title-size-go: 5vw; /* Reduced from 10vw for timer focus */
}

/* ROCKET STYLES */
.rocket {
    position: fixed;
    left: 50%;
    bottom: -400px;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
}

.rocket-img {
    height: 300px;
    filter: drop-shadow(0 0 30px rgba(234, 88, 12, 0.4));
    mix-blend-mode: screen; /* Makes black background transparent */
    transform: rotate(-45deg); /* Fix diagonal orientation from AI gen */
}

.animate-fly-up {
    animation: flyUp 2.8s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

@keyframes flyUp {
    0% { bottom: -400px; transform: translateX(-50%) scale(1); }
    15% { bottom: 10%; transform: translateX(-50%) scale(1.1); }
    100% { bottom: 120%; transform: translateX(-50%) scale(0.6); }
}

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

body, html {
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, var(--brand-navy) 0%, #000000 100%);
    color: var(--brand-white);
    font-family: var(--font-main);
    overflow: hidden;
    user-select: none;
}

/* IMPORT MONO FONT */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* LOCAL FONT: HACKD */
@font-face {
    font-family: 'Hackd';
    src: url('fonts/Hackd.woff2') format('woff2'),
         url('fonts/Hackd.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* UTILS */
.hidden { display: none !important; opacity: 0; }

/* STAGE LAYOUT */
#stage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 5vh 3vw;
    position: relative;
    z-index: 10;
}

/* HEADER */
.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo { height: 90px; width: auto; opacity: 0.9; }

.live-badge {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--brand-red);
    color: white;
    padding: 0.6rem 1.2rem;
    font-weight: 800;
    border-radius: 4px;
    font-size: 1.1rem;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(234, 88, 12, 0.4);
    animation: pulseRed 2s infinite;
}

.live-badge.ended {
    background: #444;
    color: #aaa;
    animation: none;
    box-shadow: none;
}

/* IMPACT LAYER (The "NOW." Flash) */
.impact-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: black;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}
#impact-word {
    font-size: 25vw;
    font-weight: 900;
    font-family: var(--font-cyber);
    color: var(--brand-red);
    text-transform: uppercase;
}

.center-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    text-align: center;
    padding: 2vh 0 12vh 0; /* Extra bottom padding to clear fixed footer */
}

.layout-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#title-box { flex: 0 0 20%; }
#timer-box { flex: 0 0 40%; }
#info-box  { flex: 0 0 20%; }

/* TITLES */
#main-title {
    font-weight: 800;
    font-family: var(--font-cyber);
    text-shadow: 0 0 30px rgba(0,0,0,0.5);
    line-height: 1;
    will-change: transform, opacity;
}

/* State: PREP */
.title-prep {
    font-size: var(--title-size-prep);
    color: var(--brand-white);
    letter-spacing: 0.05em;
}
.subtitle-prep {
    font-size: 2vw;
    font-weight: 300;
    color: #889;
    letter-spacing: 0.3em;
    margin-top: 2vh;
}

/* State: GO Animation Classes */
.animate-impact {
    animation: scaleOvershoot 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    color: var(--brand-white);
    font-size: var(--title-size-go);
    text-shadow: 0 0 50px var(--brand-red), 0 0 20px rgba(234, 88, 12, 0.5);
}

.subtitle-go {
    font-size: 3vw;
    color: var(--brand-red);
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-top: 2vh; /* More space */
    animation: fadeInUp 1s ease 0.5s both;
}

/* SETTLE INFO */
#settle-info {
    margin-top: 5vh;
    padding-bottom: 5vh; /* Push away from footer */
    animation: fadeIn 0.5s ease forwards;
}

.info-chips {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3vh;
}

.chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    font-family: var(--font-cyber);
}

.motto-container {
    height: 3rem; 
    font-size: 2rem;
    font-style: italic;
    color: #bbb;
    font-family: var(--font-cyber);
}

/* FOOTER */
.footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 1;
    font-size: 0.85rem;
    padding: 1.5vh 3vw;
    letter-spacing: 0.1em;
    border-top: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    font-family: var(--font-cyber);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

.github-branding {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0.9;
}

.github-logo-footer {
    width: 18px;
    height: 18px;
    filter: invert(1);
}

.github-text {
    color: #fff;
}

.github-text a {
    color: #fff !important;
    text-decoration: none;
    font-weight: 800;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.github-text a:hover {
    border-bottom: 2px solid #fff;
    opacity: 1;
}

.authority-text {
    opacity: 0.8;
}

/* ANIMATIONS */
@keyframes scaleOvershoot {
    0% { transform: scale(0.5); opacity: 0; filter: blur(20px); }
    60% { transform: scale(1.1); opacity: 1; filter: blur(0px); }
    100% { transform: scale(1); }
}

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

@keyframes fadeInDown {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, 20px); }
}

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

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(234, 88, 12, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

/* GRAND FINALE ANIMATIONS */
.stop-coding {
    color: #ff0000 !important;
    animation: blinkRed 0.5s infinite alternate;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8) !important;
}

@keyframes blinkRed {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(1.1); }
}

.glitch-text {
    animation: glitch 0.2s infinite;
    position: relative;
    color: #ff0000 !important;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

.flash-red {
    background: rgba(255, 0, 0, 0.5) !important;
    animation: quickFlash 0.5s ease;
}

@keyframes quickFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ADMIN OVERLAY */
#admin-overlay {
    position: fixed; top: 10px; right: 10px;
    background: rgba(0,0,0,0.85); padding: 15px;
    border-radius: 8px; z-index: 9999;
    font-family: monospace; border-left: 3px solid var(--brand-red);
    cursor: auto;
}
.admin-panel li { list-style: none; margin-bottom: 5px; }
kbd { background: #333; padding: 2px 5px; border-radius: 3px; }

/* CONFETTI CANVAS */
#confetti-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 5;
}

/* FS FALLBACK */
#fs-fallback {
    position: fixed; bottom: 20px; right: 20px; 
    z-index: 200;
}
.btn-fs {
    padding: 10px 20px; font-size: 14px;
    background: rgba(200, 16, 46, 0.8); color: white; border: none;
    cursor: pointer; border-radius: 4px;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}
.btn-fs:hover { background: var(--brand-red); }

/* FINAL MESSAGE CUSTOMIZATION */
.end-message-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5vh;
    animation: fadeIn 1s ease 1s both;
}

.end-rule-line {
    font-size: 1.8rem;
    color: var(--brand-red);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.end-gratitude {
    font-size: 1.4rem;
    color: #fff;
    line-height: 1.6;
    max-width: 600px;
    opacity: 0.9;
    font-style: italic;
}

.end-instruction {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.05em;
    padding-top: 1vh;
}

.evaluation-status {
    color: #22c55e !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
    padding: 0.8rem 1.5rem; /* Slightly more compact padding */
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.05);
    margin-top: 1vh; /* Reduced top margin */
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); opacity: 1; }
    70% { box-shadow: 0 0 0 15px rgba(34, 197, 94, 0); opacity: 0.8; }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, .animate-impact, .subtitle-go, .rocket {
        animation: none !important;
        transition: none !important;
        filter: none !important;
    }
}

/* === NEW COUNTDOWN STYLES === */
.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 5vh;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(234, 88, 12, 0.1);
    min-width: 140px;
    text-align: center;
}

.time-card span {
    font-size: 5rem;
    font-weight: 700;
    font-family: var(--font-cyber);
    color: var(--brand-red);
    text-shadow: 0 0 20px rgba(234, 88, 12, 0.3);
    line-height: 1;
}

.time-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2em;
}

.time-separator {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    padding-bottom: 2rem; /* Align visually with digits */
}

/* === BUTTON REDESIGN === */
.btn-primary {
    display: table;
    margin: 3rem auto;
    padding: 1rem 4rem;
    font-size: 1.5rem;
    background: transparent;
    color: var(--brand-red);
    border: 2px solid var(--brand-red);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.2);
    z-index: 100;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--brand-red);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-primary:hover {
    color: var(--brand-navy);
    box-shadow: 0 0 40px rgba(234, 88, 12, 0.6);
}

.btn-primary:hover::before {
    left: 0;
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .time-card { min-width: 80px; padding: 1rem; }
    .time-card span { font-size: 3rem; }
    .time-separator { font-size: 2rem; }
    .countdown-container { gap: 0.5rem; }
}

/* Primary Start Button */
.btn-primary {
    display: table;
    margin: 2rem auto;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand-red);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.4);
    transition: all 0.3s ease;
    font-family: var(--font-main);
    z-index: 100;
    position: relative;
}

.btn-primary:hover {
    background: #fff;
    color: var(--brand-red);
    box-shadow: 0 0 40px rgba(234, 88, 12, 0.8);
    transform: translateY(-2px);
}

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

/* === LIVE TIMER STYLES === */
#live-timer-container {
    margin: 0;
    padding: 2vh 0;
    text-align: center;
    width: 100%;
    animation: fadeIn 1s ease 0.5s backwards;
}

#live-timer-container.hidden {
    display: none !important;
}

.timer-label {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.8em;
    color: #22c55e; /* Cyber Green */
    opacity: 1;
    margin-bottom: 4vh; /* Increased spacing */
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.live-timer-digits {
    font-family: var(--font-cyber);
    font-size: 15vw; 
    font-weight: 900;
    line-height: 1;
    color: var(--brand-red);
    text-shadow: 0 0 30px rgba(234, 88, 12, 0.4), 0 0 60px rgba(234, 88, 12, 0.1);
    letter-spacing: -0.02em;
    transition: all 0.5s ease;
}

/* Ensure Title Container and Settle Info transition smoothly */
#title-container, #settle-info {
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ensure Button Container centers properly */
#btn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1rem;
}
