/* TiltLab: original browser pinball tables. Backglass palette borrowed from the cabinet, not the arcade. */
:root {
    --tilt-ink: #07081c;
    --tilt-ink-soft: #0d1030;
    --tilt-panel: #12163d;
    --tilt-chrome: #dde6f2;
    --tilt-copy: #c9d1e2;
    --tilt-muted: #8d97b3;
    --tilt-rule: rgba(221, 230, 242, 0.16);
    --tilt-blue: #315cff;
    --tilt-magenta: #f13cc8;
    --tilt-cyan: #7ce7ff;
    --tilt-amber: #ffb547;
}

body.editorial-page.tiltlab-page {
    margin: 0;
    color: var(--tilt-copy);
    background: var(--tilt-ink);
    color-scheme: dark;
}

body.editorial-page.tiltlab-page h1,
body.editorial-page.tiltlab-page h2,
body.editorial-page.tiltlab-page h3 {
    color: var(--tilt-chrome);
}

body.editorial-page.tiltlab-page p,
body.editorial-page.tiltlab-page li {
    color: var(--tilt-copy);
}

body.editorial-page.tiltlab-page main a,
body.editorial-page.tiltlab-page .tiltlab-footer a {
    color: var(--tilt-cyan);
    text-decoration-color: rgba(124, 231, 255, 0.4);
}

body.editorial-page.tiltlab-page main a:hover,
body.editorial-page.tiltlab-page .tiltlab-footer a:hover {
    color: var(--tilt-chrome);
}

.tiltlab-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.tiltlab-kicker {
    margin: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body.editorial-page.tiltlab-page .tiltlab-kicker {
    color: var(--tilt-magenta);
}

/* Hero */
.tiltlab-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px);
    background:
        radial-gradient(ellipse 60% 70% at 78% 40%, rgba(49, 92, 255, 0.28), transparent 70%),
        radial-gradient(ellipse 40% 50% at 12% 90%, rgba(241, 60, 200, 0.14), transparent 70%),
        var(--tilt-ink);
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
}

.tiltlab-hero h1 {
    margin: 0;
    font-size: clamp(4.2rem, 13vw, 9.5rem);
    line-height: 0.86;
    letter-spacing: -0.04em;
    font-weight: 800;
}

body.editorial-page.tiltlab-page .tiltlab-hero h1 span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 2px var(--tilt-chrome);
}

.tiltlab-deck {
    max-width: 30ch;
    margin: 28px 0 0;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.45;
}

.tiltlab-lamp {
    margin: 32px 0 0;
}

.tiltlab-lamp span {
    display: inline-block;
    padding: 6px 18px;
    border: 2px solid var(--tilt-amber);
    border-radius: 4px;
    color: var(--tilt-amber);
    font-weight: 800;
    letter-spacing: 0.38em;
    padding-right: calc(18px - 0.38em);
    animation: tiltlab-lamp 5.2s steps(1, end) infinite;
}

@keyframes tiltlab-lamp {
    0%, 86% { opacity: 0.22; box-shadow: none; }
    88%, 90%, 92% { opacity: 1; box-shadow: 0 0 22px rgba(255, 181, 71, 0.45); }
    89%, 91% { opacity: 0.22; box-shadow: none; }
    93%, 100% { opacity: 0.22; box-shadow: none; }
}

.tiltlab-playfield {
    margin: 0;
    justify-self: center;
    width: min(100%, 340px);
    transform: perspective(900px) rotateX(18deg);
    transform-origin: 50% 100%;
}

.tiltlab-playfield svg {
    display: block;
    width: 100%;
    height: auto;
}

.tl-cabinet { fill: #1b1f3f; stroke: var(--tilt-chrome); stroke-width: 3; }
.tl-field { stroke: rgba(221, 230, 242, 0.35); stroke-width: 1; }
.tl-orbit, .tl-lane { fill: none; stroke: rgba(124, 231, 255, 0.55); stroke-width: 2.5; stroke-linecap: round; }
.tl-plunger { fill: var(--tilt-chrome); }
.tl-bumpers circle { fill: var(--tilt-panel); stroke: var(--tilt-magenta); stroke-width: 4; }
.tl-targets rect { fill: var(--tilt-magenta); }
.tl-inserts circle { fill: var(--tilt-blue); opacity: 0.85; }
.tl-sling { fill: rgba(49, 92, 255, 0.35); stroke: var(--tilt-cyan); stroke-width: 2; stroke-linejoin: round; }
.tl-flippers path { fill: var(--tilt-chrome); }
.tl-ball { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6)); }

@media (prefers-reduced-motion: no-preference) {
    .tl-ball { animation: tiltlab-ball 6s ease-in-out infinite; }
    .tl-bumpers circle:nth-child(2) { animation: tiltlab-bumper 6s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
    .tiltlab-lamp span { animation: none; opacity: 0.6; }
}

@keyframes tiltlab-ball {
    0%   { transform: translate(0, 0); }
    18%  { transform: translate(-20px, -96px); }
    30%  { transform: translate(14px, -70px); }
    55%  { transform: translate(-52px, 90px); }
    72%  { transform: translate(-46px, 196px); }
    84%  { transform: translate(-10px, 30px); }
    100% { transform: translate(0, 0); }
}

@keyframes tiltlab-bumper {
    0%, 27%, 34%, 100% { fill: var(--tilt-panel); }
    30% { fill: var(--tilt-magenta); }
}

/* Sections */
.tiltlab-intro,
.tiltlab-tables,
.tiltlab-rules {
    padding: clamp(56px, 8vw, 104px) 0;
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(24px, 5vw, 80px);
}

.tiltlab-split h2,
.tiltlab-section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.tiltlab-prose p {
    margin: 0 0 1.1em;
    font-size: 1.12rem;
    line-height: 1.65;
}

body.editorial-page.tiltlab-page .tiltlab-prose p:first-child {
    color: var(--tilt-chrome);
}

.tiltlab-section-heading {
    max-width: 640px;
    margin-bottom: 40px;
}

body.editorial-page.tiltlab-page .tiltlab-section-heading > p:last-child {
    margin: 16px 0 0;
    color: var(--tilt-muted);
    font-size: 1.05rem;
}

/* Table cards */
.tiltlab-table-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 18px;
}

.tiltlab-table-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    padding: 26px 24px;
    border: 1px solid var(--tilt-rule);
    border-radius: 14px;
    background: linear-gradient(160deg, var(--tilt-panel), var(--tilt-ink-soft));
}

.tiltlab-table-card.is-empty {
    background: transparent;
    border-style: dashed;
}

.tiltlab-table-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--tilt-blue);
}

.tiltlab-table-card h3 {
    margin: 4px 0 10px;
    font-size: 1.5rem;
}

body.editorial-page.tiltlab-page .tiltlab-table-card.is-empty h3,
body.editorial-page.tiltlab-page .tiltlab-table-card.is-empty p {
    color: var(--tilt-muted);
}

.tiltlab-table-card p {
    margin: 0;
    line-height: 1.55;
}

body.editorial-page.tiltlab-page .tiltlab-table-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tilt-amber);
}

.tiltlab-table-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tilt-amber);
    box-shadow: 0 0 10px rgba(255, 181, 71, 0.7);
}

.tiltlab-specs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
}

body.editorial-page.tiltlab-page .tiltlab-specs li {
    padding: 4px 10px;
    border: 1px solid var(--tilt-rule);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--tilt-chrome);
}

/* House rules */
.tiltlab-rule-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tiltlab-rule-list li {
    padding: 16px 0;
    border-top: 1px solid var(--tilt-rule);
    font-size: 1.08rem;
    line-height: 1.55;
}

.tiltlab-rule-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

body.editorial-page.tiltlab-page .tiltlab-rule-list strong {
    color: var(--tilt-cyan);
}

.tiltlab-crosslink {
    padding: 36px 0;
}

body.editorial-page.tiltlab-page .tiltlab-crosslink p {
    margin: 0;
    color: var(--tilt-muted);
}

/* Footer fallback (the horizon footer replaces this when JavaScript runs) */
.tiltlab-footer {
    padding: 32px 0;
    border-top: 1px solid var(--tilt-rule);
    background: var(--tilt-ink);
}

body.editorial-page.tiltlab-page .tiltlab-footer p {
    margin: 0 0 6px;
    color: var(--tilt-muted);
}

@media (max-width: 900px) {
    .tiltlab-hero-grid,
    .tiltlab-split {
        grid-template-columns: 1fr;
    }

    .tiltlab-playfield {
        width: min(72%, 280px);
    }

    .tiltlab-table-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Section links ---------- */
.tiltlab-subnav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(7, 8, 28, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-subnav .tiltlab-shell {
    display: flex;
    gap: 28px;
    overflow-x: auto;
}

body.editorial-page.tiltlab-page .tiltlab-subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: var(--tilt-copy);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

body.editorial-page.tiltlab-page .tiltlab-subnav a:hover {
    color: var(--tilt-cyan);
}

/* ---------- Machines ---------- */
.tiltlab-machine-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 22px;
}

.tiltlab-machine {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    border: 1px solid var(--tilt-rule);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(160deg, var(--tilt-panel), var(--tilt-ink-soft));
}

.tiltlab-machine.is-empty {
    grid-template-columns: 1fr;
    background: transparent;
    border-style: dashed;
}

.tiltlab-machine-figure {
    display: block;
    background: #05060f;
}

.tiltlab-machine-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

.tiltlab-machine-copy {
    padding: clamp(22px, 3vw, 36px);
}

.tiltlab-machine h3 {
    margin: 6px 0 8px;
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    line-height: 1.05;
}

body.editorial-page.tiltlab-page .tiltlab-machine-question {
    margin: 0 0 12px;
    color: var(--tilt-chrome);
    font-style: italic;
}

.tiltlab-machine-copy > p {
    margin: 0 0 12px;
    line-height: 1.55;
}

body.editorial-page.tiltlab-page .tiltlab-machine.is-empty h3,
body.editorial-page.tiltlab-page .tiltlab-machine.is-empty p {
    color: var(--tilt-muted);
}

.tiltlab-machine-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin: 22px 0 14px;
}

body.editorial-page.tiltlab-page a.tiltlab-play {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 3px;
    background: var(--tilt-cyan);
    color: #0b1725;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}

body.editorial-page.tiltlab-page a.tiltlab-play:hover {
    background: #c5f5ff;
    color: #0b1725;
}

body.editorial-page.tiltlab-page a.tiltlab-about-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
}

body.editorial-page.tiltlab-page .tiltlab-machine-meta {
    margin: 0;
    color: var(--tilt-muted);
    font-size: 0.85rem;
}

/* ---------- Lineage ---------- */
.tiltlab-lineage-section {
    padding: clamp(56px, 8vw, 104px) 0;
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-lineage {
    position: relative;
    list-style: none;
    margin: 0 0 48px;
    padding: 0;
    display: grid;
    gap: 18px;
}

.tiltlab-lineage::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 28px;
    bottom: 28px;
    width: 2px;
    background: linear-gradient(var(--tilt-cyan), var(--tilt-magenta) 70%, transparent);
}

.tiltlab-lineage-node {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 20px;
}

.tiltlab-lineage-number {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--tilt-cyan);
    background: var(--tilt-ink);
    color: var(--tilt-chrome);
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 0 18px rgba(124, 231, 255, 0.35);
}

.tiltlab-lineage-node.is-next .tiltlab-lineage-number {
    border-style: dashed;
    border-color: var(--tilt-muted);
    box-shadow: none;
    color: var(--tilt-muted);
}

.tiltlab-lineage-node > div {
    padding: 4px 0 8px;
}

.tiltlab-lineage-node h3 {
    margin: 10px 0 6px;
    font-size: 1.6rem;
}

body.editorial-page.tiltlab-page .tiltlab-lineage-node h3 a {
    color: var(--tilt-chrome);
    text-decoration: none;
}

body.editorial-page.tiltlab-page .tiltlab-lineage-node h3 a:hover {
    color: var(--tilt-cyan);
}

body.editorial-page.tiltlab-page .tiltlab-lineage-node.is-next h3,
body.editorial-page.tiltlab-page .tiltlab-lineage-node.is-next p {
    color: var(--tilt-muted);
}

body.editorial-page.tiltlab-page .tiltlab-lineage-label {
    margin: 14px 0 8px;
    color: var(--tilt-magenta);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tiltlab-introduced,
.tiltlab-echoes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.editorial-page.tiltlab-page .tiltlab-introduced li {
    padding: 5px 12px;
    border: 1px solid rgba(124, 231, 255, 0.35);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--tilt-chrome);
}

.tiltlab-echoes {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

body.editorial-page.tiltlab-page .tiltlab-echo-kind {
    color: var(--tilt-amber);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-right: 6px;
}

body.editorial-page.tiltlab-page .tiltlab-lineage-note {
    margin: 14px 0 0;
    color: var(--tilt-muted);
}

.tiltlab-parts h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.tiltlab-parts > p {
    margin: 0 0 20px;
    max-width: 60ch;
}

.tiltlab-parts ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tiltlab-parts li {
    padding: 22px;
    border: 1px solid var(--tilt-rule);
    border-radius: 12px;
    background: var(--tilt-ink-soft);
}

.tiltlab-parts h4 {
    margin: 0 0 8px;
    color: var(--tilt-chrome);
    font-size: 1.1rem;
}

.tiltlab-parts li p {
    margin: 0 0 10px;
    line-height: 1.55;
    font-size: 0.95rem;
}

body.editorial-page.tiltlab-page .tiltlab-part-meta {
    margin: 0;
    color: var(--tilt-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.tiltlab-part-meta code {
    font-size: 0.78rem;
    color: var(--tilt-cyan);
}

@media (max-width: 900px) {
    .tiltlab-machine {
        grid-template-columns: 1fr;
    }

    .tiltlab-parts ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .tiltlab-lineage::before {
        left: 21px;
    }

    .tiltlab-lineage-node {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 14px;
    }

    .tiltlab-lineage-number {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }

    .tiltlab-subnav .tiltlab-shell {
        gap: 20px;
    }
}

/* ---------- Machine about pages ---------- */
.tiltlab-about-hero {
    padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 6vw, 72px);
    background:
        radial-gradient(ellipse 60% 70% at 78% 40%, rgba(49, 92, 255, 0.25), transparent 70%),
        var(--tilt-ink);
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-about-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
}

.tiltlab-about-hero h1 {
    margin: 0;
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    line-height: 0.92;
    letter-spacing: -0.035em;
    font-weight: 800;
}

body.editorial-page.tiltlab-page .tiltlab-about-hero h1 span {
    display: block;
    color: var(--tilt-cyan);
    font-style: italic;
}

.tiltlab-about-figure {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--tilt-rule);
}

.tiltlab-about-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.tiltlab-about-section {
    padding: clamp(56px, 8vw, 104px) 0;
    border-bottom: 1px solid var(--tilt-rule);
}

.tiltlab-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--tilt-rule);
    border-radius: 12px;
}

.tiltlab-parts-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.98rem;
}

.tiltlab-parts-table th,
.tiltlab-parts-table td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--tilt-rule);
    color: var(--tilt-copy);
    line-height: 1.5;
}

.tiltlab-parts-table thead th {
    color: var(--tilt-muted);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--tilt-ink-soft);
}

.tiltlab-parts-table tbody th {
    color: var(--tilt-chrome);
    white-space: nowrap;
}

.tiltlab-parts-table td:nth-child(2),
.tiltlab-parts-table td:last-child {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tiltlab-parts-table tbody tr:last-child th,
.tiltlab-parts-table tbody tr:last-child td {
    border-bottom: 0;
}

.tiltlab-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tiltlab-card {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--tilt-rule);
    border-radius: 14px;
    background: linear-gradient(160deg, var(--tilt-panel), var(--tilt-ink-soft));
}

.tiltlab-plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tiltlab-plain-list li {
    padding: 10px 0;
    border-top: 1px solid var(--tilt-rule);
    line-height: 1.55;
}

.tiltlab-plain-list li:first-child {
    border-top: 0;
}

body.editorial-page.tiltlab-page .tiltlab-plain-list strong {
    color: var(--tilt-chrome);
}

.tiltlab-specs-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
}

.tiltlab-specs-grid > div {
    padding: 18px 0;
    border-top: 1px solid var(--tilt-rule);
}

.tiltlab-specs-grid dt {
    margin: 0 0 6px;
    color: var(--tilt-cyan);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tiltlab-specs-grid dd {
    margin: 0;
    color: var(--tilt-copy);
    line-height: 1.6;
}

@media (max-width: 900px) {
    .tiltlab-about-hero-grid,
    .tiltlab-two-col,
    .tiltlab-specs-grid {
        grid-template-columns: 1fr;
    }
}
