/* Základ stránky, popisky těles a chybová hláška. Rozhraní (lišty, panely, okna) je ve styles/ui.css. */

:root {
    --main-font: 'Montserrat', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    --header-font: 'Raleway', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    --mono-font: 'Roboto Mono', monospace;

    --bg: #070b18;
    --glass: rgba(10, 15, 32, 0.72);
    --glass-strong: rgba(10, 15, 32, 0.9);
    --line: rgba(150, 180, 255, 0.16);
    --line-strong: rgba(150, 180, 255, 0.32);
    --text: #eef2ff;
    --text-dim: #aab6d4;
    --accent: #7cc7ff;
    --accent-ink: #04121f;
    --sun: #ffd35c;
    --good: #5ee0a0;
    --bad: #ff8794;
    --label-bg: rgba(6, 10, 24, 0.62);
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    overflow: hidden;
    background: var(--bg);
}

body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    font-family: var(--main-font);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--text);
    background-color: var(--bg);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
    font-family: var(--header-font);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

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

#status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    text-align: center;
    z-index: 1000;
    background-color: var(--glass-strong);
    border: 1px solid var(--line);
    padding: 18px 24px;
    border-radius: 16px;
}

.noscript {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    background: var(--bg);
}

/* ---- Popisky těles (rozmístění počítá src/scene/Labels.js) ---- */

.distance-label, .planet-label {
    position: absolute;
    pointer-events: none;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 10;
}

.distance-label {
    font-size: 11px;
    color: #bcd8ff;
    background-color: rgba(6, 10, 24, 0.7);
    padding: 2px 6px;
    transform: translate(-50%, -50%);
}

.planet-label {
    left: 0;
    top: 0;
    will-change: transform, opacity;
    transition: none;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 600;
    padding: 3px 8px;
    background-color: var(--label-bg);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    font-family: var(--header-font);
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.planet-label--sun {
    font-size: 15px;
    border: 1px solid rgba(255, 211, 92, 0.5);
    box-shadow: 0 0 8px rgba(255, 211, 92, 0.45);
}

.planet-label--dwarf {
    font-size: 13px;
}

.planet-label--moon {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 5px;
    border-color: rgba(170, 170, 255, 0.25);
}

.planet-label.is-focus {
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 10px rgba(124, 199, 255, 0.55);
}

@media (max-width: 820px) {
    .planet-label { font-size: 12px; padding: 2px 6px; }
    .planet-label--moon { font-size: 10px; padding: 1px 4px; }
    .planet-label--dwarf { font-size: 11px; }
    .planet-label--sun { font-size: 13px; }
    .distance-label { font-size: 10px; padding: 1px 4px; }
}

/* ---- Chybová hláška ---- */

#fatal-error {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#fatal-error .fatal-box {
    background-color: #12172c;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    padding: 28px;
    max-width: min(520px, 90vw);
    text-align: center;
}

#fatal-error h2 {
    color: var(--sun);
    margin-bottom: 12px;
    font-size: 22px;
}

#fatal-error p {
    margin-bottom: 16px;
}

#fatal-error code:empty { display: none; }

#fatal-error code {
    display: block;
    font-family: var(--mono-font);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0 16px;
    word-break: break-word;
    text-align: left;
    max-height: 160px;
    overflow: auto;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150, 180, 255, 0.28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(150, 180, 255, 0.45); }
* { scrollbar-width: thin; scrollbar-color: rgba(150, 180, 255, 0.35) transparent; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
