/* The server table (server-block.js), used by the Servers page and Home's servers section:
   vitalrust.com's list in the site's tokens. One panel, a header row in small spaced caps, one row
   per server; the regions still to come are dimmed rows. Every colour is a palette variable. */

/* ---------------------------------------------------------------- Servers page */

.servers-main { padding-top: 48px; padding-bottom: 96px; }
.section-tight > .container { padding-top: 64px; padding-bottom: 64px; }

/* ---------------------------------------------------------------- table */

/* One grid for the header and every row, so PLAYERS and NEXT WIPE sit exactly over their columns at
   every width (same columns, same gap, same padding; the edge bar is drawn over the row, not in it). */
.sv-table { --sv-cols: minmax(0, 2fr) minmax(170px, 1fr) minmax(190px, 1fr) 196px; --sv-pad: 28px; }
.sv-table-head, .sv-row { display: grid; grid-template-columns: var(--sv-cols); align-items: center; column-gap: 28px; padding: 0 var(--sv-pad); }
.sv-table-head { min-height: 64px; border-bottom: 1px solid var(--panel-line-top); }
.sv-title {
    margin: 0; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900;
    font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text);
}
.sv-col, .sv-label {
    font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-4);
}
.sv-col { display: flex; align-items: center; gap: 8px; }
.sv-col-players::before, .sv-col-wipe::before { content: ''; width: 5px; height: 5px; flex: none; margin-left: -13px; background: var(--accent); } /* in the gap: the label's text lines up with the figures under it */
.sv-label { display: none; }

.sv-rows { margin: 0; padding: 0; list-style: none; }
.sv-row { position: relative; padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--panel-line); transition: background-color 0.25s, box-shadow 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.sv-row:last-child { border-bottom: 0; }
/* The edge bar: teal on the live server while it is online (live.js sets .is-online on the row),
   muted when it is offline or unknown; on the other rows it grows in on hover. */
.sv-row::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong);
    transform: scaleY(0); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s, width 0.25s;
}
.sv-row.is-live { background-image: linear-gradient(90deg, color-mix(in srgb, var(--peacock-teal) 12%, transparent) 0%, transparent 60%); }
.sv-row.is-live::before { transform: none; background: var(--off); }
.sv-row.is-live.is-online::before { background: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--peacock-teal) 60%, transparent); }
.sv-row.is-live.is-offline { background-image: none; }
.sv-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Name, status chip and tags. */
.sv-cell-name { align-items: flex-start; gap: 10px; }
.sv-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.sv-name { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900; font-size: 22px; line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; }
.sv-region { font-size: 13px; color: var(--text-3); }
.sv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-tag { padding: 3px 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--obsidian) 45%, transparent); font-weight: 700; font-size: 12px; line-height: 1.3; color: var(--text-2); }
/* Status: Checking and Offline are muted (grey square, hollow when offline); Online is a teal chip
   whose dot sends out a soft ring. */
.sv-status {
    /* Plain status text with a small round light: no boxed chip and no glow box (owner, 2026-12-03). */
    display: inline-flex; align-items: center; gap: 7px; padding: 0;
    font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4);
    transition: color 0.3s;
}
.sv-pulse { position: relative; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--off); }
.sv-row.is-online .sv-status { color: var(--accent-text, var(--accent)); }
.sv-row.is-online .sv-pulse { background: var(--accent); }
.sv-row.is-online .sv-pulse::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: sv-pulse 2.6s ease-out infinite; }
@keyframes sv-pulse { 0% { transform: scale(0.6); opacity: 0.7; } 70%, 100% { transform: scale(1.8); opacity: 0; } }
.sv-row.is-offline .sv-pulse { background: transparent; border: 1px solid var(--text-5); }
.sv-state { font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: inherit; }
.sv-state.is-online { color: var(--text); }
.sv-state.is-offline { color: var(--text-4); }

/* Players: big figures, a segmented meter that fills in, the queue as a chip. */
.sv-big { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.sv-of { margin-left: 3px; color: var(--text-4); font-weight: 700; font-size: 0.6em; letter-spacing: 0.02em; }
.sv-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.pop-bar { position: relative; display: block; width: 100%; max-width: 180px; height: 6px; background: var(--line); }
.pop-bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, var(--obsidian) 10px 13px); }
.pop-fill { display: block; width: 0%; height: 100%; background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--peacock-teal) 55%, transparent); transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }
.sv-queue {
    align-self: flex-start; padding: 2px 8px; border: 1px solid var(--line);
    font-family: var(--font-mono); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; color: var(--text-3); white-space: nowrap;
}
/* Next wipe: days, hours and minutes, each with its unit. */
.sv-units { display: inline-flex; align-items: baseline; gap: 0.32em; }
.sv-u { display: inline-flex; align-items: baseline; gap: 0.04em; }
.sv-u-l { font: inherit; font-size: 0.66em; letter-spacing: 0; color: var(--text-3); } /* "3d 04h 58m": units tight to their numbers, same face as the digits */

.sv-cell-actions { flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; }
.btn-connect { min-height: 48px; padding: 10px 20px; }

/* Regions still to come: calm and compact. */
.sv-row.is-soon { padding-top: 15px; padding-bottom: 15px; }
.sv-row.is-soon .sv-name-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.sv-row.is-soon .sv-name { font-size: 15px; color: var(--text-5); }
.sv-row.is-soon .sv-region { font-size: 13px; color: var(--text-5); }
.sv-cell-soon { grid-column: 2 / 4; }
.sv-soon-tag {
    align-self: flex-start; padding: 3px 8px; border: 1px solid var(--line);
    font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-5);
}
.sv-notify {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
    font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); transition: color 0.2s;
}
.sv-notify svg { transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s; }
.sv-notify:hover, .sv-notify:focus-visible { color: var(--text); }
.sv-notify:hover svg, .sv-notify:focus-visible svg { transform: translateX(4px); color: var(--accent); }

/* Hover (a mouse only): the row lights, the live row lifts a little and its bar thickens, the other
   rows' bar grows in. A tap state everywhere. */
.sv-row:active { background-color: var(--panel-hover); }
@media (hover: hover) {
    .sv-row:hover { background-color: var(--panel-hover); }
    .sv-row.is-live:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--peacock-teal) 70%, transparent); z-index: 1; }
    .sv-row.is-live:hover::before { width: 4px; }
    .sv-row.is-soon:hover::before { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sv-row, .sv-row::before, .pop-fill, .sv-notify svg { transition: none; }
    .sv-row.is-live:hover { transform: none; }
    .sv-row.is-online .sv-pulse::after { animation: none; }
}

/* ---------------------------------------------------------------- server info dialog */

/* The live row's Server info button opens this native <dialog> (live.js, showModal): focus stays
   inside; Escape, the Close button and a click on the backdrop close it. Sized to fit 1366x768 and
   1440x900 with no inner scroll (overflow is only a fallback). Dark like the panels, bone text only.
   The bottom right corner is cut like the panels, and the border follows the cut (the last
   background layer draws the diagonal). On phones it is a bottom sheet (below). */
.sv-info {
    --cut: 18px;
    width: min(680px, calc(100vw - 24px)); max-height: calc(100svh - 32px); padding: 0; overflow: auto;
    border: 1px solid var(--line-strong); color: var(--text);
    background:
        linear-gradient(135deg, transparent calc(50% - 1px), var(--line-strong) 50%, transparent calc(50% + 1px)) right bottom / var(--cut) var(--cut) no-repeat,
        color-mix(in srgb, var(--obsidian) 92%, var(--deep-peacock));
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
.sv-info[open] { animation: sv-info-in 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes sv-info-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.sv-info::backdrop { background: color-mix(in srgb, var(--obsidian) 72%, transparent); backdrop-filter: blur(8px); }
.sv-info-body { display: flex; flex-direction: column; }
/* Hero: a short strip (~130 px): the server's scene behind the live pill, its name and tags. */
.sv-info-hero { position: relative; padding: 18px 24px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; overflow: hidden; border-bottom: 1px solid var(--line-strong); }
.sv-info-hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(90deg, var(--obsidian) 0%, color-mix(in srgb, var(--obsidian) 70%, transparent) 55%, color-mix(in srgb, var(--deep-peacock) 45%, transparent) 100%), url("/web/assets/video/hero-poster.jpg") center / cover no-repeat;
}
.sv-info-hero::after { content: ""; position: absolute; left: 0; top: 0; width: 96px; height: 3px; background: var(--accent); }
.sv-info-hero > *:not(.sv-info-hero-bg) { position: relative; z-index: 1; }
.sv-info-live {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 9px;
    border: 1px solid var(--line-overlay); background: color-mix(in srgb, var(--obsidian) 60%, transparent);
    font-weight: 800; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4);
}
/* The same status treatment as the table: teal while online, muted otherwise. */
.sv-info-live:has(.is-online) { border-color: color-mix(in srgb, var(--peacock-teal) 55%, transparent); background: color-mix(in srgb, var(--obsidian) 50%, var(--deep-peacock)); color: var(--text); }
.sv-info-live .dot { width: 7px; height: 7px; background: var(--off); }
.sv-info-live .dot.is-online { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.sv-info-live .dot.is-offline { background: transparent; border: 1px solid var(--text-5); }
.sv-info-title {
    margin: 0; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900;
    font-size: clamp(24px, 4vw, 34px); line-height: 1; text-transform: uppercase; overflow-wrap: anywhere;
}
.sv-info-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-info-tag { padding: 3px 9px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--obsidian) 60%, transparent); font-weight: 700; font-size: 12px; color: var(--text); }
/* Stats: one row of equal tiles (Players, Next wipe, Next KOTH). */
.sv-info-grid { margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.sv-info-tile { margin: 0; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; background: color-mix(in srgb, var(--obsidian) 88%, var(--deep-peacock)); min-width: 0; }
.sv-info-tile dt { font-weight: 800; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.sv-info-tile dd { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sv-info-big { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.sv-info-big .sv-of { font-size: 0.6em; color: var(--text-3); }
.sv-info-tile .pop-bar { max-width: none; }
.sv-info-tile .sv-sub { font-size: 12px; color: var(--text-3); }
/* The wipe schedule: one small line under the stats. */
.sv-info-schedule { margin: 0; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; border-bottom: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); }
.sv-info-schedule-label { font-weight: 800; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.sv-info-mid { font-weight: 800; font-size: 14px; color: var(--text); }
/* How to join: a compact numbered list, one line per step, teal numerals. */
.sv-info-join { padding: 14px 24px 4px; }
.sv-info-h3 { margin: 0 0 6px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900; font-size: 14px; text-transform: uppercase; color: var(--text); }
.sv-info-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; }
.sv-info-steps li {
    counter-increment: step; display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 6px 0;
    border-bottom: 1px solid var(--line-faint); font-size: 14px; color: var(--text);
}
.sv-info-steps li:last-child { border-bottom: 0; }
.sv-info-steps li::before {
    content: counter(step); flex: none; width: 18px;
    font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 900; font-size: 18px; line-height: 1; color: var(--accent-text);
}
.sv-info-steps code { margin-right: 0.35em; font-family: var(--font-mono); font-weight: 800; color: var(--text); }
.sv-info-foot { padding: 12px 24px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sv-info-more { font-weight: 800; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.sv-info-actions { margin: 0; }
.sv-info-actions .btn { cursor: pointer; border: 0; }

/* Phones: centred like on desktop, the full width less an 8px gutter each side (never past the
   right edge), compacted so it fits 390x844 and 375x667 with no inner scroll: a smaller hero, Players
   across the top with Next wipe and Next KOTH as two tiles under it, a tight join list. */
@media (max-width: 600px) {
    .sv-info { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100svh - 16px); margin: auto; }
    .sv-info-hero { padding: 12px 16px; gap: 6px; }
    .sv-info-title { font-size: 22px; }
    .sv-info-tag { padding: 2px 7px; font-size: 11px; }
    .sv-info-grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sv-info-tile.is-players { grid-column: 1 / -1; }
    .sv-info-tile { padding: 10px 14px; gap: 4px; }
    .sv-info-tile dd { gap: 4px; }
    .sv-info-big { font-size: 20px; }
    .sv-info-schedule { padding: 8px 16px; font-size: 12px; }
    .sv-info-mid { font-size: 13px; }
    .sv-info-join { padding: 10px 16px 0; }
    .sv-info-h3 { margin-bottom: 2px; font-size: 13px; }
    .sv-info-steps li { min-height: 34px; padding: 4px 0; font-size: 13px; gap: 12px; }
    .sv-info-foot { padding: 10px 16px 14px; }
}
/* While the dialog is open the page behind cannot scroll (live.js pins the body; this stops the
   rubber band and the scroll chain). */
html.dialog-open, html.dialog-open body { overflow: hidden; overscroll-behavior: none; }
.sv-info { overscroll-behavior: contain; }
@media (prefers-reduced-motion: reduce) { .sv-info[open] { animation: none; } }

/* Phones and narrow tablets: the live row stacks (name and status, players, next wipe, a full-width
   Server info), each figure on one line with its label, split by hairlines; the column header gives
   way to the labels in the cells. The soon rows stay one compact line each. */
@media (max-width: 820px) {
    .sv-table { --sv-pad: 18px; }
    .sv-table-head { grid-template-columns: 1fr; min-height: 58px; }
    .sv-col { display: none; }
    .sv-label { display: block; }
    .sv-row { grid-template-columns: minmax(0, 1fr); padding-top: 20px; padding-bottom: 20px; }
    .sv-row.is-live > .sv-cell + .sv-cell { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-faint); }
    .sv-row.is-live > .sv-cell-actions { border-top: 0; padding-top: 4px; }
    .sv-name { font-size: 20px; }
    .sv-cell-players, .sv-cell-wipe { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
    .sv-cell-players .sv-big, .sv-cell-wipe .sv-big { justify-self: end; }
    .sv-cell-players .pop-bar { grid-column: 1 / -1; max-width: none; }
    .sv-cell-players .sv-queue { grid-column: 1 / -1; justify-self: start; }
    .sv-cell-wipe .sv-sub { grid-column: 1 / -1; }
    .sv-cell-actions { justify-content: stretch; }
    .btn-connect { flex: 1; justify-content: center; }
    .sv-row.is-soon { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name act" "soon act"; row-gap: 8px; padding-top: 14px; padding-bottom: 14px; }
    .sv-row.is-soon .sv-cell-name { grid-area: name; }
    .sv-row.is-soon .sv-cell-soon { grid-area: soon; grid-column: auto; }
    .sv-row.is-soon .sv-cell-actions { grid-area: act; }
    .sv-row.is-soon .sv-cell-actions:empty { display: none; }
    .section-tight > .container { padding-top: 40px; padding-bottom: 40px; }
    .servers-main { padding-top: 24px; }
}
