@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;800&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
    --bg-void: #03060e;
    --text-main: #edf3ff;
    --text-soft: #a7b6d6;
    --cyan: #52ecff;
    --cyan-soft: rgba(82, 236, 255, 0.45);
    --cyan-border: rgba(80, 224, 255, 0.42);
    --panel-bg: rgba(5, 10, 22, 0.86);
    --danger: #ff6e8f;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    background: radial-gradient(circle at 28% 14%, #0f2347 0%, var(--bg-void) 46%, #010204 100%);
}

canvas {
    display: block;
}

/* Splash screen ---------------------------------------------------------- */
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(13, 71, 148, 0.28), transparent 36%),
        radial-gradient(circle at 80% 72%, rgba(0, 117, 161, 0.2), transparent 42%),
        rgba(2, 6, 16, 0.78);
    backdrop-filter: blur(9px);
}

#splash-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-card {
    width: min(760px, 95vw);
    padding: clamp(1.8rem, 4vw, 3rem);
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 24px 70px rgba(0, 0, 0, 0.5);
}

.splash-kicker {
    margin: 0 0 0.9rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: clamp(0.74rem, 1.4vw, 0.94rem);
}

.splash-card h1 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0.08em;
    font-size: clamp(2rem, 6.2vw, 4.2rem);
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 26px rgba(82, 236, 255, 0.42);
}

.splash-copy {
    max-width: 560px;
    margin: 1.2rem auto 2rem;
    line-height: 1.45;
    font-size: clamp(1rem, 2.2vw, 1.24rem);
    color: #d7e3ff;
}

#start-btn {
    border: 1px solid var(--cyan);
    border-radius: 12px;
    padding: 0.92rem 1.9rem;
    background: linear-gradient(140deg, rgba(0, 184, 255, 0.35), rgba(8, 17, 40, 0.32));
    color: var(--text-main);
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 24px rgba(0, 184, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#start-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(140deg, rgba(0, 184, 255, 0.56), rgba(8, 17, 40, 0.3));
    box-shadow: 0 0 32px rgba(0, 184, 255, 0.48);
}

#start-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

/* Fact panel ------------------------------------------------------------- */
#fact-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 18;
    width: min(470px, 100vw);
    height: 100vh;
    padding: 1.3rem 1.1rem 1.5rem;
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 175, 255, 0.16), transparent 30%),
        radial-gradient(circle at 80% 22%, rgba(0, 255, 221, 0.08), transparent 45%),
        var(--panel-bg);
    border-left: 1px solid var(--cyan-border);
    box-shadow:
        -16px 0 44px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(80, 224, 255, 0.18);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    transform: translateX(104%);
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: #28dfff rgba(14, 24, 44, 0.95);
}

#fact-panel.is-visible {
    transform: translateX(0);
}

#fact-panel::-webkit-scrollbar {
    width: 8px;
}

#fact-panel::-webkit-scrollbar-track {
    background: rgba(14, 24, 44, 0.95);
}

#fact-panel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #4ce8ff, #00a7ff);
}

.panel-glow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 216, 255, 0.22), transparent 68%);
    filter: blur(8px);
    pointer-events: none;
}

.panel-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

#fact-subtitle {
    margin: 0;
    color: var(--text-soft);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

#fact-name {
    margin: 0.3rem 0 0;
    font-size: clamp(1.7rem, 6vw, 2.4rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 20px var(--cyan-soft);
}

#close-panel-btn {
    border: 1px solid var(--danger);
    border-radius: 10px;
    background: rgba(255, 110, 143, 0.12);
    color: #ffd7e2;
    cursor: pointer;
    letter-spacing: 0.05em;
    padding: 0.45rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    transition: transform 0.2s ease, background 0.2s ease;
}

#close-panel-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 110, 143, 0.22);
}

.stats-grid {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(58, 202, 255, 0.26);
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid rgba(58, 202, 255, 0.16);
    background: rgba(9, 17, 36, 0.76);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: #b3c6ea;
    text-transform: uppercase;
    font-size: 0.81rem;
    letter-spacing: 0.05em;
}

.stat-row strong {
    color: #f2f8ff;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-align: right;
}

#fact-text {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(58, 202, 255, 0.24);
    padding: 1rem;
    background: rgba(7, 13, 29, 0.78);
}

#fact-text p {
    margin: 0 0 0.95rem;
    line-height: 1.52;
    font-size: 1rem;
    color: #dce8ff;
}

#fact-text p:last-child {
    margin-bottom: 0;
}

/* HUD hint ---------------------------------------------------------------- */
#interaction-hint {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 8;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    border-radius: 10px;
    border: 1px solid rgba(141, 213, 255, 0.32);
    background: rgba(8, 16, 34, 0.7);
    color: #d8e7ff;
    padding: 0.62rem 0.9rem;
    font-size: 0.94rem;
    letter-spacing: 0.03em;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

#interaction-hint.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 760px) {
    #fact-panel {
        padding: 1rem 0.85rem 1.2rem;
    }

    .stat-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .stat-row strong {
        text-align: left;
    }

    #interaction-hint {
        left: 0.7rem;
        right: 0.7rem;
        bottom: 0.7rem;
        text-align: center;
    }
}
