:root {
    --bg: #07100d;
    --panel: #102119;
    --panel-2: #192b23;
    --line: rgba(118, 255, 134, .18);
    --text: #f5fff7;
    --muted: #a7b9ad;
    --green: #55e86a;
    --green-2: #1dad43;
    --gold: #ffd84d;
    --danger: #ef4444;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top, #123b26 0, var(--bg) 42%, #030705 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.app-shell {
    width: min(100%, 1120px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 96px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 82px;
    padding: 10px 18px;
    background: rgba(8, 19, 15, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand img {
    width: 86px;
    height: 56px;
    object-fit: contain;
}

.icon-btn,
.close-btn {
    border: 0;
    color: var(--text);
    background: #182821;
    border-radius: var(--radius);
    cursor: pointer;
}

.icon-btn {
    display: grid;
    gap: 4px;
    width: 42px;
    height: 42px;
    place-content: center;
}

.icon-btn span {
    display: block;
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: #b8c8bf;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    font-size: 14px;
    font-weight: 800;
}

.auth-link.accent,
.balance-pill {
    color: var(--green);
}

.balance-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #0e2218;
}

.divider {
    color: #65736b;
}

.page-content {
    padding: 16px;
}

.flash {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-weight: 800;
}

.flash.success {
    background: rgba(85, 232, 106, .14);
    border: 1px solid rgba(85, 232, 106, .32);
}

.flash.error {
    background: rgba(239, 68, 68, .14);
    border: 1px solid rgba(239, 68, 68, .32);
}

.hero-carousel {
    display: grid;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.hero-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    scroll-snap-align: center;
}

.hero-card img,
.promo-card img,
.drawer-banner img,
.auth-banner {
    display: block;
    width: 100%;
    height: auto;
}

.promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.promo-card {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .08);
}

.lobby-tabs {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px;
    border-radius: var(--radius);
    background: #111d27;
    color: #91a39a;
    font-weight: 900;
}

.lobby-tabs span {
    white-space: nowrap;
}

.lobby-tabs .active {
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #31d35c, #11852f);
    color: white;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.game-card,
.invite-box,
.wallet-panel,
.list-panel,
.admin-panel,
.auth-card,
.game-room {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(31, 61, 44, .92), rgba(12, 25, 19, .96));
    box-shadow: 0 16px 42px rgba(0, 0, 0, .24);
}

.game-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 138px;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at right, rgba(85, 232, 106, .28), transparent 34%),
        linear-gradient(135deg, #14271c, #08110d);
}

.game-card h2,
.section-title h1,
.room-head h1,
.admin-panel h1 {
    margin: 0;
}

.game-card p,
.section-title p,
.room-head p,
.center-muted,
.empty {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.play-btn,
.primary-btn,
.copy-btn,
.soft-btn,
.admin-form button,
.finance-row button,
.inline-balance button,
.delete-form button {
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #72f77d, #29b646);
    color: #061009;
    cursor: pointer;
    font-weight: 950;
    text-align: center;
}

.play-btn,
.copy-btn {
    padding: 12px 16px;
}

.primary-btn {
    width: 100%;
    padding: 15px 18px;
    text-transform: uppercase;
}

.soft-btn {
    padding: 0 20px;
    background: #377d46;
}

.invite-box {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 18px;
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background .2s ease;
}

.drawer.open {
    pointer-events: auto;
    background: rgba(0, 0, 0, .55);
}

.drawer-panel {
    width: min(86vw, 330px);
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    background: #08130f;
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform .22s ease;
}

.drawer.open .drawer-panel {
    transform: translateX(0);
}

.drawer-head,
.drawer-chips,
.coupon-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.drawer-head img,
.login-logo {
    width: 142px;
    height: 94px;
    object-fit: contain;
}

.close-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
}

.chip {
    flex: 1;
    padding: 10px;
    border-radius: 999px;
    background: #1b2a23;
    color: #b8c8bf;
    text-align: center;
    font-weight: 900;
}

.chip.active {
    background: #0ea83d;
    color: #fff;
}

.drawer-banner {
    display: block;
    overflow: hidden;
    margin-top: 10px;
    border-radius: var(--radius);
}

.coupon-box,
.drawer-links {
    margin-top: 14px;
}

.coupon-box label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.coupon-row input {
    min-width: 0;
    flex: 1;
}

.coupon-row button {
    width: 54px;
}

.drawer-links {
    display: grid;
    gap: 9px;
}

.drawer-links a,
.drawer-links button {
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: var(--radius);
    background: #1b2a36;
    color: #fff;
    font-weight: 900;
    text-align: left;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(100%, 1120px);
    transform: translateX(-50%);
    padding: 9px 10px 12px;
    border-top: 1px solid var(--line);
    background: rgba(8, 17, 14, .96);
    backdrop-filter: blur(14px);
}

.bottom-nav a {
    display: grid;
    gap: 5px;
    place-items: center;
    min-width: 0;
    color: #9bacb5;
    font-size: 12px;
    font-weight: 900;
}

.bottom-nav a.active {
    color: var(--green);
}

.bottom-nav svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.auth-card {
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
}

.auth-card.compact {
    max-width: 460px;
    padding: 24px;
    text-align: center;
}

.auth-form,
.money-form,
.admin-form {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.auth-form label,
.money-form label,
.admin-form label {
    color: #dce8df;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    outline: none;
    background: #263a32;
    color: #fff;
}

textarea {
    min-height: 78px;
    padding: 10px 12px;
}

.split-row,
.phone-row {
    display: grid;
    gap: 10px;
}

.split-row {
    grid-template-columns: 1fr 132px;
}

.phone-row {
    grid-template-columns: 128px 1fr;
}

.phone-row span {
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: #263a32;
    color: #dce8df;
    font-weight: 900;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.check-row input {
    width: 24px;
    min-height: 24px;
}

.check-row.small {
    padding: 0;
    border: 0;
}

.center-muted {
    text-align: center;
    font-weight: 800;
}

.center-muted a {
    color: var(--green);
}

.wallet-panel,
.list-panel,
.game-room,
.admin-panel {
    padding: 18px;
    margin-bottom: 16px;
}

.quick-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
}

.quick-values button {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #14271c;
    color: #fff;
    font-weight: 900;
}

.history-row,
.finance-row,
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.history-row span,
.finance-row span,
.user-row span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.status {
    padding: 6px 10px;
    border-radius: 999px;
    background: #24362d;
    color: var(--muted);
    font-style: normal;
    font-weight: 900;
}

.status.paid,
.status.approved {
    background: rgba(85, 232, 106, .16);
    color: var(--green);
}

.status.pending {
    background: rgba(255, 216, 77, .14);
    color: var(--gold);
}

.status.rejected {
    background: rgba(239, 68, 68, .14);
    color: #ff9a9a;
}

.room-head,
.buy-panel,
.ball-stage {
    display: grid;
    gap: 14px;
}

.room-head {
    grid-template-columns: 1fr auto;
    align-items: start;
}

.voice-toggle {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d2117;
    color: var(--green);
    font-weight: 900;
}

.buy-panel {
    grid-template-columns: 1fr 1fr minmax(180px, .8fr);
    align-items: end;
    margin: 16px 0;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.ball-stage {
    grid-template-columns: 112px 1fr;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius);
    background: radial-gradient(circle at left, rgba(85, 232, 106, .22), rgba(255, 255, 255, .04));
}

.last-ball {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #fff, #9ff0a8 45%, #0a6e28 78%);
    color: #051009;
    font-size: 34px;
    font-weight: 1000;
    box-shadow: 0 0 28px rgba(85, 232, 106, .38);
}

.called-strip {
    display: flex;
    gap: 7px;
    margin: 14px 0;
    overflow-x: auto;
}

.called-strip span {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #1c3126;
    color: #fff;
    font-weight: 900;
}

.cards-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px;
}

.bingo-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: #fff;
    color: #122017;
}

.bingo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0f7d31;
    color: #fff;
    font-weight: 950;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    padding: 8px;
    background: #d6ded9;
}

.bingo-grid strong,
.bingo-grid button {
    display: grid;
    min-height: 45px;
    place-items: center;
    border: 0;
    background: #fff;
    color: #102119;
    font-weight: 950;
}

.bingo-grid strong {
    background: #edf5ef;
    color: #0f7d31;
}

.bingo-grid button.marked {
    background: #55e86a;
}

.bingo-grid button.free {
    background: #ffd84d;
}

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

.admin-nav a {
    padding: 10px 14px;
    border-radius: var(--radius);
    background: #16271f;
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.admin-nav a.active {
    background: #22b54a;
    color: #fff;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.admin-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #13251c;
}

.admin-grid span {
    display: block;
    color: var(--muted);
}

.admin-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.grid-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 0;
}

.edit-line,
.banner-edit {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.banner-edit {
    grid-template-columns: 120px repeat(auto-fit, minmax(160px, 1fr));
}

.banner-edit img {
    width: 120px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
}

.finance-row form {
    margin: 0;
}

.finance-row button,
.inline-balance button,
.admin-form button,
.delete-form button {
    min-height: 42px;
    padding: 0 12px;
}

.delete-form {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 14px;
}

.delete-form button {
    background: #4a1717;
    color: #ffd5d5;
}

.inline-balance {
    display: grid;
    grid-template-columns: 120px 100px 1fr 92px;
    gap: 8px;
    width: min(100%, 560px);
}

@media (max-width: 720px) {
    .page-content {
        padding: 12px;
    }

    .topbar {
        height: 72px;
        padding: 8px 12px;
    }

    .brand img {
        width: 72px;
        height: 50px;
    }

    .auth-link {
        font-size: 13px;
    }

    .promo-grid,
    .buy-panel,
    .split-row,
    .phone-row,
    .ball-stage,
    .room-head,
    .invite-box,
    .inline-balance {
        grid-template-columns: 1fr;
    }

    .invite-box {
        display: grid;
    }

    .history-row,
    .finance-row,
    .user-row {
        display: grid;
        align-items: stretch;
    }

    .banner-edit {
        grid-template-columns: 1fr;
    }

    .banner-edit img {
        width: 100%;
        height: auto;
    }
}
