@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
    --bg: #071012;
    --bg-2: #0d1b1f;
    --card: rgba(17, 31, 35, 0.82);
    --card-strong: rgba(23, 43, 48, 0.96);
    --line: rgba(192, 255, 221, 0.14);
    --text: #ecfff5;
    --muted: #91aaa2;
    --gold: #f4c96b;
    --mint: #67f5be;
    --cyan: #5bd8ff;
    --danger: #ff6b6b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 26px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at 10% 5%, rgba(103, 245, 190, 0.18), transparent 34rem),
        radial-gradient(circle at 92% 18%, rgba(244, 201, 107, 0.15), transparent 30rem),
        linear-gradient(140deg, #071012 0%, #0b171a 42%, #071012 100%);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.01em;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
}

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

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

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.app-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 18px 16px 108px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -8px 22px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(6, 14, 16, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.25);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
}

.brand-mark,
.game-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(244, 201, 107, 0.5);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(244, 201, 107, 0.24), rgba(103, 245, 190, 0.08)),
        #101c1f;
    color: var(--gold);
    font-family: "Rajdhani", sans-serif;
    font-size: 18px;
    font-weight: 700;
    box-shadow: inset 0 1px 18px rgba(244, 201, 107, 0.18);
}

.brand strong,
h1,
h2,
h3 {
    font-family: "Rajdhani", sans-serif;
    letter-spacing: 0.01em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.wallet-pill {
    display: grid;
    gap: 2px;
    padding: 8px 14px;
    border: 1px solid rgba(103, 245, 190, 0.22);
    border-radius: 999px;
    background: rgba(103, 245, 190, 0.08);
    text-align: right;
}

.wallet-pill span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.wallet-pill strong {
    color: var(--mint);
    font-size: 13px;
}

.content {
    display: grid;
    gap: 22px;
}

.hero-card,
.lobby-hero,
.admin-hero,
.wallet-hero,
.play-panel,
.panel,
.auth-card,
.notice-card,
.game-card,
.stat-card {
    border: 1px solid var(--line);
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    padding: clamp(28px, 7vw, 70px);
    border-radius: 36px;
}

.hero-card::after {
    position: absolute;
    right: -80px;
    bottom: -130px;
    width: 360px;
    height: 360px;
    content: "";
    border: 1px solid rgba(244, 201, 107, 0.35);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(244, 201, 107, 0.32), transparent 32%),
        conic-gradient(from 20deg, rgba(103, 245, 190, 0.3), rgba(244, 201, 107, 0.26), rgba(91, 216, 255, 0.2), rgba(103, 245, 190, 0.3));
    filter: blur(0.2px);
    opacity: 0.75;
}

.hero-kicker,
.eyebrow {
    color: var(--gold);
    font-family: "Rajdhani", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-card h1,
.lobby-hero h1,
.admin-hero h1,
.section-head h1,
.play-header h1,
.auth-card h1 {
    max-width: 780px;
    margin: 12px 0;
    font-size: clamp(42px, 10vw, 90px);
    line-height: 0.88;
}

.hero-card p,
.lobby-hero p,
.admin-hero p,
.wallet-hero p,
.play-header p,
.game-card p,
.notice-card,
.muted {
    color: var(--muted);
}

.hero-card p {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.6;
}

.hero-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--mint), var(--gold));
    color: #061214;
    box-shadow: 0 16px 36px rgba(103, 245, 190, 0.18);
}

.btn-ghost {
    border: 1px solid rgba(236, 255, 245, 0.18);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
}

.btn-wide {
    width: 100%;
}

.notice-card {
    padding: 16px 18px;
    border-radius: 20px;
    line-height: 1.55;
}

.hero-card .notice-card {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin-top: 26px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.public-grid {
    margin-top: -80px;
    padding: 0 clamp(10px, 3vw, 34px);
}

.game-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    min-height: 246px;
    padding: 20px;
    border-radius: var(--radius);
}

.game-card::before {
    position: absolute;
    inset: auto -32px -70px auto;
    width: 150px;
    height: 150px;
    content: "";
    border-radius: 50%;
    background: rgba(103, 245, 190, 0.11);
}

.game-card h2 {
    margin: 10px 0 0;
    font-size: 30px;
}

.game-card p {
    margin: 0;
    line-height: 1.5;
}

.game-badge {
    justify-self: start;
    padding: 6px 10px;
    border: 1px solid rgba(244, 201, 107, 0.24);
    border-radius: 999px;
    color: var(--gold);
    font-size: 12px;
}

.game-meta,
.limit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.game-meta span,
.limit-row span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.is-disabled {
    filter: grayscale(1);
    opacity: 0.62;
}

.lobby-hero,
.admin-hero,
.wallet-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(22px, 4vw, 42px);
    border-radius: 32px;
}

.lobby-hero h1,
.admin-hero h1,
.wallet-hero h1 {
    font-size: clamp(36px, 7vw, 64px);
}

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

.stat-card {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: 22px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    color: var(--mint);
    font-family: "Rajdhani", sans-serif;
    font-size: 30px;
}

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

.section-head.compact {
    align-items: center;
}

.section-head h1,
.section-head h2,
.panel h2 {
    margin: 4px 0;
}

.panel,
.auth-card {
    padding: 22px;
    border-radius: var(--radius);
}

.auth-card {
    width: min(520px, 100%);
    margin: 32px auto;
}

.stack-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(236, 255, 245, 0.15);
    border-radius: 16px;
    outline: none;
    background: rgba(5, 11, 12, 0.68);
    color: var(--text);
    padding: 13px 14px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(103, 245, 190, 0.56);
    box-shadow: 0 0 0 3px rgba(103, 245, 190, 0.12);
}

.flash {
    margin-bottom: 16px;
    padding: 13px 16px;
    border-radius: 18px;
    background: rgba(103, 245, 190, 0.12);
    color: var(--mint);
}

.flash-error {
    background: rgba(255, 107, 107, 0.12);
    color: #ffc0c0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(236, 255, 245, 0.08);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--gold);
    font-family: "Rajdhani", sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

td small {
    color: var(--muted);
}

.status {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(103, 245, 190, 0.1);
    color: var(--mint);
    font-size: 12px;
}

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

.mini-list > div,
.mini-list time {
    display: inline-block;
}

.mini-list {
    grid-template-columns: 1fr auto;
}

.mini-list span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.mini-list time {
    color: var(--muted);
    font-size: 12px;
}

.play-panel {
    display: grid;
    gap: 20px;
    padding: clamp(18px, 4vw, 34px);
    border-radius: 34px;
}

.play-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.round-meter {
    display: grid;
    min-width: 88px;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(244, 201, 107, 0.22);
    border-radius: 20px;
    text-align: center;
}

.round-meter span {
    color: var(--muted);
    font-size: 11px;
}

.round-meter strong {
    color: var(--gold);
    font-size: 26px;
}

.machine {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(103, 245, 190, 0.16);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(103, 245, 190, 0.07), rgba(244, 201, 107, 0.06));
}

.machine-window {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    gap: 12px;
    border-radius: 22px;
    background:
        radial-gradient(circle, rgba(103, 245, 190, 0.16), transparent 65%),
        #061012;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(50px, 18vw, 96px);
    font-weight: 700;
}

.machine-window span {
    display: grid;
    min-width: 74px;
    min-height: 74px;
    place-items: center;
    border: 1px solid rgba(236, 255, 245, 0.13);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
}

.machine-window.is-spinning span {
    animation: popSpin 680ms ease infinite alternate;
}

.machine-result strong {
    display: block;
    color: var(--mint);
    font-size: 28px;
}

.machine-result p {
    margin: 4px 0 0;
    color: var(--muted);
}

.play-form {
    display: grid;
    gap: 14px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice-chip {
    cursor: pointer;
}

.choice-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.choice-chip span {
    display: grid;
    min-height: 54px;
    place-items: center;
    border: 1px solid rgba(236, 255, 245, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
}

.choice-chip input:checked + span {
    border-color: rgba(103, 245, 190, 0.72);
    background: rgba(103, 245, 190, 0.14);
    color: var(--mint);
}

.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.method-list,
.method-admin-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

details,
.method-editor {
    padding: 14px;
    border: 1px solid rgba(236, 255, 245, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

summary {
    cursor: pointer;
    color: var(--gold);
    font-weight: 700;
}

.admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 18px;
    padding-bottom: 2px;
}

.admin-nav a {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid rgba(236, 255, 245, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 13px;
}

.admin-nav a.is-active,
.bottom-nav a.is-active {
    border-color: rgba(103, 245, 190, 0.42);
    color: var(--mint);
}

.admin-form input {
    min-width: 110px;
}

.mini-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mini-form input,
.mini-form select {
    width: auto;
    min-width: 120px;
    padding: 9px 10px;
    border-radius: 12px;
}

.mini-form button {
    border: 1px solid rgba(236, 255, 245, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    padding: 9px 12px;
}

.inline-search {
    display: flex;
    gap: 8px;
}

.inline-search input {
    width: min(260px, 48vw);
}

.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

.method-editor {
    display: grid;
    gap: 10px;
}

.bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 30;
    display: flex;
    justify-content: space-around;
    gap: 8px;
    width: min(720px, calc(100% - 24px));
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(6, 14, 16, 0.84);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 80px rgba(0, 0, 0, 0.5);
}

.bottom-nav a {
    display: grid;
    min-height: 42px;
    min-width: 58px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--muted);
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
}

@keyframes popSpin {
    from {
        transform: translateY(0) rotate(-1deg) scale(1);
    }
    to {
        transform: translateY(-6px) rotate(1deg) scale(1.04);
    }
}

@media (max-width: 920px) {
    .game-grid,
    .stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .app-shell {
        padding-inline: 12px;
    }

    .topbar {
        align-items: stretch;
        border-radius: 26px;
    }

    .brand small {
        display: none;
    }

    .wallet-pill {
        min-width: 130px;
    }

    .hero-card {
        min-height: 500px;
        border-radius: 28px;
    }

    .public-grid {
        margin-top: -54px;
        padding: 0;
    }

    .game-grid,
    .stats-row {
        grid-template-columns: 1fr;
    }

    .lobby-hero,
    .admin-hero,
    .wallet-hero,
    .play-header,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .bottom-nav {
        justify-content: stretch;
    }

    .bottom-nav a {
        min-width: 0;
        font-size: 14px;
    }
}

