:root {
    color-scheme: dark;
    --bg: #09090d;
    --surface: #14131b;
    --surface-2: #1c1a25;
    --border: #34303f;
    --text: #f6f4fb;
    --muted: #aaa5b7;
    --accent: #a855f7;
    --accent-2: #7c3aed;
    --success: #4ade80;
    --danger: #ff6b73;
    --shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 16% 4%, rgba(168, 85, 247, .17), transparent 30rem),
        radial-gradient(circle at 86% 88%, rgba(76, 56, 160, .13), transparent 34rem),
        var(--bg);
    font: 500 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.topbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 32px;
}

.brand, .back-link {
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
}

.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand strong { font-size: 1.02rem; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: .84rem; }
.back-link { color: var(--muted); padding: 0 12px; border-radius: 10px; }
.back-link:hover, .back-link:focus-visible { color: var(--text); background: rgba(255,255,255,.06); }

.key-layout {
    /* No forced viewport height. It padded this out and pushed the ad section
       below the fold; the art card min-height already gives it presence. */
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
    gap: 30px;
    align-items: center;
}

.art-card, .key-card, .selector-panel, .blocked-panel {
    border: 1px solid var(--border);
    background: rgba(20, 19, 27, .94);
    box-shadow: var(--shadow);
}

.art-card {
    min-height: 560px;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.art-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 32%, rgba(9,9,13,.18) 58%, rgba(9,9,13,.95));
    z-index: -1;
}

.art-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.art-copy { position: absolute; inset: auto 30px 28px; }
.eyebrow { color: #d8b4fe; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.art-copy h1 { margin: 8px 0 5px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; letter-spacing: -.045em; }
.art-copy p { margin: 0; color: #d3cfdb; max-width: 35rem; }

.key-card {
    border-radius: 24px;
    padding: clamp(24px, 4vw, 38px);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(74, 222, 128, .09);
    border: 1px solid rgba(74, 222, 128, .24);
    color: #8df0ad;
    font-size: .82rem;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 14px var(--success); }

.key-card h2, .selector-panel h1, .blocked-panel h1 { margin: 22px 0 8px; font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.12; letter-spacing: -.035em; }
.key-card > p, .selector-panel > p, .blocked-panel > p { margin: 0; color: var(--muted); }

.scope-note {
    display: flex;
    gap: 11px;
    margin: 24px 0;
    padding: 14px;
    color: #ddd8e6;
    background: rgba(168,85,247,.08);
    border: 1px solid rgba(168,85,247,.23);
    border-radius: 12px;
    font-size: .9rem;
}
.scope-note strong { color: #e9d5ff; }

.key-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.key-output {
    width: 100%;
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 13px;
    background: #0c0b10;
    border: 1px solid var(--border);
    color: #fff;
    font: 750 clamp(.82rem, 2.5vw, 1.05rem)/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .035em;
    text-align: center;
    overflow-wrap: anywhere;
}

.key-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.primary-button, .secondary-button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    padding: 0 20px;
    cursor: pointer;
    color: #fff;
    font-weight: 750;
}
.primary-button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px rgba(124,58,237,.25); }
.primary-button:hover { filter: brightness(1.09); transform: translateY(-1px); }
.secondary-button { background: var(--surface-2); border: 1px solid var(--border); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; }

.loader-download {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 0 20px;
    border: 1px solid rgba(168,85,247,.42);
    border-radius: 12px;
    color: #fff;
    background: rgba(168,85,247,.13);
    font-weight: 750;
    text-decoration: none;
}
.loader-download:hover { background: rgba(168,85,247,.22); transform: translateY(-1px); }
.loader-download[hidden] { display: none; }

.timer { margin-top: 18px; }
.timer-row { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: .84rem; }
.timer-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.timer-track { height: 7px; margin-top: 9px; background: #0d0c11; border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), #c084fc); transition: width .4s linear; }

.message {
    display: none;
    margin-top: 18px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,107,115,.09);
    border: 1px solid rgba(255,107,115,.35);
    color: #ffb2b7;
}
.message.show { display: block; }

.ad-placement {
    width: min(970px, 100%);
    min-height: 286px;
    margin: 32px auto 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(20, 19, 27, .78);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

.ad-label {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .13em;
    text-align: center;
    text-transform: uppercase;
}

.ad-placement iframe {
    display: block;
    width: 100%;
    min-height: 240px;
    border: 0;
    border-radius: 12px;
    background: #0c0b10;
}

/* Sized to content so the ad below stays reachable, like .blocked-wrap. */
.selector-wrap { min-height: min(70vh, 560px); display: grid; place-items: center; padding: 24px 0 8px; }
/* Shorter than the selector: a full-height blocked panel pushed the ad below
   the fold, so nobody bouncing off this page ever saw it. */
.blocked-wrap { min-height: min(56vh, 420px); display: grid; place-items: center; padding: 28px 0 8px; }
.selector-panel, .blocked-panel { width: min(900px, 100%); padding: clamp(25px, 5vw, 46px); border-radius: 25px; }
.selector-panel h1, .blocked-panel h1 { margin-top: 0; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 28px; }
.product-link {
    min-height: 92px;
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 10px 17px 10px 10px;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255,255,255,.018);
}
.product-link:hover, .product-link:focus-visible { border-color: var(--accent); background: rgba(168,85,247,.08); transform: translateY(-1px); }
.product-link img { width: 62px; height: 68px; object-fit: cover; border-radius: 10px; }
.product-link strong { display: block; }
.product-link span { color: var(--muted); font-size: .8rem; }
.product-link b { color: #d8b4fe; font-size: 1.25rem; }

.blocked-panel { max-width: 560px; text-align: center; }
.blocked-panel .primary-button { display: inline-grid; place-items: center; text-decoration: none; margin-top: 24px; min-width: 190px; }
.blocked-panel .blocked-jab { margin-top: 18px; color: #858091; font-size: .82rem; }
.hidden { display: none !important; }
.adsbox { width: 1px; height: 1px; position: fixed; left: -9999px; bottom: 0; }

:focus-visible { outline: 3px solid rgba(192,132,252,.9); outline-offset: 3px; }

@media (max-width: 820px) {
    .key-layout { grid-template-columns: 1fr; }
    .art-card { min-height: 360px; }
    .key-card { margin-top: -70px; position: relative; z-index: 2; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 22px, 1120px); padding-top: 12px; }
    .topbar { margin-bottom: 14px; }
    .brand span { display: none; }
    .product-grid { grid-template-columns: 1fr; }
    .selector-panel, .blocked-panel { border-radius: 18px; }
    .key-actions { grid-template-columns: 1fr; }
    .art-card { min-height: 310px; border-radius: 18px; }
    .key-card { border-radius: 18px; padding: 22px; }
    .art-copy { inset: auto 21px 21px; }
    .ad-placement { min-height: 266px; margin-top: 20px; padding: 9px; border-radius: 14px; }
    .ad-placement iframe { min-height: 225px; }
}

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