:root {
    color-scheme: dark;
    --bg: #000000;
    --panel: rgba(14, 14, 14, 0.88);
    --panel-strong: #111111;
    --panel-soft: rgba(255, 255, 255, 0.055);
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.24);
    --text: #f6f6f2;
    --muted: #a5a5a0;
    --muted-2: #70706b;
    --accent: #b9ff39;
    --accent-2: #ff365f;
    --gold: #ffca45;
    --cyan: #69e7ff;
    --danger: #ff365f;
    --ok: #65f78a;
    --radius: 8px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --font: "Bahnschrift", "Arial Narrow", "Segoe UI", Arial, sans-serif;
    --reel-card-width: 236px;
    --reel-card-height: 288px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 18px;
    overflow-x: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #000;
}

.site-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .52;
    background: url("assets/brand/pattern-corner.png") right top / min(720px, 55vw) auto no-repeat;
    mask-image: linear-gradient(180deg, #000 0 52%, transparent 86%);
}

.site-bg::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(860px, 70vw);
    height: min(520px, 55vh);
    opacity: .2;
    background: url("assets/brand/pattern-wide.png") left bottom / contain no-repeat;
    filter: contrast(1.08);
    mask-image: linear-gradient(90deg, #000, transparent 92%);
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    pointer-events: none;
    overflow: hidden;
    background: #000;
    transition: opacity .55s ease, visibility .55s ease;
}

.intro-screen.is-done {
    opacity: 0;
    visibility: hidden;
}

.intro-screen__logo { width: min(540px, 68vw); height: auto; opacity: 0; transform: scale(.96); transition: opacity .32s ease, transform .32s ease; }
.intro-screen.is-logo-ready .intro-screen__logo { opacity: 1; transform: scale(1); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 60px rgba(0, 0, 0, 0.34);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 116px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0;
}

.brand img {
    display: block;
    width: 112px;
    height: auto;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--text);
    color: #050505;
    font-size: 24px;
    line-height: 1;
}

.brand__text {
    font-size: 22px;
    line-height: 1;
}

.topnav {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.topnav a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease;
}

.topnav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.topnav a:hover {
    color: var(--text);
    background: var(--panel-soft);
}

.attempts-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-width: 112px;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid rgba(185, 255, 57, 0.42);
    border-radius: 6px;
    background: rgba(185, 255, 57, 0.12);
}

.attempts-pill span {
    font-size: 22px;
    font-weight: 900;
    color: var(--accent);
}

.attempts-pill small,
.toolbar-label,
.status-board small,
.history-meta {
    color: var(--muted);
}

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

.hero {
    min-height: 590px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 42px;
    align-items: center;
    padding: 72px 0 58px;
}

.hero__content {
    max-width: 760px;
}

.hero-logo-wrap {
    width: min(640px, 94%);
    margin-bottom: 18px;
}

.hero-logo-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: 62px;
    line-height: 0.96;
    letter-spacing: 0;
    text-transform: uppercase;
    font-weight: 800;
}

h2 {
    margin-bottom: 0;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: .015em;
    text-transform: uppercase;
    font-weight: 750;
}

h3 {
    margin-bottom: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.hero__lead {
    max-width: 620px;
    margin-bottom: 28px;
    color: #d4d4ce;
    font-size: 18px;
    line-height: 1.5;
}

.eyebrow,
.toolbar-label,
.attempts-pill small,
.status-board small,
.btn,
input,
select,
textarea {
    letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
    .intro-screen { display: none; }
}

.code-form {
    display: flex;
    width: min(620px, 100%);
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 10, 10, 0.74);
    backdrop-filter: blur(14px);
}

.auth-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.9fr) auto auto auto;
    gap: 8px;
    width: min(760px, 100%);
    margin-bottom: 10px;
}

.auth-form input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 14px;
    background: rgba(10, 10, 10, 0.74);
    color: var(--text);
    outline: none;
}

.auth-form input:focus {
    border-color: var(--accent);
}

.code-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 14px 16px;
    background: transparent;
    color: var(--text);
    outline: none;
    text-transform: uppercase;
}

.code-form input::placeholder {
    color: var(--muted-2);
    text-transform: none;
}

.form-status {
    min-height: 22px;
    margin: 12px 0 0;
    color: var(--ok);
    font-weight: 700;
}

.form-status--error {
    color: var(--danger);
}

.status-board {
    display: grid;
    gap: 12px;
    align-self: end;
}

.status-board > div {
    min-height: 104px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(16px);
}

.metric {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
}

.section {
    padding: 42px 0;
}

.section--tool {
    padding-top: 26px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.section-head > p {
    max-width: 430px;
    margin-bottom: 2px;
    color: var(--muted);
    line-height: 1.5;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.case-card {
    position: relative;
    min-height: 220px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        rgba(12, 12, 12, 0.84);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.case-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--case-accent, var(--accent));
}

.case-card:hover,
.case-card.is-active {
    transform: translateY(-2px);
    border-color: var(--case-accent, var(--line-strong));
}

.case-card.is-active {
    background:
        linear-gradient(180deg, rgba(185, 255, 57, 0.11), rgba(255, 255, 255, 0.025)),
        rgba(12, 12, 12, 0.9);
}

.case-card h3 {
    margin: 10px 0 10px;
    font-size: 24px;
    text-transform: uppercase;
}

.case-card p {
    min-height: 48px;
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.45;
}

.case-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #d8d8d2;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.13);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.btn--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #080808;
}

.btn--primary:hover {
    background: #d6ff75;
    border-color: #d6ff75;
}

.btn--ghost {
    background: transparent;
}

.btn--danger {
    border-color: rgba(255, 54, 95, 0.55);
    background: rgba(255, 54, 95, 0.16);
    color: #ffdce3;
}

.btn--small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.btn--wide {
    width: 100%;
}

.btn--spin {
    min-width: 180px;
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.sound-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.roulette-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
        rgba(8, 8, 8, 0.84);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.roulette-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.roulette-toolbar > div {
    display: grid;
    gap: 4px;
}

.roulette-toolbar strong {
    font-size: 20px;
}

.toolbar-label {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.reel-viewport {
    position: relative;
    height: 376px;
    overflow: hidden;
    background:
        linear-gradient(90deg, #050505, rgba(5, 5, 5, 0) 13%, rgba(5, 5, 5, 0) 87%, #050505),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.18));
}

.reel-pointer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    z-index: 4;
    transform: translateX(-50%);
    background: var(--accent);
    box-shadow: 0 0 22px rgba(185, 255, 57, 0.8);
}

.reel-pointer::before,
.reel-pointer::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
}

.reel-pointer::before {
    top: 0;
    border-top: 18px solid var(--accent);
}

.reel-pointer::after {
    bottom: 0;
    border-bottom: 18px solid var(--accent);
}

.reel-track {
    display: flex;
    gap: 14px;
    align-items: center;
    height: 100%;
    padding: 0 calc(50% - (var(--reel-card-width) / 2));
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.reel-card {
    flex: 0 0 var(--reel-card-width);
    width: var(--reel-card-width);
    height: var(--reel-card-height);
    display: grid;
    grid-template-rows: 202px minmax(44px, auto);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--rarity-line, var(--line));
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, var(--rarity-bg, rgba(255, 255, 255, 0.07)), rgba(0, 0, 0, 0.18)),
        #101010;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 180ms ease, border-color 180ms ease;
}

.reel-card.is-winning {
    transform: scale(1.07);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(185, 255, 57, 0.35), 0 18px 42px rgba(185, 255, 57, 0.16);
}

.prize-icon,
.prize-visual {
    display: grid;
    place-items: center;
    min-height: 84px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.05);
    color: var(--rarity-color, var(--text));
    font-size: 38px;
    font-weight: 900;
    overflow: hidden;
}

.reel-card .prize-visual {
    width: 100%;
    min-height: 0;
    height: 202px;
    padding: 10px;
}

.prize-visual {
    position: relative;
    padding: 8px;
}

.prize-visual img,
.result-prize__visual img,
.history-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prize-fallback {
    display: grid;
    place-items: center;
    gap: 3px;
    width: 100%;
    height: 100%;
    min-height: 74px;
    color: var(--rarity-color, var(--accent));
    text-align: center;
}

.prize-fallback.is-hidden {
    display: none;
}

.prize-fallback span {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.prize-fallback small {
    color: var(--rarity-color, var(--accent));
    font-size: 22px;
    font-weight: 900;
}

.prize-name {
    min-height: 44px;
    display: flex;
    align-items: end;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.prize-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.rarity-common {
    --rarity-color: #d8d8d2;
    --rarity-line: rgba(255, 255, 255, 0.18);
    --rarity-bg: rgba(255, 255, 255, 0.07);
}

.rarity-uncommon {
    --rarity-color: var(--ok);
    --rarity-line: rgba(101, 247, 138, 0.36);
    --rarity-bg: rgba(101, 247, 138, 0.12);
}

.rarity-rare {
    --rarity-color: var(--cyan);
    --rarity-line: rgba(105, 231, 255, 0.38);
    --rarity-bg: rgba(105, 231, 255, 0.12);
}

.rarity-epic {
    --rarity-color: var(--accent-2);
    --rarity-line: rgba(255, 54, 95, 0.42);
    --rarity-bg: rgba(255, 54, 95, 0.14);
}

.rarity-legendary {
    --rarity-color: var(--gold);
    --rarity-line: rgba(255, 202, 69, 0.48);
    --rarity-bg: rgba(255, 202, 69, 0.13);
}

.result-line {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.result-line strong {
    display: block;
    color: var(--accent);
    font-size: 20px;
}

.result-prize {
    display: inline-grid;
    grid-template-columns: 76px minmax(0, auto);
    align-items: center;
    gap: 14px;
    text-align: left;
}

.result-prize span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.result-prize__visual,
.history-visual {
    display: grid;
    place-items: center;
    width: 76px;
    height: 62px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.055);
    overflow: hidden;
}

.odds-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.odds-item {
    min-height: 74px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(12, 12, 12, 0.96);
}

.odds-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.odds-item span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 70px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(12, 12, 12, 0.7);
}

.history-visual {
    width: 72px;
    height: 56px;
}

.history-visual .prize-fallback {
    min-height: 42px;
}

.history-visual .prize-fallback span {
    font-size: 12px;
}

.history-visual .prize-fallback small {
    font-size: 15px;
}

.history-item strong {
    display: block;
    margin-bottom: 4px;
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#adminModal {
    align-items: stretch;
    justify-content: stretch;
    padding: clamp(10px, 2vw, 24px);
}

.modal.is-open {
    display: flex;
}

.modal__shade {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.login-panel,
.reward-panel,
.admin-panel {
    position: relative;
    width: min(100%, 440px);
    max-height: min(92vh, 900px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d0d0d;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.reward-panel {
    z-index: 1;
    width: min(460px, calc(100vw - 28px));
    padding: 26px;
    text-align: center;
    border-color: rgba(185, 255, 57, 0.42);
    background:
        radial-gradient(circle at 50% 0%, rgba(185, 255, 57, 0.16), transparent 48%),
        #0d0d0d;
    transform: translateY(14px) scale(0.96);
    opacity: 0;
    animation: reward-pop 360ms cubic-bezier(0.2, 1.1, 0.25, 1) forwards;
}

.reward-panel__close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.reward-panel h2 {
    margin-bottom: 18px;
}

.reward-visual {
    display: grid;
    place-items: center;
    width: min(270px, 76vw);
    aspect-ratio: 1.18;
    margin: 0 auto 18px;
    border: 1px solid rgba(185, 255, 57, 0.36);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.045);
    box-shadow: 0 0 42px rgba(185, 255, 57, 0.12);
    overflow: hidden;
}

.reward-visual__item {
    width: 100%;
    height: 100%;
    padding: 18px;
}

.reward-visual__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reward-visual__item .prize-fallback {
    min-height: 180px;
}

.reward-name {
    display: block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 26px;
    line-height: 1.12;
}

.reward-instruction {
    margin-bottom: 22px;
    color: #d4d4ce;
    line-height: 1.5;
}

@keyframes reward-pop {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1680px, 100%);
    height: min(94vh, 980px);
    margin: auto;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.modal-head .eyebrow {
    margin-bottom: 4px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.login-form {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.login-form label,
.case-form label {
    display: grid;
    gap: 6px;
}

.login-form span,
.case-form span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.login-form input,
.case-form input,
.admin-table input,
.admin-table select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    padding: 8px 10px;
    outline: none;
}

.login-form input:focus,
.case-form input:focus,
.admin-table input:focus,
.admin-table select:focus,
textarea:focus {
    border-color: var(--accent);
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-right: 1px solid var(--line);
    overflow: auto;
}

.admin-sidebar[hidden] {
    display: none !important;
}

.admin-layout > .admin-tabs {
    grid-column: 2;
    grid-row: 1;
    margin: 16px 16px 0;
}

.admin-layout > .admin-sidebar {
    grid-column: 1;
    grid-row: 2;
}

.admin-layout > .admin-main {
    grid-column: 2;
    grid-row: 2;
}

#adminModal.is-case-sidebar-hidden .admin-layout,
#adminModal.is-operator .admin-layout {
    grid-template-columns: minmax(0, 1fr);
}

#adminModal.is-case-sidebar-hidden .admin-main,
#adminModal.is-operator .admin-main {
    grid-column: 1;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    overflow: auto;
    min-width: 0;
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-case-list {
    display: grid;
    gap: 8px;
}

.admin-case-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    text-align: left;
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}

.admin-case-btn.is-active {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(185, 255, 57, 0.1);
}

.admin-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    padding: 14px;
    min-width: 0;
}

.case-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) 100px 150px;
    gap: 12px;
    align-items: end;
}

.check-row {
    display: flex !important;
    align-items: center;
    min-height: 38px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 4px;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
}

.admin-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    padding: 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.admin-table td:last-child,
.admin-table th:last-child {
    width: 48px;
    text-align: right;
}

.admin-table input[type="number"] {
    max-width: 96px;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1),
.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    width: 22%;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3),
.admin-table th:nth-child(4),
.admin-table td:nth-child(4),
.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 10%;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
    width: 24%;
}

.admin-table--spins {
    min-width: 1180px;
}

.admin-table--spins th,
.admin-table--spins td {
    width: auto !important;
}

.admin-photo {
    display: grid;
    grid-template-columns: 74px minmax(120px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.admin-photo__preview {
    grid-row: span 2;
    width: 74px;
    height: 58px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    overflow: hidden;
}

.admin-photo__preview .prize-fallback {
    min-height: 46px;
}

.admin-photo__preview .prize-fallback span {
    font-size: 12px;
}

.admin-photo__preview .prize-fallback small {
    font-size: 15px;
}

.admin-photo input[type="text"] {
    grid-column: 2 / 4;
    min-height: 32px;
    font-size: 12px;
}

.file-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    overflow: hidden;
}

.file-btn:hover,
.file-btn:focus-within {
    border-color: var(--accent);
}

/* The native control covers the label: one tap reliably opens the picker on touch browsers. */
.file-btn input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.admin-table input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

.chance-value {
    color: var(--accent);
    font-weight: 900;
    white-space: nowrap;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.code-generator {
    display: grid;
    grid-template-columns: minmax(110px, 1.1fr) repeat(3, minmax(86px, 0.8fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.code-generator label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.code-output {
    min-height: 78px;
    margin-bottom: 12px;
}

textarea {
    resize: vertical;
    font-family: "Consolas", "Courier New", monospace;
    min-height: 120px;
}

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

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 58px;
    }

    .status-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .case-grid {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 260px;
    }

    .case-form {
        grid-template-columns: 1fr 1fr;
    }

    .code-generator {
        grid-template-columns: 1fr 1fr;
    }

    .code-generator .btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    :root {
        --reel-card-width: 172px;
        --reel-card-height: 220px;
    }

    .topbar {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .topnav {
        grid-column: 1 / -1;
        justify-content: start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .topnav a {
        white-space: nowrap;
    }

    h1 {
        font-size: 46px;
    }

    h2 {
        font-size: 28px;
    }

    .hero__lead {
        font-size: 17px;
    }

    .code-form {
        flex-direction: column;
    }

    .auth-form {
        grid-template-columns: 1fr;
    }

    .status-board {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: start;
        flex-direction: column;
    }

    .roulette-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .btn--spin {
        grid-column: 1 / -1;
        width: 100%;
    }

    .reel-viewport {
        height: 278px;
    }

    .reel-card { grid-template-rows: 146px minmax(38px, auto); padding: 10px; }
    .reel-card .prize-visual { height: 146px; padding: 7px; }

    .prize-icon {
        min-height: 66px;
        font-size: 30px;
    }

    .history-item {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 10px;
    }

    .case-form {
        grid-template-columns: 1fr;
    }

    .code-generator {
        grid-template-columns: 1fr;
    }
}

/* Main poster, centered category rows and consistent artwork containment. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.hero {
    display: block;
    min-height: 0;
    padding: 30px 0 38px;
}

.hero-poster {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: #07080d;
    box-shadow: 0 24px 58px rgba(0,0,0,.46);
}

.hero-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-stats {
    width: min(100%, 980px);
    margin: 20px auto 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#cases.section { padding-top: 20px; }
.case-grid { padding-top: 8px; }
.case-category {
    margin-bottom: 76px;
    padding: 0;
}
.case-category__title {
    margin-bottom: 32px;
    text-align: left;
    font-size: clamp(30px, 3.4vw, 44px);
}
.case-category__grid {
    justify-content: center;
    gap: 38px 34px;
}
.case-category__grid .case-card {
    flex: 0 1 300px;
    width: min(100%, 300px);
}

.history-visual,
.account-winning .history-visual {
    width: 74px;
    height: 74px;
    min-width: 74px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 6px;
    background: #101114;
}

.history-visual img,
.account-winning .history-visual img,
.account-avatar {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.account-avatar {
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover !important;
}

.admin-poster {
    width: min(100%, 960px);
    margin: 4px auto 18px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b0c10;
}
.admin-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
    .hero { padding: 12px 0 28px; }
    .hero-poster { border-radius: 5px; }
    .hero-stats { grid-template-columns: 1fr; gap: 10px; }
    .case-category { margin-bottom: 54px; }
    .case-category__title { margin-bottom: 22px; font-size: 30px; }
    .case-category__grid { gap: 30px; }
    .history-visual,
    .account-winning .history-visual { width: 62px; height: 62px; min-width: 62px; }
}

.topnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 104px;
    padding: 0 12px;
}

.topnav a span {
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.topnav svg { width: 22px; height: 22px; }

@media (max-width: 620px) {
    .topnav { gap: 6px; }
    .topnav a {
        flex-direction: column;
        gap: 5px;
        min-width: 86px;
        width: auto;
        height: 66px;
        padding: 7px 10px;
    }
    .topnav a span { display: inline; font-size: 10px; text-transform: none; }
}

/* CaseShot v1: club showcase and data workspace */
.site-bg {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 48%, rgba(0, 0, 0, .57) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .8)),
        url("assets/club-bg.png") center / cover no-repeat;
}

.site-bg::after,
.site-bg::before { display: none; }

.hero {
    display: block;
    min-height: 640px;
    padding: clamp(100px, 15vh, 170px) 0 96px;
}

.hero__content {
    display: block;
    max-width: 690px;
}

.hero__content > .eyebrow,
.hero__content > h1,
.hero__lead { display: block; }

.hero h1 {
    margin: 0 0 18px;
    font-family: "Bahnschrift", "Arial Narrow", sans-serif;
    font-size: clamp(58px, 8vw, 112px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: .88;
}

.hero__lead {
    max-width: 520px;
    margin-bottom: 28px;
    font-size: 18px;
    font-weight: 600;
}

.hero .code-form { margin: 0; }
.hero .form-status { text-align: left; }
.hero-video-wrap, .hero-wheel-wrap { display: none !important; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
    width: min(620px, 100%);
    margin-top: 34px;
}

.hero-stats article {
    min-height: 104px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    background: rgba(5,5,6,.74);
    backdrop-filter: blur(10px);
}

.hero-stats strong { display: block; color: #2F54EB; font-size: 36px; line-height: 1; }
.hero-stats span { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.25; text-transform: uppercase; }

.case-grid { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); align-items: stretch; }
.case-card { grid-template-rows: 230px minmax(130px, auto) auto; min-height: 410px; }
.case-card__image { width: 100%; height: 230px; object-fit: contain; padding: 10px; }
.case-card__info { min-height: 130px; }

.admin-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 16px; }
.admin-tab { min-height: 40px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.035); cursor: pointer; font-size: 12px; font-weight: 800; }
.admin-tab:hover, .admin-tab.is-active { border-color: #2F54EB; background: rgba(47,84,235,.16); color: #fff; }
.admin-hint { max-width: 760px; color: var(--muted); line-height: 1.45; }
.admin-tab-panel[hidden] { display: none !important; }
.admin-table--catalog { min-width: 1080px; }

@media (max-width: 720px) {
    .hero { min-height: 590px; padding-top: 100px; }
    .hero h1 { font-size: clamp(48px, 15vw, 76px); }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-stats article { min-height: 72px; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
    .hero-stats span { margin: 0; text-align: right; }
    .case-card { min-height: 370px; grid-template-rows: 205px minmax(120px, auto) auto; }
    .case-card__image { height: 205px; }
}

/* Case catalog refresh */
:root { --accent: #2F54EB; }

.btn--primary {
    border-color: #2F54EB;
    background: #2F54EB;
    color: #fff;
}

.btn--primary:hover { background: #4969f0; border-color: #4969f0; }

.attempts-pill { border-color: rgba(47, 84, 235, .62); background: rgba(47, 84, 235, .14); }
.attempts-pill span, .eyebrow { color: #6f8aff; }

.header-account {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.header-login,
.header-profile {
    border: 1px solid rgba(47, 84, 235, .68);
    border-radius: 6px;
    background: rgba(47, 84, 235, .13);
    color: #f6f6f2;
    cursor: pointer;
    font-weight: 850;
}

.header-login { min-height: 40px; padding: 0 16px; }
.header-login:hover, .header-profile:hover { background: rgba(47, 84, 235, .25); }
.header-profile { display: grid; place-items: center; width: 42px; height: 42px; padding: 3px; border-radius: 50%; }
.header-avatar {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    background: #172245 center / cover no-repeat;
    color: #c8d2ff;
    font-size: 13px;
    font-weight: 900;
}
.header-avatar.has-image { color: transparent; }
.balance-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(47, 84, 235, .62);
    border-radius: 6px;
    background: rgba(47, 84, 235, .1);
    white-space: nowrap;
}
.balance-pill span, .balance-pill small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.balance-pill strong { color: #91a7ff; font-size: 18px; }

.account-auth { display: grid; gap: 18px; }
.account-auth__intro { max-width: 540px; color: var(--muted); line-height: 1.5; }
.account-auth__intro p:last-child { margin: 0; }
.account-auth__tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.account-auth__tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.account-auth__tab.is-active { border-color: #2F54EB; color: #fff; }
.account-auth__form { max-width: 430px; }

.hero {
    grid-template-columns: 1fr;
    min-height: 470px;
    padding: 36px 0 20px;
}

.hero__content { width: 100%; }
.hero-video-wrap { width: min(100%, 1020px); min-height: 390px; margin-bottom: 14px; }
.hero-video { max-height: 440px; }
.hero-video-wrap::after { background: linear-gradient(90deg, transparent, #2F54EB, transparent); }
.hero-wheel-wrap { display: none; }

.case-grid { display: grid; gap: 50px; padding: 8px 0 24px; }
.case-category h3 { margin: 0 0 24px; text-align: center; font-size: 28px; text-transform: uppercase; }
.case-category__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px 18px; }
.case-category__grid .case-card { flex: 0 1 290px; width: min(100%, 290px); }
.case-price { display: inline-flex; margin-top: 10px; padding: 5px 9px; border: 1px solid rgba(47,84,235,.75); border-radius: 5px; color: #aebcff; font-size: 12px; font-weight: 800; }
.case-code-form { margin: 18px 0 10px; }

.account-page[hidden] { display: none !important; }
.account-page {
    width: min(1180px, calc(100% - 28px));
    min-height: 100dvh;
    margin: 0 auto;
    padding: 28px 0 max(48px, env(safe-area-inset-bottom));
}
.account-page__head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.account-page__head > div { display: grid; gap: 3px; }
.account-page__head span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.account-page__head h1 { margin: 0; font-size: clamp(32px, 5vw, 62px); }
body.is-account-page main > :not(#accountPage) { display: none !important; }

.account-auth { display: grid; grid-template-columns: minmax(0, .8fr) minmax(320px, 1fr); align-items: start; gap: clamp(24px, 6vw, 80px); }
.account-auth__intro { padding-top: 26px; }
.account-auth__intro h2 { margin-bottom: 14px; font-size: clamp(28px, 4vw, 48px); }
.account-auth__card,
.account-sidebar,
.account-topup,
.account-panel-section { border: 1px solid var(--line); border-radius: 10px; background: rgba(13,13,13,.92); box-shadow: var(--shadow); }
.account-auth__card { overflow: hidden; }
.account-auth__form { max-width: none; }
.account-auth__tabs { padding: 0 12px; }

.account-dashboard { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.35fr); gap: 22px; align-items: start; }
.account-sidebar { overflow: hidden; }
.account-profile-card { display: grid; justify-items: center; gap: 14px; padding: 26px 20px; text-align: center; background: radial-gradient(circle at 50% 0%, rgba(47,84,235,.22), transparent 62%); }
.account-profile-card > div:nth-child(2) { display: grid; gap: 5px; }
.account-profile-card span,
.account-ledger span,
.account-winning span { color: var(--muted); font-size: 13px; }
.account-avatar { display: grid; place-items: center; width: 96px; height: 96px; border: 2px solid rgba(111,138,255,.7); border-radius: 50%; background: #172245 center / cover no-repeat; color: #d8dfff; font-size: 27px; font-weight: 900; }
.account-avatar.has-image { color: transparent; }
.account-balance { display: grid; gap: 2px; text-align: center; }
.account-balance strong { color: #9db0ff; font-size: 36px; }
.account-settings { border-top: 1px solid var(--line); }
.account-settings h3 { margin: 0; }
.account-main { display: grid; gap: 18px; min-width: 0; }
.account-topup,
.account-panel-section { padding: 22px; }
.account-topup { background: linear-gradient(135deg, rgba(47,84,235,.18), rgba(13,13,13,.94) 60%); }
.account-topup p { margin: 8px 0 0; color: var(--muted); }
.account-topup__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 18px; }
.account-topup__form input { min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.32); color: var(--text); padding: 8px 12px; outline: none; }
.account-panel-section h2 { margin-bottom: 14px; font-size: 24px; }
.account-ledger p { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; margin: 0; border-bottom: 1px solid var(--line); }
.account-winning { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.account-winning > div:last-child { display: grid; gap: 4px; min-width: 0; }
.history-visual { flex: 0 0 72px; align-self: center; }

@media (max-width: 720px) {
    .account-page { width: min(100% - 20px, 1180px); padding-top: 18px; }
    .account-page__head { align-items: flex-start; }
    .account-auth,
    .account-dashboard { grid-template-columns: 1fr; }
    .account-auth__intro { padding-top: 0; }
    .account-topup__form { grid-template-columns: 1fr; }
    .account-settings { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .case-category__grid .case-card { flex-basis: min(100%, 330px); }
}

@media (max-width: 620px) {
    .topbar { grid-template-columns: 1fr auto; gap: 10px; }
    .topnav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .header-account { gap: 7px; }
    .balance-pill { gap: 4px; padding: 0 8px; }
    .balance-pill span, .balance-pill small { display: none; }
    .balance-pill strong::after { content: " кр."; color: var(--muted); font-size: 10px; }
}

.case-card {
    display: grid;
    grid-template-rows: minmax(180px, 1fr) auto auto;
    min-height: 390px;
    padding: 0 14px 16px;
    border: 0;
    background: transparent;
    overflow: visible;
    transform-origin: center bottom;
}

.case-card::before { display: none; }

.case-card__image {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
    mix-blend-mode: screen;
    filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--case-accent) 30%, transparent));
    transition: transform 220ms ease, filter 220ms ease;
}

.case-card__info { text-align: center; }
.case-card .chip { font-size: 11px; min-height: 24px; padding: 4px 8px; }
.case-card h3 { margin: 9px 0 5px; font-size: 20px; }
.case-card p { min-height: 42px; margin: 0; font-size: 13px; }
.case-card .case-stats { justify-content: center; margin-top: 12px; }

.case-card:hover {
    border-color: transparent;
    background: transparent;
    transform: translateY(-6px) scale(1.025);
}

.case-card.is-active:not(:hover) {
    border-color: transparent;
    background: transparent;
    transform: none;
}

.case-card:hover .case-card__image {
    transform: scale(1.07);
    filter: drop-shadow(0 18px 30px color-mix(in srgb, var(--case-accent) 55%, transparent));
}

.case-card.is-active:not(:hover) .case-card__image {
    transform: none;
    filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--case-accent) 30%, transparent));
}

#caseSummary { display: none; }

.case-detail { display: none; }
.opening-head, .roulette-shell { display: none; }
.is-case-page .hero, .is-case-page #cases, .is-case-page #history { display: none; }
.is-case-page .case-detail { display: block; padding: 46px 0 74px; }
.is-case-page .opening-head { display: flex; width: min(1180px, calc(100% - 32px)); margin: 54px auto 20px; }
.is-case-page .roulette-shell { display: block; width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.case-detail__top, .case-detail__content { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.case-back { margin-bottom: 18px; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.case-back:hover { color: #fff; }
.case-detail__hero { position: relative; display: grid; grid-template-columns: minmax(340px, .9fr) 1fr; align-items: center; min-height: 380px; padding: 26px 48px; border: 1px solid rgba(255,255,255,.11); background: rgba(13,13,18,.82); overflow: hidden; }
.case-detail__hero::before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 25% 42%, color-mix(in srgb, var(--case-accent) 30%, transparent), transparent 42%); pointer-events:none; }
.case-detail__hero > * { position: relative; z-index: 1; }
.case-detail__hero img { width: min(100%, 380px); max-height: 340px; justify-self: center; object-fit: contain; mix-blend-mode: screen; filter: drop-shadow(0 22px 32px color-mix(in srgb, var(--case-accent) 40%, transparent)); }
.case-detail__hero h1 { font-size: clamp(36px, 5vw, 68px); margin-bottom: 14px; }
.case-detail__hero p:not(.eyebrow) { max-width: 500px; color: var(--muted); line-height: 1.55; }
.case-detail__content { padding-top: 48px; }
.case-detail__content h2 { text-align: center; margin-bottom: 22px; }
.prize-catalog { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.catalog-prize { min-height: 145px; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.catalog-prize__visual { height: 72px; margin-bottom: 9px; }
.catalog-prize__visual .prize-fallback { min-height: 72px; }
.catalog-prize strong, .catalog-prize span { display:block; }
.catalog-prize strong { font-size: 13px; }
.catalog-prize span { margin-top: 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
    .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .case-detail__hero { grid-template-columns: 1fr; text-align: center; padding: 28px; }
    .prize-catalog { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 620px) {
    .hero { min-height: 330px; }
    .hero-video-wrap { min-height: 260px; }
    .case-grid { grid-template-columns: 1fr; gap: 14px; }
    .case-card { grid-template-rows: 210px auto auto; min-height: 330px; }
    .case-card__image { height: 230px; }
    .case-detail__top, .case-detail__content { width: min(100% - 24px, 1180px); }
    .case-detail__hero { min-height: 0; padding: 22px; }
    .prize-catalog { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Centered 1SHOT animation */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 560px;
}

.hero__content {
    width: 100%;
    align-items: center;
}

.hero-video-wrap {
    width: min(1120px, 100%);
    min-height: 450px;
    margin: 0 auto 22px;
}

.hero-video {
    width: min(100%, 1080px);
    max-height: 500px;
}

.code-form { width: min(620px, 100%); }

.prize-id-field {
    min-width: 175px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    color: #9db0ff;
}

.prize-id-label { color: var(--muted); font-size: 12px; }

/* Image containment and compact admin columns */
.prize-visual img,
.admin-photo__preview img,
.catalog-prize__visual img,
.reward-visual__item img,
.history-visual img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.admin-photo { width: 250px; max-width: 250px; grid-template-columns: 64px minmax(0, 1fr); overflow: hidden; }
.admin-photo__preview { width: 64px; height: 58px; }
.admin-photo input[type="text"] { grid-column: 2; max-width: 176px; overflow: hidden; text-overflow: ellipsis; }
.admin-photo .file-btn { min-width: 0; white-space: nowrap; }
.admin-photo [data-clear-prize-image] { display: none; }

.admin-table { min-width: 1240px; }
.admin-table th:nth-child(1), .admin-table td:nth-child(1) { width: 19%; }
.admin-table th:nth-child(2), .admin-table td:nth-child(2) { width: 19%; }
.admin-table th:nth-child(3), .admin-table td:nth-child(3) { width: 11%; }
.admin-table th:nth-child(4), .admin-table td:nth-child(4),
.admin-table th:nth-child(5), .admin-table td:nth-child(5),
.admin-table th:nth-child(6), .admin-table td:nth-child(6) { width: 8%; }
.admin-table th:nth-child(7), .admin-table td:nth-child(7) { width: 25%; }
.admin-table th:nth-child(8), .admin-table td:nth-child(8) { width: 40px; }

@media (max-width: 620px) {
    .hero { min-height: 390px; }
    .hero-video-wrap { min-height: 290px; }
    .hero-video { max-height: 320px; }
}

/* Full-page admin and clean case art */
#adminModal.is-open {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    padding: 0;
    background: #090909;
}

#adminModal .modal__shade { display: none; }
#adminModal .admin-panel {
    width: 100%;
    height: 100vh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.case-detail__hero {
    min-height: 350px;
    padding: 18px 48px;
    border: 0;
    background: transparent;
    overflow: visible;
}

.case-detail__hero::before { display: none; }
.case-detail__hero img {
    width: min(100%, 440px);
    max-height: 390px;
    mix-blend-mode: normal;
    filter: drop-shadow(0 22px 30px color-mix(in srgb, var(--case-accent) 38%, transparent));
}

.case-card__image {
    object-fit: cover;
    object-position: 50% 48%;
    mix-blend-mode: normal;
    border-radius: 4px;
}

.reward-panel {
    width: min(390px, calc(100vw - 28px));
    padding: 22px;
    border-color: rgba(47, 84, 235, .8);
    background: radial-gradient(circle at 50% 0%, rgba(47, 84, 235, .24), transparent 52%), #0d0d0d;
}

.reward-visual {
    width: min(300px, 78vw);
    aspect-ratio: 1;
    border-color: rgba(47, 84, 235, .64);
    background: #111;
    box-shadow: 0 0 46px rgba(47, 84, 235, .24);
}

.reward-visual__item { padding: 8px; }
.reward-name { color: #7891ff; }

/* Uploaded PNGs must never resize the layout. */
.prize-visual,
.catalog-prize__visual,
.admin-photo__preview,
.reward-visual__item,
.history-visual,
.result-prize__visual {
    position: relative;
    overflow: hidden;
}

.prize-visual img,
.catalog-prize__visual img,
.admin-photo__preview img,
.reward-visual__item img,
.history-visual img,
.result-prize__visual img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.admin-layout { grid-template-columns: 240px minmax(0, 1fr); }
.admin-main { padding: 14px; }
.admin-table { min-width: 980px; }
.admin-photo { width: 188px; max-width: 188px; grid-template-columns: 54px minmax(0, 1fr); gap: 6px; }
.admin-photo__preview { width: 54px; height: 54px; }
.admin-photo input[type="text"] { max-width: 122px; }
.admin-photo .file-btn { padding: 6px 8px; font-size: 11px; }

@media (max-width: 820px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 210px; }
}

/* Main drop screen */
.topnav {
    gap: 12px;
}

.topnav a {
    width: 58px;
    height: 52px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .035);
}

.topnav a:hover {
    border-color: rgba(47, 84, 235, .5);
    background: rgba(47, 84, 235, .12);
}

.topnav svg {
    width: 29px;
    height: 29px;
    stroke-width: 1.55;
}

.hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr);
    min-height: 590px;
    gap: clamp(24px, 5vw, 76px);
    padding: 54px 0 46px;
}

.hero__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.hero-logo-wrap,
.auth-form,
.hero__lead,
.hero__content > h1,
.hero__content > .eyebrow,
.status-board {
    display: none;
}

.hero-video-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: min(720px, 100%);
    min-height: 340px;
    margin: 0 auto 24px;
    overflow: hidden;
}

.hero-video-wrap::after {
    content: "";
    position: absolute;
    inset: auto 7% 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(185,255,57,.75), transparent);
}

.hero-video {
    display: block;
    width: 100%;
    max-height: 390px;
    object-fit: contain;
}

.hero-wheel-wrap {
    display: grid;
    place-items: center;
    min-width: 0;
    align-self: center;
}

.hero-wheel-wrap img {
    display: block;
    width: min(100%, 530px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 22px 38px rgba(255, 0, 41, .22));
}

.code-form {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    margin: 0 auto;
}

.codeStatus {
    text-align: center;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero__content { order: 1; }
    .hero-wheel-wrap { order: 2; }

    .hero-video-wrap {
        min-height: 260px;
        margin-bottom: 12px;
    }

    .hero-wheel-wrap img {
        width: min(420px, 82vw);
    }
}

@media (max-width: 720px) {
    .topnav a {
        width: 54px;
        height: 48px;
    }

    .topnav svg {
        width: 27px;
        height: 27px;
    }

    .hero {
        padding-top: 36px;
    }

    .hero-video-wrap {
        min-height: 180px;
        margin-bottom: 8px;
    }

    .hero-wheel-wrap img {
        width: min(330px, 88vw);
    }

    .code-form {
        margin-top: 2px;
    }
}

/* Header labels and hero composition */
.topnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 112px;
    height: 52px;
    padding: 0 12px;
}

.topnav a span {
    display: inline;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.topnav svg { width: 22px; height: 22px; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: center;
    gap: clamp(36px, 9vw, 130px);
    min-height: 620px;
}

.hero__content { max-width: 760px; }
.hero .hero-drop-title {
    display: grid;
    justify-items: center;
    margin: 0 auto 34px;
    color: #fff;
    font-family: "Bahnschrift", "Arial Narrow", sans-serif;
    font-size: 116px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: .74;
    text-transform: uppercase;
    transform: skewX(-8deg);
    text-shadow: 5px 5px 0 rgba(47, 84, 235, 0.34);
}

.hero .hero-drop-title span { display: block; }
.hero .hero__content > .eyebrow,
.hero .hero__content > h1,
.hero .hero__content > .hero__lead { display: block; }

.hero .hero__content > h1 {
    margin: 0 0 18px;
    font-family: "Bahnschrift", "Arial Narrow", sans-serif;
    font-size: clamp(58px, 8vw, 112px);
    font-weight: 900;
    line-height: .9;
}

.hero .hero__content > .hero__lead {
    max-width: 540px;
    margin-bottom: 28px;
    color: #ececea;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.48;
    text-align: center;
}
.hero .hero__content { text-align: center; }
.hero .hero__content .code-form { margin-left: auto; margin-right: auto; }
.hero .hero__content .form-status { text-align: center; }
.hero .code-form { margin: 0; }
.hero .form-status { text-align: left; }

.hero-stats {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
}

.hero-stats article { min-height: 104px; }

@media (max-width: 720px) {
    .topnav a {
        flex-direction: column;
        gap: 5px;
        min-width: 86px;
        width: auto;
        height: 66px;
        padding: 7px 10px;
    }
    .topnav a span { display: inline; font-size: 10px; text-transform: none; }
    .hero { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
    .hero-stats { grid-template-columns: 1fr; }
}

.catalog-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 420px);
}

.catalog-picker select {
    min-width: 0;
    flex: 1;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #101010;
    color: var(--text);
}

.consent-panel {
    position: relative;
    z-index: 1;
    width: min(500px, calc(100vw - 28px));
    padding: 28px;
    border: 1px solid rgba(47, 84, 235, 0.62);
    border-radius: var(--radius);
    background: #0d0d0d;
    box-shadow: var(--shadow);
}

.consent-panel h2 { margin: 0 0 20px; }

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 14px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}

.consent-check input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: #2f54eb;
}

.consent-check a {
    color: #8ea4ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-panel .btn { margin-top: 12px; }

@media (max-width: 620px) {
    .catalog-picker { width: 100%; }
    .admin-section-head:has(.catalog-picker) { align-items: stretch; flex-direction: column; }
    .hero .hero-drop-title { font-size: 72px; }
}

/* Admin users and balance ledger */
.admin-users { display: grid; gap: 18px; min-width: 0; }
.admin-help { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.admin-users__toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.admin-users__toolbar label { display: grid; flex: 1; gap: 7px; max-width: 560px; }
.admin-users__toolbar label span,
.admin-balance-form label span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.admin-users__toolbar input,
.admin-balance-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0b0b0b;
    color: var(--text);
}
.admin-users__toolbar input:focus,
.admin-balance-form input:focus { border-color: #2f54eb; outline: 2px solid rgba(47,84,235,.18); }
.admin-users__count { margin: 0 0 12px; color: var(--muted); white-space: nowrap; }
.admin-table--users { min-width: 760px; }
.admin-table--transactions { min-width: 940px; }
.admin-user-row { cursor: pointer; transition: background .15s ease; }
.admin-user-row:hover,
.admin-user-row:focus,
.admin-user-row.is-selected { background: rgba(47,84,235,.14); outline: none; }
.admin-user-row.is-selected td:first-child { box-shadow: inset 3px 0 #2f54eb; }
.admin-user-row code,
.admin-selected-user code,
.admin-table--transactions code { color: #aebcff; font-size: 11px; }
.admin-load-more { justify-self: center; }
.admin-selected-user {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(47,84,235,.55);
    border-radius: 8px;
    background: rgba(47,84,235,.08);
}
.admin-selected-user > div { display: grid; gap: 6px; min-width: 0; }
.admin-selected-user span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.admin-selected-user strong,
.admin-selected-user code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-selected-user__balance { color: #91a7ff; font-size: 22px; }
.admin-selected-user > p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.admin-balance-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-balance-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.admin-balance-form h4 { margin: 0; font-size: 17px; }
.admin-balance-form label { display: grid; gap: 7px; }
.admin-balance-form .btn { width: 100%; }
.admin-balance-form :disabled { cursor: not-allowed; opacity: .45; }
.admin-amount { font-weight: 900; white-space: nowrap; }
.admin-amount.is-positive { color: #63d890; }
.admin-amount.is-negative { color: #ff7a87; }

/* Catalog hierarchy, readable prices and robust uploaded artwork. */
.case-grid {
    display: block;
    padding: 14px 0 34px;
}

.case-category {
    display: block;
    margin: 0 0 72px;
}

.case-category__title {
    margin: 0 0 24px;
    text-align: left;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    text-transform: uppercase;
}

.case-category__grid {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 34px 26px;
}

.case-card__image {
    object-fit: contain !important;
    object-position: center !important;
    padding: 8px;
    border-radius: 0;
    background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--case-accent) 12%, transparent), transparent 64%);
}

.case-price {
    justify-content: center;
    min-height: 48px;
    margin-top: 16px;
    padding: 10px 18px;
    border-color: #5474ff;
    background: rgba(47,84,235,.24);
    box-shadow: 0 0 24px rgba(47,84,235,.22);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.balance-pill {
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.account-auth {
    width: min(100%, 540px);
    grid-template-columns: 1fr;
    margin: clamp(12px, 6vh, 72px) auto 0;
    gap: 20px;
}

.account-auth__intro { max-width: none; padding: 0; text-align: center; }
.account-auth__intro h2 { margin: 0 0 10px; }
.account-auth__card { width: 100%; }
.account-auth__form { padding: 22px; }
.account-auth__form[hidden] { display: none !important; }
.account-auth__tabs { justify-content: center; }
.account-auth__tab { min-width: 132px; }

.admin-credential-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-credential-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.025); }
.admin-credential-form h4 { margin: 0; }
.admin-credential-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.admin-credential-form input { min-height: 40px; border: 1px solid var(--line); border-radius: 5px; background: #0b0b0d; color: var(--text); padding: 0 10px; }
#adminModal.is-operator .admin-layout { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 620px) {
    .account-auth { margin-top: 12px; }
    .account-auth__form { padding: 18px; }
    .admin-credential-grid { grid-template-columns: 1fr; }
}

.admin-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

@media (max-width: 820px) {
    #adminModal.is-open { overflow: auto; }
    #adminModal .admin-panel { display: block; min-height: 100dvh; height: auto; overflow: visible; }
    #adminModal .modal-head { position: sticky; top: 0; z-index: 4; padding: 14px 16px; }
    #adminModal .modal-head h2 { font-size: 28px; }
    #adminModal .admin-layout { display: block; overflow: visible; }
    #adminModal .admin-layout > .admin-tabs { margin: 0; }
    #adminModal .admin-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; padding: 12px; overflow: visible; }
    #adminModal .admin-tabs,
    #adminModal .admin-section-head,
    #adminModal .admin-case-list,
    #adminModal #deleteCaseButton { grid-column: 1 / -1; }
    #adminModal .admin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
    #adminModal .admin-case-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #adminModal .admin-main { display: block; overflow: visible; padding: 12px; }
    #adminModal .admin-block { margin-bottom: 12px; padding: 12px; }
    #adminModal .table-scroll { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 480px) {
    .case-grid { gap: 54px; }
    .case-category h3 { margin-bottom: 18px; font-size: 25px; }
    .case-category__grid { gap: 24px; }
    .case-price { width: 100%; }
    #adminModal .modal-head { align-items: flex-start; }
    #adminModal .modal-head h2 { font-size: 25px; }
    #adminModal .admin-sidebar { grid-template-columns: 1fr; }
    #adminModal .admin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #adminModal .admin-case-list { grid-template-columns: 1fr; }
    #adminModal .admin-section-head { align-items: flex-start; flex-direction: column; }
    #adminModal .admin-section-actions { width: 100%; justify-content: stretch; }
    #adminModal .admin-section-actions .btn { flex: 1 1 140px; }
}

@media (max-width: 840px) {
    .admin-selected-user { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-balance-actions { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .admin-users__toolbar { align-items: stretch; flex-direction: column; }
    .admin-users__count { margin: 0; }
    .admin-selected-user { grid-template-columns: 1fr; }
}

/* Larger, high-contrast display scale for the public catalog. */
h1 { font-size: 68px; }
h2 { font-size: 40px; }
h3 { font-size: 22px; }

.topnav a span { font-size: 14px; }
.btn,
input,
select,
textarea { font-size: 16px; }
.eyebrow,
.toolbar-label,
.hero-stats span { font-size: 14px; }
.hero-stats strong { font-size: 42px; }
.hero .hero-drop-title { font-size: 126px; }
.hero .hero__content > .hero__lead { font-size: 20px; }
.case-category__title { font-size: 38px; }
.case-card h3 { font-size: 26px; }
.case-card p { font-size: 18px; line-height: 1.42; }
.case-card .chip { font-size: 13px; }
.case-price { font-size: 18px; padding: 8px 13px; }
.catalog-prize strong { font-size: 15px; }
.catalog-prize span,
.prize-meta { font-size: 13px; }
.history-item strong,
.prize-name { font-size: 17px; }
.history-meta { font-size: 14px; }

@media (max-width: 720px) {
    body { font-size: 16px; }
    h1 { font-size: 46px; }
    h2 { font-size: 32px; }
    h3 { font-size: 20px; }
    .hero .hero-drop-title { font-size: 78px; }
    .hero .hero__content > .hero__lead { font-size: 17px; }
    .hero-stats strong { font-size: 36px; }
    .case-category__title { font-size: 30px; }
    .case-card h3 { font-size: 22px; }
    .case-card p { font-size: 16px; }
    .case-price { font-size: 16px; }
}

/* Final homepage layout overrides. Keep these last so older theme rules cannot crop the poster. */
.hero { display: block; min-height: 0; padding: 30px 0 38px; }
.hero-poster { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #07080d; box-shadow: 0 24px 58px rgba(0,0,0,.46); }
.hero-poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-stats { width: min(100%, 980px); margin: 20px auto 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#cases.section { padding-top: 20px; }
.case-grid { padding-top: 8px; }
.case-category { margin-bottom: 76px; padding: 0; }
.case-category__title { margin-bottom: 32px; text-align: left; font-size: clamp(30px, 3.4vw, 44px); }
.case-category__grid { justify-content: center; gap: 38px 34px; }
.case-category__grid .case-card { flex: 0 1 300px; width: min(100%, 300px); }
.history-visual, .account-winning .history-visual { width: 74px; height: 74px; min-width: 74px; padding: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; background: #101114; }
.history-visual img, .account-winning .history-visual img { display: block; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; object-position: center !important; }
.account-avatar { overflow: hidden; background-repeat: no-repeat; background-size: cover !important; }
.admin-poster { width: min(100%, 960px); margin: 4px auto 18px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0b0c10; }
.admin-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.admin-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
    .hero { padding: 12px 0 28px; }
    .hero-poster { border-radius: 5px; }
    .hero-stats { grid-template-columns: 1fr; gap: 10px; }
    .case-category { margin-bottom: 54px; }
    .case-category__title { margin-bottom: 22px; font-size: 30px; }
    .case-category__grid { gap: 30px; }
    .history-visual, .account-winning .history-visual { width: 62px; height: 62px; min-width: 62px; }
}

/* Keep the catalog CTA readable and consistent on every card size. */
.case-price {
    display: grid;
    place-items: center;
    justify-self: center;
    width: min(100%, 228px);
    min-height: 58px;
    margin: 18px auto 0;
    padding: 10px 18px;
    box-sizing: border-box;
    line-height: 1;
    text-align: center;
}

.case-card p {
    display: -webkit-box;
    min-height: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.case-card:hover {
    transform: translateY(-5px) scale(1.015);
    border-color: #2F54EB;
    background: linear-gradient(180deg, rgba(47, 84, 235, .16), rgba(255, 255, 255, .025)), rgba(12, 12, 12, .92);
    box-shadow: 0 16px 38px rgba(47, 84, 235, .26);
}

.case-card:hover .case-card__image {
    filter: drop-shadow(0 18px 30px rgba(47, 84, 235, .52));
}

@media (max-width: 480px) {
    .case-price {
        width: 100%;
        min-height: 64px;
        font-size: 20px;
    }
}

/* Public feed and the final catalog pass. */
.case-category__title {
    font-size: clamp(42px, 4vw, 56px);
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 255, 255, .16), 0 0 34px rgba(47, 84, 235, .18);
}

.case-card:hover {
    background: rgba(47, 84, 235, .07);
    box-shadow: 0 16px 36px rgba(47, 84, 235, .18);
}

.case-price {
    width: min(100%, 192px);
    min-height: 46px;
    margin: 15px auto 0;
    padding: 8px 14px;
    font-size: 16px;
}

.case-detail__price {
    display: grid;
    position: relative;
    align-self: flex-start;
    width: min(100%, var(--case-title-width, 200px));
    min-height: 52px;
    margin: 22px 0 0;
    font-size: 18px;
    transform: none;
}

.case-detail__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 500px;
}

.case-detail__info h1 {
    width: fit-content;
    max-width: 100%;
}

.prize-catalog {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.catalog-prize {
    min-height: 208px;
    padding: 14px;
}

.catalog-prize__visual,
.catalog-prize__visual .prize-fallback {
    height: 118px;
    min-height: 118px;
}

.balance-pill {
    min-height: 46px;
    gap: 8px;
}

.balance-pill span,
.balance-pill small {
    font-size: 12px;
}

.balance-pill strong {
    font-size: 20px;
}

.history-item--new {
    animation: publicWinIn 620ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes publicWinIn {
    from { opacity: 0; transform: translateY(-14px); border-color: rgba(47, 84, 235, .9); box-shadow: 0 0 0 rgba(47, 84, 235, 0); }
    55% { border-color: rgba(47, 84, 235, .9); box-shadow: 0 0 28px rgba(47, 84, 235, .32); }
    to { opacity: 1; transform: translateY(0); border-color: var(--line); box-shadow: 0 0 0 rgba(47, 84, 235, 0); }
}

@media (max-width: 620px) {
    .case-category__title { font-size: 40px; }
    .case-price { width: min(100%, 188px); min-height: 46px; font-size: 16px; }
    .case-detail__info { align-items: center; max-width: 100%; }
    .case-detail__hero { padding-bottom: 22px; }
    .case-detail__price { align-self: center; width: min(100%, var(--case-title-width, 200px)); min-height: 52px; margin: 22px 0 0; font-size: 18px; }
    .balance-pill span { display: inline !important; font-size: 11px; }
    .balance-pill strong { font-size: 19px; }
    .prize-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .catalog-prize { min-height: 188px; padding: 10px; }
    .catalog-prize__visual,
    .catalog-prize__visual .prize-fallback { height: 96px; min-height: 96px; }
}

/* Account avatar crop and the compact mobile header. */
.account-avatar {
    display: grid !important;
    place-items: center;
    width: 96px !important;
    height: 96px !important;
    min-width: 96px;
    min-height: 96px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background-position: center;
    background-size: cover !important;
}

.avatar-crop-panel {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100vw - 28px));
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101114;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .62);
}

.avatar-crop-preview {
    position: relative;
    width: min(260px, 70vw);
    aspect-ratio: 1;
    margin: 18px auto;
    overflow: hidden;
    border: 2px solid rgba(111, 138, 255, .85);
    border-radius: 50%;
    background: #08090d;
}

.avatar-crop-preview img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    transform: translate(-50%, -50%);
}

.avatar-crop-controls { display: grid; gap: 12px; }
.avatar-crop-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.avatar-crop-controls input { width: 100%; accent-color: #2F54EB; }

@media (max-width: 620px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "brand account" "balance balance" "nav nav";
        gap: 8px;
        width: min(100% - 18px, 540px);
        margin-top: 9px;
        padding: 8px;
    }
    .brand { grid-area: brand; min-width: 0; }
    .brand img { width: 104px; }
    .header-account { display: contents; }
    .header-login, .header-profile { grid-area: account; justify-self: end; align-self: start; }
    .header-login { min-height: 38px; padding: 0 12px; }
    .header-profile { width: 38px; height: 38px; padding: 2px; border-radius: 50%; }
    .topnav { grid-area: nav; justify-content: flex-start; gap: 5px; overflow: visible; padding: 0; }
    .topnav a { min-width: 88px; height: 48px; padding: 6px 7px; flex-direction: row; gap: 5px; }
    .topnav a span { font-size: 10px; }
    .topnav svg { width: 17px; height: 17px; }
    .balance-pill { grid-area: balance; justify-self: stretch; align-self: center; min-height: 48px; gap: 4px; padding: 0 12px; }
    .balance-pill span { display: inline !important; font-size: 10px; }
    .balance-pill small { display: inline !important; font-size: 10px; }
    .balance-pill strong { font-size: 17px; }
}

/* Reference-inspired account workspace. */
.mobile-nav { display: none; }
.header-profile[hidden] { display: none !important; }
.mobile-menu { display: none; }

.account-dashboard { grid-template-columns: 1fr; gap: 28px; }
.account-sidebar { display: contents; }
.account-profile-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: center;
    gap: 30px;
    padding: 32px;
    border: 1px solid rgba(198, 212, 255, .16);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(17, 23, 40, .86), rgba(8, 10, 16, .92));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}
.account-profile-card__identity { display: flex; align-items: center; gap: 28px; min-width: 0; }
.account-profile-card__copy { display: grid; gap: 7px; min-width: 0; }
.account-profile-card__copy > strong { font-size: 30px; line-height: 1.1; }
.account-profile-card__copy > span { color: var(--muted); font-size: 17px; }
.account-profile-card__copy .btn { width: fit-content; margin-top: 7px; }
.account-balance {
    display: grid;
    gap: 8px;
    min-height: 154px;
    padding: 28px;
    border: 1px solid rgba(198, 212, 255, .16);
    border-radius: 10px;
    background: rgba(3, 5, 10, .42);
    text-align: left;
}
.account-balance > span,
.account-balance em { color: var(--muted); font-size: 15px; font-style: normal; }
.account-balance strong { color: #92a6ff; font-size: 48px; line-height: 1; }
.account-balance strong small { color: var(--text); font-size: 22px; }
.account-settings {
    display: grid;
    gap: 20px;
    padding: 32px;
    border: 1px solid rgba(198, 212, 255, .16);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(17, 23, 40, .78), rgba(8, 10, 16, .9));
}
.account-settings h3 { margin: 0 0 8px; font-size: 28px; text-transform: uppercase; }
.account-settings > label { width: min(100%, 480px); }
.avatar-setting { display: grid; gap: 7px; padding-top: 24px; border-top: 1px solid var(--line); }
.avatar-setting > span { font-size: 17px; font-weight: 800; }
.avatar-setting > small,
.avatar-setting > p { margin: 0; color: var(--muted); font-size: 14px; }
.avatar-setting__row { display: flex; align-items: center; gap: 22px; margin-top: 8px; }
.account-avatar--upload { width: 112px !important; height: 112px !important; min-width: 112px; min-height: 112px; }
.avatar-upload {
    display: grid;
    gap: 4px;
    min-width: 280px;
    padding: 18px 20px;
    border: 1px dashed rgba(198, 212, 255, .3);
    border-radius: 8px;
    background: rgba(2, 4, 9, .3);
    color: var(--text);
    cursor: pointer;
}
.avatar-upload:hover { border-color: #4969f0; background: rgba(47, 84, 235, .1); }
.avatar-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.avatar-upload strong { font-size: 16px; }
.avatar-upload span { color: var(--muted); font-size: 13px; }
.profile-actions { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-actions .btn { min-width: 230px; }
.account-settings #userLogoutButton { justify-self: start; }
.account-main { display: grid; gap: 18px; }

@media (min-width: 621px) {
    .topbar {
        grid-template-columns: 180px minmax(0, 1fr) auto;
        gap: 26px;
        padding: 12px 18px;
        border-radius: 12px;
    }
    .topnav { justify-content: flex-start; gap: 12px; }
    .topnav a { min-width: 128px; height: 48px; }
    .header-account { gap: 12px; }
    .header-account .balance-pill { order: -1; min-height: 56px; padding: 0 16px; }
    .header-account .balance-pill span { text-transform: none; font-size: 13px; }
    .header-account .balance-pill strong { font-size: 24px; }
    .account-page { width: min(1120px, calc(100% - 48px)); padding-top: 58px; }
    .account-page__head { display: block; margin-bottom: 32px; }
    .account-page__head .btn { margin-bottom: 20px; }
    .account-page__head > div { display: block; }
    .account-page__head > div > span { display: none; }
    .account-page__head h1 { font-size: 50px; }
}

@media (max-width: 620px) {
    body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
    .topbar {
        position: relative;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "brand balance account";
        gap: 6px;
        width: min(100% - 20px, 520px);
        margin-top: 8px;
        padding: 10px;
        border-radius: 12px;
    }
    .topbar .brand { grid-area: brand; align-self: center; min-width: 100px; }
    .topbar .brand img { width: 104px; }
    .topbar .topnav { display: none; }
    .topbar .header-account { display: contents; }
    .topbar .header-login,
    .topbar .header-profile { grid-area: account; justify-self: end; align-self: center; }
    .topbar .header-login { min-height: 38px; padding: 0 10px; }
    .topbar .header-profile[hidden] { display: none !important; }
    .topbar .header-profile { width: 42px; height: 42px; padding: 3px; }
    .topbar .balance-pill { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); grid-area: unset; width: auto; min-width: 0; display: flex; align-items: center; justify-content: center; min-height: 38px; gap: 4px; padding: 0 10px; border-radius: 8px; line-height: 1; white-space: nowrap; }
    .topbar .balance-pill span { display: inline !important; font-size: 11px; text-transform: none; }
    .topbar .balance-pill strong { font-size: 18px; }
    .topbar .balance-pill small { display: inline !important; font-size: 10px; }
    .topbar .balance-pill strong::after { content: none; }
    .mobile-nav {
        position: fixed;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 10px;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 64px;
        padding: 6px;
        border: 1px solid rgba(198, 212, 255, .16);
        border-radius: 12px;
        background: rgba(6, 8, 14, .94);
        box-shadow: 0 12px 36px rgba(0, 0, 0, .48);
        backdrop-filter: blur(16px);
    }
    .mobile-nav a,
    .mobile-nav button {
        display: grid;
        place-items: center;
        gap: 3px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-size: 10px;
        cursor: pointer;
    }
    .mobile-nav a.is-active { color: #91a7ff; background: rgba(47, 84, 235, .1); }
    .mobile-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-menu { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; pointer-events: none; opacity: 0; transition: opacity 180ms ease; }
    .mobile-menu.is-open { pointer-events: auto; opacity: 1; }
    .mobile-menu__shade { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, .62); }
    .mobile-menu__panel { position: relative; display: grid; gap: 18px; width: 100%; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border: 1px solid rgba(198, 212, 255, .18); border-radius: 16px 16px 0 0; background: #10131d; box-shadow: 0 -18px 60px rgba(0, 0, 0, .48); transform: translateY(100%); transition: transform 220ms ease; }
    .mobile-menu.is-open .mobile-menu__panel { transform: translateY(0); }
    .mobile-menu__panel header { display: flex; align-items: center; justify-content: space-between; }
    .mobile-menu__panel h2 { margin: 0; font-size: 24px; }
    .mobile-menu__actions { display: grid; gap: 8px; }
    .mobile-menu__actions button,
    .mobile-menu__actions a { display: flex; align-items: center; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .035); color: var(--text); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
    .mobile-menu__actions button:hover,
    .mobile-menu__actions a:hover { border-color: #4969f0; background: rgba(47, 84, 235, .12); }
    .mobile-menu__logout { border-color: rgba(255, 54, 95, .5) !important; color: #ffb3c0 !important; }
    .mobile-menu__support { margin: 0; padding: 12px; border: 1px solid rgba(111, 138, 255, .28); border-radius: 8px; background: rgba(47, 84, 235, .1); color: var(--muted); font-size: 14px; line-height: 1.45; }
    .account-page { width: min(100% - 20px, 520px); padding: 20px 0 28px; }
    .account-page__head { display: block; margin-bottom: 20px; }
    .account-page__head .btn { margin-bottom: 18px; padding: 0; border: 0; background: transparent; color: var(--muted); }
    .account-page__head > div > span { display: none; }
    .account-page__head h1 { font-size: 32px; }
    .account-dashboard { gap: 16px; }
    .account-profile-card { grid-template-columns: 1fr; gap: 22px; padding: 22px; border-radius: 10px; }
    .account-profile-card__identity { gap: 16px; }
    .account-profile-card__copy > strong { font-size: 24px; }
    .account-profile-card__copy > span { font-size: 14px; }
    .account-avatar { width: 88px !important; height: 88px !important; min-width: 88px; min-height: 88px; }
    .account-balance { min-height: 0; padding: 18px; text-align: center; }
    .account-balance strong { font-size: 38px; }
    .account-settings { gap: 18px; padding: 22px; border-radius: 10px; }
    .account-settings h3 { font-size: 22px; }
    .avatar-setting__row { gap: 14px; }
    .account-avatar--upload { width: 78px !important; height: 78px !important; min-width: 78px; min-height: 78px; }
    .avatar-upload { min-width: 0; flex: 1; padding: 15px; }
    .profile-actions { display: grid; }
    .profile-actions .btn { width: 100%; min-width: 0; }
    .account-settings #userLogoutButton { justify-self: stretch; }
}
