/**
 * CSS Variables - Design Tokens
 */
:root {
    /* Colors */
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-text-muted: #cccccc;
    --color-panel-bg: rgba(0, 0, 0, 0.75);
    --color-panel-bg-solid: rgba(0, 0, 0, 0.9);
    --color-accent: #2c47dc;
    --color-accent-glow: #eeeeff;
    --color-border: rgba(255, 255, 255, 0.5);
    --color-border-light: rgba(255, 255, 255, 0.75);
    --color-selection: #2c47dc;

    /* Fonts */
    --font-body: "Lora", Georgia, serif;
    --font-mono: "Lekton", monospace;
    --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --text-shadow-glow: 0 0 3px #fff, 0 0 10px #000;
    --text-shadow-accent: 0 0 3px var(--color-accent), 0 0 10px var(--color-accent-glow);
    --text-shadow-hover: 0 0 3px #fff, 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #fff;

    /* Z-index layers */
    --z-canvas: 10;
    --z-ui: 9999;
    --z-modal: 10000;
}

/**
 * Reset and Base Styles
 */
* {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    font-size: 14px;
    line-height: 20px;
    margin: 0;
    overflow: hidden;
    font-family: var(--font-body);
    position: fixed;
}

/**
 * Selection
 */
::selection,
::-moz-selection {
    background: var(--color-selection);
}

/**
 * Links
 */
a {
    transition: border var(--transition-normal);
}
a:link,
a:active,
a:visited {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}
a:hover {
    border-bottom: 1px solid transparent;
    text-decoration: none;
}

/**
 * Utility Classes
 */
.unselectable {
    user-select: none;
}

/**
 * Loader
 */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
}
#loader div {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -80px;
    margin-left: -250px;
    text-align: center;
}
#loader p {
    color: var(--color-text);
    width: 500px;
    font-size: 21px;
    line-height: 40px;
    font-style: italic;
    font-weight: normal;
    padding-bottom: 20px;
    text-shadow: var(--text-shadow-glow);
}

/**
 * Markers
 */
.marker {
    font-family: var(--font-mono);
    user-select: none;
    position: absolute;
    padding: 0px 0px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: opacity var(--transition-slow);
}
.marker span.name {
    color: var(--color-text);
    text-shadow: var(--text-shadow-glow);
    transition: text-shadow var(--transition-normal);
}
.marker span.name:hover {
    text-shadow: var(--text-shadow-hover);
}
.marker.label span.name {
    cursor: default !important;
    font-size-adjust: none;
}
.marker.label span.name:hover {
    text-shadow: var(--text-shadow-glow) !important;
}

.legacymarker {
    font-family: var(--font-mono);
    user-select: none;
    position: absolute;
    padding: 6px 8px;
    min-width: 140px;
    transition: opacity var(--transition-slow);
    display: inline;
}
.legacymarker span.name {
    display: inline-block;
    width: 100%;
    color: var(--color-text);
    text-shadow: 0.1em 0.1em 4px #000;
    transition: text-shadow var(--transition-normal);
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/**
 * Keyframe Animations
 */
@keyframes aura {
    from {
        box-shadow: inset 0 0 1px white;
    }
    to {
        box-shadow: inset 0 0 50px white;
    }
}

/**
 * Icon Navigation
 */
#icon-nav {
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px 20px 16px 20px;
}
#icon-nav > * {
    opacity: 0.8;
    vertical-align: top;
    cursor: pointer;
    display: inline-block;
}

#icon-nav > *:hover {
    opacity: 1;
}
#icon-nav > *:not(:first-child) {
    margin-left: 10px;
}

/**
 * Spectral Graph / Heat Map
 */
#spectral-graph {
    position: absolute;
    left: 0;
    top: 67px;
    color: var(--color-text);
    font-family: var(--font-mono);
    display: none;
    user-select: none;
    padding: 24px 20px 20px 20px;
    transition: opacity var(--transition-normal);
    opacity: 0.8;
}
#spectral-graph:hover,
#spectral-graph.heatvision {
    opacity: 1;
}
#spectral-graph p {
    position: absolute;
    width: 300px;
    top: 42px;
    left: 20px;
    font-size: 12px;
}
#spectral-graph p.left {
    text-align: left;
}
#spectral-graph p.center {
    text-align: center;
}
#spectral-graph p.right {
    text-align: right;
}
#spectral-graph h5 {
    margin-top: 30px;
}
#spectral-graph #heat-map {
    width: 300px;
    height: 20px;
    background: linear-gradient(
        to right,
        #c8420a 0%,
        #f8e141 25%,
        white 50%,
        #444fe3 98%,
        #be78ef 100%
    );
}

/**
 * Theater Mode
 */
#theater .top-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 67px;
    background: var(--color-bg);
    margin-top: -67px;
}
#theater .bottom-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 67px;
    background: var(--color-bg);
    margin-bottom: -67px;
}
#theater .message {
    position: absolute;
    top: 75%;
    left: 0;
    right: 0;
    text-align: center;
}
#theater .message p {
    padding: 0 100px;
    height: 40px;
    font-size: 28px;
    line-height: 40px;
    margin-top: -30px;
    color: var(--color-text);
    font-style: italic;
    text-shadow: var(--text-shadow-accent);
}
#theater .message p span {
    padding: 10px 20px;
    background: var(--color-panel-bg-solid);
}

/**
 * Controls Help
 */
#controlshelp {
    background-color: rgba(0, 0, 0, 0.65);
    padding: 15px;
    color: var(--color-text);
    font-size: 32px;
    user-select: none;
}

/**
 * Layout
 */
#layout {
    transform: scale(1.25);
    transition: all var(--transition-normal);
}

/**
 * Star Name & Detail Title
 */
#star-name,
#detailTitle {
    color: var(--color-text);
    font-size: 42px;
    line-height: 60px;
    margin: 0 0 20px 0;
    border-bottom: 1px solid var(--color-border-light);
    position: relative;
    display: block;
    font-style: italic;
    text-shadow: var(--text-shadow-accent);
    user-select: none;
}

#star-name {
    position: fixed;
    left: 0;
    bottom: 0;
    margin: 0 20px 25px 20px;
    width: auto;
    padding-right: 40px;
    display: none;
    user-select: none;
}
#star-name span {
    cursor: pointer;
}

#detailTitle {
    padding-right: 160px;
}

#detailTitle span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/**
 * Detail Panel
 */
#detailBody {
    color: white;
    z-index: var(--z-ui);
    display: block;
    text-shadow: 0 0 7px rgba(255, 255, 255, 0.7);
}
#detailBody p:first-child {
    text-indent: 0;
}
#detailBody p + p {
    margin-top: 20px;
}

#detailContainer {
    display: none;
    background-color: var(--color-panel-bg);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 0 20px 60px 20px;
    overflow: auto;
    width: 560px;
    z-index: var(--z-ui) !important;
}
#detailContainer ul {
    margin-left: 20px;
}
#detailContainer ul li {
    margin-bottom: 10px;
}

#detailFooter {
    margin-top: 20px;
    color: var(--color-text-muted);
    font-size: 12px;
}

#detailClose {
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
    color: var(--color-text);
    padding: 10px;
    font-size: 28px;
}
#detailClose > * {
    text-shadow: 0 0 transparent;
    display: inline-block;
    margin-left: 10px;
    opacity: 0.8;
}
#detailClose > *:hover {
    opacity: 1;
}

#instance-portal {
    cursor: pointer;
    font-size: 24px;
}

#zoom-back {
    cursor: pointer;
    font-size: 20px;
}

/**
 * Meta Info
 */
#meta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    text-align: center;
    z-index: var(--z-ui);
    color: var(--color-text);
    transition: text-shadow var(--transition-normal);
    text-shadow: var(--text-shadow-accent);
}
#meta p {
    vertical-align: bottom;
    padding: 20px 40px;
    background: var(--color-panel-bg-solid);
}
#meta p a {
    text-decoration: none;
    font-style: italic;
    border: 0;
}
#meta:hover {
    text-shadow: 0 0 5px #fff, 0 0 10px var(--color-accent-glow);
}

/**
 * Tooltip
 */
div.tip {
    font-size: 14px;
    line-height: 14px;
    display: inline-block;
    font-style: italic;
    padding: 0;
    margin-top: 0;
    margin-left: 0;
    color: var(--color-text);
}
div.tip > div {
    display: inline-block;
    vertical-align: top;
}

/**
 * Minimap
 */
#minimap {
    opacity: 0;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    color: var(--color-text);
    text-align: center;
    padding: 20px;
    user-select: none;
    transition: opacity 1s ease;
    z-index: var(--z-ui);
}
#minimap.ready {
    opacity: 0.8;
}
#minimap.ready:hover {
    opacity: 1;
}
#minimap #home {
    cursor: pointer;
    transition: all var(--transition-normal);
}
#minimap #zoom-levels {
    left: 0;
    right: 0;
    position: relative;
    cursor: ns-resize;
    border-bottom: 2px solid white;
    border-top: 2px solid white;
    transition: all var(--transition-normal);
    margin-top: 10px;
}
#minimap #zoom-backdrop {
    position: relative;
    width: 0;
    height: 100%;
    margin: 0 auto;
    border-left: 2px solid white;
}
#minimap #zoom-cursor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 0;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
}
#minimap #about {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 24px;
    width: 24px;
    line-height: 27px;
    text-align: center;
    height: 24px;
    border-radius: 24px;
    transition: all var(--transition-normal);
    font-weight: bold;
    cursor: pointer;
    bottom: 20px;
    left: 50%;
    margin-left: -12px;
}
#minimap #grid-view {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 20px;
    width: 24px;
    line-height: 24px;
    text-align: center;
    height: 24px;
    transition: all var(--transition-normal);
    cursor: pointer;
    bottom: 60px;
    left: 50%;
    margin-left: -12px;
    opacity: 0.7;
}
#minimap #grid-view:hover {
    opacity: 1;
    text-shadow: var(--text-shadow-hover);
}
#minimap #volume {
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin: 0 auto;
}

#minimap #heatvision {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 14px;
    width: 105px;
    line-height: 23px;
    text-align: center;
    height: 20px;
    transition: all var(--transition-normal);
    font-weight: bold;
    border: 1px solid #ccc;
    cursor: pointer;
    background: var(--color-panel-bg-solid);
    bottom: 20px;
    right: 156px;
}
#minimap #sound {
    cursor: pointer;
    transition: all var(--transition-normal);
    bottom: 13px;
    right: 54px;
    position: absolute;
    visibility: visible;
}
#minimap #soundoff {
    cursor: pointer;
    transition: all var(--transition-normal);
    bottom: 13px;
    right: 54px;
    position: absolute;
    display: none;
}

/**
 * Superscript & References
 */
sup {
    vertical-align: super;
    font-size: 9.24px;
    line-height: 0;
}

.reference {
    display: none;
    visibility: hidden;
}

/**
 * CSS 3D World
 */
#css-world {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    position: absolute;
}

#css-camera {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    position: absolute;
}

#css-container {
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    position: absolute;
}

/**
 * Canvas
 */
canvas {
    pointer-events: none;
    z-index: var(--z-canvas);
}

/**
 * Chrome Experiments Badge
 */
#chrome-experiments {
    width: 141px;
    height: 72px;
}
#chrome-experiments a {
    border-bottom: 0px;
}
