:root {
    --bg: #070b14;
    --bg-soft: #0d1424;
    --panel: rgba(15, 24, 42, 0.88);
    --panel-solid: #101a2e;
    --line: rgba(148, 180, 232, 0.16);
    --line-strong: rgba(148, 180, 232, 0.3);
    --text: #e9f0ff;
    --muted: #93a3bf;
    --accent: #63e6be;
    --accent-2: #7dd3fc;
    --accent-3: #f5c76a;
    --danger: #ff7a90;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(99, 230, 190, 0.14), transparent 60%),
        radial-gradient(900px 600px at 88% 0%, rgba(125, 211, 252, 0.12), transparent 55%),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin: 0 0 0.45em;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 4.4rem);
}

h2 {
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

p {
    margin: 0 0 1rem;
}

.muted {
    color: var(--muted);
}

.mono {
    font-family: var(--mono);
    font-size: 0.78rem;
    word-break: break-all;
}

.eyebrow {
    margin: 0 0 0.65rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.fine-print {
    color: var(--muted);
    font-size: 0.8rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem clamp(1rem, 4vw, 3rem);
    background: rgba(7, 11, 20, 0.78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.4rem;
    background: conic-gradient(from 40deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
    box-shadow: 0 0 24px rgba(99, 230, 190, 0.42);
    transform: rotate(12deg);
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
}

.site-nav a {
    color: var(--muted);
}

.site-nav a:hover,
.site-nav a.button {
    color: var(--text);
}

.nav-points {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.78rem;
}

.site-main {
    flex: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(1.2rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 1.2rem clamp(1rem, 4vw, 2rem) 2rem;
    color: var(--muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--line);
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.5vw, 1.6rem);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.card-head h2 {
    margin: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    border: 1px solid rgba(99, 230, 190, 0.5);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #8cf5d2);
    color: #052019;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.button:hover {
    text-decoration: none;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.button:disabled {
    filter: grayscale(0.6);
    cursor: not-allowed;
    transform: none;
}

.button-small {
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
}

.button-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.button-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(255, 122, 144, 0.5);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.link-button:hover {
    color: var(--text);
    text-decoration: underline;
}

.text-link {
    font-size: 0.85rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.75rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

label {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(4, 8, 15, 0.55);
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 230, 190, 0.16);
}

.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.65rem;
    color: var(--text);
}

.checkbox-row input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

.form-error {
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 122, 144, 0.35);
    border-radius: 10px;
    background: rgba(255, 122, 144, 0.08);
    color: #ffc0ca;
    font-size: 0.84rem;
}

.form-hint {
    color: var(--muted);
    font-size: 0.8rem;
}

.form-foot {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: center;
    gap: clamp(1.5rem, 5vw, 4rem);
    min-height: 62vh;
}

.hero-copy h1 {
    background: linear-gradient(120deg, #ffffff 20%, var(--accent) 62%, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    max-width: 34rem;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.hero-art {
    position: relative;
    min-height: 380px;
    border: 1px solid var(--line);
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 40%, rgba(99, 230, 190, 0.2), transparent 36%),
        linear-gradient(160deg, rgba(13, 20, 36, 0.9), rgba(5, 8, 16, 0.98));
    box-shadow: var(--shadow);
}

.hero-grid {
    position: absolute;
    inset: 46% -20% -10%;
    background-image:
        linear-gradient(rgba(125, 211, 252, 0.23) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.23) 1px, transparent 1px);
    background-size: 46px 46px;
    transform: perspective(420px) rotateX(58deg);
    transform-origin: top;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    animation: float 7s ease-in-out infinite;
}

.orb-one {
    width: 120px;
    height: 120px;
    left: 16%;
    top: 21%;
    background: radial-gradient(circle at 32% 30%, #b8ffe8, #34c99e 46%, #0b4b3b 100%);
    box-shadow: 0 30px 70px rgba(52, 201, 158, 0.35);
}

.orb-two {
    width: 68px;
    height: 68px;
    right: 18%;
    top: 16%;
    background: radial-gradient(circle at 32% 30%, #c8f3ff, #38a8d8 48%, #0c3145 100%);
    animation-delay: -2.4s;
}

.orb-three {
    width: 34px;
    height: 34px;
    right: 30%;
    bottom: 22%;
    background: radial-gradient(circle at 32% 30%, #fff2c8, #dba73d 50%, #4b3308 100%);
    animation-delay: -4.1s;
}

.hero-card {
    position: absolute;
    left: 10%;
    bottom: 10%;
    display: grid;
    gap: 0.15rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(6, 11, 20, 0.86);
    backdrop-filter: blur(10px);
}

.hero-card-label {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-card strong {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 1.2rem;
}

.hero-card-sub {
    color: var(--muted);
    font-size: 0.75rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

.feature-grid,
.metric-grid,
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-number {
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 0.78rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
}

.split-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
    margin: 2rem 0;
}

.split-section > div > h2 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.ledger-card {
    display: grid;
    gap: 0.15rem;
}

.ledger-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.ledger-row:last-child {
    border-bottom: 0;
}

.ledger-row strong {
    color: var(--text);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 460px);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
    min-height: 62vh;
}

.auth-copy p {
    max-width: 30rem;
    color: var(--muted);
}

.auth-card {
    width: 100%;
}

.check-list {
    display: grid;
    gap: 0.5rem;
    margin: 1.2rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.check-list li::before {
    content: "→";
    margin-right: 0.6rem;
    color: var(--accent);
}

.recovery-panel {
    margin-top: 2rem;
    border-color: rgba(99, 230, 190, 0.4);
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
    margin: 1rem 0 1.4rem;
}

.recovery-grid code {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(4, 8, 15, 0.6);
    color: var(--accent-3);
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-head p {
    margin: 0;
    max-width: 44rem;
    color: var(--muted);
}

.wallet-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wallet-balance {
    display: grid;
    align-content: start;
    gap: 0.2rem;
    background:
        radial-gradient(circle at 80% 0%, rgba(99, 230, 190, 0.2), transparent 50%),
        var(--panel);
}

.wallet-label {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-balance > strong {
    font-family: var(--mono);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.wallet-sub {
    color: var(--accent);
    font-family: var(--mono);
}

.wallet-meta {
    display: grid;
    gap: 0.25rem;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.wallet-meta strong {
    color: var(--text);
}

.stack {
    display: grid;
    gap: 0.7rem;
}

.stack-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(4, 8, 15, 0.32);
}

.stack-row > div {
    display: grid;
    gap: 0.15rem;
}

.stack-row strong {
    font-size: 0.92rem;
}

.stack-row span {
    color: var(--muted);
    font-size: 0.78rem;
}

.store-item {
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.store-item .price {
    color: var(--accent-3);
    font-family: var(--mono);
    font-size: 1.3rem;
}

.store-item .type {
    color: var(--accent-2);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    padding: 0.65rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.status {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-completed,
.status-paid,
.status-confirmed,
.status-active {
    border-color: rgba(99, 230, 190, 0.4);
    color: var(--accent);
}

.status-pending,
.status-requested {
    border-color: rgba(245, 199, 106, 0.4);
    color: var(--accent-3);
}

.status-rejected,
.status-failed,
.status-expired {
    border-color: rgba(255, 122, 144, 0.4);
    color: var(--danger);
}

.metric {
    display: grid;
    gap: 0.2rem;
}

.metric span {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric strong {
    font-family: var(--mono);
    font-size: 1.55rem;
}

.warning-card {
    border-color: rgba(255, 122, 144, 0.45);
    background: rgba(255, 122, 144, 0.07);
}

pre {
    max-height: 380px;
    overflow: auto;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(4, 8, 15, 0.7);
    color: #ffd7de;
    font-size: 0.78rem;
}

.toast {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 60;
    max-width: min(380px, calc(100vw - 2.4rem));
    padding: 0.85rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--panel-solid);
    box-shadow: var(--shadow);
    font-size: 0.86rem;
}

.toast.error {
    border-color: rgba(255, 122, 144, 0.5);
    color: #ffc0ca;
}

.game-shell {
    display: grid;
    gap: 1rem;
}

.game-topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-topbar h1 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.game-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.game-stats > div {
    display: grid;
    gap: 0.1rem;
    min-width: 78px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(4, 8, 15, 0.42);
}

.game-stats span {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.game-stats strong {
    font-family: var(--mono);
    font-size: 0.95rem;
}

.canvas-wrap {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 15%, rgba(125, 211, 252, 0.2), transparent 42%),
        linear-gradient(#0a1426, #060a12);
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
    min-height: 320px;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(4, 8, 15, 0.66);
    backdrop-filter: blur(5px);
}

.game-overlay[hidden] {
    display: none;
}

.overlay-card {
    width: min(520px, 100%);
    padding: clamp(1rem, 3vw, 1.6rem);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(9, 16, 30, 0.94);
    box-shadow: var(--shadow);
}

.overlay-card h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.overlay-card p {
    color: var(--muted);
}

.control-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.45rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.8rem;
}

kbd {
    display: inline-block;
    min-width: 1.35rem;
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.7rem;
    text-align: center;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.6rem;
    margin: 1rem 0;
}

.result-stats > div {
    display: grid;
    gap: 0.1rem;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(4, 8, 15, 0.4);
}

.result-stats span {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.result-stats strong {
    font-family: var(--mono);
    font-size: 1.1rem;
}

.game-hint {
    position: absolute;
    left: 50%;
    bottom: 0.85rem;
    z-index: 8;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2rem);
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(4, 8, 15, 0.72);
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
    pointer-events: none;
}

.game-finish {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 9;
    box-shadow: var(--shadow);
}

.game-sound {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 9;
    box-shadow: var(--shadow);
}

.run-callout {
    position: absolute;
    top: 16%;
    left: 50%;
    z-index: 9;
    transform: translate(-50%, 12px);
    opacity: 0;
    color: var(--accent);
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 4px 22px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.run-callout[data-tone="near"] {
    color: var(--accent-2);
}

.run-callout.is-visible {
    animation: run-callout-pop 1s ease-out;
}

.game-stats strong.is-pulsing {
    display: inline-block;
    animation: hud-pulse 0.28s ease-out;
}

.touch-controls {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 9;
    display: none;
    justify-content: center;
    gap: 0.55rem;
    pointer-events: none;
}

.touch-button {
    display: grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(9, 16, 30, 0.75);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(6px);
}

.touch-button:active {
    border-color: var(--accent);
    background: rgba(99, 230, 190, 0.18);
    transform: translateY(1px);
}

.canvas-wrap.is-crashing::after {
    position: absolute;
    inset: 0;
    z-index: 7;
    content: "";
    background: radial-gradient(circle, transparent 35%, rgba(255, 64, 92, 0.42));
    pointer-events: none;
    animation: crash-flash 0.5s ease-out forwards;
}

@media (hover: none), (pointer: coarse), (any-pointer: coarse) {
    .touch-controls {
        display: flex;
    }
}

@keyframes run-callout-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, 12px) scale(0.92);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.05);
    }
    30% {
        transform: translate(-50%, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20px) scale(1);
    }
}

@keyframes hud-pulse {
    0% {
        color: var(--text);
        transform: scale(1);
    }
    35% {
        color: var(--accent-3);
        transform: scale(1.18);
    }
    100% {
        color: var(--text);
        transform: scale(1);
    }
}

@keyframes crash-flash {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.game-footer {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.leaderboard {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: rank;
}

.leaderboard li {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.84rem;
    counter-increment: rank;
}

.leaderboard li::before {
    content: counter(rank);
    color: var(--muted);
    font-family: var(--mono);
}

.leaderboard li:first-child::before {
    color: var(--accent-3);
}

.leaderboard .leader-score {
    color: var(--accent);
    font-family: var(--mono);
}

.leaderboard .leader-time {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.75rem;
}

.segmented {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(4, 8, 15, 0.4);
}

.segmented button {
    padding: 0.3rem 0.65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.segmented button.active {
    background: rgba(99, 230, 190, 0.14);
    color: var(--accent);
}

body.modal-open {
    overflow: hidden;
}

.checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.checkout-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 11, 0.82);
    backdrop-filter: blur(8px);
}

.checkout-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: clamp(1.1rem, 3vw, 1.8rem);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background:
        radial-gradient(circle at 80% 0%, rgba(99, 230, 190, 0.09), transparent 42%),
        linear-gradient(160deg, #111d33, #0a111e);
    box-shadow: var(--shadow);
}

.checkout-panel h2 {
    margin: 0.2rem 0 0.3rem;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.checkout-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.checkout-close:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.08);
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(190px, 240px) 1fr;
    gap: 1.2rem;
    align-items: start;
    margin: 1rem 0;
}

.checkout-qr-wrap {
    display: grid;
    gap: 0.55rem;
    justify-items: center;
    text-align: center;
}

.checkout-qr {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    padding: 0.65rem;
    border-radius: 16px;
    background: #ffffff;
    color: #0a101a;
    font-family: var(--mono);
    font-size: 0.75rem;
    overflow: hidden;
}

.checkout-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.checkout-details {
    display: grid;
    gap: 0.55rem;
    align-content: start;
}

.checkout-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--line);
}

.checkout-row span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.checkout-row strong {
    font-family: var(--mono);
    font-size: 0.88rem;
    text-align: right;
}

.checkout-status[data-tone="pending"] {
    color: var(--accent-2);
}

.checkout-status[data-tone="success"] {
    color: var(--accent);
}

.checkout-status[data-tone="error"] {
    color: var(--danger);
}

.checkout-invoice-field {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.checkout-invoice-field textarea {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(4, 8, 15, 0.55);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.74rem;
    line-height: 1.45;
    resize: vertical;
    text-transform: none;
    letter-spacing: 0;
}

.checkout-invoice-field textarea:focus {
    outline: 2px solid rgba(99, 230, 190, 0.35);
    outline-offset: 2px;
}

.checkout-panel .hero-actions {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-qr-wrap {
        width: min(230px, 100%);
        margin: 0 auto;
    }
}

@media (max-width: 960px) {
    .hero,
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-art {
        min-height: 300px;
    }

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

    .game-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        width: 100%;
    }

    .canvas-wrap {
        aspect-ratio: 4 / 3;
    }

    .game-hint {
        display: none;
    }

    .game-stats {
        width: 100%;
    }

    .game-stats > div {
        flex: 1;
    }

    .lede {
        font-size: 1rem;
    }
}
