:root {
    --bg: #0a0a0a;
    --panel: #141414;
    --border: #262626;
    --text: #e5e5e5;
    --text-dim: #888;
    --accent: #d97706;
    --accent-hover: #f59e0b;
}

* { box-sizing: border-box; }

html {
    /* Reserves the scrollbar's width whether or not it's currently needed, so
       switching to a taller/shorter view doesn't shift the centered header
       horizontally when the scrollbar appears or disappears. */
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.88), rgba(10, 10, 10, 0.88)),
        url('https://github.com/asquad420/hillside/blob/main/hillside1.png?raw=true');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
}

a { color: inherit; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.hero-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
}

.hero-brand {
    text-decoration: none;
    color: inherit;
}

.hero-brand h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hero-brand .tagline {
    margin: 3px 0 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.hero-brand .dedication {
    margin: 4px 0 0;
    color: var(--text-dim);
    font-size: 11.5px;
    max-width: 360px;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions .btn {
    padding: 9px 18px;
    font-size: 13px;
}

.site-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 9px 16px;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border);
    backdrop-filter: blur(2px);
}

.site-nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.site-nav a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.splash {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.splash.hide {
    opacity: 0;
    pointer-events: none;
}

.splash img {
    max-width: 360px;
    width: 65vw;
    height: auto;
    border-radius: 12px;
}

.splash-skip {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.easter-egg {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    opacity: 0.3;
    margin-top: 14px;
    transition: opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.easter-egg:hover {
    opacity: 1;
    transform: scale(1.15) rotate(-4deg);
}

.hydrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.4s ease;
}

.hydrate-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.hydrate-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.hydrate-overlay.escaped .hydrate-playing {
    display: none;
}

.hydrate-image {
    width: 18vmin;
    border-radius: 50%;
    transform: scale(0.5);
    /* The "back-out" easing overshoots past full size before settling, which is
       what actually reads as the image growing/bulging rather than just resizing. */
    transition: width 1.1s cubic-bezier(0.34, 1.56, 0.64, 1), transform 1.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hydrate-overlay.visible .hydrate-image {
    width: 75vmin;
    transform: scale(1);
}

.hydrate-hint {
    color: var(--text-dim);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    min-height: 1em;
}

.hydrate-reward {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 20px;
    cursor: default;
}

.hydrate-overlay.escaped .hydrate-reward {
    display: flex;
}

.hydrate-badge {
    /* The source badge is a small, non-square banner (120x37) - forcing it into
       a 140x140 square was stretching it out of shape. Showing it at native
       size keeps its real proportions. */
    width: auto;
    height: auto;
    animation: hydrate-badge-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hydrate-badge-in {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hydrate-reward h2 {
    margin: 0;
    font-size: 24px;
    color: var(--accent);
}

.hydrate-reward p {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
}

.header-hero {
    position: relative;
    padding: 40px 24px;
    background-size: cover;
    background-position: center 30%;
    background-color: var(--panel);
}

.header-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.8) 100%);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-connect {
    background: #ce422b;
    color: #fff;
}
.btn-connect:hover { background: #e14e35; }

.btn-discord {
    background: #5865f2;
    color: #fff;
}
.btn-discord:hover { background: #6975f3; }

.connect-line {
    margin-top: 16px;
    font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.connect-line button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.connect-line button:hover { border-color: var(--accent); color: var(--accent); }

.views {
    overflow: hidden;
    position: relative;
    transition: height 0.4s ease;
}

.views-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.view {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
}

.view-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

.status-panel,
.map-panel,
.news-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
}

.status-loading {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
}

.section-label {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 8px;
}

.section-title {
    text-align: center;
    font-size: 26px;
    margin: 0 0 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.feature-card:hover {
    border-color: var(--accent);
}

.feature-card h3 {
    margin: 0 0 6px;
    font-size: 15.5px;
    color: var(--accent);
}

.feature-card p {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.5;
}

.link-discord-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 16px;
    max-width: 680px;
    margin: 28px auto 0;
    line-height: 1.6;
}

.link-discord-note code {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
    font-size: 14.5px;
    color: var(--accent);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-card {
    /* Positioned per-card via JS (left/top set to the triggering card's own
       center), not flex-centered on the viewport - the translate here just
       re-centers the box on that point once its left/top mark the point itself. */
    position: fixed;
    top: 50%;
    left: 50%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px 28px;
    max-width: 380px;
    width: calc(100vw - 40px);
    /* Stays pointer-events:none until the modal is actually open - it's always
       present (just invisible) at whatever point it was last positioned, so
       without this gate it would permanently block hover on whatever's under
       that point, even while "closed". */
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.97);
    transition: transform 0.4s ease, left 0.2s ease, top 0.2s ease;
}

.modal-overlay.visible .modal-card {
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-card h3 {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 18px;
}

.modal-card p {
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
}

.modal-close:hover {
    color: var(--accent);
}

.wipe-band {
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px 20px;
}

.wipe-band p {
    color: var(--text-dim);
    max-width: 480px;
    margin: 10px auto 22px;
    font-size: 14px;
}

footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    padding: 30px 20px 50px;
    border-top: 1px solid var(--border);
}

.leaderboard-frame {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

footer .connect-line { margin-top: 10px; }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent); }

/* Status view */

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-on {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.status-dot-off {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-headline {
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.status-server-name {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 19px;
}

.status-server-desc {
    margin: 0 0 22px;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-line;
}

.status-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.status-stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-stat-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-stat-value {
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Status view: player count chart */

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 40px 0 16px;
}

.chart-range-toggle {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.chart-range-toggle button {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 7px 16px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
}

.chart-range-toggle button.active {
    background: var(--accent);
    color: #000;
}

.chart-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px;
}

.player-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-grid {
    stroke: var(--border);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.chart-axis-label {
    fill: var(--text-dim);
    font-size: 9px;
}

.chart-area {
    fill: var(--accent);
    fill-opacity: 0.18;
    stroke: none;
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart-endpoint {
    fill: var(--accent);
    stroke: var(--panel);
    stroke-width: 2;
}

/* Wipe view: map */

.map-frame {
    position: relative;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-image {
    display: block;
    width: 100%;
    height: auto;
    /* Rust maps are always square - reserving the ratio up front means the view's
       height is correct even before the image itself has actually downloaded. */
    aspect-ratio: 1;
}

/* Wipe view: countdown */

.countdown-units {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 72px;
}

.countdown-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-live {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    margin-top: 18px;
}

.map-caption {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    margin: 14px 0 0;
}

.map-caption a { color: var(--accent); }

.map-retry-row {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* News view */

.news-subheading {
    text-align: left;
    margin-bottom: 16px;
}

.news-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.news-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
}

.news-date {
    color: var(--text-dim);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-title {
    margin: 4px 0 8px;
    font-size: 16px;
}

.news-title a {
    color: var(--accent);
    text-decoration: none;
}

.news-title a:hover { text-decoration: underline; }

.news-body {
    margin: 0;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-line;
}
