:root {
    color-scheme: dark;
    --bg: #08090b;
    --bg-soft: #0e1013;
    --surface: #15181c;
    --surface-raised: #1c2025;
    --text: #f7f7f8;
    --muted: #9ca2aa;
    --red: #ef1b24;
    --red-bright: #ff3a42;
    --red-dark: #84080d;
    --silver: #d9dce1;
    --gold: #ffc857;
    --line: rgba(255, 255, 255, 0.11);
    --line-red: rgba(239, 27, 36, 0.32);
    --shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.32);
    --content: 78rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    min-width: 18rem;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(239, 27, 36, 0.08), transparent 26rem),
        linear-gradient(180deg, #0b0c0f 0%, var(--bg) 45%);
    font-family: Inter, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

::selection { color: #fff; background: var(--red); }

:focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 3px;
}

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

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--red-bright);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.02; }
h1 { font-size: clamp(3rem, 8vw, 6rem); letter-spacing: -0.055em; }
h2 { font-size: clamp(1.65rem, 4vw, 2.8rem); letter-spacing: -0.035em; }

/* Shared navigation */
.site-header {
    position: relative;
    z-index: 20;
    display: flex;
    width: min(100% - 3rem, var(--content));
    min-height: 5.4rem;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 auto;
    border-bottom: 1px solid var(--line);
}

.site-logo {
    display: block;
    width: 12.5rem;
    height: 3.6rem;
    overflow: hidden;
    text-decoration: none;
}

.site-logo-crop {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.site-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.site-nav a {
    position: relative;
    padding: 0.55rem 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--red);
    content: "";
    transform: scaleX(0);
    transition: transform 170ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle span { display: block; width: 100%; height: 2px; margin: 0.22rem 0; background: var(--text); }

.site-footer {
    display: flex;
    width: min(100% - 3rem, var(--content));
    min-height: 6rem;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 auto;
    padding: 1.4rem 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.site-footer p { margin: 0; }
.site-footer-brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); font-weight: 800; letter-spacing: 0.06em; }
.site-footer-brand img { border-radius: 0.35rem; }

/* Common page presentation */
.page-shell,
.store-page,
.prism-hiscores {
    width: min(100% - 3rem, var(--content));
    margin: 0 auto;
    padding: clamp(4rem, 8vw, 6.5rem) 0 6rem;
}

.page-heading { max-width: 46rem; margin-bottom: 2.75rem; }
.page-heading h1 { max-width: 11ch; margin-bottom: 1.1rem; }
.page-heading > p:last-child { max-width: 42rem; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.button {
    display: inline-flex;
    min-height: 3.2rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.35rem;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 170ms ease, background-color 170ms ease, border-color 170ms ease;
}

.button-primary { color: #fff; background: linear-gradient(135deg, var(--red-bright), var(--red-dark)); box-shadow: 0 0.8rem 2rem rgba(239, 27, 36, 0.24); }
.button-secondary { border-color: rgba(255,255,255,.24); color: var(--text); background: rgba(8,9,11,.55); }
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button-primary:hover { background: linear-gradient(135deg, #ff555c, var(--red)); }
.button-secondary:hover { border-color: var(--red); background: rgba(239,27,36,.1); }

/* Home */
.prism-hero {
    position: relative;
    min-height: clamp(38rem, 78vh, 54rem);
    overflow: hidden;
    isolation: isolate;
}

.prism-hero-media,
.prism-hero-media::after { position: absolute; inset: 0; }
.prism-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.48; filter: saturate(.7) contrast(1.08); }
.prism-hero-media::after {
    background:
        linear-gradient(90deg, rgba(8,9,11,.96) 0%, rgba(8,9,11,.72) 48%, rgba(8,9,11,.3) 100%),
        linear-gradient(180deg, rgba(8,9,11,.2), var(--bg));
    content: "";
}

.prism-hero-content {
    position: relative;
    z-index: 1;
    width: min(100% - 3rem, var(--content));
    margin: 0 auto;
    padding: clamp(5rem, 10vw, 8rem) 0;
}

.prism-hero-logo {
    width: min(28rem, 75vw);
    aspect-ratio: 3 / 1;
    margin-bottom: 1.8rem;
}

.prism-hero-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prism-hero h1 { max-width: 10ch; margin-bottom: 1.25rem; }
.prism-hero-copy { max-width: 38rem; margin-bottom: 2rem; color: var(--silver); font-size: 1.08rem; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.prism-intro {
    display: grid;
    width: min(100% - 3rem, var(--content));
    grid-template-columns: minmax(0, 1fr) minmax(18rem, .85fr);
    align-items: end;
    gap: 3rem;
    margin: 0 auto;
    padding: 5rem 0;
    border-bottom: 1px solid var(--line);
}

.prism-intro h2 { max-width: 13ch; margin: 0; }
.prism-intro > p { margin: 0; color: var(--muted); line-height: 1.8; }

.prism-paths {
    display: grid;
    width: min(100% - 3rem, var(--content));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0 auto;
    padding: 5rem 0;
    background: var(--line);
}

.prism-path {
    position: relative;
    min-height: 20rem;
    padding: 1.8rem;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    transition: background-color 180ms ease, transform 180ms ease;
}

.prism-path::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--red); content: ""; transform: scaleX(0); transform-origin: left; transition: transform 180ms ease; }
.prism-path:hover { z-index: 1; background: var(--surface-raised); transform: translateY(-4px); }
.prism-path:hover::before { transform: scaleX(1); }
.prism-path-number { color: var(--red-bright); font-size: 0.72rem; font-weight: 800; letter-spacing: .12em; }
.prism-path h2 { margin: 4rem 0 0.8rem; }
.prism-path p { color: var(--muted); line-height: 1.65; }
.prism-path-link { position: absolute; bottom: 1.8rem; color: var(--silver); font-size: .86rem; font-weight: 800; }

.home-updates { width: min(100% - 3rem, var(--content)); margin: 0 auto; padding: 0 0 6rem; }
.section-heading { margin-bottom: 2rem; }
.section-heading h2 { margin: 0; }

/* Updates */
.updates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.update-card { display: flex; min-height: 22rem; flex-direction: column; padding: 1.4rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.update-card-meta { color: var(--red-bright); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.update-card h2, .update-card h3 { font-size: 1.5rem; }
.content-card-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.update-card > p:not(.update-card-meta) { color: var(--muted); line-height: 1.6; }
.read-more { margin-top: auto; color: var(--red-bright); font-weight: 800; text-decoration: none; }
.empty-state { grid-column: 1 / -1; padding: clamp(2.5rem, 6vw, 5rem); border: 1px dashed rgba(239,27,36,.3); border-radius: 1rem; background: rgba(21,24,28,.6); text-align: center; }
.empty-state img { border-radius: .75rem; box-shadow: 0 0 2rem rgba(239,27,36,.2); }
.empty-state h2 { margin: 1.2rem 0 .6rem; font-size: 1.8rem; }
.empty-state p { margin: 0; color: var(--muted); }
.content-load-error { grid-column: 1 / -1; color: var(--muted); }

/* Downloads */
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.download-card { position: relative; display: flex; min-height: 29rem; flex-direction: column; align-items: flex-start; padding: clamp(1.5rem, 4vw, 2.2rem); overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow); }
.download-card::after { position: absolute; top: -7rem; right: -7rem; width: 16rem; height: 16rem; border: 1px solid rgba(239,27,36,.15); border-radius: 50%; content: ""; box-shadow: 0 0 4rem rgba(239,27,36,.08); }
.download-card > img { position: relative; z-index: 1; width: 5rem; height: 5rem; margin-bottom: 2rem; border-radius: .8rem; }
.status-pill { position: absolute; top: 1.5rem; right: 1.5rem; padding: .35rem .6rem; border: 1px solid var(--line-red); border-radius: 999px; color: #ff8489; background: rgba(239,27,36,.08); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.download-card h2 { margin-bottom: .8rem; }
.download-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.download-button { width: 100%; min-height: 3rem; margin-top: auto; border: 1px solid var(--line); border-radius: .5rem; color: var(--muted); background: rgba(8,9,11,.45); font-weight: 800; }
.download-button:disabled { cursor: not-allowed; opacity: .72; }

/* Vote */
.vote-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr); gap: 1.2rem; align-items: start; }
.vote-action-card, .vote-panel { position: relative; padding: clamp(1.5rem, 4vw, 2.2rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); }
.vote-action-card { background: linear-gradient(135deg, rgba(239,27,36,.12), var(--surface) 45%); }
.panel-number { position: absolute; top: 1.5rem; right: 1.5rem; color: rgba(255,255,255,.1); font-size: 3rem; font-weight: 900; }
.vote-action-card h2, .vote-panel h2 { margin-bottom: 1.5rem; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.username-form { display: flex; gap: .6rem; }
.username-form input, .prism-hiscores-search input, .checkout-form input, .coupon-controls input { min-width: 0; min-height: 3rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .5rem; outline: 0; color: var(--text); background: var(--bg-soft); }
.username-form input { flex: 1; }
.username-form input:focus, .prism-hiscores-search input:focus, .checkout-form input:focus, .coupon-controls input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,27,36,.12); }
.vote-submit-button, .voting-site-button { min-height: 3rem; padding: .7rem 1.1rem; border: 1px solid var(--red); border-radius: .5rem; color: #fff; background: var(--red); font-weight: 800; cursor: pointer; text-decoration: none; }
.voting-sites { display: flex; flex-wrap: wrap; gap: .6rem; }
.top-voters-list { display: grid; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.top-voters-list li { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border-bottom: 1px solid var(--line); color: var(--silver); }
.top-voters-list li strong { color: var(--red-bright); }
.monthly-voter-count { margin-left: auto; color: var(--muted); white-space: nowrap; }

/* Store */
.store-heading { max-width: 44rem; margin-bottom: 2.5rem; }
.store-heading h1 { margin-bottom: 1rem; }
.store-heading > p:last-child { color: var(--muted); line-height: 1.7; }
.store-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.2rem; align-items: start; }
.store-catalog, .cart-panel, .checkout-panel { min-width: 0; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); box-shadow: var(--shadow); }
.store-catalog { overflow: hidden; }
.store-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.store-tab { min-height: 3.4rem; padding: .8rem 1.1rem; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.store-tab:hover, .store-tab.is-active { border-bottom-color: var(--red); color: var(--text); background: rgba(239,27,36,.06); }
.store-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.2rem; }
.store-items--deals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.store-item-card, .deal-card { position: relative; display: flex; min-width: 0; min-height: 19rem; flex-direction: column; align-items: center; padding: 1.2rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface-raised); text-align: center; }
.store-item-card h3, .deal-card h3 { margin: .8rem 0 .45rem; font-size: 1.1rem; }
.store-item-card > p, .deal-card > p { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.store-item-image { width: 5.5rem; height: 5.5rem; object-fit: contain; }
.store-item-amount { margin-bottom: .7rem; }
.store-item-footer { width: 100%; margin-top: auto; }
.store-item-prices { display: flex; align-items: baseline; justify-content: center; gap: .5rem; margin-bottom: .75rem; }
.store-item-prices del { color: var(--muted); }
.store-item-price { color: var(--red-bright); font-size: 1.1rem; }
.quantity-control { display: grid; width: 100%; grid-template-columns: 2.5rem 1fr 2.5rem; border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; }
.quantity-control button { min-height: 2.5rem; border: 0; color: var(--text); background: var(--bg-soft); cursor: pointer; }
.quantity-control button:hover { background: rgba(239,27,36,.14); }
.quantity-control span { display: grid; place-items: center; border-right: 1px solid var(--line); border-left: 1px solid var(--line); }
.deal-visual { display: grid; place-items: center; }
.deal-image { width: 8rem; height: 8rem; object-fit: contain; }
.deal-badge, .deal-kicker { color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.deal-badge { position: absolute; top: .75rem; left: .75rem; }
.deal-discount-label { margin-bottom: .4rem; }
.deal-info-button { border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.deal-info-button:hover { color: var(--text); }
.deal-card--exclusive { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; text-align: left; }
.deal-exclusive-copy { align-self: center; }
.deal-exclusive-action { display: flex; flex-direction: column; align-items: center; }
.store-sidebar { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.cart-panel, .checkout-panel { padding: 1.2rem; }
.cart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cart-heading h2, .checkout-panel h2 { margin-bottom: 1rem; font-size: 1.25rem; }
.cart-heading span { color: var(--muted); font-size: .78rem; }
.cart-items { display: grid; gap: .55rem; }
.cart-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.cart-item p { margin: 0; font-size: .82rem; }
.cart-item strong { color: var(--red-bright); font-size: .82rem; }
.cart-empty { color: var(--muted); font-size: .85rem; }
.cart-total { display: flex; justify-content: space-between; margin: 1rem 0; padding-top: .9rem; border-top: 1px solid var(--line); }
.cart-total strong { color: var(--red-bright); }
.coupon-controls { display: flex; gap: .45rem; }
.coupon-controls input { width: 100%; min-height: 2.6rem; font-size: .8rem; }
.coupon-controls button { border: 1px solid var(--line-red); border-radius: .45rem; color: var(--text); background: rgba(239,27,36,.1); cursor: pointer; }
.coupon-message, .checkout-error { min-height: 1.2rem; margin: .45rem 0 0; color: #ff8e93; font-size: .78rem; }
.coupon-message[data-state="success"] { color: #79d89a; }
.checkout-form { display: grid; gap: .5rem; }
.checkout-form label { color: var(--muted); font-size: .78rem; font-weight: 800; }
.checkout-form input { width: 100%; min-height: 2.7rem; }
.store-submit, .pay-button { min-height: 2.8rem; margin-top: .5rem; border: 1px solid var(--red); border-radius: .5rem; color: #fff; background: var(--red); font-weight: 800; cursor: pointer; }
.checkout-summary { display: grid; gap: .6rem; }
.checkout-summary-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .4rem; font-size: .78rem; }
.checkout-summary-line span { color: var(--muted); }
.checkout-summary-line strong { overflow: hidden; text-overflow: ellipsis; }
.checkout-edit-button { border: 0; color: var(--red-bright); background: transparent; cursor: pointer; }
.payment-status { padding: .7rem; margin-bottom: .8rem; border: 1px solid var(--line); border-radius: .45rem; color: var(--muted); font-size: .82rem; }
.payment-status[data-state="success"] { border-color: rgba(88,200,127,.35); color: #79d89a; }
.deal-modal { width: min(100% - 2rem, 34rem); padding: 0; border: 1px solid var(--line-red); border-radius: .8rem; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.deal-modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(3px); }
.deal-modal-inner { position: relative; padding: 1.6rem; }
.deal-modal-close { position: absolute; top: .75rem; right: .75rem; width: 2.3rem; height: 2.3rem; border: 1px solid var(--line); border-radius: .4rem; color: var(--text); background: var(--bg-soft); cursor: pointer; }
.deal-modal-items { display: grid; gap: .55rem; padding: 0; list-style: none; }
.deal-modal-items li { display: flex; align-items: center; gap: .65rem; padding: .55rem; border-bottom: 1px solid var(--line); }
.deal-modal-item-icon { object-fit: contain; }
.deal-modal-note { color: var(--muted); font-size: .84rem; }
.store-load-error { grid-column: 1 / -1; color: var(--muted); }

/* Hiscores */
.prism-hiscores { width: min(100% - 3rem, 94rem); }
.prism-hiscores-heading { margin-bottom: 1.4rem; }
.prism-hiscores-search { max-width: 32rem; padding: .9rem 1rem; margin-bottom: 1.4rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.prism-hiscores-search label { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.prism-hiscores-search > div { display: flex; gap: .5rem; }
.prism-hiscores-search input { flex: 1; }
.prism-hiscores-search button { min-height: 3rem; padding: .7rem 1rem; border: 1px solid var(--red); border-radius: .5rem; color: #fff; background: var(--red); font-weight: 800; cursor: pointer; white-space: nowrap; }
.prism-hiscores-layout { display: grid; grid-template-columns: 19rem minmax(0,1fr); align-items: start; gap: 1.2rem; }
.prism-hiscores-categories { position: sticky; top: 1rem; max-height: calc(100svh - 2rem); padding: .9rem; overflow-y: auto; border: 1px solid var(--line-red); border-radius: .9rem; background: linear-gradient(180deg, var(--surface), var(--bg-soft)); box-shadow: var(--shadow); scrollbar-color: rgba(239,27,36,.6) transparent; }
.prism-hiscores-categories > p { padding: 0 .5rem .75rem; margin: 0 0 .9rem; border-bottom: 1px solid var(--line); color: var(--red-bright); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.prism-hiscores-categories > div { display: grid; gap: 1rem; }
.prism-hiscores-category-group > p { margin: 0 0 .35rem; padding: 0 .5rem; color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.prism-hiscores-category-group > div { display: grid; gap: .12rem; }
.prism-hiscores-categories button { width: 100%; padding: .58rem .7rem; border: 0; border-left: 3px solid transparent; border-radius: .4rem; color: var(--muted); background: transparent; font-size: .88rem; font-weight: 700; text-align: left; cursor: pointer; }
.prism-hiscores-categories button:hover, .prism-hiscores-categories button.is-active { border-left-color: var(--red); color: #fff; background: rgba(239,27,36,.12); }
.prism-hiscores-board, .prism-profile { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); box-shadow: var(--shadow); }
.prism-hiscores-board-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, rgba(239,27,36,.13), transparent 58%); }
.prism-hiscores-board-head p { margin: 0 0 .3rem; color: var(--red-bright); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.prism-hiscores-board-head h2 { margin: 0; font-size: 2rem; }
.prism-hiscores-board-head > span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.prism-hiscores-table-wrap, .prism-profile-table-wrap { overflow-x: auto; }
.prism-hiscores-table { width: 100%; min-width: 62rem; border-collapse: collapse; font-size: .88rem; }
.prism-hiscores-table th, .prism-hiscores-table td { padding: .9rem 1rem; border-bottom: 1px solid rgba(255,255,255,.075); text-align: left; white-space: nowrap; }
.prism-hiscores-table th { color: var(--muted); background: rgba(8,9,11,.34); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.prism-hiscores-table td:nth-child(n+5), .prism-hiscores-table th:nth-child(n+5) { text-align: right; font-variant-numeric: tabular-nums; }
.prism-hiscores-table tbody tr:hover { background: rgba(239,27,36,.06); }
.prism-hiscores-table a { color: var(--text); font-weight: 800; text-decoration: none; }
.prism-hiscores-table a:hover { color: var(--red-bright); text-decoration: underline; }
.prism-hiscores-rank { color: var(--red-bright); font-weight: 800; }
.prism-hiscores-table tbody tr:first-child .prism-hiscores-rank { color: var(--gold); }
.prism-hiscores-mode { color: var(--muted); font-size: .8rem; }
.prism-hiscores-prestige { color: #ff858a; }
.prism-hiscores-empty, .prism-profile-empty { padding: 2rem !important; color: var(--muted); text-align: center !important; }
.prism-hiscores-pagination { display: flex; min-height: 4.2rem; align-items: center; gap: .75rem; padding: .8rem 1.2rem; color: var(--muted); font-size: .82rem; }
.prism-hiscores-pagination button { min-height: 2.3rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: .45rem; color: var(--text); background: var(--bg-soft); cursor: pointer; }
.prism-hiscores-pagination button:hover:not(:disabled) { border-color: var(--red); color: var(--red-bright); }
.prism-hiscores-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.prism-profile-back { display: inline-block; margin: 1.2rem 1.5rem 0; color: var(--red-bright); font-size: .86rem; font-weight: 800; text-decoration: none; }
.prism-profile-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 1.5rem; padding: 1.5rem; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, rgba(239,27,36,.13), transparent 58%); }
.prism-profile-identity { min-width: 0; }
.prism-profile-identity h1 { max-width: none; margin-bottom: 1rem; overflow-wrap: anywhere; font-size: clamp(2.5rem, 7vw, 4.5rem); }
.prism-profile-modes { display: flex; flex-wrap: wrap; gap: .5rem; }
.prism-profile-modes > span, .prism-profile-rank { display: grid; gap: .2rem; min-width: 8.5rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .5rem; background: rgba(8,9,11,.5); }
.prism-profile-modes small, .prism-profile-rank span, .prism-profile-totals span { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.prism-profile-modes strong { color: var(--silver); font-size: .9rem; }
.prism-profile-rank { min-width: 10rem; text-align: right; }
.prism-profile-rank strong { color: var(--red-bright); font-size: 1.8rem; }
.prism-profile-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: rgba(8,9,11,.25); }
.prism-profile-totals > div { display: grid; gap: .35rem; min-width: 0; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface-raised); }
.prism-profile-totals strong { overflow: hidden; font-size: 1.2rem; text-overflow: ellipsis; white-space: nowrap; }
.prism-profile-totals > div:last-child strong { color: var(--red-bright); }
.prism-profile-records { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; padding: 1.5rem; }
.prism-profile-section { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .6rem; background: var(--bg-soft); }
.prism-profile-section--skills { grid-column: 1 / -1; }
.prism-profile-section header { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.prism-profile-section header p { margin: 0; font-weight: 800; }
.prism-profile-section header span { color: var(--muted); font-size: .72rem; }
.prism-profile-table { width: 100%; min-width: 22rem; border-collapse: collapse; }
.prism-profile-section--skills .prism-profile-table { min-width: 38rem; }
.prism-profile-table th, .prism-profile-table td { padding: .7rem .85rem; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; white-space: nowrap; }
.prism-profile-table th { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.prism-profile-table td:not(:first-child), .prism-profile-table th:not(:first-child) { text-align: right; }
.prism-profile-table td:last-child { color: #ff858a; font-weight: 800; }

/* Responsive */
@media (max-width: 68rem) {
    .site-nav { gap: .85rem; }
    .store-layout { grid-template-columns: 1fr; }
    .store-sidebar { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .prism-hiscores-layout { grid-template-columns: 16rem minmax(0,1fr); }
}

@media (max-width: 54rem) {
    .nav-toggle { display: block; }
    .site-nav { position: absolute; top: calc(100% + .5rem); right: 0; display: none; width: min(18rem, calc(100vw - 2rem)); flex-direction: column; align-items: stretch; gap: 0; padding: .6rem; border: 1px solid var(--line-red); border-radius: .7rem; background: var(--surface); box-shadow: var(--shadow); }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: .8rem .9rem; }
    .prism-intro, .vote-layout { grid-template-columns: 1fr; }
    .prism-paths { grid-template-columns: 1fr; gap: 1px; }
    .prism-path { min-height: 16rem; }
    .updates-grid { grid-template-columns: 1fr; }
    .store-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .store-items--deals { grid-template-columns: 1fr; }
    .prism-hiscores-layout { grid-template-columns: 1fr; }
    .prism-hiscores-categories { position: static; max-height: none; }
    .prism-hiscores-categories > div { display: flex; gap: .75rem; overflow-x: auto; }
    .prism-hiscores-category-group { flex: 0 0 11rem; }
    .prism-profile-records { grid-template-columns: 1fr; }
    .prism-profile-section--skills { grid-column: auto; }
}

@media (max-width: 40rem) {
    .site-header, .site-footer, .page-shell, .store-page, .prism-hiscores, .prism-hero-content, .prism-intro, .prism-paths, .home-updates { width: min(100% - 1.5rem, var(--content)); }
    .site-header { gap: .75rem; }
    .site-logo { width: 10rem; max-width: calc(100% - 3.5rem); flex: 0 1 10rem; }
    .nav-toggle { display: block; flex: 0 0 2.75rem; margin-left: auto; }
    .site-footer { align-items: flex-start; flex-direction: column; gap: .7rem; }
    .prism-hero { min-height: 39rem; }
    .prism-hero-content { max-width: calc(100% - 1.5rem); padding-top: 4rem; overflow: hidden; }
    .prism-hero-logo, .prism-hero-copy { max-width: 100%; }
    .prism-hero-copy, .prism-hero h1 { overflow-wrap: anywhere; }
    .prism-intro { gap: 1.5rem; }
    .download-grid, .store-sidebar, .prism-profile-totals { grid-template-columns: 1fr; }
    .username-form, .prism-hiscores-search > div { flex-direction: column; }
    .username-form button, .prism-hiscores-search button { width: 100%; }
    .store-items { grid-template-columns: 1fr; }
    .deal-card--exclusive { display: flex; text-align: center; }
    .prism-profile-hero { grid-template-columns: 1fr; }
    .prism-profile-rank { text-align: left; }
    .prism-profile-records { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
