:root {
    color-scheme: dark;
    --bg: #0c1018;
    --bg-soft: #121826;
    --panel: rgba(18, 24, 38, 0.84);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --muted: #9aa6c3;
    --accent: #7dd3fc;
    --accent-strong: #38bdf8;
    --shadow: 0 18px 60px rgba(2, 6, 23, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.1), transparent 30%),
        linear-gradient(180deg, #05070d 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 24px;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 40px;
}

.global-clock-bar {
    width: min(1440px, calc(100% - 32px));
    margin: 20px auto 0;
    display: flex;
    justify-content: flex-start;
}

.global-clock-bar .elday-clock.digital {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.85rem 1.25rem;
    width: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.global-clock-bar .elday-clock.digital .elday-clock-digital {
    padding: 0;
    text-align: left;
    display: block;
}

.global-clock-bar .elday-clock.digital .elday-clock-digital-time {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #38bdf8;
}

.global-clock-bar .elday-clock.digital .elday-day-name {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.global-clock-bar .elday-clock.digital .elday-day-description.normalelday {
    font-size: 0.85rem;
    color: #10b981;
}

.global-clock-bar .elday-clock.digital .elday-day-description.specialelday {
    font-size: 0.85rem;
    color: #f59e0b;
}

.sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}

.brand,
.panel {
    border: 1px solid var(--panel-border);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.brand {
    padding: 22px;
    border-radius: 28px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.brand.brand-home {
    flex-direction: column;
    text-align: center;
    gap: 14px;
}

.brand-logo-link {
    display: block;
    width: 100%;
    max-width: 220px;
}

.brand-logo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.brand-mark {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--accent-strong), #0f172a);
    color: white;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand h1,
.hero h2,
.section-head h2,
.panel h2,
.entry h3 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
}

.panel {
    border-radius: 24px;
    padding: 20px;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.55);
}

.login-form button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #00111f;
    font-weight: 800;
    cursor: pointer;
}

.nav-panel {
    display: grid;
    gap: 10px;
}

.nav-panel a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid transparent;
    color: var(--text);
}

.nav-panel a:hover {
    border-color: rgba(125, 211, 252, 0.35);
    background: rgba(8, 15, 29, 0.72);
}

.content-area {
    display: grid;
    gap: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 24px;
    align-items: end;
}

.lead,
.muted,
.entry p,
.section-head span,
.metric {
    color: var(--muted);
}

.hero-stats {
    display: grid;
    gap: 12px;
}

.hero-stats div,
.entry,
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.hero-stats div {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(8, 15, 29, 0.58);
    border: 1px solid var(--panel-border);
}

.hero-stats strong {
    display: block;
    font-size: 1.1rem;
}

.hero-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.grid {
    display: grid;
    gap: 24px;
}

.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head {
    align-items: baseline;
    margin-bottom: 16px;
}

.entry {
    padding: 16px 0;
    border-top: 1px solid rgba(154, 166, 195, 0.12);
}

.entry:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.entry-date {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.85rem;
}

.compact {
    align-items: center;
}

.badge {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    font-size: 0.82rem;
    white-space: nowrap;
}

.metric {
    margin: 0;
    font-weight: 700;
}

.pager {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 8px 0 18px;
}

.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(8, 15, 29, 0.58);
    color: var(--text);
    font-size: 0.9rem;
}

.pager-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.pager-status {
    color: var(--muted);
    font-size: 0.92rem;
}

.search-form {
    margin: 18px 0 22px;
    display: grid;
    gap: 8px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(5, auto minmax(130px, 1fr));
    gap: 10px;
    align-items: center;
}

.filter-row label {
    color: var(--muted);
    font-size: 0.9rem;
}

.filter-row select,
.filter-row input[type="text"] {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(2, 6, 23, 0.5);
    color: var(--text);
}

.channel-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 8px;
}

.channel-filter-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.channel-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.channel-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.5);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.channel-checkbox:hover {
    border-color: rgba(125, 211, 252, 0.35);
}

.channel-checkbox input[type="checkbox"] {
    accent-color: var(--accent-strong);
    cursor: pointer;
}

.log-entry,
.log-entry:first-of-type {
    padding: 10px 14px;
    border-top: 0;
    border-radius: 10px;
    margin-bottom: 6px;
}

.log-entry p {
    margin: 0;
    color: var(--text);
}

.entry-market {
    background: rgba(20, 83, 45, 0.65);
    border-left: 4px solid #22c55e;
}

.entry-channel6 {
    background: rgba(71, 85, 105, 0.55);
    border-left: 4px solid #94a3b8;
}

.entry-gm,
.entry-ig {
    background: rgba(30, 64, 175, 0.6);
    border-left: 4px solid #60a5fa;
}

.entry-new {
    animation: logEntryHighlight 1.6s ease-out;
}

@keyframes logEntryHighlight {
    0% {
        filter: brightness(1.35);
    }
    100% {
        filter: brightness(1);
    }
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.live-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-row input {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 11px 13px;
    background: rgba(2, 6, 23, 0.5);
    color: var(--text);
}

.search-row button {
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #00111f;
    font-weight: 800;
    cursor: pointer;
}

.search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(2, 6, 23, 0.5);
    color: var(--text);
}

.panel-inset {
    background: rgba(8, 15, 29, 0.5);
}

.login-card {
    max-width: 520px;
    margin: 0 auto;
}

.form-error {
    border: 1px solid rgba(255, 91, 91, 0.4);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 0 14px;
}

.api-code {
    margin: 10px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.65);
    color: #93c5fd;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-x: auto;
}

.hero-globe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.14), rgba(8, 15, 29, 0.72));
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hero-globe-card:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.45);
}

.hero-globe-img {
    width: 148px;
    height: 148px;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.65));
}

.hero-globe-caption strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
}

.hero-globe-caption span {
    font-size: 0.82rem;
    color: var(--accent);
}

.hero-globe-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.globe-static-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.65));
}

.globe-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px;
    margin-top: 12px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.12), rgba(2, 6, 23, 0.78));
}

#draia-globe-canvas {
    max-width: 100%;
    height: auto;
    cursor: grab;
    border-radius: 50%;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.75));
}

#draia-globe-canvas:active {
    cursor: grabbing;
}

.globe-emblem-large {
    width: min(340px, 100%);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.75));
}

.map-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.worldmap-viewport {
    margin-top: 14px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background: rgba(2, 6, 23, 0.8);
    overflow: auto;
    max-height: 680px;
}

.worldmap-full-img {
    display: block;
    width: 100%;
    height: auto;
    transition: width 0.18s ease;
}

.home-worldmap-banner {
    display: block;
    margin-top: 12px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.home-worldmap-banner img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.25s ease;
}

.home-worldmap-banner:hover img {
    transform: scale(1.015);
}

@media (max-width: 1080px) {
    .page-shell,
    .hero,
    .two-up {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100%, calc(100% - 20px));
        padding-top: 10px;
    }

    .brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-stats div,
    .entry,
    .section-head {
        flex-direction: column;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}
