/* ==========================================================================
   TAMAN BERTEMAN — UNIFIED FLOATING HOTBAR NAVBAR & MONUMENT FOOTER (V7)
   - Detached floating architectural bevel navbar (identical shape & size on all 3 sites!)
   - Minecraft Hotbar-inspired numbered realm slots (01 Beranda · 02 Store · 03 Sosial)
   - Bulletproof CSS Grid stacked horizontal slider (ZERO width-squish bugs!)
   - Architectural Monument Footer with top Command Crown + 4-Column Grid + Theme Pill
   - 3 Synchronized Themes (day | sunset | night) & ZERO White Scrollbars!
   ========================================================================== */

@view-transition { navigation: auto; }

@keyframes vtFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-6px) scale(0.992); }
}
@keyframes vtFadeIn {
    from { opacity: 0; transform: translateY(8px) scale(1.005); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
::view-transition-old(root) { animation: vtFadeOut 360ms cubic-bezier(0.22, 1, 0.36, 1) both; }
::view-transition-new(root) { animation: vtFadeIn 480ms cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   3-THEME TOKEN SYSTEM (Pagi / Senja / Malam)
   ========================================================================== */
:root,
:root[data-theme="day"] {
    --page-bg: #c6dff4;
    --ink: #0f1714;
    --ink-muted: #3d4d47;
    --ink-faint: #63746d;
    --accent: #1b7a3d;
    --accent-bright: #22c55e;
    --accent-soft: rgba(27, 122, 61, 0.11);
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: rgba(255, 255, 255, 0.93);
    --surface-solid: #ffffff;
    --surface-sub: #f2f6f3;
    --nav-bg: rgba(255, 255, 255, 0.88);
    --nav-rim: rgba(255, 255, 255, 0.95);
    --footer-bg: rgba(14, 19, 17, 0.95);
    --footer-crown: rgba(23, 31, 28, 0.96);
    --footer-ink: #eef4f0;
    --footer-muted: rgba(238, 244, 240, 0.66);
    --footer-line: rgba(255, 255, 255, 0.11);
    --line: rgba(15, 23, 20, 0.10);
    --line-strong: rgba(15, 23, 20, 0.19);
    --btn-bg: #111916;
    --btn-ink: #ffffff;
    --console-bg: rgba(13, 18, 16, 0.92);
    --console-input-bg: rgba(255, 255, 255, 0.07);
    --shadow-soft: 0 18px 46px rgba(14, 22, 20, 0.10);
    --shadow-nav: 0 12px 34px rgba(14, 22, 20, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --radius-sm: 9px;
    --radius-md: 13px;
    --radius-lg: 18px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --nav-h: 88px;
}

/* SORE: Warm Editorial Golden-Hour Paper (organic terracotta & espresso — ZERO AI purple/neon!) */
:root[data-theme="sunset"] {
    --page-bg: #e8c7a9;
    --ink: #241912;
    --ink-muted: #5b4639;
    --ink-faint: #7d6758;
    --accent: #b45309;
    --accent-bright: #d97706;
    --accent-soft: rgba(180, 83, 9, 0.12);
    --surface: rgba(255, 249, 242, 0.84);
    --surface-strong: rgba(255, 251, 246, 0.93);
    --surface-solid: #fffaf4;
    --surface-sub: #f6ece0;
    --nav-bg: rgba(255, 249, 242, 0.88);
    --nav-rim: rgba(255, 255, 255, 0.86);
    --footer-bg: rgba(28, 20, 15, 0.96);
    --footer-crown: rgba(42, 30, 23, 0.96);
    --footer-ink: #faf2ea;
    --footer-muted: rgba(250, 242, 234, 0.66);
    --footer-line: rgba(255, 230, 204, 0.14);
    --line: rgba(42, 28, 19, 0.11);
    --line-strong: rgba(42, 28, 19, 0.22);
    --btn-bg: #241912;
    --btn-ink: #fffaf4;
    --console-bg: rgba(24, 17, 13, 0.92);
    --console-input-bg: rgba(255, 242, 228, 0.08);
    --shadow-soft: 0 18px 46px rgba(42, 24, 12, 0.14);
    --shadow-nav: 0 12px 34px rgba(42, 24, 12, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* MALAM: Architectural Obsidian & Warm Lantern Gold (neutral charcoal — ZERO AI navy/neon!) */
:root[data-theme="night"] {
    --page-bg: #12151b;
    --ink: #f1f3f5;
    --ink-muted: rgba(235, 238, 243, 0.72);
    --ink-faint: rgba(235, 238, 243, 0.48);
    --accent: #ddb46c;
    --accent-bright: #e5c382;
    --accent-soft: rgba(221, 180, 108, 0.15);
    --surface: rgba(22, 25, 31, 0.82);
    --surface-strong: rgba(20, 23, 29, 0.92);
    --surface-solid: #181b22;
    --surface-sub: #21252f;
    --nav-bg: rgba(20, 23, 29, 0.86);
    --nav-rim: rgba(255, 255, 255, 0.12);
    --footer-bg: rgba(13, 15, 19, 0.96);
    --footer-crown: rgba(21, 24, 30, 0.96);
    --footer-ink: #f1f3f5;
    --footer-muted: rgba(235, 238, 243, 0.62);
    --footer-line: rgba(255, 255, 255, 0.10);
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.20);
    --btn-bg: #f1f3f5;
    --btn-ink: #12151b;
    --console-bg: rgba(15, 18, 23, 0.94);
    --console-input-bg: rgba(255, 255, 255, 0.06);
    --shadow-soft: 0 22px 58px rgba(0, 0, 0, 0.48);
    --shadow-nav: 0 14px 38px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* ==========================================================================
   BASE RESET & ZERO WHITE SCROLLBARS
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    background: var(--page-bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: background 600ms var(--ease), color 600ms var(--ease);
}
html::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar,
.chat-stream::-webkit-scrollbar,
.players-roster::-webkit-scrollbar,
.store-dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.no-scrollbar, .chat-stream, .players-roster, .store-dialog {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body {
    font-family: var(--font-sans);
    background: transparent;
    color: var(--ink);
    line-height: 1.6;
    min-height: 100svh;
    overflow-x: clip;
    display: flex;
    flex-direction: column;
}

body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

main {
    position: relative;
    z-index: 2;
    flex: 1;
    animation: pageEnter 540ms var(--ease) both;
    transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
body.is-navigating main { opacity: 0.4; transform: translateY(-6px); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
    width: 1.05em;
    height: 1.05em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 500;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-weight: 700;
    font-size: 0.85rem;
}
.skip-link:focus { top: 16px; }

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 32px);
}

.voxel-world-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    pointer-events: none;
}

/* ==========================================================================
   FLOATING ARCHITECTURAL HOTBAR NAVBAR (DISTINCTIVE & IDENTICAL ON ALL 3 SITES)
   ========================================================================== */
.tb-nav {
    position: fixed;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 120;
    pointer-events: none;
    padding: 0 clamp(12px, 2.5vw, 28px);
}

.tb-nav-inner {
    pointer-events: auto;
    width: min(1180px, 100%);
    height: 62px;
    margin: 0 auto;
    padding: 0 12px 0 14px;
    border-radius: 17px;
    background: var(--nav-bg);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-nav);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    position: relative;
    transition: background 550ms var(--ease), border-color 550ms var(--ease), box-shadow 550ms var(--ease);
}

/* Subtle emerald Minecraft accent notch on top bevel of floating dock */
.tb-nav-inner::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: var(--accent-bright);
    opacity: 0.85;
}

.tb-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    min-width: 0;
    padding: 4px 8px 4px 4px;
    border-radius: 11px;
    transition: background 220ms var(--ease);
}
.tb-brand:hover { background: var(--accent-soft); }

.tb-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #0e1614;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 -2px 0 rgba(34, 197, 94, 0.55);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.tb-brand-mark img { width: 24px; height: 24px; object-fit: contain; display: block; }
.tb-brand-copy { display: grid; line-height: 1.1; }
.tb-brand-title { font-size: 0.96rem; font-weight: 800; letter-spacing: -0.025em; color: var(--ink); white-space: nowrap; }
.tb-brand-sub { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); white-space: nowrap; }

/* Minecraft Hotbar-Inspired Numbered Realm Slots */
.tb-nav-menu { display: flex; align-items: center; justify-content: center; }

.tb-nav-links {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(128, 142, 138, 0.10);
    border: 1px solid var(--line);
}

.tb-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--ink-muted);
    transition: background 280ms var(--ease), color 280ms var(--ease), transform 220ms var(--ease), box-shadow 280ms var(--ease);
    white-space: nowrap;
}

.tb-nav-link .slot-num {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    opacity: 0.55;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(128, 142, 138, 0.14);
}

.tb-nav-link:hover {
    color: var(--ink);
    background: var(--surface);
}

.tb-nav-link.is-active {
    background: var(--btn-bg);
    color: var(--btn-ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14), inset 0 -2px 0 var(--accent-bright);
}

.tb-nav-link.is-active .slot-num {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.16);
}

/* Right Actions: World Time Dial + Live Player Pill */
.tb-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.theme-switcher {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    border-radius: 11px;
    background: rgba(128, 142, 138, 0.12);
    border: 1px solid var(--line);
    width: 104px;
    height: 36px;
    flex-shrink: 0;
}

.theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    height: calc(100% - 6px);
    border-radius: 8px;
    background: var(--btn-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 380ms var(--ease), background 400ms var(--ease);
    pointer-events: none;
}

.theme-btn {
    position: relative;
    z-index: 1;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
    transition: color 300ms var(--ease);
}
.theme-btn.is-active { color: var(--btn-ink); }

.tb-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    cursor: pointer;
    transition: background 240ms var(--ease), border-color 240ms var(--ease), transform 200ms var(--ease);
}
.tb-nav-pill:hover { border-color: var(--accent); transform: translateY(-1px); }

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}
.pulse-dot.checking { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22); }
.pulse-dot.offline { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22); }

.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    place-items: center;
    cursor: pointer;
}
.mobile-toggle .menu-close { display: none; }
.mobile-toggle[aria-expanded="true"] .menu-open-icon { display: none; }
.mobile-toggle[aria-expanded="true"] .menu-close { display: block; }
.nav-mobile-extras { display: none; }

/* ==========================================================================
   BULLETPROOF HORIZONTAL SLIDING JAVA <-> BEDROCK DOCK (GRID-AREA: SLOT!)
   ========================================================================== */
.edition-dock {
    background: var(--surface-strong);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: background 550ms var(--ease), border-color 550ms var(--ease);
}

.edition-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-bottom: 1px solid var(--line);
    background: rgba(128, 140, 136, 0.08);
}

.edition-tab-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50%;
    background: var(--surface-solid);
    box-shadow: inset 0 -2.5px 0 var(--accent);
    transition: transform 420ms var(--ease), background 500ms var(--ease);
    pointer-events: none;
}

.edition-tab {
    position: relative;
    z-index: 1;
    border: 0;
    background: transparent;
    padding: 13px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-muted);
    cursor: pointer;
    transition: color 320ms var(--ease);
}
.edition-tab.is-active, .edition-tab[aria-selected="true"] { color: var(--ink); }

.edition-slider {
    overflow: hidden;
    width: 100%;
    display: grid;
    grid-template-areas: "slot";
}

.edition-slide {
    grid-area: slot;
    width: 100%;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    opacity: 0;
    pointer-events: none;
    transition: transform 440ms var(--ease), opacity 360ms var(--ease);
}

.edition-slide[data-slide-idx="0"] { transform: translateX(-34px); }
.edition-slide[data-slide-idx="1"] { transform: translateX(34px); }

.edition-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.edition-addr { display: grid; gap: 3px; min-width: 0; }
.edition-label { font-family: var(--font-mono); font-size: 0.67rem; font-weight: 600; letter-spacing: 0.09em; color: var(--ink-faint); }
.edition-addr code { font-family: var(--font-mono); font-size: clamp(0.9rem, 1.35vw, 1.06rem); font-weight: 600; color: var(--ink); word-break: break-all; }
.edition-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Shared Tactile Buttons */
.btn-voxel, .btn-solid, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 17px;
    border: 0;
    border-radius: 11px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
    transition: transform 240ms var(--ease), opacity 240ms var(--ease), background 320ms var(--ease);
}
.btn-voxel:hover, .btn-solid:hover, .btn-primary:hover { transform: translateY(-1.5px); opacity: 0.93; }
.btn-voxel.is-copied { background: #22c55e; color: #06180c; }
.btn-voxel:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-voxel-ghost, .btn-outline, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 11px;
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 240ms var(--ease), background 240ms var(--ease), transform 240ms var(--ease);
}
.btn-voxel-ghost:hover, .btn-outline:hover, .btn-secondary:hover { border-color: var(--accent); transform: translateY(-1.5px); }

/* ==========================================================================
   CLEAN THEME-ADAPTIVE FLOATING ARCHITECTURAL FOOTER (IDENTICAL ON ALL 3 SITES)
   Matches the floating Hotbar Navbar & automatically follows Day / Sunset / Night!
   ========================================================================== */
.tb-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 36px 0 28px;
    color: var(--ink);
}

.tb-footer-shell {
    position: relative;
    background: var(--surface-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    padding: clamp(26px, 3.5vw, 36px) clamp(22px, 3.5vw, 36px) 22px;
    box-shadow: var(--shadow-soft);
    transition: background 500ms var(--ease), border-color 500ms var(--ease), color 500ms var(--ease);
}

/* Matching subtle accent bevel notch paired with the Floating Navbar */
.tb-footer-shell::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 84px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: var(--accent);
    opacity: 0.85;
}

.tb-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 1fr));
    gap: clamp(22px, 3.5vw, 40px);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.tb-footer-brand { display: grid; gap: 12px; align-content: start; }
.tb-footer-logo { display: inline-flex; align-items: center; gap: 10px; }
.tb-footer-logo img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #101614;
    padding: 4px;
    border: 1px solid var(--line);
}
.tb-footer-logo strong { display: block; font-size: 0.98rem; font-weight: 800; letter-spacing: -0.025em; color: var(--ink); }
.tb-footer-logo span { display: block; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); }
.tb-footer-desc { font-size: 0.84rem; color: var(--ink-muted); line-height: 1.6; max-width: 36ch; }

.tb-footer-ip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 6px 5px 12px;
    border-radius: 10px;
    background: var(--surface-sub);
    border: 1px solid var(--line);
    width: fit-content;
    max-width: 100%;
}
.tb-footer-ip code { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; color: var(--ink); }

.tb-footer-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 7px;
    border: 0;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.tb-footer-copy:hover { opacity: 0.9; transform: translateY(-1px); }

.tb-footer-col-title {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 12px;
}

.tb-footer-links { list-style: none; display: grid; gap: 9px; font-size: 0.84rem; }
.tb-footer-links a, .tb-footer-links button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--ink-muted);
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: color 200ms var(--ease), transform 200ms var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tb-footer-links a:hover, .tb-footer-links button:hover { color: var(--accent); transform: translateX(3px); }

.tb-footer-bottom {
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.74rem;
    color: var(--ink-faint);
}

.tb-footer-badges { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.68rem; }

.tb-footer-badge {
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--surface-sub);
    border: 1px solid var(--line);
    color: var(--ink-muted);
}

.tb-footer-theme-btn {
    cursor: pointer;
    color: var(--ink);
    font-weight: 600;
    transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.tb-footer-theme-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Toast Notification */
.toast-box, .social-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(16px);
    z-index: 450;
    padding: 12px 18px;
    border-radius: 10px;
    background: #0f1715;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}
.toast-box.show, .toast-box:not(:empty), .social-toast:not(:empty) { opacity: 1; transform: translateX(-50%) translateY(0); }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   RESPONSIVE SHELL
   ========================================================================== */
@media (max-width: 960px) {
    .tb-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    /* Eliminate expensive mobile GPU backdrop-blur compositing over live WebGL! */
    .tb-nav-inner, .edition-dock, .tb-footer-shell {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    :root[data-theme="day"] {
        --surface: rgba(255, 255, 255, 0.94);
        --surface-strong: rgba(255, 255, 255, 0.97);
        --nav-bg: rgba(255, 255, 255, 0.96);
    }
    :root[data-theme="sunset"] {
        --surface: rgba(255, 249, 242, 0.94);
        --surface-strong: rgba(255, 251, 246, 0.97);
        --nav-bg: rgba(255, 249, 242, 0.96);
    }
    :root[data-theme="night"] {
        --surface: rgba(20, 23, 29, 0.94);
        --surface-strong: rgba(18, 21, 27, 0.97);
        --nav-bg: rgba(18, 21, 27, 0.96);
    }

    .tb-nav { top: 10px; }
    .tb-nav-inner { grid-template-columns: minmax(0, 1fr) auto; height: 56px; border-radius: 14px; }

    .tb-nav-menu {
        position: fixed;
        inset: 74px 12px auto 12px;
        border-radius: 16px;
        border: 1px solid var(--line-strong);
        background: var(--surface-solid);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
        padding: 18px;
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms var(--ease), transform 220ms var(--ease);
    }
    .tb-nav-menu.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .tb-nav-links { flex-direction: column; align-items: stretch; background: transparent; border: 0; padding: 0; gap: 6px; }
    .tb-nav-link { font-size: 0.98rem; padding: 11px 14px; }
    .nav-mobile-extras { display: grid; gap: 10px; }
    .tb-nav-pill .pill-text { display: none; }
    .tb-nav-pill { padding: 0 9px; }
    .mobile-toggle { display: grid; }
}

@media (max-width: 600px) {
    .tb-nav-inner { padding: 0 10px; gap: 6px; }
    .tb-brand { gap: 7px; padding: 2px 4px 2px 2px; }
    .tb-brand-mark { width: 32px; height: 32px; border-radius: 9px; }
    .tb-brand-mark img { width: 20px; height: 20px; }
    .tb-brand-title { font-size: 0.86rem; }
    .tb-brand-sub { display: none; }
    .tb-nav-actions { gap: 6px; }
    .theme-switcher { width: 84px; height: 34px; }
    .mobile-toggle { width: 34px; height: 34px; }

    .edition-slide { flex-direction: column; align-items: stretch; padding: 14px 15px; gap: 12px; }
    .edition-actions { display: grid; grid-template-columns: 1fr; }
    .edition-actions:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; }

    .tb-footer { padding: 22px 0 22px; }
    .tb-footer-shell { border-radius: 16px; padding: 22px 18px 18px; }
    .tb-footer-ip { width: 100%; }
    .tb-footer-ip code { font-size: 0.72rem; word-break: break-all; }
    .tb-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; padding-bottom: 18px; }
    .tb-footer-brand { grid-column: 1 / -1; }
    .tb-footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 14px; }
}

@media (max-width: 440px) {
    .tb-nav-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
