/* TailFiber game styles. The game moved from the homepage to
   builds.html in the redesign, and its CSS moved with it — the
   homepage stylesheet no longer carries any .tf-* rules. */

/* ============================================================
           TAILFIBER MINI-GAME
        ============================================================ */
        /* The game is focusable (tabindex=0) because its key handlers are gated
           on focus — so that focus has to be visible, or a keyboard player
           cannot tell when the arrows will reach the game. */
        .tf-wrap:focus-visible {
            outline: 3px solid var(--gold);
            outline-offset: 3px;
        }

.tf-wrap {
            position: relative;
            width: 100%;
            min-height: 460px;
            aspect-ratio: 16 / 11;
            background: radial-gradient(120% 80% at 50% 30%, #0e1c14 0%, #060b08 80%);
            border: 1px solid var(--border-strong);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(244, 196, 48, 0.05);
            user-select: none;
            -webkit-user-select: none;
            touch-action: none;
            transition: border-color .2s ease;
        }

/* Fullscreen takeover */
        .tf-wrap.tf-fullscreen {
            position: fixed !important;
            inset: 0 !important;
            width: 100% !important;
            height: 100dvh !important;
            max-width: none !important;
            aspect-ratio: auto !important;
            border-radius: 0;
            border-color: var(--gold);
            z-index: 9999;
        }

.tf-wrap.tf-fullscreen .tf-hud { padding: 1.2rem 1.5rem; }

.tf-wrap.tf-fullscreen .tf-stat { min-width: 80px; padding: 0.5rem 0.8rem; }

.tf-wrap.tf-fullscreen .tf-stat-val { font-size: 1.3rem; }

.tf-wrap.tf-fullscreen .tf-fiber-btn { padding: 0.6rem 1rem; font-size: 0.9rem; }

.tf-wrap.tf-fullscreen .tf-overlay-card { max-width: 540px; padding: 2rem; }

.tf-wrap.tf-fullscreen .tf-overlay-title { font-size: 2.4rem; }

body.tf-locked { overflow: hidden; }

.tf-canvas {
            position: absolute;
            inset: 0;
            width: 100%; height: 100%;
            display: block;
        }

.tf-hud {
            position: absolute;
            inset: 0;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 0.6rem 0.7rem;
            font-family: var(--font-mono);
            z-index: 2;
        }

.tf-hud-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 0.5rem;
        }

.tf-stat {
            display: flex;
            flex-direction: column;
            background: rgba(10, 8, 2, 0.65);
            backdrop-filter: blur(6px);
            padding: 0.35rem 0.6rem;
            border-radius: 6px;
            border: 1px solid rgba(244, 196, 48, 0.12);
            min-width: 56px;
        }

.tf-stat-label {
            font-size: 0.56rem;
            letter-spacing: 0.16em;
            color: var(--ink-3);
            line-height: 1;
        }

.tf-stat-val {
            font-size: 1.05rem;
            color: var(--gold);
            font-weight: 700;
            line-height: 1.1;
            margin-top: 0.15rem;
        }

.tf-hp-wrap {
            position: absolute;
            left: 0.7rem; right: 0.7rem;
            top: 4.0rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

.tf-hp-bar {
            flex: 1;
            height: 6px;
            background: rgba(10, 8, 2, 0.7);
            border: 1px solid rgba(244, 196, 48, 0.16);
            border-radius: 3px;
            overflow: hidden;
        }

.tf-hp-fill {
            height: 100%;
            width: 100%;
            background: linear-gradient(90deg, var(--green), var(--gold));
            transition: width .2s ease, background .25s ease;
        }

.tf-hp-fill.low { background: linear-gradient(90deg, var(--red), var(--gold)); }

.tf-hp-fill.critical { background: var(--red); animation: pulse 0.7s ease-in-out infinite; }

.tf-hp-label {
            font-size: 0.56rem;
            letter-spacing: 0.16em;
            color: var(--ink-3);
        }

.tf-fiber-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.35rem;
            pointer-events: auto;
        }

.tf-fiber-label {
            font-size: 0.56rem;
            letter-spacing: 0.16em;
            color: var(--ink-3);
        }

.tf-fiber-options {
            display: flex;
            gap: 0.3rem;
        }

.tf-fiber-btn {
            font-family: var(--font-mono);
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            background: rgba(10, 8, 2, 0.7);
            color: var(--ink-2);
            border: 1.5px solid transparent;
            padding: 0.45rem 0.7rem;
            min-height: 26px;
            border-radius: 6px;
            cursor: pointer;
            transition: all .15s ease;
        }

.tf-fiber-btn[data-fiber="lps"]  { color: #f4c430; border-color: rgba(244, 196, 48, 0.30); }

.tf-fiber-btn[data-fiber="ompc"] { color: #4cc97d; border-color: rgba(76, 201, 125, 0.30); }

.tf-fiber-btn[data-fiber="lamb"] { color: #ff6b8a; border-color: rgba(255, 107, 138, 0.30); }

.tf-fiber-btn[data-fiber="pili"] { color: #4cb8ff; border-color: rgba(76, 184, 255, 0.30); }

.tf-fiber-btn[data-fiber="nfra"] { color: #c084fc; border-color: rgba(192, 132, 252, 0.30); }

.tf-fiber-btn.active[data-fiber="lps"]  { background: rgba(244, 196, 48, 0.18); border-color: #f4c430; box-shadow: 0 0 12px rgba(244, 196, 48, 0.4); }

.tf-fiber-btn.active[data-fiber="ompc"] { background: rgba(76, 201, 125, 0.18); border-color: #4cc97d; box-shadow: 0 0 12px rgba(76, 201, 125, 0.4); }

.tf-fiber-btn.active[data-fiber="lamb"] { background: rgba(255, 107, 138, 0.18); border-color: #ff6b8a; box-shadow: 0 0 12px rgba(255, 107, 138, 0.4); }

.tf-fiber-btn.active[data-fiber="pili"] { background: rgba(76, 184, 255, 0.18); border-color: #4cb8ff; box-shadow: 0 0 12px rgba(76, 184, 255, 0.4); }

.tf-fiber-btn.active[data-fiber="nfra"] { background: rgba(192, 132, 252, 0.18); border-color: #c084fc; box-shadow: 0 0 12px rgba(192, 132, 252, 0.4); }

/* Pause + fullscreen buttons must sit above the overlay */
        .tf-pause-btn {
            pointer-events: auto;
            position: relative;
            z-index: 10;
            background: rgba(10, 8, 2, 0.7);
            color: var(--gold);
            border: 1px solid rgba(244, 196, 48, 0.20);
            border-radius: 6px;
            width: 30px; height: 30px;
            font-size: 0.85rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all .15s ease;
            align-self: flex-start;
        }

.tf-pause-btn:hover { border-color: var(--gold); background: rgba(244, 196, 48, 0.10); }

.tf-level-badge {
            font-family: var(--font-mono);
            font-size: 0.58rem;
            letter-spacing: 0.14em;
            color: var(--gold);
            background: rgba(244, 196, 48, 0.10);
            border: 1px solid rgba(244, 196, 48, 0.30);
            border-radius: 50px;
            padding: 1px 7px;
            font-weight: 700;
            transition: all .25s ease;
        }

.tf-level-badge.bump { transform: scale(1.18); background: var(--gold); color: var(--bg); }

/* Setup screen */
        .tf-setup { width: 100%; }

.tf-setup-title {
            font-family: var(--font-display);
            font-size: 1.55rem;
            background: linear-gradient(135deg, var(--gold) 0%, #4cc97d 100%);
            -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.25rem;
            font-weight: 600;
            text-align: center;
        }

.tf-setup-sub {
            font-family: var(--font-mono);
            font-size: 0.66rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--ink-3);
            text-align: center;
            margin-bottom: 1.1rem;
        }

.tf-setup-group {
            margin-bottom: 0.9rem;
        }

.tf-setup-label {
            font-family: var(--font-mono);
            font-size: 0.62rem;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--ink-3);
            margin-bottom: 0.4rem;
            display: block;
        }

.tf-phage-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 0.35rem;
        }

.tf-phage-opt, .tf-dur-opt {
            background: rgba(10, 8, 2, 0.55);
            border: 1px solid rgba(244, 196, 48, 0.18);
            border-radius: 7px;
            padding: 0.5rem 0.4rem;
            text-align: center;
            cursor: pointer;
            font-family: var(--font-mono);
            color: var(--ink-2);
            transition: all .15s ease;
        }

.tf-phage-opt:hover, .tf-dur-opt:hover {
            border-color: var(--gold);
            background: rgba(244, 196, 48, 0.08);
            color: var(--ink);
        }

.tf-phage-opt.active, .tf-dur-opt.active {
            border-color: var(--gold);
            background: rgba(244, 196, 48, 0.18);
            color: var(--gold);
            box-shadow: 0 0 10px rgba(244, 196, 48, 0.25);
        }

.tf-phage-name {
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            display: block;
            line-height: 1.1;
        }

.tf-phage-stat {
            font-size: 0.56rem;
            color: var(--ink-4);
            letter-spacing: 0.1em;
            text-transform: uppercase;
            margin-top: 0.18rem;
            display: block;
        }

.tf-phage-opt.active .tf-phage-stat { color: var(--ink-3); }

.tf-phage-lore {
            font-family: var(--font-body);
            font-size: 0.74rem;
            font-style: italic;
            color: var(--ink-2);
            line-height: 1.35;
            margin-top: 0.55rem;
            padding: 0.55rem 0.7rem;
            background: rgba(10, 8, 2, 0.45);
            border-left: 2px solid var(--gold);
            border-radius: 4px;
            min-height: 2.6rem;
        }

.tf-dur-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 0.35rem;
        }

.tf-dur-opt { padding: 0.5rem 0.2rem; font-size: 0.74rem; }

/* Results screen */
        .tf-results-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin: 0.8rem 0 0.7rem;
        }

.tf-result-cell {
            background: rgba(10, 8, 2, 0.55);
            border: 1px solid rgba(244, 196, 48, 0.14);
            border-radius: 6px;
            padding: 0.5rem 0.7rem;
            text-align: left;
        }

.tf-result-key {
            font-family: var(--font-mono);
            font-size: 0.58rem;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--ink-3);
            display: block;
        }

.tf-result-val {
            font-family: var(--font-display);
            font-size: 1.2rem;
            color: var(--gold);
            font-weight: 700;
            line-height: 1.1;
            display: block;
            margin-top: 0.1rem;
        }

.tf-bio-explain {
            font-family: var(--font-body);
            font-size: 0.78rem;
            color: var(--ink-2);
            line-height: 1.5;
            background: rgba(76, 201, 125, 0.06);
            border-left: 2px solid var(--green);
            padding: 0.55rem 0.75rem;
            border-radius: 4px;
            text-align: left;
            margin-bottom: 0.7rem;
        }

.tf-bio-explain strong { color: var(--ink); }

.tf-result-actions {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
        }

.tf-btn-secondary {
            font-family: var(--font-mono);
            font-size: 0.74rem;
            font-weight: 700;
            letter-spacing: 0.10em;
            text-transform: uppercase;
            background: transparent;
            color: var(--ink-2);
            border: 1px solid var(--border-strong);
            padding: 0.55rem 1rem;
            border-radius: 50px;
            cursor: pointer;
            transition: all .2s ease;
        }

.tf-btn-secondary:hover { color: var(--gold); border-color: var(--gold); }

/* Mobile joystick */
        .tf-joystick {
            display: none;
            position: absolute;
            bottom: 70px;
            left: 12px;
            width: 80px; height: 80px;
            border-radius: 50%;
            background: rgba(10, 8, 2, 0.55);
            border: 1.5px solid rgba(244, 196, 48, 0.30);
            pointer-events: auto;
            z-index: 3;
            touch-action: none;
        }

.tf-joystick-thumb {
            position: absolute;
            top: 50%; left: 50%;
            width: 32px; height: 32px;
            background: var(--gold);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 14px rgba(244, 196, 48, 0.5);
            transition: background .15s ease;
            pointer-events: none;
        }

.tf-joystick.active .tf-joystick-thumb { background: #fff8d6; }

.tf-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(6, 11, 8, 0.78);
            backdrop-filter: blur(6px);
            z-index: 5;
            transition: opacity .25s ease;
        }

.tf-overlay.hidden { opacity: 0; pointer-events: none; }

.tf-overlay-card {
            text-align: center;
            padding: 1.1rem 1.4rem;
            background: linear-gradient(160deg, rgba(244, 196, 48, 0.08), rgba(10, 8, 2, 0.5));
            border: 1px solid var(--border-strong);
            border-radius: 10px;
            max-width: 90%;
        }

.tf-overlay-title {
            font-family: var(--font-display);
            font-size: 1.6rem;
            background: linear-gradient(135deg, var(--gold) 0%, #4cc97d 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

.tf-overlay-text {
            font-family: var(--font-body);
            font-size: 0.84rem;
            color: var(--ink-2);
            line-height: 1.45;
            margin-bottom: 0.8rem;
        }

.tf-overlay-keys {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.8rem;
            font-family: var(--font-mono);
            font-size: 0.68rem;
            color: var(--ink-3);
        }

.tf-overlay-keys kbd {
            background: rgba(0,0,0,0.4);
            border: 1px solid var(--border);
            border-radius: 3px;
            padding: 1px 5px;
            font-size: 0.66rem;
            /* The game surface is dark in BOTH themes, so this cannot follow
               --gold: in light mode that resolves to #7d5800 and put dark gold
               on a dark chip. Pinned to the bright gold. */
            color: #f4c430;
            margin: 0 1px;
        }

.tf-btn-play {
            font-family: var(--font-mono);
            font-size: 0.86rem;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            background: var(--gold);
            color: var(--bg);
            border: 0;
            padding: 0.7rem 1.6rem;
            border-radius: 50px;
            cursor: pointer;
            transition: all .2s ease;
            box-shadow: 0 6px 18px rgba(244, 196, 48, 0.4);
        }

.tf-btn-play:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(244, 196, 48, 0.55); }

.tf-toast {
            position: absolute;
            bottom: 0.8rem;
            left: 50%;
            transform: translate(-50%, 18px);
            background: rgba(10, 8, 2, 0.85);
            border: 1px solid var(--border-strong);
            color: var(--ink);
            padding: 0.45rem 0.85rem;
            border-radius: 50px;
            font-family: var(--font-mono);
            font-size: 0.72rem;
            letter-spacing: 0.08em;
            opacity: 0;
            transition: all .3s ease;
            pointer-events: none;
            z-index: 3;
            white-space: nowrap;
            max-width: 90%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

.tf-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Damage flash overlay */
        .tf-wrap.hurt::after {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(196, 30, 58, 0.35);
            pointer-events: none;
            z-index: 4;
            animation: tfHurt .3s ease;
        }


/* responsive */
@media (hover: none), (pointer: coarse) {
.tf-joystick { display: block; }
}

@media (max-width: 820px) {
.tf-wrap { max-width: 100%; aspect-ratio: 4 / 5; }
.tf-fiber-btn { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
}

@media (max-width: 480px) {
.tf-hp-wrap { top: 4.6rem; }
}


/* section chrome for the game's card (moved with the section) */
/* ============================================================
           CONCEPT — Building Next (TailFiber)
        ============================================================ */
        .concept-card {
            position: relative;
            max-width: 1000px;
            margin: 0 auto;
            padding: 1.8rem 1.8rem 2rem;
            background: linear-gradient(155deg,
                rgba(244, 196, 48, 0.06) 0%,
                rgba(26, 128, 64, 0.04) 45%,
                rgba(196, 30, 58, 0.04) 100%),
                var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
        }

.concept-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(800px circle at 100% 0%, rgba(244, 196, 48, 0.08), transparent 50%);
            pointer-events: none;
        }

.concept-status {
            display: inline-flex;
            align-items: center;
            gap: 0.55rem;
            padding: 0.4rem 0.85rem;
            background: rgba(26, 128, 64, 0.12);
            border: 1px solid var(--green);
            border-radius: 50px;
            margin-bottom: 1.4rem;
            position: relative;
        }

.concept-status-dot {
            width: 8px; height: 8px;
            background: var(--green);
            border-radius: 50%;
            box-shadow: 0 0 12px var(--green);
            animation: pulse 1.6s ease-in-out infinite;
        }

.concept-status-label {
            font-family: var(--font-mono);
            font-size: 0.7rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--green-text);
            font-weight: 700;
        }

.concept-grid {
            display: grid;
            grid-template-columns: minmax(280px, 380px) 1fr;
            gap: 2.4rem;
            align-items: stretch;
            position: relative;
        }

.concept-title {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            margin-bottom: 1rem;
        }

.concept-codename {
            font-family: var(--font-display);
            font-size: clamp(2.2rem, 5vw, 3.2rem);
            font-weight: 600;
            line-height: 1;
            background: linear-gradient(135deg, var(--gold) 0%, #c89a1e 60%, var(--green) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -0.02em;
        }

.concept-sub {
            font-family: var(--font-mono);
            font-size: 0.74rem;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--ink-3);
        }

.concept-tagline {
            font-family: var(--font-display);
            font-size: 1.12rem;
            font-style: italic;
            color: var(--ink);
            line-height: 1.45;
            margin-bottom: 0.9rem;
        }

.concept-body {
            color: var(--ink-2);
            font-size: 0.96rem;
            line-height: 1.65;
            margin-bottom: 1.3rem;
        }

.concept-pills-group {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            margin-bottom: 1.5rem;
        }

.concept-pills-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.4rem;
        }

.concept-pills-label {
            font-family: var(--font-mono);
            font-size: 0.66rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--ink-4);
            min-width: 84px;
        }

.concept-pill {
            font-family: var(--font-mono);
            font-size: 0.72rem;
            color: var(--ink-2);
            background: rgba(244, 196, 48, 0.06);
            border: 1px solid var(--border);
            padding: 0.22rem 0.55rem;
            border-radius: 50px;
        }

.concept-pill.phage {
            color: var(--gold);
            border-color: var(--border-strong);
            background: var(--gold-dim);
            font-style: italic;
        }

.concept-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.6rem;
        }

.concept-viz {
            position: relative;
            display: flex;
            align-items: stretch;
            justify-content: stretch;
            min-width: 0;
        }

@media (max-width: 820px) {
.concept-grid { grid-template-columns: 1fr; gap: 1.5rem; }
.concept-viz { order: -1; }
.concept-svg { max-width: 280px; }
.concept-pills-label { min-width: auto; width: 100%; margin-bottom: 0.2rem; }
}

@media (max-width: 480px) {
.concept-card { padding: 1.4rem 1.2rem 1.6rem; }
}
