
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #08080a;
    --bg-elevated: #0e0e11;
    --surface: #141417;
    --surface-2: #1b1b20;
    --border: #26262c;
    --border-strong: #38383f;

    --text: #f4f4f6;
    --text-muted: #8d8d96;
    --text-faint: #55555c;

    --ember: #ff9d4d;
    --ember-strong: #ffb46e;
    --ember-soft: rgba(255, 157, 77, 0.14);
    --ember-glow: rgba(255, 157, 77, 0.35);

    --online: #5fd97a;
    --offline: #e15b5b;

    --font-display: 'Unbounded', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 8px;

    --ease: cubic-bezier(.16,.8,.24,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--ember); color: #100a04; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

img { -webkit-user-drag: none; user-drag: none; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--ember);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 14px;
}
.eyebrow .blink {
    display: inline-block;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes fadeUp { 0% { opacity: 0; transform: translateY(28px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes emberDrift {
    0%   { transform: translate3d(0,0,0) scale(1); opacity: 0; }
    10%  { opacity: 0.9; }
    100% { transform: translate3d(var(--dx), var(--dy), 0) scale(0.3); opacity: 0; }
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(95, 217, 122, 0.45); }
    70% { box-shadow: 0 0 0 9px rgba(95, 217, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(95, 217, 122, 0); }
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.active { opacity: 1; transform: translateY(0); }

header {
    position: fixed;
    top: 0; width: 100%;
    background: rgba(8, 8, 10, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
}
.logo-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-text img { width: 30px; height: 30px; border-radius: 8px; }
.logo-text .blink { color: var(--ember); font-weight: 400; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.sound-toggle {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
    flex-shrink: 0;
}
.sound-toggle svg { width: 16px; height: 16px; }
.sound-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.sound-toggle .icon-off { display: none; }
.sound-toggle[aria-pressed="true"] .icon-on { display: none; }
.sound-toggle[aria-pressed="true"] .icon-off { display: block; }
.sound-toggle:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px 6px 10px;
    border-radius: 30px;
    white-space: nowrap;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
    flex-shrink: 0;
}
.status-dot.online { background: var(--online); animation: pulseDot 2s infinite; }
.status-dot.offline { background: var(--offline); }

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 140px 20px 80px;
    position: relative;
    overflow: hidden;
}
#emberCanvas {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}
.hero > .hero-glow {
    position: absolute;
    width: 700px; height: 700px;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, var(--ember-soft) 0%, transparent 65%);
    border-radius: 50%;
    z-index: 0;
    animation: float 9s ease-in-out infinite;
}
.hero > * { position: relative; z-index: 1; }

.hero-kicker {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 26px;
    min-height: 1.4em;
}
.hero-kicker .cursor-caret {
    display: inline-block;
    width: 8px; height: 1em;
    background: var(--ember);
    margin-left: 2px;
    vertical-align: -2px;
    animation: blink 1s steps(1) infinite;
}

.hero img.logo {
    width: 108px; height: 108px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    margin-bottom: 32px;
    animation: fadeUp 1s var(--ease), float 5s ease-in-out infinite;
    object-fit: cover;
    box-shadow: 0 0 60px -12px var(--ember-glow);
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 5.2rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 18px;
    animation: fadeUp 1.1s var(--ease);
    color: #fff;
    letter-spacing: -0.01em;
}
.hero h1 .caret-static {
    color: var(--ember);
    font-weight: 400;
}
.hero p.slogan {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    max-width: 560px;
    animation: fadeUp 1.25s var(--ease);
}
.hero p.subtext {
    font-size: 1rem;
    color: var(--text-faint);
    margin-bottom: 42px;
    max-width: 480px;
    animation: fadeUp 1.35s var(--ease);
}

.btn-group { display: flex; gap: 14px; animation: fadeUp 1.5s var(--ease); flex-wrap: wrap; justify-content: center; }
.btn {
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-body);
    border: 1px solid transparent;
}
.btn-primary {
    background-color: var(--ember);
    color: #140b03;
}
.btn-primary .ip-text { font-family: var(--font-mono); font-weight: 600; }
.btn-primary:hover { transform: translateY(-3px); background-color: var(--ember-strong); box-shadow: 0 10px 30px -10px var(--ember-glow); }
.btn-secondary {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background-color: var(--surface-2); border-color: var(--border-strong); transform: translateY(-3px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.hero-status-line {
    margin-top: 30px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-faint);
    animation: fadeUp 1.6s var(--ease);
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-cue {
    position: absolute;
    bottom: 34px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    animation: fadeUp 2s var(--ease);
}
.scroll-cue .line { width: 1px; height: 26px; background: linear-gradient(var(--border-strong), transparent); animation: float 2.4s ease-in-out infinite; }

section.content-section { max-width: 1040px; margin: 130px auto; padding: 0 24px; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-title { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; color: #fff; }
.section-lede { color: var(--text-muted); max-width: 560px; margin: 14px auto 0; font-size: 1.02rem; }
.section-head.left { text-align: left; }
.section-head.left .section-lede { margin-left: 0; }

.about-box {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
    padding: 42px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    font-size: 1.08rem;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}
.about-box::before {
    content: "";
    position: absolute;
    top: -40%; right: -10%;
    width: 260px; height: 260px;
    background: radial-gradient(circle, var(--ember-soft), transparent 70%);
    border-radius: 50%;
}
.about-box strong { color: var(--text); }
.about-box p { position: relative; z-index: 1; }

.grid-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 22px; }
.card {
    background: var(--surface);
    padding: 34px 26px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.card:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.card .icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--ember-soft);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    color: var(--ember);
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; font-weight: 700; color: var(--text); }
.card p { color: var(--text-muted); font-size: 0.94rem; }
.card.disabled { cursor: default; }
.card.disabled .icon { background: var(--surface-2); color: var(--text-faint); }
.card.disabled h3, .card.disabled p { color: var(--text-faint); }
.card.card-stage-ready {
    border-color: var(--ember);
    animation: stage-ready-pulse 1.8s ease-in-out infinite;
}
@keyframes stage-ready-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 157, 77, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(255, 157, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .card.card-stage-ready { animation: none; }
}
.badge {
    position: absolute;
    top: 18px; right: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-faint);
}
[data-rules-count] { color: var(--ember); border-color: rgba(255, 157, 77, 0.3); background: var(--ember-soft); }
[data-rules-count]:empty { display: none; }
.card-plain-link { text-decoration: none; color: inherit; }
.eyebrow-centered { justify-content: center; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 22px;
    text-align: center;
    transition: transform 0.3s var(--ease), border-color 0.3s;
    position: relative;
}
.team-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.team-avatar-wrap {
    width: 84px; height: 84px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.team-avatar { width: 100%; height: 100%; image-rendering: pixelated; }
.team-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.team-role { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.team-bio { font-size: 0.85rem; color: var(--text-faint); line-height: 1.55; margin-top: 10px; }
.team-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.team-tags span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 20px;
    color: var(--text-muted);
}
.team-skel { width: 100%; height: 100%; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.cta-band {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 56px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-band::after {
    content: "";
    position: absolute;
    bottom: -30%; left: 50%;
    transform: translateX(-50%);
    width: 400px; height: 220px;
    background: radial-gradient(ellipse, var(--ember-soft), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 12px; color: #fff; }
.cta-band p { color: var(--text-muted); margin-bottom: 30px; }
.cta-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -8px 0 30px; }
.chip {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 30px;
    color: var(--text-muted);
    white-space: nowrap;
}
.cta-footnote { margin-top: 26px !important; margin-bottom: 0 !important; font-size: 0.85rem; color: var(--text-faint) !important; }

.subhead-row { margin: 52px 0 8px; }
.subhead { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text); }
.subhead-note { color: var(--text-muted); font-size: 0.92rem; margin-top: 6px; }
.grid-blocks-6 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature-card { cursor: default; }
.feature-card:hover { transform: translateY(-5px) !important; }

.modal-sub { color: var(--text-faint); font-size: 0.9rem; font-family: var(--font-mono); }
.rules-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--surface-2);
    z-index: 2;
}
.rules-jump a {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.rules-jump a:hover { color: var(--ember); border-color: rgba(255, 157, 77, 0.4); }
.rules-list { margin-top: 24px; list-style: none; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.rules-list li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--surface-2);
}
.rules-list li:last-child { border-bottom: none; }
.rules-list .num {
    font-family: var(--font-mono);
    color: var(--ember);
    font-weight: 600;
    flex-shrink: 0;
    width: 38px;
    font-size: 0.9rem;
}
.rules-list strong { color: var(--text); display: block; margin-bottom: 3px; }
.rule-penalty {
    display: block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--offline);
    opacity: 0.9;
}
.rules-divider {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--ember);
    padding: 22px 0 2px !important;
    border-bottom: none !important;
}
.rules-divider:first-child { padding-top: 4px !important; }

.rules-note { padding: 0 !important; border-bottom: none !important; }
.rules-note-block {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin: 4px 0 6px;
}
.rules-note-title {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 10px;
}
.rules-note-title:not(:first-child) { margin-top: 16px; }
.rules-terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px 16px;
}
.rules-terms-grid span { font-size: 0.86rem; color: var(--text-muted); }
.rules-terms-grid b { color: var(--text); }
.rules-terms-grid code {
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 5px;
    color: var(--ember);
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    bottom: -100px; left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text);
    padding: 14px 26px;
    border-radius: 50px;
    border: 1px solid var(--border);
    transition: bottom 0.45s cubic-bezier(.34,1.56,.64,1);
    z-index: 3000;
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5);
}
.toast.show { bottom: 34px; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); flex-shrink: 0; }
.toast .msg-wrap { display: flex; flex-direction: column; text-align: left; }
.toast .sub:empty { display: none; }

footer {
    background: var(--bg-elevated);
    padding: 44px 24px 30px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}
.footer-logo { font-family: var(--font-display); font-weight: 800; color: var(--text); margin-bottom: 10px; font-size: 1.05rem; }
.footer-logo .blink { color: var(--ember); }
footer .disclaimer { font-size: 0.8rem; margin-top: 12px; color: var(--text-faint); }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--ember); }

@media (max-width: 640px) {
    .hero { padding-top: 120px; }
    section.content-section { margin: 90px auto; }
    .cta-band { padding: 40px 24px; }
    .status-pill span.ptext { display: none; }
}

.page { display: none; }
.page.active { display: block; }

.tab-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    gap: 4px;
    background: rgba(14, 14, 17, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55);
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.25s, background 0.25s;
    white-space: nowrap;
}
.tab-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--ember); color: #100a04; }
.tab-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

footer { padding-bottom: 118px; }

@media (max-width: 640px) {
    .tab-bar {
        bottom: 12px;
        width: calc(100% - 24px);
        justify-content: space-between;
    }
    .tab-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: 12px 4px;
        font-size: 0.72rem;
    }
    .tab-btn svg { width: 19px; height: 19px; }

    .tab-btn span {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

.rules-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px clamp(20px, 4vw, 40px);
}
.rules-jump {
    position: sticky;
    top: 74px;
    background: var(--bg-elevated);
    padding: 12px 0 14px;
    margin: -4px 0 4px;
}
.rules-divider { scroll-margin-top: 130px; }

.loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.loader::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--ember-soft), transparent 60%);
    opacity: 0.6;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { position: relative; text-align: center; width: 260px; }
.loader-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 22px;
}
.loader-logo .blink { color: var(--ember); }
.loader-bar {
    width: 100%; height: 4px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.loader-fill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--ember), var(--ember-strong));
    border-radius: 4px;
    transition: width 0.25s var(--ease);
}
.loader-text {
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}

.mc-block-stage {
    width: 168px; height: 168px;
    margin: 0 auto 14px;
    perspective: 700px;
    cursor: grab;
    touch-action: none;
    animation: fadeUp 1s var(--ease);
}
.mc-block-stage:active { cursor: grabbing; }
.mc-block-stage:focus-visible { outline: 2px solid var(--ember); outline-offset: 6px; border-radius: 12px; }

.mc-block {
    position: relative;
    width: 84px; height: 84px;
    margin: 42px auto;
    transform-style: preserve-3d;
    --block-rx: -20deg;
    --block-ry: 35deg;
    transform: rotateX(var(--block-rx)) rotateY(var(--block-ry));
    transition: transform 0.6s cubic-bezier(.2,.9,.3,1.2);
}
.mc-block.no-transition { transition: none; }
.mc-block.mining { animation: blockPunch 0.25s ease; }

@keyframes blockPunch {
    0% { transform: rotateX(var(--block-rx)) rotateY(var(--block-ry)) scale(1); }
    30% { transform: rotateX(var(--block-rx)) rotateY(var(--block-ry)) scale(0.86) translateY(4px); }
    60% { transform: rotateX(var(--block-rx)) rotateY(var(--block-ry)) scale(0.92); }
    100% { transform: rotateX(var(--block-rx)) rotateY(var(--block-ry)) scale(1); }
}

.mc-face {
    position: absolute;
    width: 84px; height: 84px;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.28);
    image-rendering: pixelated;
    background-size: cover;
    background-repeat: no-repeat;
}

.mc-face-top {
    transform: rotateX(90deg) translateZ(42px);
    background-color: #6cad3f;
    background-image: url(../data/blocks/grass_block_top.png);
    background-blend-mode: multiply;
    filter: drop-shadow(0 0 18px var(--ember-glow));
}
.mc-face-bottom {
    transform: rotateX(-90deg) translateZ(42px);
    background-image: url(../data/blocks/dirt.png);
    filter: brightness(0.7);
}
.mc-face-front {
    transform: translateZ(42px);
    background-image: url(../data/blocks/grass_block_side.png);
}
.mc-face-back {
    transform: rotateY(180deg) translateZ(42px);
    background-image: url(../data/blocks/grass_block_side.png);
    filter: brightness(0.78);
}
.mc-face-right {
    transform: rotateY(90deg) translateZ(42px);
    background-image: url(../data/blocks/grass_block_side.png);
    filter: brightness(0.85);
}
.mc-face-left {
    transform: rotateY(-90deg) translateZ(42px);
    background-image: url(../data/blocks/grass_block_side.png);
    filter: brightness(0.68);
}

.mc-debris {
    position: absolute;
    left: 50%; top: 50%;
    width: 10px; height: 10px;
    background: repeating-conic-gradient(#8a5c34 0% 25%, #7c4f2b 0% 50%) 0 0 / 6px 6px;
    pointer-events: none;
    animation: debrisFly 0.55s ease-out forwards;
}
@keyframes debrisFly {
    0% { transform: translate(-50%, -50%) translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3); opacity: 0; }
}

.mc-block-hint {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    animation: fadeUp 1.1s var(--ease);
}
.mc-stage-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--ember);
    min-height: 1em;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.mc-stage-label.show { opacity: 1; transform: translateY(0); }

.grid-blocks, .team-grid { perspective: 1000px; }
.grid-blocks-6 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.card, .team-card { transform-style: preserve-3d; will-change: transform; }
.btn { will-change: transform; }

@media (max-width: 640px) {
    .grid-blocks-6 { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
}

.toast .title { font-weight: 700; }
.toast .sub { display: block; font-weight: 400; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 640px) {
    .nav-right .sound-toggle { display: none; }
    .mc-block-stage { width: 140px; height: 140px; }
    .mc-block { width: 68px; height: 68px; margin: 36px auto; }
    .mc-face { width: 68px; height: 68px; }
    .mc-face-top { transform: rotateX(90deg) translateZ(34px); }
    .mc-face-bottom { transform: rotateX(-90deg) translateZ(34px); }
    .mc-face-front { transform: translateZ(34px); }
    .mc-face-back { transform: rotateY(180deg) translateZ(34px); }
    .mc-face-right { transform: rotateY(90deg) translateZ(34px); }
    .mc-face-left { transform: rotateY(-90deg) translateZ(34px); }
}

body.day-mode {
    --bg: #eef1f5;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #e7ebf1;
    --border: #d7dce3;
    --border-strong: #c2c9d3;
    --text: #171a20;
    --text-muted: #52586a;
    --text-faint: #8b8f9c;
    transition: background-color 0.6s ease, color 0.6s ease;
}
body.day-mode header { background: rgba(255, 255, 255, 0.78); }
body.day-mode .loader { background: var(--bg); }
body.day-mode .mc-face-top { filter: none; }
body.day-mode ::selection { background: var(--ember); color: #fff; }
body.day-mode .hero-glow { opacity: 0.35; }

body.cheat-mode .mc-face { animation: rainbowFace 2.4s linear infinite; }
@keyframes rainbowFace { 0% { filter: hue-rotate(0deg) brightness(1.15); } 100% { filter: hue-rotate(360deg) brightness(1.15); } }
body.cheat-mode-flash { animation: cheatFlash 0.6s ease; }
@keyframes cheatFlash {
    0% { background-color: var(--bg); }
    30% { background-color: #2a2410; }
    100% { background-color: var(--bg); }
}

.logo-text { position: relative; user-select: none; }

.ember-spark {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ember) 0%, rgba(255,157,77,0) 70%);
    z-index: 9999;
    animation: emberSparkFade 0.75s ease-out forwards;
}
@keyframes emberSparkFade {
    0% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(-18px) scale(0.3); }
}
@media (prefers-reduced-motion: reduce) {
    body.cheat-mode .mc-face { animation: none; }
    .ember-spark { display: none; }
}

.nav-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ember);
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px var(--ember-glow);
    animation: navDotPulse 2s ease-in-out infinite;
}
@keyframes navDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.news-lede { color: var(--text-muted); max-width: 620px; margin-top: -8px; margin-bottom: 28px; }

.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.news-filter {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.news-filter:hover { color: var(--text); border-color: var(--border-strong); }
.news-filter.active { color: #fff; background: var(--ember); border-color: var(--ember); }

.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 20px;
    transition: border-color 0.25s, transform 0.25s;
}
.news-card:hover { border-color: var(--border-strong); }
.news-card.news-hidden { display: none; }
.news-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    white-space: nowrap;
    padding-top: 3px;
}
.news-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.news-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
}
.news-tag-update { color: #7bc95a; background: rgba(123, 201, 90, 0.12); border-color: rgba(123, 201, 90, 0.3); }
.news-tag-event { color: #f5c542; background: rgba(245, 197, 66, 0.12); border-color: rgba(245, 197, 66, 0.3); }
.news-tag-fix { color: #5fa8f5; background: rgba(95, 168, 245, 0.12); border-color: rgba(95, 168, 245, 0.3); }
.news-tag-announce { color: var(--ember); background: var(--ember-soft); border-color: rgba(255, 157, 77, 0.3); }
.news-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); margin: 0; }
.news-body {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card.expanded .news-body { -webkit-line-clamp: unset; overflow: visible; }
.news-expand {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ember);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.news-expand:hover { text-decoration: underline; }
.news-empty { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.85rem; padding: 20px 0; }

@media (max-width: 640px) {
    .news-card { grid-template-columns: 1fr; gap: 8px; }
    .news-date { padding-top: 0; }
}

.mc-block.block-type-dirt .mc-face {
    background-image: url(../data/blocks/dirt.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: none;
}
.mc-block.block-type-stone .mc-face {
    background-image: url(../data/blocks/stone.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: none;
}
.mc-block.block-type-coal .mc-face {
    background-image: url(../data/blocks/coal_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: none;
}
.mc-block.block-type-copper .mc-face {
    background-image: url(../data/blocks/copper_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: none;
}
.mc-block.block-type-iron .mc-face {
    background-image: url(../data/blocks/iron_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: none;
}
.mc-block.block-type-redstone .mc-face {
    background-image: url(../data/blocks/redstone_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: drop-shadow(0 0 12px rgba(233, 62, 51, 0.5));
}
.mc-block.block-type-gold .mc-face {
    background-image: url(../data/blocks/gold_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: drop-shadow(0 0 14px rgba(247, 201, 72, 0.5));
}
.mc-block.block-type-emerald .mc-face {
    background-image: url(../data/blocks/emerald_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: drop-shadow(0 0 14px rgba(61, 220, 132, 0.5));
}
.mc-block.block-type-diamond .mc-face {
    background-image: url(../data/blocks/diamond_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    filter: drop-shadow(0 0 16px rgba(107, 233, 224, 0.55));
}
.mc-block.block-type-legend .mc-face {
    background-image: url(../data/blocks/netherite_block.png);
    background-color: transparent;
    background-blend-mode: normal;
    animation: legendShimmer 3s ease-in-out infinite;
}
@keyframes legendShimmer {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(245, 197, 66, 0.55)) drop-shadow(0 0 10px rgba(180, 107, 233, 0.35)); }
    50% { filter: drop-shadow(0 0 22px rgba(245, 197, 66, 0.8)) drop-shadow(0 0 16px rgba(180, 107, 233, 0.55)); }
}
@media (prefers-reduced-motion: reduce) {
    .mc-block.block-type-legend .mc-face { animation: none; }
}

.mc-block.block-type-mythic .mc-face {
    background-image: url(../data/blocks/netherite_block.png), url(../data/blocks/enchanted_glint_item.png);
    background-size: cover, 64px 64px;
    background-repeat: no-repeat, repeat;
    background-position: center center, 0 0;
    background-blend-mode: normal, screen;
    background-color: transparent;
    animation: mythicGlint 2.6s linear infinite, mythicGlow 3s ease-in-out infinite;
}
@keyframes mythicGlint {
    0% { background-position: center center, 0 0; }
    100% { background-position: center center, 64px 64px; }
}
@keyframes mythicGlow {
    0%, 100% { filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.6)) drop-shadow(0 0 10px rgba(96, 40, 180, 0.4)); }
    50% { filter: drop-shadow(0 0 26px rgba(200, 120, 255, 0.85)) drop-shadow(0 0 16px rgba(140, 60, 220, 0.6)); }
}
@media (prefers-reduced-motion: reduce) {
    .mc-block.block-type-mythic .mc-face { animation: none; }
}

.hero-compact { min-height: 56vh; padding-top: 150px; }

.stat-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    animation: fadeUp 1.5s var(--ease);
}
.stat-chip {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 30px;
    color: var(--text-muted);
    white-space: nowrap;
}
.stat-chip b { color: var(--ember); font-weight: 600; }

.book-controls { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.search-box {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--border-strong); }
.search-box svg { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 13px 0;
}
.search-box input::placeholder { color: var(--text-faint); }

.sort-box select {
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 13px 38px 13px 16px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d8d96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.sort-box select:focus { border-color: var(--border-strong); }
.sort-box select option { background: var(--surface); color: var(--text); }

.results-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    margin-bottom: 18px;
}

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.recipe-skel-grid { display: contents; }
.recipe-skel {
    height: 340px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border: 1px solid var(--border);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.recipe-empty, .recipe-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.recipe-error { color: var(--offline); }

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.recipe-card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.recipe-color-bar { height: 5px; width: 100%; flex-shrink: 0; }

.recipe-body { padding: 24px 22px 22px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.recipe-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.recipe-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.recipe-base-name { font-size: 0.78rem; color: var(--text-faint); margin-top: 3px; }
.recipe-tag {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface-2);
    white-space: nowrap;
}

.recipe-lore {
    font-style: italic;
    font-size: 0.86rem;
    color: var(--text-muted);
    border-left: 2px solid var(--ember);
    padding-left: 10px;
}

.gh-wiki {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}
.gh-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.gh-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.gh-sidebar-head svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-faint); }
.gh-page-count {
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.7rem;
    color: var(--text-faint);
    text-transform: none;
    letter-spacing: 0;
}
.gh-page-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px;
    max-height: 480px;
    overflow-y: auto;
}
.gh-page-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gh-page-link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-page-link:hover { background: var(--surface-2); color: var(--text); }
.gh-page-link.active {
    background: var(--ember-soft);
    border-color: rgba(255, 157, 77, 0.35);
    color: var(--ember-strong);
    font-weight: 600;
}
.gh-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.gh-sidebar-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.gh-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 420px;
    overflow: hidden;
}
.gh-content-head {
    padding: 20px 26px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gh-breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-faint);
}
.gh-content-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.gh-content-meta { display: flex; align-items: center; gap: 10px; }
.gh-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gh-content-body {
    padding: 26px 28px 34px;
    font-size: 0.96rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.gh-content-body code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--ember-strong);
}
.gh-empty-state {
    padding: 70px 20px;
    text-align: center;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.gh-empty-state svg { width: 34px; height: 34px; margin-bottom: 14px; opacity: 0.5; }

@media (max-width: 860px) {
    .gh-wiki { grid-template-columns: 1fr; }
    .gh-sidebar { position: static; }
    .gh-page-list { max-height: 280px; }
}

.recipe-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recipe-stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.recipe-stat b { color: var(--text); font-weight: 600; font-family: var(--font-mono); }
.recipe-diff-dots { font-family: var(--font-mono); letter-spacing: 1px; color: var(--ember); }
.recipe-diff-dots span.off { color: var(--border-strong); }

.recipe-ingredients {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.recipe-ingredients h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 10px;
    font-weight: 500;
}
.recipe-ing-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.recipe-ing-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; color: var(--text-muted); }
.recipe-ing-list li b { color: var(--ember); font-family: var(--font-mono); font-weight: 600; }

.recipe-effects { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-effect {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    background: var(--ember-soft);
    border: 1px solid rgba(255, 157, 77, 0.3);
    color: var(--ember);
    padding: 3px 8px;
    border-radius: 20px;
}

@media (max-width: 640px) {
    .recipe-grid { grid-template-columns: 1fr; }
    .book-controls { flex-direction: column; }
}

.clicker-player-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ember);
    background: var(--ember-soft);
    border: 1px solid rgba(255, 157, 77, 0.3);
    border-radius: 20px;
    padding: 5px 13px;
    margin: 2px 0 10px;
}

.leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 620px;
}
.leaderboard-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: border-color 0.2s, background 0.2s;
}
.leaderboard-row:hover { border-color: var(--border-strong); }
.leaderboard-row.is-you { border-color: var(--ember); background: var(--ember-soft); }
.lb-rank { font-family: var(--font-mono); font-weight: 700; color: var(--text-faint); font-size: 0.9rem; }
.leaderboard-row:nth-child(1) .lb-rank { color: #f7c948; }
.leaderboard-row:nth-child(2) .lb-rank { color: #c9c9d1; }
.leaderboard-row:nth-child(3) .lb-rank { color: #cd8a4f; }
.lb-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-you-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--ember);
    color: #140b03;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}
.lb-count { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.84rem; white-space: nowrap; }

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 4, 6, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.show { opacity: 1; }
.modal-box {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    text-align: center;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.3s var(--ease);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-icon {
    width: 50px; height: 50px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--ember-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ember);
}
.modal-icon svg { width: 22px; height: 22px; }
.modal-box h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 10px; color: var(--text); }
.modal-lede { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 22px; line-height: 1.55; }
.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-form input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}
.modal-form input:focus { border-color: var(--ember); }
.modal-error {
    min-height: 16px;
    font-size: 0.76rem;
    color: var(--offline);
    font-family: var(--font-mono);
}
.modal-form .btn { width: 100%; justify-content: center; margin-top: 4px; }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .leaderboard-row { grid-template-columns: 26px 1fr auto; padding: 10px 12px; }
    .lb-name { font-size: 0.86rem; }
}

.lb-sync-note {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-faint);
    margin-top: 6px;
}
.leaderboard-row.leaderboard-empty {
    justify-content: center;
    text-align: center;
}
.leaderboard-row.leaderboard-empty .lb-rank,
.leaderboard-row.leaderboard-empty .lb-name,
.leaderboard-row.leaderboard-empty .lb-count {
    color: var(--text-faint);
    font-family: var(--font-mono);
}
