/* ==========================================================================
   Kutaj Casino Demo — app.css
   Dark "cockpit" aesthetic. Local fonts only (system stack). No CDN.
   ========================================================================== */

:root {
    --bg-0: #070a16;
    --bg-1: #0b1022;
    --bg-2: #11182f;
    --panel: rgba(20, 27, 51, 0.66);
    --panel-solid: #141b33;
    --stroke: rgba(120, 140, 200, 0.16);
    --stroke-strong: rgba(120, 140, 200, 0.32);

    --ink: #eef2ff;
    --ink-dim: #aab3d4;
    --ink-mute: #6f7aa3;

    --blue: #4d7cff;
    --violet: #9a6bff;
    --green: #34e0a1;
    --amber: #ffc24d;
    --red: #ff6b81;

    --grad: linear-gradient(120deg, #4d7cff 0%, #9a6bff 55%, #34e0a1 120%);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);

    --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--bg-0);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Ambient aurora background ------------------------------------------------ */
.aurora {
    position: fixed;
    inset: -20% -10% auto -10%;
    height: 70vh;
    z-index: -2;
    background:
        radial-gradient(40% 60% at 20% 20%, rgba(77, 124, 255, 0.25), transparent 70%),
        radial-gradient(40% 55% at 80% 10%, rgba(154, 107, 255, 0.22), transparent 70%),
        radial-gradient(45% 50% at 60% 60%, rgba(52, 224, 161, 0.14), transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background:
        linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%),
        repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(255,255,255,0.012) 39px);
}
.admin-aurora {
    background:
        radial-gradient(40% 60% at 15% 10%, rgba(154, 107, 255, 0.28), transparent 70%),
        radial-gradient(40% 55% at 85% 0%, rgba(255, 107, 129, 0.16), transparent 70%);
}

/* Layout shell ------------------------------------------------------------- */
.shell {
    width: min(1180px, 100% - 2.5rem);
    margin-inline: auto;
}
main.shell { flex: 1 0 auto; padding-block: 2.4rem 4rem; }
.admin-shell { padding-block: 2rem 4rem; }

/* Typography --------------------------------------------------------------- */
.display {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    font-weight: 800;
    margin: 0.2em 0 0.3em;
}
.display.sm { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--blue);
    margin: 0 0 0.4rem;
}
.lede { font-size: 1.08rem; color: var(--ink-dim); max-width: 54ch; }
.muted { color: var(--ink-dim); }
.muted.small, .small { font-size: 0.86rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); background: rgba(255,255,255,0.06); padding: 0.1em 0.4em; border-radius: 6px; }
hr.rule { border: none; border-top: 1px solid var(--stroke); margin: 1.6rem 0; }

/* Top bar ------------------------------------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(8, 11, 22, 0.72);
    border-bottom: 1px solid var(--stroke);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.85rem;
}
.admin-topbar { background: rgba(16, 10, 28, 0.78); border-bottom-color: var(--stroke-strong); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { font-size: 1.18rem; }
.brand-accent { color: var(--violet); }
.brand-tag {
    font-size: 0.6rem; letter-spacing: 0.18em; font-weight: 800;
    padding: 0.18em 0.5em; border-radius: 6px;
    background: rgba(77, 124, 255, 0.16); color: var(--blue);
    border: 1px solid rgba(77,124,255,0.3);
}
.admin-tag { background: rgba(255,107,129,0.14); color: var(--red); border-color: rgba(255,107,129,0.3); }
.logo-mark {
    width: 20px; height: 20px; border-radius: 6px;
    background: var(--grad);
    box-shadow: 0 0 18px rgba(77,124,255,0.5);
}
.logo-img { display: block; filter: drop-shadow(0 0 10px rgba(77,124,255,0.45)); }
.admin-mark { background: linear-gradient(120deg, var(--violet), var(--red)); }
.nav-links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav-links a { color: var(--ink-dim); font-size: 0.92rem; font-weight: 600; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-admin { color: var(--violet) !important; }
.nav-logout { margin: 0; }

/* Buttons ------------------------------------------------------------------ */
.btn {
    --b: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font: inherit; font-weight: 700; cursor: pointer;
    padding: 0.7rem 1.15rem; border-radius: var(--radius-sm);
    border: 1px solid var(--b); color: var(--ink);
    background: rgba(255,255,255,0.04);
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    text-decoration: none; line-height: 1;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-primary { background: var(--grad); color: #07101f; --b: transparent; box-shadow: 0 10px 30px -12px rgba(77,124,255,0.8); }
.btn-primary:hover { box-shadow: 0 14px 36px -12px rgba(154,107,255,0.85); }
.btn-ghost { background: rgba(255,255,255,0.04); --b: var(--stroke-strong); color: var(--ink); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); }
.btn-danger { background: rgba(255,107,129,0.14); --b: rgba(255,107,129,0.4); color: var(--red); }
.btn-danger:hover { background: rgba(255,107,129,0.22); }
.btn-disabled { opacity: 0.45; pointer-events: none; background: rgba(255,255,255,0.04); --b: var(--stroke); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* Panels ------------------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 1.2rem; }
.panel.narrow { max-width: 560px; margin-inline: auto; }
.center-pad { text-align: center; padding: 3rem 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-title { font-size: 1.1rem; margin: 0 0 0.8rem; font-weight: 700; }
.panel-head .panel-title { margin: 0; }
.link-sm { font-size: 0.85rem; font-weight: 600; }
.pad { padding: 0.6rem 0; }

/* Hero --------------------------------------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding-block: 2rem 3rem;
}
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.6rem 0 1.4rem; }
.disclaimer-panel {
    border: 1px solid rgba(52,224,161,0.3);
    background: rgba(52,224,161,0.07);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: var(--ink-dim);
}
.disclaimer-panel strong { color: var(--green); }
.hero-chip {
    background: var(--panel);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow);
}
.chip-balance { display: flex; flex-direction: column; gap: 0.2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--stroke); }
.chip-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-mute); }
.chip-amount { font-size: 2.4rem; font-weight: 800; }
.chip-cur { font-size: 0.8rem; color: var(--blue); font-weight: 700; }
.chip-rows { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; font-size: 0.9rem; color: var(--ink-dim); }
.chip-rows .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.5rem; }
.dot.win { background: var(--green); }
.dot.info { background: var(--blue); }
.dot.warn { background: var(--amber); }

/* Sections ----------------------------------------------------------------- */
.section { margin-top: 2.6rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-title { font-size: 1.4rem; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.section-sub { color: var(--ink-mute); font-size: 0.9rem; margin: 0; }

/* Game grid + cards -------------------------------------------------------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
}
.game-card {
    display: flex; flex-direction: column; gap: 0.9rem;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 1.3rem;
    transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative; overflow: hidden;
}
.game-card::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: 0.6;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--stroke-strong); box-shadow: 0 26px 50px -26px rgba(77,124,255,0.5); }
.game-card.is-disabled { opacity: 0.55; }
.game-card.is-disabled::after { background: var(--ink-mute); }
.game-card-glyph {
    width: 54px; height: 54px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.6rem;
    background: rgba(77,124,255,0.12); border: 1px solid var(--stroke-strong);
}
.game-card-body { flex: 1; }
.game-card-cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-mute); }
.game-card-name { font-size: 1.15rem; margin: 0.25rem 0 0.4rem; font-weight: 700; }
.game-card-bets { font-size: 0.85rem; color: var(--ink-dim); margin: 0; }

/* Auth --------------------------------------------------------------------- */
.auth-wrap { display: grid; place-items: center; padding-block: 1.5rem; }
.auth-card { width: min(440px, 100%); }
.auth-card.wide { width: min(620px, 100%); }
.auth-alt { margin: 1.2rem 0 0; font-size: 0.9rem; color: var(--ink-dim); }

/* Forms -------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-inline { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label { font-size: 0.8rem; color: var(--ink-dim); font-weight: 600; }
input, select, textarea {
    font: inherit; color: var(--ink);
    background: rgba(7,10,22,0.7);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,124,255,0.2); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; color: var(--ink-dim); }
.check input { width: auto; margin-top: 0.2rem; }
.filter-bar { margin-bottom: 1.2rem; }

/* Flash -------------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.4rem; }
.flash {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--stroke-strong);
    background: var(--panel); font-size: 0.92rem;
}
.flash-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.flash-success { border-color: rgba(52,224,161,0.4); } .flash-success .flash-dot { background: var(--green); }
.flash-error { border-color: rgba(255,107,129,0.4); } .flash-error .flash-dot { background: var(--red); }
.flash-info { border-color: rgba(77,124,255,0.4); } .flash-info .flash-dot { background: var(--blue); }

/* Tables ------------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--stroke); }
.data-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); font-weight: 700; }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* Pills -------------------------------------------------------------------- */
.pill {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    padding: 0.2em 0.6em; border-radius: 999px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--stroke);
    color: var(--ink-dim); letter-spacing: 0.02em;
}
.pill-credit, .pill-bonus { color: var(--green); border-color: rgba(52,224,161,0.35); background: rgba(52,224,161,0.08); }
.pill-debit { color: var(--red); border-color: rgba(255,107,129,0.35); background: rgba(255,107,129,0.08); }
.pill-refund, .pill-info { color: var(--blue); border-color: rgba(77,124,255,0.35); background: rgba(77,124,255,0.08); }
.pill-adjustment { color: var(--amber); border-color: rgba(255,194,77,0.35); background: rgba(255,194,77,0.08); }
.pill-admin { color: var(--violet); border-color: rgba(154,107,255,0.4); background: rgba(154,107,255,0.1); }

/* Two-column --------------------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.6rem; align-items: start; }

/* Dashboard / balance chip ------------------------------------------------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.balance-chip {
    display: inline-flex; align-items: baseline; gap: 0.5rem;
    background: var(--panel); border: 1px solid var(--stroke-strong);
    border-radius: 999px; padding: 0.6rem 1.2rem; box-shadow: var(--shadow);
}
.balance-chip .chip-label { font-size: 0.7rem; }
.balance-chip .chip-amount { font-size: 1.3rem; }

/* Stat grid (admin) -------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.stat-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 1.3rem; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute); display: block; }
.stat-value { font-size: 2rem; font-weight: 800; display: block; margin-top: 0.3rem; }

/* Game detail -------------------------------------------------------------- */
.game-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.back-link { font-size: 0.85rem; color: var(--ink-mute); font-weight: 600; }
.game-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; align-items: start; }
.game-side { display: flex; flex-direction: column; gap: 1.2rem; }
.game-meta-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.game-stage .game-stage { margin-block: 1rem; }
.bet-bar { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--stroke); }
.bet-field { flex: 1; min-width: 130px; }
.bet-quick { display: flex; gap: 0.4rem; }
.play-hint { margin: 0.7rem 0 0; }
.round-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.round-list li { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; padding: 0.4rem 0; border-bottom: 1px solid var(--stroke); }

/* Game result banner ------------------------------------------------------- */
.game-result { min-height: 0; transition: all 0.2s ease; }
.game-result.show { min-height: auto; margin-bottom: 1rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--stroke-strong); background: var(--panel); font-weight: 600; }
.game-result.win { border-color: rgba(52,224,161,0.5); color: var(--green); box-shadow: 0 0 30px -12px rgba(52,224,161,0.6); }
.game-result.lose { border-color: rgba(255,107,129,0.5); color: var(--red); }
.game-result.draw { border-color: rgba(77,124,255,0.5); color: var(--blue); }

/* Game-specific visuals (animation targets) -------------------------------- */
.choice-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.choice-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; border-radius: 999px; border: 1px solid var(--stroke-strong); cursor: pointer; font-size: 0.9rem; }
.choice-pill input { width: auto; margin: 0; }
.choice-pill small { color: var(--ink-mute); }
.disclaimer-strip { font-size: 0.8rem; color: var(--amber); border: 1px solid rgba(255,194,77,0.3); background: rgba(255,194,77,0.07); border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; margin-bottom: 1rem; }

.coin { width: 92px; height: 92px; border-radius: 50%; margin: 1rem auto; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; background: var(--grad); color: #07101f; transition: transform 0.6s ease; }
.coin.flipping { animation: coinflip 0.6s linear 3; }
@keyframes coinflip { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

.reels { display: flex; gap: 0.6rem; justify-content: center; margin: 1.2rem 0; }
.reel { width: 80px; height: 80px; border-radius: 14px; display: grid; place-items: center; font-size: 2.2rem; background: rgba(7,10,22,0.7); border: 1px solid var(--stroke-strong); }
.reel.spinning { animation: reelpulse 0.3s ease infinite; }
@keyframes reelpulse { 50% { opacity: 0.4; transform: translateY(-4px); } }

.dice-pair { display: flex; gap: 1rem; justify-content: center; margin: 1.2rem 0; }
.die { width: 70px; height: 70px; border-radius: 14px; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; background: rgba(7,10,22,0.7); border: 1px solid var(--stroke-strong); }
.die.rolling { animation: reelpulse 0.25s ease infinite; }

.wheel-wrap { display: grid; place-items: center; margin: 1.2rem 0; }
.wheel { width: 180px; height: 180px; border-radius: 50%; border: 6px solid var(--stroke-strong); background: conic-gradient(var(--blue), var(--violet), var(--green), var(--amber), var(--blue)); transition: transform 2.4s cubic-bezier(0.16,1,0.3,1); }
.wheel-pointer { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 16px solid var(--ink); margin-bottom: -6px; }

.race-track { display: flex; flex-direction: column; gap: 0.4rem; margin: 1rem 0; }
.lane { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 0.6rem; background: rgba(7,10,22,0.5); border-radius: 8px; padding: 0.3rem 0.6rem; position: relative; }
.lane-no { font-family: var(--mono); color: var(--ink-mute); }
.runner { width: 18px; height: 18px; border-radius: 50%; background: var(--grad); transition: transform 2.6s cubic-bezier(0.3,0.8,0.4,1); }
.lane-name { font-size: 0.82rem; color: var(--ink-dim); }

/* Admin game blocks -------------------------------------------------------- */
.game-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.game-admin textarea { font-size: 0.82rem; }

/* Footer ------------------------------------------------------------------- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--stroke); background: rgba(7,10,22,0.6); margin-top: auto; }
.footer-inner { padding-block: 2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; }
.footer-disclaimer { color: var(--ink-dim); font-size: 0.88rem; max-width: 70ch; margin: 0; }
.footer-meta { color: var(--ink-mute); font-size: 0.78rem; margin: 0; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .hero-chip { order: -1; }
    .game-layout { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .shell { width: min(1180px, 100% - 1.6rem); }
    .form-row { grid-template-columns: 1fr; }
    .nav-links { gap: 0.7rem; }
    .nav-links a { font-size: 0.85rem; }
    .display { font-size: clamp(1.8rem, 8vw, 2.4rem); }
    .data-table { font-size: 0.82rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.4rem; }
}

/* Accessibility ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
