:root {
    /* No Man's Sky Palette: Deep Space Void, Crimson Atlas Red, Anomaly Cyan, Amber Gold */
    --nms-void: #06090e;
    --nms-surface: rgba(10, 16, 26, 0.75);
    --nms-surface-hover: rgba(16, 26, 42, 0.9);
    --nms-border: rgba(0, 229, 255, 0.18);
    --nms-border-bright: rgba(0, 229, 255, 0.55);

    --atlas-crimson: #ff2a4b;
    --hud-cyan: #00e5ff;
    --hud-amber: #f59e0b;
    --text-primary: #e6f1f5;
    --text-muted: #72879d;

    /* Status classes */
    --status-rest-bg: rgba(90, 105, 120, 0.15);
    --status-rest-text: #8fa0b2;
    --status-rest-border: rgba(143, 160, 178, 0.3);

    --status-active-bg: rgba(255, 42, 75, 0.14);
    --status-active-text: #ff4d6a;
    --status-active-border: rgba(255, 42, 75, 0.45);

    --status-recon-bg: rgba(0, 229, 255, 0.12);
    --status-recon-text: #00e5ff;
    --status-recon-border: rgba(0, 229, 255, 0.45);

    --status-warp-bg: rgba(245, 158, 11, 0.14);
    --status-warp-text: #fbbf24;
    --status-warp-border: rgba(245, 158, 11, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--nms-void);
    background-image: 
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 80% 40%, rgba(0, 229, 255, 0.7), transparent),
        radial-gradient(1px 1px at 45% 75%, rgba(255, 42, 75, 0.5), transparent),
        radial-gradient(circle at 50% 0%, rgba(255, 42, 75, 0.08) 0%, transparent 60%);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Rajdhani', sans-serif;
    padding: clamp(12px, 2vw, 25px);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Outer HUD Frame */
.schedule-canvas {
    width: 100%;
    max-width: 1800px;
    background:
        linear-gradient(135deg, rgba(255, 42, 75, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 95% 100%, rgba(0, 229, 255, 0.05) 0%, transparent 50%),
        #090d14;
    border: 1px solid var(--nms-border);
    clip-path: polygon(
        0 18px, 18px 0,
        calc(100% - 18px) 0, 100% 18px,
        100% calc(100% - 18px), calc(100% - 18px) 100%,
        18px 100%, 0 calc(100% - 18px)
    );
    box-shadow: 0 35px 85px -15px rgba(0, 0, 0, 0.95), inset 0 0 1px 1px rgba(0, 229, 255, 0.15);
    padding: clamp(20px, 3vw, 55px) clamp(16px, 3.5vw, 70px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Corner HUD crosshairs */
.schedule-canvas::before {
    content: "SEC // EUCLID_074F";
    position: absolute;
    top: 6px;
    right: 24px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(0, 229, 255, 0.45);
}

.header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--nms-border);
    margin-bottom: 24px;
    position: relative;
    width: 100%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 220px;
    height: 3px;
    background: linear-gradient(90deg, var(--atlas-crimson), var(--hud-cyan), transparent);
}

/* Minimalist Atlas Diamond */
.atlas-icon {
    position: relative;
    width: 44px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.atlas-diamond {
    width: 32px;
    height: 32px;
    border: 2px solid var(--atlas-crimson);
    transform: rotate(45deg);
    box-shadow: 0 0 14px rgba(255, 42, 75, 0.5);
}

.atlas-core {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--atlas-crimson);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--atlas-crimson);
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-prefix {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(11px, 0.85vw, 13px);
    color: var(--atlas-crimson);
    letter-spacing: 2.5px;
}

.main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 2.2vw, 40px);
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffffff;
}

.main-title span {
    color: var(--hud-cyan);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid var(--nms-border);
    padding: 6px 14px;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    font-family: 'Share Tech Mono', monospace;
    margin-top: 4px;
}

.date-badge .label {
    font-size: clamp(11px, 0.9vw, 14px);
    font-weight: 700;
    color: var(--hud-amber);
    letter-spacing: 1.5px;
}

.date-badge .range {
    font-size: clamp(13px, 1vw, 16px);
    color: #c9d8e6;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
}

.sub-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(11px, 0.85vw, 14px);
    color: var(--hud-cyan);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-title::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--atlas-crimson);
    transform: rotate(45deg);
    box-shadow: 0 0 8px var(--atlas-crimson);
}

.twitch-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 229, 255, 0.08);
    color: var(--hud-cyan);
    border: 1px solid var(--hud-cyan);
    padding: 8px 18px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(12px, 0.9vw, 14px);
    letter-spacing: 1.5px;
    text-decoration: none;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    transition: all 0.25s ease;
}

.twitch-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.twitch-btn:hover {
    background: var(--hud-cyan);
    color: var(--nms-void);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    transform: translateY(-2px);
}

.shelving-unit {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Framing lines above and below Today */
.accent-boundary-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--atlas-crimson) 0%, var(--hud-cyan) 35%, transparent 85%);
    box-shadow: 0 0 10px rgba(255, 42, 75, 0.55);
    position: relative;
}

.accent-boundary-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: -2.5px;
    width: 7px;
    height: 7px;
    background: var(--atlas-crimson);
    box-shadow: 0 0 8px var(--atlas-crimson);
    transform: rotate(45deg);
}

.accent-boundary-line.line-top {
    margin-bottom: 2px;
}

.accent-boundary-line.line-bottom {
    margin-top: 2px;
    margin-bottom: 10px;
}

/* Sci-fi HUD Shelf Row */
.shelf-row {
    flex-shrink: 0;
    min-height: 90px;
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(190px, 250px) minmax(0, 1fr) auto;
    align-items: center;
    position: relative;
    background: var(--nms-surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--nms-border);
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    padding: 12px clamp(16px, 2vw, 32px);
    transition: all 0.25s ease;
}

.shelf-row:hover {
    background: var(--nms-surface-hover);
    border-color: var(--nms-border-bright);
    transform: translateX(5px);
}

.shelf-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.25s ease;
}

.shelf-row:hover::before {
    background: var(--hud-cyan);
    box-shadow: 0 0 12px var(--hud-cyan);
}

/* Featured / Active Day Row (Between Both Lines) */
.shelf-row.is-today {
    min-height: 104px;
    background: linear-gradient(90deg, rgba(255, 42, 75, 0.16) 0%, rgba(18, 30, 48, 0.95) 45%, rgba(10, 16, 26, 0.95) 100%);
    border: 1.5px solid var(--atlas-crimson);
    box-shadow:
        0 0 28px rgba(255, 42, 75, 0.25),
        inset 0 0 20px rgba(255, 42, 75, 0.12);
    transform: scale(1.006);
    position: relative;
    z-index: 2;
}

.shelf-row.is-today:hover {
    transform: scale(1.006) translateX(4px);
    border-color: #ff5e78;
}

.shelf-row.is-today::before {
    background: var(--atlas-crimson);
    width: 6px;
    box-shadow: 0 0 16px var(--atlas-crimson);
}

.shelf-row.is-today .day-label {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.shelf-row.is-today .time-slot {
    font-size: clamp(14px, 1.05vw, 18px);
    color: #ffd166;
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.shelf-row.is-today .case-title {
    font-size: clamp(20px, 1.35vw, 24px);
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

/* Pulsing "LIVE CYCLE" text tag inside the day slot */
.live-ping-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.8px;
    color: var(--atlas-crimson);
    font-weight: 700;
}

.live-ping-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--atlas-crimson);
    box-shadow: 0 0 8px var(--atlas-crimson);
    animation: atlas-pulse 1.8s infinite ease-in-out;
}

@keyframes atlas-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.35;
    }
}

.day-slot {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(16px, 1.2vw, 21px);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1.5px;
    padding-right: 12px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.day-label {
    display: inline-block;
}

.time-slot {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(13px, 0.95vw, 16px);
    font-weight: 500;
    color: var(--hud-amber);
    padding: 0 clamp(10px, 1vw, 18px);
    border-left: 1px solid var(--nms-border);
    white-space: nowrap;
    text-align: center;
}

.activity-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(12px, 1.2vw, 24px);
    border-left: 1px solid var(--nms-border);
    min-width: 0;
}

.case-title {
    font-size: clamp(18px, 1.25vw, 22px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.25;
    word-break: break-word;
}

.case-details {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(12px, 0.85vw, 15px);
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
    word-break: break-word;
}

.status-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: clamp(12px, 1.2vw, 24px);
    border-left: 1px solid var(--nms-border);
    flex-shrink: 0;
}

.seal-badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(11px, 0.8vw, 13px);
    font-weight: 700;
    width: clamp(160px, 11vw, 200px);
    height: clamp(38px, 2.4vw, 44px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    white-space: nowrap;
}

.seal-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.status-rest {
    background: var(--status-rest-bg);
    color: var(--status-rest-text);
    border: 1px solid var(--status-rest-border);
}
.status-rest::before { background: var(--status-rest-text); }

.status-active {
    background: var(--status-active-bg);
    color: var(--status-active-text);
    border: 1px solid var(--status-active-border);
}
.status-active::before { background: var(--status-active-text); box-shadow: 0 0 6px var(--status-active-text); }

.status-investigation {
    background: var(--status-recon-bg);
    color: var(--status-recon-text);
    border: 1px solid var(--status-recon-border);
}
.status-investigation::before { background: var(--status-recon-text); box-shadow: 0 0 6px var(--status-recon-text); }

.status-special {
    background: var(--status-warp-bg);
    color: var(--status-warp-text);
    border: 1px solid var(--status-warp-border);
}
.status-special::before { background: var(--status-warp-text); box-shadow: 0 0 6px var(--status-warp-text); }

/* Media Query */

@media (min-width:600px) and (max-width: 1260px) {
     .header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        gap: 12px;

    }
    .date-badge {
        justify-content: center;
    }

    .shelf-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "day time"
            "activity activity"
            "badge badge";
        clip-path: none;
        gap: 10px;
        padding: 14px;
    }

    .shelf-row:hover,
    .shelf-row.is-today {
        transform: none;
    }

    .day-slot {
        grid-area: day;
        padding-right: 0;
    }

    .time-slot {
        grid-area: time;
        text-align: right;
        border-left: none;
        padding: 0;
    }

    .activity-slot {
        grid-area: activity;
        border-left: none;
        border-top: 1px solid var(--nms-border);
        border-bottom: 1px solid var(--nms-border);
        padding: 5px 0;
    }

    .status-slot {
        grid-area: badge;
        border-left: none;
        padding-left: 0;
        width: 100%;
    }

    .seal-badge {
        width: 100%;
        clip-path: none;
    }
}

@media (min-width:320px) and (max-width: 600px) {

    .header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        gap: 12px;
    }

    .shelf-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .shelf-row:hover,
    .shelf-row.is-today {
        transform: none;
    }

    .live-ping-tag,
    .day-slot,
    .time-slot,
    .case-title,
    .case-details {
        padding: 0 0 0 2px;
    }
    .time-slot {
        border-left: none;
        padding-left: 0;
    }

    .activity-slot {
        border-left: none;
        border-top: 1px solid var(--nms-border);
        border-bottom: 1px solid var(--nms-border);
        padding: 5px;
        width: 100%;
        text-align: center;
    }

    .status-slot {
        text-align: center;
        border-left: none;
        padding-left: 0;
        width: 100%;
    }

    .seal-badge {
        width: 100%;
        clip-path: none;
    }
}
