/* ===== MahiBet — mobile-first design system (v2) ===== */
:root {
    --bg: #070c1a;
    --bg-2: #0b1430;
    --surface: #111c3a;
    --surface-2: #16244a;
    --surface-3: #1d2f5c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #eaf0ff;
    --muted: #8a97b8;
    --primary: #1f6bff;
    --primary-2: #27a6ff;
    --primary-glow: rgba(31, 107, 255, 0.5);
    --green: #22c55e;
    --green-2: #16a34a;
    --gold: #ffce4a;
    --red: #ff5a6a;
    --radius: 16px;
    --nav-h: 66px;
    --shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    background:
        radial-gradient(900px 500px at 80% -5%, rgba(39, 166, 255, 0.20), transparent 60%),
        radial-gradient(700px 420px at 0% 0%, rgba(31, 107, 255, 0.14), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    padding-bottom: calc(var(--nav-h) + 12px);
}
body.no-nav { padding-bottom: 0; }

h1, h2, h3, .brand { font-family: 'Sora', 'Inter', sans-serif; letter-spacing: -0.02em; }
a { color: var(--primary-2); text-decoration: none; }
img { max-width: 100%; display: block; }

/* App shell: mobile frame centered on desktop */
.shell { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; }

/* ===== Top bar ===== */
.appbar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: rgba(7, 12, 26, 0.82);
    backdrop-filter: blur(14px);
    position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid var(--border);
}
.appbar .menu-btn, .appbar .avatar {
    width: 40px; height: 40px; border-radius: 12px; border: none; cursor: pointer;
    background: var(--surface-2); color: var(--text); display: grid; place-items: center; flex-shrink: 0;
}
.appbar .menu-btn svg, .appbar .avatar svg { width: 20px; height: 20px; }
.appbar .brand { font-size: 19px; font-weight: 800; flex: 1; display: flex; align-items: center; gap: 2px; }
.appbar .brand b { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.appbar .brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); box-shadow: 0 0 12px var(--primary-2); }
.balance-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--gold);
    font-weight: 800; font-size: 14px; font-family: 'Sora', sans-serif;
}
.balance-chip .rb { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; font-size: 11px; }
.appbar .ghost-links { display: flex; gap: 6px; }
.appbar .ghost-links a { color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px; }

/* ===== Content ===== */
.content { padding: 14px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 3px; font-size: 14px; }

/* ===== Cards / buttons ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: none;
    padding: 14px 20px; border-radius: 13px; font-family: inherit; font-weight: 700; font-size: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
    box-shadow: 0 10px 24px -10px var(--primary-glow); transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn-green { background: linear-gradient(135deg, var(--green), var(--green-2)); box-shadow: 0 10px 24px -10px rgba(34,197,94,.5); }
.btn-danger { background: linear-gradient(135deg, #ff5a6a, #e23b4e); }
.btn-sm { padding: 9px 15px; font-size: 13px; border-radius: 10px; }

/* ===== Forms ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .lead { position: absolute; left: 14px; display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-icon .trail { position: absolute; right: 12px; background: none; border: none; color: var(--gold); cursor: pointer; font-size: 16px; }
.field input, .field select {
    width: 100%; padding: 14px 15px; border-radius: 13px;
    background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 15px; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input.has-lead { padding-left: 64px; }
.field input.has-flag { padding-left: 78px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,107,255,.2); }
.field input::placeholder { color: #566185; }

/* ===== Auth modal ===== */
.auth-overlay { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 20px; }
.auth-modal { width: 100%; max-width: 420px; position: relative; }
.auth-tabs {
    display: flex; background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-radius: 18px 18px 0 0; padding: 18px 20px 26px; gap: 18px; position: relative;
}
.auth-tabs a { font-size: 21px; font-weight: 800; color: rgba(255,255,255,.55); font-family: 'Sora', sans-serif; }
.auth-tabs a.active { color: #fff; }
.auth-tabs .close { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.25); color: #fff; display: grid; place-items: center; font-size: 15px; }
.auth-body {
    background: var(--surface); border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 18px 18px; padding: 26px 22px; margin-top: -10px; position: relative; z-index: 1; box-shadow: var(--shadow);
}
.flag-box { position: absolute; left: 12px; display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--text); pointer-events: none; }
.flag-box .fl { font-size: 18px; }

/* ===== Banner carousel ===== */
.banner { border-radius: var(--radius); overflow: hidden; position: relative; margin-bottom: 14px; aspect-ratio: 20/9;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); border: 1px solid var(--border); }
.banner .slides { display: flex; height: 100%; transition: transform .4s ease; }
.banner .slide { min-width: 100%; height: 100%; display: flex; align-items: center; padding: 20px; gap: 12px;
    background-size: cover; background-position: center; }
.banner .slide .txt { position: relative; z-index: 2; }
.banner .slide h3 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.banner .slide p { font-size: 12px; color: rgba(255,255,255,.8); max-width: 60%; }
.banner .dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 3; }
.banner .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.banner .dots i.on { background: #fff; width: 16px; border-radius: 3px; }

/* ===== Promo cards ===== */
.promo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.promo-card { border-radius: 14px; padding: 14px 10px; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); position: relative; overflow: hidden; }
.promo-card .emo { font-size: 24px; position: absolute; top: 10px; right: 10px; opacity: .9; }
.promo-card .t { font-size: 12.5px; font-weight: 700; line-height: 1.25; }

/* ===== Category chips ===== */
.cats { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 8px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 60px; }
.cat .ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: all .15s ease; }
.cat.active .ic { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; box-shadow: 0 8px 20px -8px var(--primary-glow); }
.cat .lb { font-size: 11px; color: var(--muted); font-weight: 600; }
.cat.active .lb { color: var(--text); }

/* ===== Section header ===== */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 12px; }
.sec-head .ttl { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.sec-head .ttl .fire { font-size: 18px; }
.sec-head .more { font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); }

/* ===== Game grid ===== */
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.game-card { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
    aspect-ratio: 3/4; display: flex; flex-direction: column; justify-content: flex-end; color: var(--text);
    transition: transform .12s ease; background: var(--surface-2); }
.game-card:active { transform: scale(.97); }
.game-card .art { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; }
.game-card .art img { width: 100%; height: 100%; object-fit: cover; }
.game-card .art::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, transparent 45%, rgba(5,8,18,.92)); }
.game-card .best { position: absolute; top: 7px; left: 7px; z-index: 2; background: linear-gradient(135deg, #ffb020, #ff7a3d); color: #2a1500; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.game-card .fav { position: absolute; top: 7px; right: 7px; z-index: 2; color: #fff; opacity: .85; font-size: 15px; }
.game-card .nm { position: relative; z-index: 2; padding: 8px; font-size: 11px; font-weight: 700; line-height: 1.2; }

/* ===== Bottom nav ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 50;
    height: var(--nav-h); display: flex; align-items: center; justify-content: space-around;
    background: rgba(10, 16, 36, 0.95); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; flex: 1; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--primary-2); }
.bottom-nav a.center { position: relative; }
.bottom-nav a.center .bump {
    width: 52px; height: 52px; border-radius: 50%; margin-top: -26px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 20px -6px var(--primary-glow); border: 4px solid var(--bg);
}
.bottom-nav a.center .bump svg { width: 24px; height: 24px; }
.bottom-nav a.center span { margin-top: 2px; color: var(--gold); }

/* ===== Deposit ===== */
.pay-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-method { flex: 1; padding: 13px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 14px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.pay-method.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.bonus-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.amount-input { position: relative; margin-bottom: 18px; }
.amount-input .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 18px; font-family: 'Sora',sans-serif; }
.amount-input input { width: 100%; padding: 18px 16px 18px 48px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 18px; font-weight: 700; }
.amount-input input:focus { outline: none; border-color: var(--primary); }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.preset { position: relative; padding: 16px 8px; border-radius: 12px; text-align: center; cursor: pointer; font-weight: 800; font-size: 15px;
    background: var(--surface-2); border: 1px solid var(--border); font-family: 'Sora', sans-serif; transition: all .12s ease; }
.preset:active { transform: scale(.96); }
.preset.active { border-color: var(--primary); background: var(--surface-3); box-shadow: 0 0 0 2px var(--primary-glow); }
.preset .bonus { position: absolute; top: -9px; right: -6px; background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; box-shadow: 0 4px 10px -3px rgba(34,197,94,.6); }
.promo-check { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: #eef2ff; color: #1a2340; margin-bottom: 18px; cursor: pointer; }
.promo-check .box { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: background .15s ease; }
.promo-check.off .box { background: #c3ccea; }
.promo-check .lb { font-weight: 700; font-size: 14px; }

/* ===== Lists / pills ===== */
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.row-item:last-child { border-bottom: none; }
.pill { padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.pill.green { background: rgba(34,197,94,.14); color: var(--green); }
.pill.gold { background: rgba(255,206,74,.14); color: var(--gold); }
.pill.red { background: rgba(255,90,106,.14); color: var(--red); }
.pill.accent { background: rgba(39,166,255,.18); color: var(--primary-2); }
.pill.muted { background: rgba(255,255,255,.07); color: var(--muted); }

/* ===== Stat grid (admin/dashboard) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; background: rgba(255,255,255,.05); }
.stat .ico svg { width: 20px; height: 20px; }
.stat .label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 4px; font-family: 'Sora', sans-serif; }
.stat.primary .ico { background: rgba(31,107,255,.18); color: var(--primary-2); } .stat.primary .value { color: var(--primary-2); }
.stat.green .ico { background: rgba(34,197,94,.16); color: var(--green); } .stat.green .value { color: var(--green); }
.stat.gold .ico { background: rgba(255,206,74,.16); color: var(--gold); } .stat.gold .value { color: var(--gold); }

.action-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

/* ===== Slot (mock) ===== */
.slot-wrap { max-width: 480px; margin: 0 auto; }
.slot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.slot-balance { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 20px; color: var(--gold); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 22px; border-radius: 18px; margin-bottom: 18px;
    background: radial-gradient(circle at 50% 0%, rgba(39,166,255,.18), transparent 70%), #0a0f1f; border: 1px solid var(--border-strong); }
.reel { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; font-size: 50px;
    background: linear-gradient(160deg, #15203f, #0c1326); border: 1px solid var(--border); box-shadow: inset 0 3px 12px rgba(0,0,0,.6); }
.reel.spinning { animation: reelspin .45s linear infinite; }
@keyframes reelspin { 0%{transform:translateY(-6px);opacity:.5} 50%{transform:translateY(6px);opacity:1} 100%{transform:translateY(-6px);opacity:.5} }
.reel.win { animation: reelwin .5s ease; box-shadow: 0 0 22px rgba(39,166,255,.6), inset 0 0 12px rgba(39,166,255,.3); border-color: var(--primary); }
@keyframes reelwin { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
.bet-row { display: flex; gap: 10px; margin-bottom: 14px; }
.bet-row .stepper { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px; }
.bet-row .stepper button { width: 38px; height: 38px; border: none; border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 20px; font-weight: 700; cursor: pointer; }
.bet-row .stepper input { width: 80px; text-align: center; background: transparent; border: none; color: var(--text); font-size: 17px; font-weight: 700; font-family: 'Sora', sans-serif; }
.bet-row .stepper input:focus { outline: none; }
.spin-btn { flex: 1; font-size: 18px; }
.win-banner { text-align: center; min-height: 26px; font-weight: 800; font-family: 'Sora', sans-serif; font-size: 19px; margin-bottom: 8px; }
.win-banner.show { color: var(--gold); animation: pop .4s ease; }
@keyframes pop { 0%{transform:scale(.8);opacity:0} 100%{transform:scale(1);opacity:1} }
.quick-bets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.quick-bets button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }

/* ===== Hero (logged out landing, if used) ===== */
.hero { text-align: center; padding: 40px 16px; }
.hero h1 { font-size: 34px; line-height: 1.1; margin-bottom: 14px; }
.hero h1 .grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin-bottom: 24px; }

/* ===== Modo jogo (tela cheia) ===== */
body.bare { padding-bottom: 0; background: #000; }
body.bare .shell { max-width: 100%; min-height: 100vh; }
.game-full { padding: 0; margin: 0; }
.game-stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; background: #000; z-index: 100; }
.game-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.game-close {
    position: fixed; top: 10px; right: 10px; z-index: 110;
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 18px; font-weight: 700;
    backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.2);
}
.game-close:hover { background: rgba(0,0,0,0.75); color: #fff; }

/* ===== Footer ===== */
.site-footer { padding: 26px 18px 30px; text-align: center; border-top: 1px solid var(--border); margin-top: 20px; }
.site-footer .age { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--red); color: var(--red); font-weight: 800; font-size: 13px; margin-bottom: 12px; }
.site-footer p { color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 420px; margin: 0 auto 6px; }
.site-footer .links { margin-top: 10px; }
.site-footer .links a, .site-footer .links span { color: var(--muted); font-size: 12px; }
.site-footer .copy { margin-top: 10px; opacity: .7; }

/* ===== Admin activity feed ===== */
.feed-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-item .amt { font-weight: 800; font-family: 'Sora', sans-serif; }
.feed-item .amt.pos { color: var(--green); }
.feed-item .amt.neg { color: var(--red); }

/* ===== Auth-wrap (compat telas antigas) ===== */
.auth-wrap { max-width: 460px; margin: 0 auto; }
.auth-wrap h1 { font-size: 22px; margin-bottom: 4px; }
.auth-wrap .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.auth-wrap .alt { text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }

@media (min-width: 560px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
