/* Transport-specific cards must stay hidden even when their layout uses flex. */
[data-tcp-only][hidden],
[data-quic-only][hidden] {
    display: none !important;
}

/* Self-hosted fonts (SIL OFL) — the CSP allows font-src 'self' only, so these must stay local. */
@font-face {
    font-family: "Press Start 2P";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/press-start-2p-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
    overflow-x: hidden;
}


/* Quantus-style scramble glitch (driven by glitch.js): swapped glyphs use the
   page's own monospaced pixel font, so layout never shifts; about half of them
   flash flare orange like the ticker on quantus.com. */
.gl {
    color: var(--accent-color, #ff6b35);
}
.title .gl {
    text-shadow: 0 0 12px var(--glow-color, rgba(255, 107, 53, 0.25));
}

/* Quantus film grain: the same self-contained SVG noise overlay quantus.com
   paints over every page (img-src allows data: URIs). */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 900;
    opacity: 0.7;
    mix-blend-mode: overlay;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

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

.container > *,
.calculator-wrapper > *,
.results-grid > *,
.pool-metrics-grid > *,
.stats-grid > * {
    min-width: 0;
}

.retro-table-container,
.table-container {
    max-width: 100%;
    overflow-x: auto;
}

.result-value,
.result-usd,
.fact-value,
.pool-share-value,
.stat-card-body,
.stat-value {
    overflow-wrap: anywhere;
}

.retro-footer {
    position: static;
    inset: auto;
    box-sizing: border-box;
    flex: none;
}

/* INDEX: the ALERTS toggle wraps to the row start on phones, so its settings
   menu must anchor left to stay on-screen */
/* BENCHMARK: two-miner rows — stack the miner label above its bar on phones */
/* SITE: POOL CHAT — floating widget (chat.js), collapsed launcher bottom-left.
   Served same-origin from the chat sidecar via /api/chat; styles live here so
   the CSP style hashes in the six pages, _headers, and both pool Nginx
   configs stay frozen. */
.chat-launcher {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 22px;
    background: linear-gradient(180deg, #171717 0%, #0e0e0e 100%);
    color: var(--flare-bright, #ff8a5c);
    border: 2px solid var(--border-color, #2c2c2b);
    border-bottom-color: var(--accent-color, #ff6b35);
    font-family: inherit;
    font-size: 0.6em;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.chat-launcher:hover {
    border-color: var(--accent-color, #ff6b35);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), 0 0 14px var(--glow-color, rgba(255, 107, 53, 0.25));
    transform: translateY(-3px);
}
.chat-launcher-open {
    display: none;
}
.chat-launcher-gem {
    display: flex;
    align-items: center;
    color: var(--accent-color, #ff6b35);
    animation: chat-gem-pulse 2.8s ease-in-out infinite;
}
/* letter-spacing adds a phantom space after the final glyph — cancel it so
   the icon + label sit optically dead-center in the launcher */
.chat-launcher-label {
    margin-right: -3px;
}
@keyframes chat-gem-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.chat-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    background: var(--flare-bright, #ff8a5c);
    color: var(--main-bg, #0e0e0e);
    border: 2px solid var(--main-bg, #0e0e0e);
    padding: 3px 6px;
    font-size: 0.85em;
    box-shadow: 0 0 8px var(--glow-color, rgba(255, 107, 53, 0.25));
}
.chat-badge[hidden] {
    display: none !important;
}

.chat-panel {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    width: min(340px, calc(100vw - 78px));
    height: min(430px, 72vh);
    background: var(--main-bg, #0e0e0e);
    border: 2px solid var(--border-color, #2c2c2b);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
.chat-panel[hidden] {
    display: none !important;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-color, #2c2c2b);
}
.chat-title {
    flex: 1;
    color: var(--accent-color, #ff6b35);
    font-size: 0.6em;
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--glow-color, rgba(255, 107, 53, 0.25));
}
.chat-nick,
.chat-snd,
.chat-x {
    background: none;
    border: 1px solid var(--border-color, #2c2c2b);
    color: var(--muted, #8f8d88);
    font-family: inherit;
    font-size: 0.52em;
    padding: 4px 7px;
    cursor: pointer;
}
.chat-nick:hover,
.chat-snd:hover,
.chat-x:hover {
    color: var(--flare-bright, #ff8a5c);
    border-color: var(--accent-color, #ff6b35);
}
.chat-snd-on {
    color: var(--flare-bright, #ff8a5c);
    border-color: var(--accent-color, #ff6b35);
}

.chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    background: rgba(0, 0, 0, 0.18);
}
.chat-msg {
    padding: 6px 10px;
    font-size: 0.55em;
    line-height: 1.8;
    overflow-wrap: anywhere;
}
.chat-time {
    color: var(--muted, #8f8d88);
    opacity: 0.75;
    margin-right: 7px;
    font-size: 0.9em;
}
.chat-name {
    font-weight: bold;
    margin-right: 7px;
}
.chat-body {
    color: var(--text-color, #e8e6e0);
}
.chat-msg-system {
    background: rgba(255, 107, 53, 0.07);
    border-left: 2px solid var(--accent-color, #ff6b35);
}
.chat-name-system {
    color: var(--flare-bright, #ff8a5c);
    text-shadow: 0 0 5px var(--glow-color, rgba(255, 107, 53, 0.25));
}
.chat-msg-system .chat-body {
    color: var(--flare, #ff6b35);
}
.chat-c0 { color: #ff8a5c; }
.chat-c1 { color: #4ade80; }
.chat-c2 { color: #c97a6b; }
.chat-c3 { color: #8fb9c9; }
.chat-c4 { color: #b89fd9; }
.chat-c5 { color: #e0b070; }
.chat-c6 { color: #7dc9c9; }
.chat-c7 { color: #d99fb8; }

.chat-status {
    padding: 6px 10px;
    font-size: 0.5em;
    letter-spacing: 1px;
    color: var(--red-soft, #c97a6b);
    border-top: 1px solid var(--border-color, #2c2c2b);
}
.chat-status[hidden] {
    display: none !important;
}

.chat-inputrow {
    display: flex;
    border-top: 1px solid var(--border-color, #2c2c2b);
}
.chat-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 0;
    padding: 11px 10px;
    color: var(--text-color, #e8e6e0);
    font-family: inherit;
    font-size: 0.55em;
}
.chat-input:focus {
    outline: 1px solid var(--accent-color, #ff6b35);
    outline-offset: -1px;
}
.chat-send {
    background: none;
    border: 0;
    border-left: 1px solid var(--border-color, #2c2c2b);
    color: var(--flare-bright, #ff8a5c);
    font-family: inherit;
    font-size: 0.55em;
    letter-spacing: 1px;
    padding: 0 14px;
    cursor: pointer;
}
.chat-send:hover {
    background: rgba(255, 107, 53, 0.12);
}
.chat-send:disabled {
    color: var(--muted, #8f8d88);
    cursor: default;
}

/* SITE: WORKERS TABLE — row cap controls (poolscript.js renders at most
   WORKER_ROW_CAP rows per group until SHOW ALL is clicked). */
.worker-table .wg-more {
    text-align: center;
}
.worker-table .wg-showall,
.worker-table .wg-showless {
    background: none;
    border: 1px solid var(--border-color, #2c2c2b);
    color: var(--muted, #8f8d88);
    font: inherit;
    letter-spacing: 1px;
    padding: 5px 16px;
    margin: 2px 0;
    cursor: pointer;
}
.worker-table .wg-showall:hover,
.worker-table .wg-showless:hover {
    color: var(--text-color, #e8e6e0);
    border-color: var(--accent-color, #ff6b35);
}

/* SITE: BACKGROUND FX TOGGLE — nav-rail button injected by navrail.js,
   cycling neural-bg.js between FULL / LITE / OFF. Pinned to the rail bottom
   above the live stats block, and — like that block — invisible until the
   rail expands on hover (pointer-events off so the collapsed strip can't be
   clicked blind). Hidden on phones, where the rail never expands. */
.nav-rail-fx {
    margin-top: auto;
    background: none;
    border: none;
    border-top: 1px solid var(--border-color, #2c2c2b);
    color: var(--muted, #8f8d88);
    font: inherit;
    font-size: 0.6em;
    text-align: left;
    width: 100%;
    padding: 12px 14px;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease 0.1s, color 0.2s ease;
}
.nav-rail:hover .nav-rail-fx {
    opacity: 1;
    pointer-events: auto;
}
.nav-rail-fx:hover {
    color: var(--hover-color, #ff8a5c);
}
.nav-rail .nav-rail-stats {
    margin-top: 0;
    margin-bottom: 6px; /* the social links now close the rail */
}
/* Keep the rail inside the viewport: its 100% height must include the padding */
nav.nav-rail {
    box-sizing: border-box;
}
/* Blocks page: a quiet LAST 50 line tucked under the LAST 10 tile value */
.stat-card .effort-sub {
    margin-top: 0.4rem;
    font-size: 0.42em;
    letter-spacing: 1px;
    line-height: 1.4;
    text-align: center;
    color: var(--muted, #8f8d88);
    opacity: 0.85;
}
.stat-card .effort-sub b {
    font-weight: normal;
    color: inherit;
}
/* Quantus network state, using the pool's Quantus palette and pixel fonts. */
.setup-note { color: var(--text-color, #e8e6e0); line-height: 1.9; font-size: 0.75rem; }
[data-pool-pin], [data-miner-command] { overflow-wrap: anywhere; word-break: break-word; }
