:root {
    color-scheme: dark;
    --ink: #f7f2e8;
    --muted: #b9ad9d;
    --paper: #161412;
    --panel: #211e1b;
    --panel-raised: #2a2521;
    --line: #453d35;
    --burgundy: #7e2334;
    --burgundy-bright: #bd4258;
    --gold: #d4a848;
    --success: #76c893;
    --crystal: #5dd9d0;
    --crystal-dark: #196f70;
    --radius: 1rem;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 20rem;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 0%, rgb(126 35 52 / 18%), transparent 32rem),
        linear-gradient(180deg, #12100f 0%, var(--paper) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) auto minmax(13rem, 1fr);
    align-items: center;
    gap: 1.5rem;
    min-height: 5.25rem;
    padding: 0 4vw;
    border-bottom: 1px solid rgb(212 168 72 / 24%);
    background: rgb(18 16 15 / 88%);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    justify-self: start;
}

.brand-mark {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 0.9rem;
    letter-spacing: -0.06em;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.brand small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.main-nav {
    display: flex;
    gap: 1.6rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.main-nav a,
.office-link {
    transition: color 160ms ease;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 0.9rem;
}

.logout-link,
.text-link {
    color: var(--muted);
    font-size: 0.84rem;
}

.logout-link:hover,
.text-link:hover {
    color: var(--ink);
}

.main-nav a:hover,
.main-nav a:focus-visible,
.office-link:hover,
.office-link:focus-visible {
    color: var(--ink);
}

.office-link {
    justify-self: end;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.88rem;
}

.page-shell {
    width: min(74rem, 92vw);
    min-height: calc(100vh - 10rem);
    margin: 0 auto;
    padding: 4.5rem 0 5rem;
}

.messages {
    margin-bottom: 1.5rem;
}

.messages.floating-messages {
    position: fixed;
    z-index: 30;
    top: 5.5rem;
    left: 50%;
    width: min(36rem, 90vw);
    margin: 0;
    transform: translateX(-50%);
    filter: drop-shadow(0 0.8rem 1.5rem rgb(0 0 0 / 45%));
}

.message {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--panel);
}

.message.success {
    border-color: var(--crystal-dark);
}

.message.error,
.errorlist {
    color: #ff9aa9;
}

.dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

h1 {
    max-width: 14ch;
    margin-bottom: 0.8rem;
    font-size: clamp(2.6rem, 6vw, 5.4rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
}

.lead {
    max-width: 46rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
}

.status-badge span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: var(--crystal);
    box-shadow: 0 0 1rem var(--crystal);
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.balance-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.2rem;
    min-height: 10rem;
    padding: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--panel-raised), var(--panel));
}

.balance-card::after {
    position: absolute;
    right: -3rem;
    bottom: -5rem;
    width: 12rem;
    height: 12rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    content: "";
    opacity: 0.08;
}

.balance-card.coins {
    color: var(--gold);
}

.balance-card.crystals {
    color: var(--crystal);
}

.balance-symbol {
    display: grid;
    width: 4.2rem;
    height: 4.2rem;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 1.8rem;
}

.balance-symbol.crystal {
    border-radius: 1rem;
    transform: rotate(45deg) scale(0.78);
}

.balance-symbol.crystal::first-letter {
    transform: rotate(-45deg);
}

.balance-card p {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.balance-card strong {
    color: var(--ink);
    font-family: Georgia, serif;
    font-size: 2.5rem;
    font-weight: 500;
}

.balance-card strong small {
    color: currentColor;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.balance-note {
    position: absolute;
    right: 1.5rem;
    top: 1.35rem;
    color: currentColor;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.institution-grid {
    display: grid;
    gap: 0.75rem;
}

.institution {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    align-items: center;
    gap: 1.2rem;
    min-height: 8rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgb(33 30 27 / 72%);
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.institution:hover,
.institution:focus-visible {
    border-color: var(--gold);
    background: var(--panel-raised);
    transform: translateX(0.3rem);
}

.institution-number {
    align-self: start;
    padding-top: 0.3rem;
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 0.9rem;
}

.institution h2 {
    margin-bottom: 0.35rem;
    font-size: 1.65rem;
}

.institution p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.arrow {
    color: var(--gold);
    font-size: 1.6rem;
}

.next-step {
    display: grid;
    grid-template-columns: minmax(12rem, 0.45fr) 1fr;
    gap: 2rem;
    margin-top: 3.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.next-step h2 {
    margin-bottom: 0;
    font-size: 2rem;
}

.next-step > p {
    align-self: end;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.section-placeholder {
    max-width: 54rem;
    padding-top: 4rem;
}

.compact-heading h1,
.client-heading h1 {
    font-size: clamp(2.6rem, 5vw, 4.3rem);
}

.auth-card {
    max-width: 36rem;
    margin: 5vh auto 0;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--panel-raised), var(--panel));
}

.auth-heading {
    margin-bottom: 2rem;
}

.auth-heading h1 {
    max-width: none;
    font-size: clamp(2.7rem, 6vw, 5rem);
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.auth-grid .auth-card {
    width: 100%;
    margin: 0;
}

.auth-grid .auth-card h2 {
    font-size: 2rem;
}

.auth-card h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.auth-card .text-link {
    display: inline-block;
    margin-top: 1.5rem;
}

.panel,
.danger-panel {
    margin-top: 1.25rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgb(33 30 27 / 78%);
}

.danger-panel {
    display: grid;
    grid-template-columns: 1fr minmax(18rem, 0.7fr);
    gap: 2rem;
    border-color: rgb(189 66 88 / 55%);
}

.panel h2,
.danger-panel h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.split-panel {
    display: grid;
    grid-template-columns: 1fr minmax(18rem, 0.75fr);
    gap: 2.5rem;
}

.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.panel-heading h2,
.panel-heading .eyebrow {
    margin-bottom: 0;
}

.muted,
.helptext {
    color: var(--muted);
    line-height: 1.55;
}

.stack-form p {
    margin-bottom: 1rem;
}

.stack-form label,
.inline-form label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.82rem;
}

input,
select,
textarea,
button {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    color: var(--ink);
    background: #171411;
    font: inherit;
}

button {
    border-color: var(--gold);
    color: #18130a;
    background: var(--gold);
    font-weight: 700;
    cursor: pointer;
}

button:hover,
button:focus-visible {
    filter: brightness(1.08);
}

button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) auto;
    align-items: end;
    gap: 0.7rem;
}

.inline-form label {
    grid-column: 1 / -1;
    margin-bottom: -0.25rem;
}

.inline-form button {
    width: auto;
}

.danger-button {
    border-color: var(--burgundy-bright);
    color: var(--ink);
    background: var(--burgundy);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.money-supply-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.money-supply-card dl {
    display: grid;
    gap: 0.7rem;
    margin: 0;
}

.money-supply-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}

.money-supply-card dt {
    color: var(--muted);
}

.money-supply-card dd {
    margin: 0;
    font-weight: 700;
}

.money-supply-card .money-total {
    padding-top: 0.35rem;
    border-bottom: 0;
    color: var(--gold);
    font-size: 1.08rem;
}

.emission-panel {
    margin-bottom: 1.5rem;
}

.destruction-panel {
    margin-bottom: 1.5rem;
    border-color: rgb(142 48 62 / 55%);
}

.amount {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.amount.positive {
    color: var(--crystal);
}

.amount.negative {
    color: #ff9aa9;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1.2rem;
    color: var(--muted);
}

.pagination a {
    color: var(--gold);
}

.empty-state {
    margin: 1rem 0 0;
    padding: 1.5rem;
    border: 1px dashed var(--line);
    border-radius: 0.7rem;
    color: var(--muted);
    text-align: center;
}

.client-list {
    display: grid;
    gap: 0.5rem;
}

.client-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, auto) minmax(10rem, auto);
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--paper);
}

.client-row:hover {
    border-color: var(--gold);
}

.client-row.inactive {
    opacity: 0.58;
}

.client-row strong,
.client-row small {
    display: block;
}

.client-row small {
    margin-top: 0.2rem;
    color: var(--muted);
}

.client-row > a {
    min-width: 0;
}

.client-row.completed-order-row {
    grid-template-columns: minmax(12rem, 1fr) auto;
}

.client-balances {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    font-variant-numeric: tabular-nums;
}

.client-balances span {
    min-width: 5rem;
    text-align: right;
}

.client-action {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgb(201 154 61 / 38%);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.82rem;
    white-space: nowrap;
}

.office-actions {
    margin-bottom: 1.25rem;
}

.action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgb(126 35 52 / 20%), var(--panel));
}

.appeal-list {
    display: grid;
    gap: 0.65rem;
}

.appeal-row {
    display: grid;
    grid-template-columns: 1fr auto 2rem;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--paper);
}

.appeal-row:hover {
    border-color: var(--gold);
}

.appeal-row strong,
.appeal-row small {
    display: block;
}

.appeal-row small,
.appeal-row > span:not(.arrow) {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.appeal-thread {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.thread-message {
    width: min(46rem, 88%);
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
}

.thread-message.from-baton {
    justify-self: end;
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    background: var(--panel-raised);
}

.thread-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.thread-meta strong {
    color: var(--gold);
}

.thread-message > p {
    margin: 0.9rem 0 0;
    line-height: 1.55;
}

.message-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.message-image {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    aspect-ratio: 1;
}

.message-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-attachment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 7rem;
    padding: 0.9rem;
    border: 1px solid var(--burgundy-bright);
    border-radius: 0.7rem;
    overflow-wrap: anywhere;
}

.pdf-attachment span {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.official-note,
.reserved-note,
.fee-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.market-card {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.market-card.official {
    border-color: rgb(212 168 72 / 65%);
    background: linear-gradient(145deg, rgb(212 168 72 / 14%), var(--panel));
    box-shadow: inset 0 0 2.5rem rgb(212 168 72 / 4%);
}

.market-card.mine {
    outline: 1px solid rgb(61 194 184 / 28%);
}

.market-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.deal-type {
    color: var(--ink);
    font-family: Georgia, serif;
    font-size: 1.25rem;
}

.official-seal {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
    place-items: center;
}

.exchange-amounts {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.8rem;
    margin: 1.35rem 0;
}

.exchange-amounts div:last-child {
    text-align: right;
}

.exchange-amounts small,
.exchange-amounts strong {
    display: block;
}

.exchange-amounts small {
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.exchange-amounts strong {
    font-family: Georgia, serif;
    font-size: 1.35rem;
}

.exchange-amounts > span {
    color: var(--gold);
    font-size: 1.4rem;
}

.market-card form {
    margin-top: 1rem;
}

.trade-history {
    margin-top: 3rem;
}

.casino-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.game-card {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 1.5rem;
    min-height: 17rem;
    padding: 1.5rem;
    border: 1px solid rgb(212 168 72 / 52%);
    border-radius: var(--radius);
    color: var(--ink);
    background: linear-gradient(145deg, rgb(126 35 52 / 35%), var(--panel));
}

.game-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.game-card.paused {
    opacity: 0.66;
}

.game-card h2 {
    margin-bottom: 0.7rem;
    font-size: 2rem;
}

.game-card > div > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.55;
}

.game-card-wheel {
    display: grid;
    width: 8rem;
    height: 8rem;
    border: 0.55rem double var(--gold);
    border-radius: 50%;
    background: repeating-conic-gradient(#7e2334 0deg 36deg, #171411 36deg 72deg);
    place-items: center;
}

.game-card-wheel span {
    display: grid;
    width: 3.2rem;
    height: 3.2rem;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    background: #171411;
    font-family: Georgia, serif;
    font-size: 1.5rem;
    place-items: center;
}

.game-card-coin {
    display: grid;
    width: 8rem;
    height: 8rem;
    border: 0.55rem double var(--gold);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #f4d989, #b87920 62%, #57350d);
    box-shadow: inset 0 0 0 0.35rem rgb(48 28 5 / 45%), 0 0.7rem 1.5rem rgb(0 0 0 / 28%);
    place-items: center;
}

.game-card-coin span {
    color: #3b2205;
    font-family: Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 0 1px #ffe7a1;
}

.game-card-mine {
    display: grid;
    width: 8rem;
    height: 8rem;
    border: 0.45rem solid #5e4635;
    border-radius: 1.4rem 1.4rem 50% 50%;
    background: radial-gradient(circle at 50% 70%, #672b70, #211a28 42%, #0b090d 72%);
    box-shadow: inset 0 0 0 0.35rem rgb(0 0 0 / 35%), 0 0.7rem 1.5rem rgb(0 0 0 / 35%);
    place-items: center;
}

.game-card-mine span {
    color: #d897ef;
    font-size: 3.8rem;
    text-shadow: 0 0 1.3rem rgb(216 151 239 / 85%);
}

.baton-coin-game {
    border-color: rgb(212 168 72 / 65%);
    background: linear-gradient(145deg, rgb(212 168 72 / 18%), rgb(126 35 52 / 15%), var(--panel));
}

.crystal-mine-game {
    border-color: rgb(180 102 207 / 62%);
    background: linear-gradient(145deg, rgb(79 44 91 / 38%), rgb(29 25 34 / 75%), var(--panel));
}

.blue-green-game {
    border-color: rgb(93 217 208 / 52%);
    background: linear-gradient(145deg, rgb(21 91 136 / 34%), rgb(17 112 95 / 20%), var(--panel));
}

.blue-green-game:hover {
    border-color: var(--crystal);
}

.blue-green-game .game-card-wheel {
    border-color: var(--crystal);
    background: repeating-conic-gradient(#155b88 0deg 36deg, #11705f 36deg 72deg);
}

.blue-green-game .game-card-wheel span {
    border-color: var(--crystal);
    color: var(--crystal);
}

.black-white-game {
    border-color: rgb(238 238 238 / 48%);
    background: linear-gradient(145deg, rgb(255 255 255 / 11%), #080808 75%, var(--panel));
}

.black-white-game:hover {
    border-color: #f2f2f2;
}

.black-white-game .game-card-wheel {
    border-color: #eee;
    background: repeating-conic-gradient(#050505 0deg 36deg, #f2f2f2 36deg 72deg);
}

.black-white-game .game-card-wheel span {
    border-color: #eee;
    color: #111;
    background: #eee;
}

.game-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.game-card-meta span,
.game-card-meta strong {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
}

.game-card-meta strong {
    color: var(--gold);
}

.roulette-heading {
    margin-top: 1.5rem;
}

.roulette-theme {
    --roulette-primary: #7e2334;
    --roulette-secondary: #171411;
    --roulette-accent: var(--gold);
}

.roulette-theme.blue-green {
    --roulette-primary: #155b88;
    --roulette-secondary: #11705f;
    --roulette-accent: var(--crystal);
}

.roulette-theme.blue-green button {
    border-color: var(--crystal);
    background: var(--crystal);
}

.roulette-theme.black-white {
    --roulette-primary: #050505;
    --roulette-secondary: #f1f1ed;
    --roulette-accent: #e9e9e4;
}

.roulette-theme.black-white button {
    border-color: #eee;
    color: #111;
    background: #eee;
}

.roulette-layout {
    display: grid;
    grid-template-columns: minmax(26rem, 1fr) minmax(19rem, 0.55fr);
    align-items: start;
    gap: 2rem;
}

.roulette-machine {
    min-width: 0;
}

.roulette-stage {
    --roulette-radius: min(38vw, 12rem);
    position: relative;
    width: min(30rem, 86vw);
    margin: 0 auto 1.25rem;
    aspect-ratio: 1;
}

.roulette-wheel,
.roulette-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.roulette-wheel {
    border: 0.85rem double var(--roulette-accent);
    background: repeating-conic-gradient(from -18deg, var(--roulette-primary) 0deg 36deg, var(--roulette-secondary) 36deg 72deg);
    box-shadow: inset 0 0 0 0.35rem #211b14, inset 0 0 2rem #000, 0 1.25rem 3rem rgb(0 0 0 / 35%);
}

.roulette-number {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 2rem;
    height: 2rem;
    margin: -1rem;
    color: #fff3d6;
    font-weight: 800;
    text-shadow: 0 1px 3px #000;
    transform: rotate(calc((var(--number-index) - 1) * 36deg)) translateY(calc(-1 * (var(--roulette-radius) - 1.6rem))) rotate(calc((var(--number-index) - 1) * -36deg));
    place-items: center;
}

.roulette-number.white-sector {
    color: #111;
    text-shadow: none;
}

.roulette-number.black-sector {
    color: #fff;
}

.roulette-hub {
    position: absolute;
    inset: 31%;
    display: grid;
    align-content: center;
    border: 0.35rem double var(--roulette-accent);
    border-radius: 50%;
    color: var(--roulette-accent);
    background: radial-gradient(circle, #33291b, #15120f 68%);
    text-align: center;
}

.roulette-hub span {
    font-family: Georgia, serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
}

.roulette-hub small {
    color: var(--muted);
    font-size: 0.7rem;
}

.roulette-orbit {
    z-index: 3;
    pointer-events: none;
}

.roulette-ball {
    position: absolute;
    top: 0.65rem;
    left: 50%;
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #d7d2c8 46%, #706b64);
    box-shadow: 0 0.15rem 0.45rem #000;
    transform: translateX(-50%);
}

.roulette-controls {
    margin-top: 0;
}

.roulette-controls > h2 {
    color: var(--gold);
    font-size: 2.5rem;
}

.roulette-result {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: 1.25rem;
    border: 1px solid var(--roulette-accent);
    border-radius: var(--radius);
    background: linear-gradient(145deg, color-mix(in srgb, var(--roulette-accent) 14%, transparent), var(--panel));
    opacity: 1;
    transform: translateY(0);
}

.roulette-result[hidden] {
    display: none;
}

.roulette-result.awaiting {
    opacity: 0;
    transform: translateY(0.8rem);
}

.roulette-result.revealed {
    transition: opacity 350ms ease, transform 350ms ease;
}

.roulette-result .result-number {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    border: 0.25rem double var(--roulette-accent);
    border-radius: 50%;
    color: var(--roulette-accent);
    font-family: Georgia, serif;
    font-size: 2.1rem;
    place-items: center;
}

.roulette-result .result-number.white-sector,
.roulette-result .result-number.black-sector {
    width: auto;
    min-width: 7rem;
    padding: 0 1rem;
    border-radius: 999px;
    font-size: 1.3rem;
}

.roulette-result .result-number.white-sector {
    color: #111;
    background: #f1f1ed;
}

.roulette-result .result-number.black-sector {
    color: #fff;
    background: #050505;
}

.roulette-result > div {
    display: flex;
    gap: 1rem;
}

.coefficient-panel {
    margin-top: 2rem;
}

.coefficient-strip,
.coefficient-form {
    display: grid;
    grid-template-columns: repeat(11, minmax(3.8rem, 1fr));
    gap: 0.55rem;
    overflow-x: auto;
}

.coefficient-strip > div {
    display: grid;
    min-height: 5rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--paper);
    place-items: center;
}

.coefficient-strip strong {
    color: var(--gold);
    font-size: 1.25rem;
}

.coefficient-strip span {
    color: var(--muted);
    font-size: 0.78rem;
}

.coefficient-strip > div.white-sector {
    border-color: #eee;
    background: #f1f1ed;
}

.coefficient-strip > div.white-sector strong,
.coefficient-strip > div.white-sector span {
    color: #111;
}

.coefficient-strip > div.black-sector {
    border-color: #555;
    background: #050505;
}

.coefficient-strip > div.black-sector strong,
.coefficient-strip > div.black-sector span {
    color: #fff;
}

.coefficient-form > div {
    position: relative;
    min-width: 4.5rem;
}

.coefficient-form label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.coefficient-form input {
    padding-right: 1.3rem;
}

.coefficient-form small {
    position: absolute;
    right: 0.45rem;
    bottom: 0.8rem;
    color: var(--muted);
}

.coefficient-form button {
    grid-column: 1 / -1;
    margin-top: 0.6rem;
}

.coin-game-theme button {
    border-color: var(--gold);
    background: var(--gold);
}

.coin-layout {
    display: grid;
    grid-template-columns: minmax(24rem, 1fr) minmax(19rem, 0.55fr);
    align-items: start;
    gap: 2rem;
}

.coin-machine {
    min-width: 0;
}

.coin-stage {
    display: grid;
    min-height: 29rem;
    align-content: center;
    justify-items: center;
    perspective: 55rem;
}

.coin-stage > p {
    min-height: 1.6rem;
    margin-top: 2rem;
    color: var(--gold);
    font-weight: 700;
}

.coin-token {
    position: relative;
    width: 10rem;
    height: 10rem;
    transform-style: preserve-3d;
}

.coin-face {
    position: absolute;
    inset: 0;
    display: grid;
    border: 0.7rem double #6b430e;
    border-radius: 50%;
    color: #3b2205;
    background: radial-gradient(circle at 35% 28%, #ffe89c, #c88624 62%, #65400e);
    box-shadow: inset 0 0 0 0.35rem rgb(255 236 163 / 38%), 0 1rem 2rem rgb(0 0 0 / 35%);
    font-family: Georgia, serif;
    font-size: 5rem;
    font-weight: 700;
    backface-visibility: hidden;
    place-items: center;
}

.coin-tail {
    color: #ddd4c2;
    background: radial-gradient(circle at 35% 28%, #706b61, #282522 62%, #0d0c0b);
    transform: rotateY(180deg);
}

.coin-result {
    margin-bottom: 1.25rem;
}

.coin-result[hidden] {
    display: none;
}

.coin-baton-count {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 2.4rem;
}

.coin-result small {
    color: var(--muted);
}

.coin-rules {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.coin-rules span {
    color: var(--muted);
}

.coin-rules strong {
    color: var(--gold);
}

.mine-game-theme button {
    border-color: #b966d0;
    background: #7a3e8c;
}

.casino-player-wallet {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) repeat(2, minmax(12rem, auto));
    align-items: stretch;
    gap: 0.75rem;
    margin: -0.35rem 0 1.5rem;
}

.casino-player-wallet > div {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgb(25 22 19 / 82%);
}

.casino-player-wallet-owner {
    align-items: flex-start !important;
    flex-direction: column;
    justify-content: center;
}

.casino-player-wallet-owner span,
.casino-wallet-currency small {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.casino-player-wallet-owner strong {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.casino-wallet-currency {
    gap: 0.75rem;
}

.casino-wallet-currency > span:last-child {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 0 0.35rem;
}

.casino-wallet-currency small {
    grid-column: 1 / -1;
}

.casino-wallet-currency strong {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 1.35rem;
}

.casino-wallet-currency em {
    color: var(--muted);
    font-size: 0.72rem;
    font-style: normal;
}

[data-player-balance].balance-updated {
    animation: casino-balance-update 650ms ease-out;
}

@keyframes casino-balance-update {
    0% { color: #fff4b8; text-shadow: 0 0 1.2rem rgb(238 188 75 / 90%); }
    100% { text-shadow: none; }
}

.mine-layout {
    display: grid;
    grid-template-columns: minmax(24rem, 1fr) minmax(19rem, 0.55fr);
    align-items: start;
    gap: 2rem;
}

.mine-machine {
    min-width: 0;
}

.mine-shaft {
    position: relative;
    min-height: 32rem;
    overflow: hidden;
    isolation: isolate;
    border: 0.45rem solid #39291f;
    border-radius: 1.2rem;
    background:
        radial-gradient(circle at 50% 23%, #020102 0 7%, transparent 24%),
        radial-gradient(ellipse at 50% 25%, #241526 0 14%, #0b080c 35%, transparent 58%),
        radial-gradient(circle at 18% 22%, rgb(216 150 70 / 13%), transparent 15%),
        linear-gradient(112deg, #3b2a20, #100c0d 31% 69%, #34251d);
    box-shadow:
        inset 0 0 5rem rgb(0 0 0 / 88%),
        inset 0 0 0 1px rgb(214 159 92 / 18%),
        0 1.2rem 2.5rem rgb(0 0 0 / 32%);
}

.mine-shaft::before,
.mine-shaft::after {
    position: absolute;
    z-index: 0;
    top: -5%;
    bottom: -4%;
    width: 36%;
    background:
        radial-gradient(circle at 30% 14%, #69503c 0 4%, transparent 5%),
        radial-gradient(circle at 72% 37%, #594131 0 6%, transparent 7%),
        radial-gradient(circle at 38% 70%, #493429 0 8%, transparent 9%),
        linear-gradient(90deg, #3f2d24, #211712 72%, transparent);
    content: "";
    filter: drop-shadow(0.7rem 0 0.8rem rgb(0 0 0 / 62%));
}

.mine-shaft::before {
    left: -3%;
    clip-path: polygon(0 0, 91% 0, 72% 9%, 86% 19%, 66% 31%, 80% 43%, 60% 57%, 82% 69%, 65% 82%, 94% 100%, 0 100%);
}

.mine-shaft::after {
    right: -3%;
    transform: scaleX(-1);
    clip-path: polygon(0 0, 91% 0, 72% 9%, 86% 19%, 66% 31%, 80% 43%, 60% 57%, 82% 69%, 65% 82%, 94% 100%, 0 100%);
}

.mine-vanishing-point {
    position: absolute;
    z-index: 1;
    top: 4.4rem;
    left: 50%;
    width: 13rem;
    height: 11rem;
    transform: translateX(-50%);
    border: 0.8rem solid #3a281f;
    border-bottom: 0;
    border-radius: 50% 50% 12% 12%;
    background: radial-gradient(circle at 50% 60%, #000 0 28%, #110b12 58%, #251827 100%);
    box-shadow: inset 0 0 2.4rem #000, 0 0 2.5rem rgb(0 0 0 / 80%);
}

.mine-vanishing-point span {
    position: absolute;
    inset: 22% 27% 0;
    border-radius: 50% 50% 0 0;
    background: #000;
    box-shadow: 0 0 1.4rem #000;
}

.mine-cavern-walls {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
}

.mine-cavern-walls span {
    position: absolute;
    width: 1.2rem;
    height: 4rem;
    clip-path: polygon(0 0, 100% 0, 62% 100%);
    background: linear-gradient(90deg, #503a2d, #17100e);
    filter: drop-shadow(0 0.45rem 0.25rem #000);
}

.mine-cavern-walls span:first-child {
    top: 0;
    left: 29%;
    transform: rotate(8deg);
}

.mine-cavern-walls span:last-child {
    top: 0;
    right: 27%;
    width: 1.65rem;
    height: 5.4rem;
    transform: rotate(-10deg);
}

.mine-depth-lines {
    position: absolute;
    z-index: 1;
    inset: 0;
    opacity: 0.42;
    background:
        linear-gradient(72deg, transparent 0 47.8%, rgb(176 124 75 / 18%) 48% 48.4%, transparent 48.7%),
        linear-gradient(-72deg, transparent 0 47.8%, rgb(176 124 75 / 18%) 48% 48.4%, transparent 48.7%),
        radial-gradient(ellipse at 50% 24%, transparent 0 16%, rgb(123 82 54 / 18%) 17% 18%, transparent 19% 100%);
}

.mine-tunnel-ribs {
    position: absolute;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.mine-tunnel-ribs i {
    position: absolute;
    left: 50%;
    display: block;
    transform: translateX(-50%);
    border: solid rgb(102 72 52 / 78%);
    border-bottom: 0;
    border-radius: 50% 50% 10% 10%;
    box-shadow:
        inset 0.35rem 0.15rem 0.35rem rgb(218 161 98 / 10%),
        0 0.7rem 1rem rgb(0 0 0 / 62%);
}

.mine-tunnel-ribs i:nth-child(1) {
    top: 6.7rem;
    width: 9rem;
    height: 7.5rem;
    border-width: 0.38rem;
    opacity: 0.72;
}

.mine-tunnel-ribs i:nth-child(2) {
    top: 5.5rem;
    width: 16rem;
    height: 13rem;
    border-width: 0.55rem;
    opacity: 0.62;
}

.mine-tunnel-ribs i:nth-child(3) {
    top: 3.4rem;
    width: 25rem;
    height: 21rem;
    border-width: 0.75rem;
    opacity: 0.48;
}

.mine-tunnel-ribs i:nth-child(4) {
    top: -1.5rem;
    width: 38rem;
    height: 32rem;
    border-width: 1.05rem;
    opacity: 0.34;
}

.mine-timber {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}

.mine-timber span {
    position: absolute;
    background:
        repeating-linear-gradient(85deg, transparent 0 0.8rem, rgb(52 24 9 / 28%) 0.85rem 1rem),
        linear-gradient(90deg, #4a2813, #a26831 48%, #3b210f);
    box-shadow: 0.35rem 0.4rem 0.5rem rgb(0 0 0 / 55%);
}

.mine-timber span:first-child,
.mine-timber span:nth-child(2) {
    top: 5rem;
    bottom: auto;
    width: 0.7rem;
    height: 10rem;
}

.mine-timber span:first-child {
    left: 34%;
    transform: rotate(-8deg);
}

.mine-timber span:nth-child(2) {
    right: 34%;
    transform: rotate(8deg);
}

.mine-timber span:last-child {
    top: 4.75rem;
    right: 32%;
    left: 32%;
    height: 0.85rem;
    transform: rotate(-0.8deg);
    border-radius: 0.25rem;
}

.mine-lantern {
    position: absolute;
    z-index: 4;
    top: 6rem;
    left: 39%;
    width: 1.35rem;
    height: 1.9rem;
    transform: translateX(-50%);
    border: 0.18rem solid #3a2a1c;
    border-radius: 0.3rem 0.3rem 0.55rem 0.55rem;
    background: linear-gradient(90deg, #7b4b1d, #ffd779 50%, #754719);
    box-shadow: 0 0 2.8rem 1.1rem rgb(255 184 72 / 27%);
}

.mine-lantern::before {
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 0.85rem;
    height: 1.1rem;
    transform: translateX(-50%);
    border: 0.16rem solid #6b4a28;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    content: "";
}

.mine-lantern span {
    position: absolute;
    inset: 0.42rem 0.5rem;
    border-radius: 45%;
    background: #fff1a8;
    box-shadow: 0 0 1rem #ffb53d;
}

.mine-rails {
    position: absolute;
    z-index: 1;
    top: 10rem;
    bottom: -2rem;
    left: 50%;
    width: min(72%, 28rem);
    transform: translateX(-50%);
    transform-origin: 50% 0;
    clip-path: polygon(43% 0, 57% 0, 92% 100%, 8% 100%);
    background: repeating-linear-gradient(0deg, transparent 0 2.3rem, #24150d 2.35rem 2.8rem, #68401f 2.85rem 3.15rem, transparent 3.2rem 4.4rem);
    opacity: 0.88;
}

.mine-rails::before,
.mine-rails::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, #27211d, #b7b0a5 45% 65%, #302923);
    filter: drop-shadow(0.25rem 0.2rem 0.15rem rgb(0 0 0 / 72%));
}

.mine-rails::before {
    clip-path: polygon(42% 0, 46% 0, 21% 100%, 12% 100%);
}

.mine-rails::after {
    clip-path: polygon(54% 0, 58% 0, 88% 100%, 79% 100%);
}

.mine-cart {
    position: absolute;
    z-index: 5;
    top: auto;
    bottom: 3.8rem;
    left: 50%;
    display: grid;
    width: 8.2rem;
    height: 4.8rem;
    transform: translateX(-50%);
    border: 0.35rem solid #33261e;
    border-radius: 0.5rem 0.5rem 1.3rem 1.3rem;
    color: #2b1b0b;
    background: linear-gradient(#d79a43, #7b4a1e);
    box-shadow: 0 0.8rem 1.5rem rgb(0 0 0 / 55%);
    font-family: Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    place-items: center;
}

.mine-cart > i {
    position: absolute;
    top: 0.75rem;
    right: 0.65rem;
    width: 0.8rem;
    height: 0.8rem;
    border: 0.12rem solid #5b391a;
    border-radius: 50%;
    background: #fff1a1;
    box-shadow: 0 0 1.4rem 0.55rem rgb(255 199 82 / 58%);
}

.mine-cart::before,
.mine-cart::after {
    position: absolute;
    bottom: -1rem;
    width: 1.25rem;
    height: 1.25rem;
    border: 0.25rem solid #1c1815;
    border-radius: 50%;
    background: #6f6258;
    content: "";
}

.mine-cart::before {
    left: 0.7rem;
}

.mine-cart::after {
    right: 0.7rem;
}

.mine-rock {
    position: absolute;
    z-index: 4;
    top: 8.7rem;
    bottom: auto;
    left: 50%;
    display: grid;
    width: 7rem;
    height: 4.2rem;
    transform: translateX(-50%);
    clip-path: polygon(4% 83%, 12% 42%, 29% 27%, 37% 4%, 55% 25%, 72% 13%, 94% 45%, 100% 88%, 78% 100%, 20% 96%);
    color: transparent;
    background:
        radial-gradient(circle at 35% 35%, #706268 0 5%, transparent 6%),
        radial-gradient(circle at 72% 48%, #62555c 0 7%, transparent 8%),
        linear-gradient(145deg, #51454d, #171318 72%);
    filter: drop-shadow(0 0.8rem 0.8rem rgb(0 0 0 / 72%));
    place-items: center;
}

.mine-rock i {
    position: absolute;
    inset: 18% 24%;
    opacity: 0;
    background: linear-gradient(60deg, transparent 47%, #dba1ee 49% 51%, transparent 53%);
}

.mine-rock span {
    font-size: 3.2rem;
}

.mine-rock.mined {
    opacity: 0;
}

.mine-haul {
    position: absolute;
    z-index: 5;
    top: 9rem;
    left: 50%;
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    transform: translateX(-50%) scale(0.45);
    border: 0.14rem solid rgb(239 190 255 / 72%);
    border-radius: 48% 52% 46% 54%;
    color: #f0c0ff;
    background: radial-gradient(circle at 35% 30%, #fff 0 5%, #ca70eb 20%, #5e2673 67%, #211028);
    box-shadow: 0 0 2.8rem rgb(219 122 255 / 88%);
    opacity: 0;
    place-items: center;
    pointer-events: none;
}

.mine-haul span {
    font-size: 2.4rem;
    text-shadow: 0 0 1rem #fff;
}

.mine-haul.found {
    opacity: 1;
    animation: mine-crystal-reveal 700ms cubic-bezier(.2, .8, .25, 1.2) both;
}

.mine-dust {
    position: absolute;
    z-index: 3;
    right: 24%;
    bottom: 5rem;
    left: 24%;
    height: 5rem;
    pointer-events: none;
}

.mine-dust i {
    position: absolute;
    bottom: 0;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #c49a70;
    opacity: 0;
    filter: blur(1px);
}

.mine-dust i:nth-child(1) { left: 12%; --dust-x: -2.8rem; }
.mine-dust i:nth-child(2) { left: 28%; --dust-x: -1.4rem; animation-delay: 120ms; }
.mine-dust i:nth-child(3) { left: 43%; --dust-x: -0.5rem; animation-delay: 240ms; }
.mine-dust i:nth-child(4) { right: 43%; --dust-x: 0.5rem; animation-delay: 80ms; }
.mine-dust i:nth-child(5) { right: 28%; --dust-x: 1.4rem; animation-delay: 190ms; }
.mine-dust i:nth-child(6) { right: 12%; --dust-x: 2.8rem; animation-delay: 300ms; }

.mine-shaft.descending .mine-lantern {
    animation: mine-lantern-sway 620ms ease-in-out infinite alternate;
}

.mine-shaft.descending .mine-dust i {
    animation: mine-dust-trail 1.15s ease-out infinite;
}

.mine-shaft.arrived .mine-vanishing-point {
    box-shadow: inset 0 0 2.4rem #000, 0 0 3.3rem rgb(171 81 196 / 24%);
}

.mine-shaft > p {
    position: absolute;
    z-index: 6;
    right: 0;
    bottom: 0.25rem;
    left: 0;
    color: #d7acdF;
    font-weight: 700;
    text-align: center;
}

.mine-result[hidden] {
    display: none;
}

.mine-result strong {
    color: #c7bcc9;
    font-family: Georgia, serif;
    font-size: 2rem;
}

.mine-result.mine-success strong,
.crystal-text {
    color: #dfa4f4;
    text-shadow: 0 0 1rem rgb(219 122 255 / 52%);
}

@keyframes mine-crystal-reveal {
    0% { opacity: 0; transform: translateX(-50%) translateY(1.5rem) scale(0.25) rotate(-18deg); }
    70% { opacity: 1; transform: translateX(-50%) translateY(-0.35rem) scale(1.08) rotate(4deg); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotate(0); }
}

.casino-history-revealed {
    animation: casino-history-reveal 520ms ease-out both;
}

@keyframes casino-history-reveal {
    from { opacity: 0; background: rgb(218 167 70 / 16%); }
    to { opacity: 1; background: transparent; }
}

@keyframes mine-lantern-sway {
    from { transform: translateX(-50%) rotate(-4deg); }
    to { transform: translateX(-50%) rotate(4deg); }
}

@keyframes mine-dust-trail {
    0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
    20% { opacity: 0.65; }
    100% { opacity: 0; transform: translate(var(--dust-x), -4.8rem) scale(1.5); }
}

.formula-panel code {
    color: var(--gold);
}

.action-card:hover {
    border-color: var(--gold);
}

.action-card h2 {
    margin-bottom: 0.35rem;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.order-section {
    margin-top: 3rem;
}

.order-section > .panel-heading {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.task-card.mine {
    border-color: rgb(212 168 72 / 55%);
}

.task-card.busy {
    opacity: 0.72;
}

.busy-note {
    display: grid;
    min-height: 2.8rem;
    padding: 0.7rem 0.9rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    color: var(--muted);
    text-align: center;
}

.abandon-form {
    margin-top: 0.7rem;
}

.view-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.view-tabs a {
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
}

.view-tabs a.active {
    border-color: var(--gold);
    color: var(--ink);
    background: rgb(212 168 72 / 10%);
}

.view-tabs span {
    margin-left: 0.35rem;
    color: var(--gold);
}

.compact-danger {
    align-items: center;
}

.task-card {
    display: flex;
    min-height: 19rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    flex-direction: column;
}

.task-card h2 {
    font-size: 1.8rem;
}

.task-card .reward-line {
    margin-top: auto;
    margin-bottom: 1rem;
}

.reward-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reward-line span {
    padding: 0.42rem 0.65rem;
    border: 1px solid rgb(212 168 72 / 40%);
    border-radius: 999px;
    color: var(--gold);
    background: rgb(212 168 72 / 8%);
    font-size: 0.82rem;
    font-weight: 700;
}

.reward-line span:last-child:nth-child(2) {
    border-color: rgb(93 217 208 / 40%);
    color: var(--crystal);
    background: rgb(93 217 208 / 8%);
}

.reward-line.large {
    align-self: end;
}

.heading-actions {
    display: grid;
    justify-items: end;
    gap: 0.8rem;
}

.reward-line.large span {
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
}

.button-link {
    display: grid;
    min-height: 2.8rem;
    padding: 0.7rem 0.9rem;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 0.65rem;
    color: #18130a;
    background: var(--gold);
    font-weight: 700;
}

.compact-button {
    min-width: 10rem;
}

.wide-card {
    max-width: 48rem;
}

.claim-list {
    display: grid;
    gap: 0.75rem;
}

.claim-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--paper);
}

.claim-card strong,
.claim-card small {
    display: block;
}

.claim-card small {
    margin-top: 0.2rem;
    color: var(--muted);
}

.claim-card > p {
    margin: 1rem 0;
    color: var(--muted);
}

.proof-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.proof-gallery a {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--panel-raised);
    aspect-ratio: 1;
}

.proof-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 160ms ease;
}

.proof-gallery a:hover img {
    transform: scale(1.035);
}

.review-actions {
    display: flex;
    gap: 0.6rem;
}

.review-actions form {
    flex: 1;
}

.secondary-button {
    border-color: var(--line);
    color: var(--ink);
    background: var(--panel-raised);
}

.success-note {
    align-self: center;
    padding: 1rem;
    border: 1px solid var(--crystal-dark);
    border-radius: 0.7rem;
    color: var(--crystal);
}

.construction-line {
    height: 0.35rem;
    margin: 3rem 0 1.25rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel-raised);
}

.construction-line span {
    display: block;
    width: 18%;
    height: 100%;
    background: linear-gradient(90deg, var(--burgundy-bright), var(--gold));
}

.construction-note {
    color: var(--muted);
}

.market-heading .button-link {
    flex: 0 0 auto;
}

.shop-catalog {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 4rem;
}

.product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover,
.product-card:focus-visible {
    border-color: rgb(212 168 72 / 70%);
    box-shadow: 0 1.1rem 2.6rem rgb(0 0 0 / 24%);
    transform: translateY(-0.2rem);
}

.product-card.official {
    border-color: rgb(212 168 72 / 52%);
}

.product-card-image {
    position: relative;
    aspect-ratio: 1 / 1.05;
    overflow: hidden;
    background: linear-gradient(145deg, #2b2723, #171412);
}

.product-card-image img,
.product-main-image,
.product-thumbnails img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-official-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgb(212 168 72 / 50%);
    border-radius: 999px;
    color: #17120b;
    background: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-card-body {
    padding: 1rem;
}

.product-seller {
    margin-bottom: 0.35rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card h2 {
    min-height: 2.7rem;
    margin-bottom: 0.8rem;
    overflow: hidden;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.product-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.product-prices span {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 800;
}

.product-prices small {
    color: var(--muted);
    font-size: 0.7rem;
}

.shop-empty {
    grid-column: 1 / -1;
    padding: 4rem 1rem;
    text-align: center;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
    gap: 3rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.product-main-image {
    max-height: 42rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--panel);
    aspect-ratio: 1;
}

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.product-thumbnails a {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    aspect-ratio: 1;
}

.product-summary {
    align-self: start;
    position: sticky;
    top: 7rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: linear-gradient(145deg, var(--panel-raised), var(--panel));
}

.product-summary h1 {
    max-width: none;
    font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.product-description {
    color: var(--muted);
    line-height: 1.65;
}

.product-status {
    display: inline-flex;
    margin: 0.5rem 0 1rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--crystal-dark);
    border-radius: 999px;
    color: var(--crystal);
    font-size: 0.78rem;
}

.product-status.sold,
.product-status.removed {
    border-color: var(--line);
    color: var(--muted);
}

.product-status.completed {
    border-color: var(--success);
    color: var(--success);
}

.purchase-box {
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.price-choice-form,
.product-management {
    display: grid;
    gap: 0.65rem;
}

.product-management {
    grid-template-columns: 1fr 1fr;
    margin-top: 1rem;
}

.product-management form,
.product-management button {
    width: 100%;
}

.sold-note {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: var(--muted);
}

.product-comments {
    max-width: 52rem;
    margin-inline: auto;
}

.comment-form {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.comment-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.comment-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--paper);
}

.comment-card > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.comment-card time {
    color: var(--muted);
    font-size: 0.75rem;
}

.comment-card p {
    margin: 0.7rem 0 0;
    line-height: 1.55;
}

.text-danger-button {
    width: auto;
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
    color: #ff9aa9;
    background: transparent;
    font-size: 0.78rem;
}

.product-form-card .lead {
    margin-bottom: 1.5rem;
}

.fund-unavailable-note {
    padding: 0.8rem;
    border: 1px solid rgb(189 66 88 / 55%);
    border-radius: 0.65rem;
    color: #ff9aa9;
    background: rgb(126 35 52 / 14%);
    line-height: 1.45;
}

.market-tabs {
    display: inline-flex;
    gap: 0.35rem;
    margin: -1rem 0 2.5rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
}

.market-tabs a {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    transition: color 160ms ease, background 160ms ease;
}

.market-tabs a:hover,
.market-tabs a.active {
    color: var(--ink);
    background: var(--panel-raised);
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.security-card {
    position: relative;
    display: flex;
    min-height: 19rem;
    flex-direction: column;
    padding: 1.35rem;
    overflow: hidden;
    border: 1px solid rgb(212 168 72 / 42%);
    border-radius: 0.85rem;
    background:
        linear-gradient(135deg, rgb(212 168 72 / 9%), transparent 45%),
        repeating-linear-gradient(0deg, transparent 0 2rem, rgb(212 168 72 / 3%) 2rem 2.05rem),
        var(--panel);
}

.security-card::after,
.security-certificate::after {
    position: absolute;
    right: -3rem;
    bottom: -3rem;
    width: 9rem;
    height: 9rem;
    border: 1px solid rgb(212 168 72 / 18%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.7rem rgb(212 168 72 / 4%);
    content: "";
}

.security-card:hover {
    border-color: var(--gold);
}

.security-card.pending {
    border-style: dashed;
}

.security-card.claimed {
    border-color: rgb(189 66 88 / 68%);
}

.security-card.listed > a {
    display: block;
}

.security-number {
    align-self: flex-end;
    margin-bottom: 2rem;
    color: var(--gold);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.security-card h2 {
    font-size: 1.7rem;
}

.security-card > p,
.security-card > a > p {
    color: var(--muted);
    line-height: 1.55;
}

.security-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.security-card-footer span {
    color: var(--muted);
    font-size: 0.75rem;
}

.security-card-footer strong {
    color: var(--gold);
    white-space: nowrap;
}

.security-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(21rem, 0.8fr);
    align-items: start;
    gap: 2rem;
    margin-top: 2rem;
}

.security-certificate {
    position: relative;
    min-height: 39rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
    border: 1px solid rgb(212 168 72 / 55%);
    border-radius: 0.75rem;
    background:
        radial-gradient(circle at 82% 18%, rgb(212 168 72 / 13%), transparent 15rem),
        repeating-linear-gradient(0deg, transparent 0 2.5rem, rgb(212 168 72 / 3%) 2.5rem 2.56rem),
        linear-gradient(145deg, #28231e, #191613);
    box-shadow: 0 2rem 5rem rgb(0 0 0 / 25%);
}

.security-certificate.status-destroyed {
    filter: grayscale(0.85);
    opacity: 0.72;
}

.security-certificate.status-claimed {
    border-color: rgb(189 66 88 / 70%);
}

.certificate-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 5rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.certificate-top strong {
    color: var(--gold);
}

.certificate-seal {
    position: absolute;
    top: 5rem;
    right: 3rem;
    display: grid;
    width: 5.5rem;
    height: 5.5rem;
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 1.5rem;
    opacity: 0.45;
    transform: rotate(-12deg);
}

.security-certificate h1 {
    max-width: 11ch;
    font-size: clamp(2.7rem, 6vw, 5.2rem);
}

.certificate-label {
    margin-top: 3rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.certificate-obligation {
    max-width: 42rem;
    font-family: Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.65;
}

.certificate-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 3rem 0 0;
}

.certificate-facts div {
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.certificate-facts dt {
    margin-bottom: 0.3rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.certificate-facts dd {
    margin: 0;
    font-weight: 700;
}

.certificate-status {
    display: inline-flex;
    margin-top: 2.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
}

.security-actions > :first-child {
    margin-top: 0;
}

.certificate-note p:last-child {
    margin-bottom: 0;
    line-height: 1.6;
}

.claim-panel,
.claim-record {
    border-color: rgb(189 66 88 / 48%);
}

.security-destroy-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.security-form-card .lead {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--gold);
}

.bank-date-strip {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin: -1.2rem 0 2.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
}

.bank-date-strip strong {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.2rem;
}

.bank-date-strip small {
    margin-left: auto;
}

.bank-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.bank-balance-grid {
    margin-top: 2rem;
}

.bank-offer-card {
    border-top: 3px solid #a64c3e;
}

.bank-offer-card.deposit {
    border-top-color: #5f9f55;
    background:
        linear-gradient(145deg, rgb(61 111 55 / 16%), transparent 48%),
        var(--panel);
}

.agreement-card.deposit {
    border-left-color: #5f9f55;
    background:
        linear-gradient(100deg, rgb(61 111 55 / 12%), transparent 32%),
        var(--panel);
}

.bank-offer-card.deposit .eyebrow,
.agreement-card.deposit .eyebrow {
    color: #83c878;
}

.bank-offer-card.deposit .bank-terms div,
.agreement-card.deposit .agreement-summary div {
    border-color: rgb(95 159 85 / 34%);
}

.bank-terms,
.agreement-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1.25rem 0;
}

.bank-terms div,
.agreement-summary div {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

.bank-terms dt,
.agreement-summary dt {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bank-terms dd,
.agreement-summary dd {
    margin: 0;
    font-weight: 700;
}

.agreement-list {
    display: grid;
    gap: 1rem;
}

.agreement-card {
    border-left: 3px solid #a64c3e;
}

.agreement-summary .agreement-total {
    border-color: rgb(216 170 68 / 55%);
    color: var(--gold);
}

.schedule-details {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.schedule-details summary {
    color: var(--gold);
    cursor: pointer;
    font-weight: 700;
}

.schedule-details .table-wrap {
    max-height: 25rem;
    margin-top: 1rem;
    overflow: auto;
}

.offer-preview {
    margin-top: 1.25rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.offer-preview .table-wrap {
    max-height: 20rem;
    overflow: auto;
}

.history-remove-form {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}

.bank-calendar-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.8fr);
    gap: 2rem;
    margin-bottom: 1rem;
}

.calendar-date-display {
    margin: 0.6rem 0 1rem;
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1;
}

.calendar-controls,
.credit-office-actions {
    display: grid;
    align-content: start;
    gap: 0.8rem;
}

.calendar-jumps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.calendar-jumps button {
    width: 100%;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
    padding: 1.35rem 4vw;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (max-width: 56rem) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        padding-bottom: 1rem;
        overflow-x: auto;
    }

    .dashboard-heading {
        align-items: start;
        flex-direction: column;
    }

    .roulette-layout {
        grid-template-columns: 1fr;
    }

    .coin-layout {
        grid-template-columns: 1fr;
    }

    .mine-layout {
        grid-template-columns: 1fr;
    }

    .shop-catalog {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-summary {
        position: static;
    }

    .security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .security-detail-layout {
        grid-template-columns: 1fr;
    }

    .bank-calendar-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 42rem) {
    .casino-player-wallet {
        grid-template-columns: 1fr 1fr;
    }

    .casino-player-wallet-owner {
        grid-column: 1 / -1;
    }

    .page-shell {
        padding-top: 3rem;
    }

    .office-link {
        padding: 0.6rem 0.75rem;
    }

    .logout-link {
        display: none;
    }

    .balance-grid {
        grid-template-columns: 1fr;
    }

    .balance-card {
        min-height: 8.5rem;
    }

    .institution {
        grid-template-columns: 2rem 1fr auto;
        padding: 1.1rem;
    }

    .next-step {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .split-panel,
    .danger-panel,
    .auth-grid,
    .task-grid,
    .market-grid,
    .casino-grid,
    .roulette-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-card {
        grid-template-columns: 1fr;
    }

    .coin-stage {
        min-height: 23rem;
    }

    .money-supply-grid {
        grid-template-columns: 1fr;
    }

    .mine-shaft {
        min-height: 25rem;
    }

    .shop-catalog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .product-card-body {
        padding: 0.8rem;
    }

    .product-management {
        grid-template-columns: 1fr;
    }

    .security-grid,
    .certificate-facts,
    .bank-product-grid,
    .bank-terms,
    .agreement-summary {
        grid-template-columns: 1fr;
    }

    .bank-date-strip {
        align-items: flex-start;
        flex-direction: column;
        border-radius: 1rem;
    }

    .bank-date-strip small {
        margin-left: 0;
    }

    .calendar-jumps {
        grid-template-columns: 1fr;
    }

    .security-card {
        min-height: 16rem;
    }

    .certificate-top {
        margin-bottom: 3.5rem;
    }

    .certificate-seal {
        top: 6rem;
        right: 1.5rem;
        width: 4rem;
        height: 4rem;
    }

    .roulette-stage {
        --roulette-radius: min(40vw, 12rem);
    }

    .client-row {
        grid-template-columns: 1fr 1.5rem;
    }

    .client-balances {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .client-action {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .appeal-row {
        grid-template-columns: 1fr 1.5rem;
    }

    .appeal-row > span:not(.arrow) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .thread-message {
        width: 100%;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
