/* ===== OmeX Valdymo skydas theme (body.kx) =====
   The look first built for the Kreditai page, shared by every logged-in page:
   near-black surfaces, faint 44px grid, white primary actions, Geist + Geist
   Mono. Amber marks "best value"/VIP gold, green marks bonuses and wins.
   Section 1 = tokens, background, shell. Section 2 = shared kx-* parts.
   Section 3 = the older app.css components restyled to match. */

/* ---------- 1. Tokens, background, shell ---------- */
body.kx {
  --bg: #070707; --s1: #0d0d0d; --s2: #131313; --s3: #1a1a1a; --field: #0b0b0b;
  --l1: #1a1a1a; --l2: #242424; --l3: #333;
  --ink: #f5f5f4; --ink2: #cfcfcd; --mut: #939391; --faint: #6a6a68;
  --white: #fafaf9; --on-white: #0a0a0a;
  --gold: #f5a524; --gold-ink: #fbbf4d; --gold-line: rgba(245,165,36,.35);
  --green: #4ade80; --green-soft: rgba(74,222,128,.1); --green-line: rgba(74,222,128,.28);
  --red: #f87171;
  --ease: cubic-bezier(.22,1,.36,1); --spring: cubic-bezier(.34,1.56,.64,1);
  --top: 60px;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* old app.css tokens, remapped so anything still using them follows along */
  --card: var(--s1); --line: var(--l1); --line-strong: var(--l2); --muted: var(--mut); --accent: var(--ink2); --accent2: var(--l3);

  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}
html:has(body.kx) { background: #070707; }
body.kx ::selection { background: rgba(255,255,255,.18); }
body.kx :focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.kx .num, .kx [data-num], .kx .tabular-nums { font-variant-numeric: tabular-nums; }
.kx .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.kx .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.kx ::-webkit-scrollbar-track { background: var(--bg); }
body.kx ::-webkit-scrollbar-thumb { background: #262626; border-color: var(--bg); }

/* Background: 44px grid + a soft white glow at the top that fades lower down. */
body.kx::before, body.kx::after { content: ""; position: fixed; pointer-events: none; z-index: 0; }
body.kx::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
          mask-image: linear-gradient(#000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
}
body.kx::after {
  left: 50%; top: -260px; width: 1100px; height: 620px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,255,255,.075), rgba(255,255,255,.02) 55%, transparent);
}
.kx .orb-layer { display: none; }
.kx main { position: relative; z-index: 1; }

/* Top bar */
.kx .app-topbar {
  height: var(--top); background: rgba(7,7,7,.72); border-bottom: 1px solid var(--l1);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.kx .app-crumbs { display: flex; align-items: center; gap: .45rem; font-size: 13.5px; }
.kx .app-crumb { color: var(--mut); font-weight: 500; white-space: nowrap; }
.kx .app-crumb.is-current { color: var(--ink); font-weight: 600; font-size: 13.5px; margin: 0; }
.kx .app-crumb-sep { width: 14px; height: 14px; color: var(--faint); flex-shrink: 0; }
@media (max-width: 520px) { .kx .app-crumbs > .app-crumb:not(.is-current), .kx .app-crumbs > .app-crumb-sep { display: none; } }
.kx .cr-pill {
  height: 34px; gap: 7px; padding: 0 12px 0 9px; border-radius: 999px;
  background: var(--s2); border: 1px solid var(--l2); font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.kx .cr-pill:hover { background: var(--s3); border-color: var(--l3); }
.kx .cr-pill:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.kx .app-iconbtn { background: var(--s2); border-color: var(--l2); color: var(--ink2); }
.kx .app-iconbtn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* Sidebar */
.kx .app-sidebar { background: var(--s1); border-right-color: var(--l1); }
.kx .app-sb-top { border-bottom-color: var(--l1); }
.kx .app-usercard { background: var(--s2); border-color: var(--l1); border-radius: 14px; }
.kx .app-usercard:hover { border-color: var(--l3); }
.kx .app-credits { background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--l2); border-radius: 12px; }
.kx .app-credits:hover { border-color: var(--l3); }
.kx .app-credits b { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; }
.kx .app-group { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; color: var(--faint); padding: 1rem .75rem .4rem; }
.kx .app-nl { color: var(--mut); font-size: 13.5px; border-radius: 9px; transition: color .15s, background-color .15s, box-shadow .15s; }
.kx .app-nl svg { color: var(--faint); }
.kx .app-nl:hover { background: rgba(255,255,255,.035); color: var(--ink); }
.kx .app-nl:hover svg { color: var(--ink2); }
.kx .app-nl.is-active { background: var(--s3); box-shadow: inset 0 0 0 1px var(--l2); color: var(--ink); }
.kx .app-nl.is-active::before { display: none; }
.kx .app-nl.is-active svg { color: var(--white); }
.kx .app-nl:focus-visible { outline: 2px solid var(--white); outline-offset: -2px; }
.kx .app-nl-danger:hover { background: rgba(248,113,113,.07); }
.kx .app-sub-items { border-left-color: var(--l2) !important; margin-left: 1.15rem; padding-left: .6rem; }
.kx .app-sidebar .border-t { border-top-color: var(--l1) !important; }

/* Drawer below 900px (instead of the shell's default 1023px). */
@media (min-width: 901px) and (max-width: 1023px) {
  body.kx.app-shell { padding-left: 264px; }
  body.kx .app-sidebar { transform: none; box-shadow: none; }
  body.kx .app-scrim.is-open { display: none; }
  body.kx [data-sidebar-toggle] { display: none; }
}
@media (max-width: 900px) {
  body.kx .app-scrim { display: block; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); background: rgba(0,0,0,.66); }
  body.kx .app-scrim.is-open { opacity: 1; pointer-events: auto; }
}

.kx .app-content { max-width: 1320px; padding-top: 1.5rem; padding-bottom: 5rem; }

/* ---------- 2. Shared kx-* parts ---------- */
.kx-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.kx-card { border: 1px solid var(--l1); border-radius: 18px; background: linear-gradient(180deg, var(--s1), rgba(13,13,13,.86)); }
.kx-h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); margin: 0; }
.kx-sub { margin-top: .3rem; font-size: 13.5px; color: var(--mut); }

.kx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: 44px; padding: 0 1.25rem; border-radius: 12px; border: 1px solid var(--l2);
  background: var(--s2); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; user-select: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s var(--ease);
}
.kx-btn:hover { border-color: var(--l3); background: var(--s3); }
.kx-btn:active { transform: scale(.97); }
.kx-btn-white { background: var(--white); color: var(--on-white); border-color: var(--white); }
.kx-btn-white:hover { background: #fff; border-color: #fff; transform: translateY(-1px); box-shadow: 0 8px 28px -10px rgba(255,255,255,.45); }
.kx-btn-white:active { transform: translateY(0) scale(.97); }
.kx-btn[disabled] { cursor: not-allowed; opacity: .6; transform: none; box-shadow: none; }
.kx-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.kx-btn-sm { height: 34px; padding: 0 .9rem; font-size: 13px; border-radius: 10px; }

.kx-coin { display: inline-block; flex-shrink: 0; object-fit: contain; }
.kx-coin-xs { width: 18px; height: 18px; }
.kx-coin-sm { width: 22px; height: 22px; }

.kx-tag {
  height: 22px; padding: 0 .55rem; border-radius: 6px; display: inline-flex; align-items: center;
  font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  background: var(--s3); color: var(--mut); box-shadow: inset 0 0 0 1px var(--l2);
}

.kx-toasts { position: fixed; top: calc(var(--top) + 12px); left: 50%; z-index: 120; display: grid; gap: .5rem; width: min(420px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.kx-toast {
  display: flex; align-items: center; gap: .65rem; padding: .75rem .95rem; border-radius: 12px; pointer-events: auto;
  background: rgba(19,19,19,.96); border: 1px solid var(--l2); color: var(--ink); font-size: 13.5px;
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.9); animation: kxToastIn .38s var(--ease);
}
.kx-toast.is-out { animation: kxToastOut .26s var(--ease) forwards; }
.kx-toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.kx-toast--ok svg { color: var(--green); }
.kx-toast--err svg { color: var(--red); }
.kx-toast--info svg { color: var(--mut); }
@keyframes kxToastIn { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes kxToastOut { to { opacity: 0; transform: translateY(-10px); } }

/* Mobile bottom bar (≤900px): current pick + main action. Pages toggle .is-hidden. */
.kx-mbar { display: none; }
@media (max-width: 900px) {
  .kx-mbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; display: flex; align-items: center; gap: .9rem;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right));
    background: rgba(10,10,10,.9); border-top: 1px solid var(--l2);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(0); transition: transform .32s var(--ease);
  }
  .kx-mbar.is-hidden { transform: translateY(110%); }
}
.kx-mbar-txt { flex: 1; min-width: 0; }
.kx-mbar-txt b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kx-mbar-txt span { display: block; margin-top: .1rem; font: 400 12px/1.2 var(--mono); color: var(--green); }
.kx-mbar-txt span.is-none { color: var(--faint); }
.kx-mbar .kx-btn { height: 44px; padding: 0 1.4rem; }

/* ---------- 3. Older components, restyled ---------- */

/* Type: Geist everywhere, lighter weights than the old Inter 800/900 look. */
.kx .font-sans, .kx .font-display { font-family: var(--sans); }
.kx .font-mono { font-family: var(--mono); }
.kx main .font-black { font-weight: 700; }
.kx main .font-extrabold { font-weight: 600; }
.kx main h1, .kx main h2, .kx main h3 { letter-spacing: -.025em; }
.kx main .tracking-tight { letter-spacing: -.03em; }
.kx .eyebrow, .kx .ak-eyebrow, .kx .tx-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.kx .tx-eyebrow::before { background: var(--faint); }

/* Panels */
.kx .panel {
  border-radius: 18px; border: 1px solid var(--l1);
  background: linear-gradient(180deg, var(--s1), rgba(13,13,13,.86));
  box-shadow: none;
}
.kx .panel-accent { background: linear-gradient(180deg, var(--s1), rgba(13,13,13,.86)); }
.kx .panel-accent::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent); }
.kx .panel-header { border-bottom-color: var(--l1); }
.kx .panel-hover:hover, .kx .panel.card-lift:hover { border-color: var(--l3); box-shadow: none; transform: translateY(-2px); }
.kx .panel.card-lift::before { display: none; }
.kx .card-lift:hover { transform: translateY(-2px); }
.kx .panel, .kx .panel-hover, .kx .card-lift { transition: transform .2s var(--ease), border-color .15s, background-color .15s; }
/* The first panel on a page is its header: same soft top-left light as the Kreditai hero. */
.kx main > .panel:first-child, .kx main > section:first-child > .panel:first-child, .kx .ak-hero {
  background:
    radial-gradient(520px 220px at 12% 0%, rgba(255,255,255,.06), transparent 70%),
    linear-gradient(180deg, var(--s1), rgba(13,13,13,.8));
}
.kx .ak-hero::after { display: none; }
.kx .border-white\/10 { border-color: var(--l1) !important; }

/* Buttons */
.kx .btn-primary {
  border-radius: 12px; background: var(--white); color: var(--on-white); border: 1px solid var(--white); box-shadow: none;
  font-family: var(--sans); font-weight: 600;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.kx .btn-primary:hover { background: #fff; border-color: #fff; transform: translateY(-1px); box-shadow: 0 8px 28px -10px rgba(255,255,255,.45); }
.kx .btn-primary:active { transform: scale(.97); }
.kx .btn-secondary {
  border-radius: 12px; background: var(--s2); color: var(--ink); border: 1px solid var(--l2);
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease);
}
.kx .btn-secondary:hover { background: var(--s3); border-color: var(--l3); transform: none; }
.kx .btn-secondary:active { transform: scale(.97); }
.kx .btn-ghost { border-radius: 12px; color: var(--mut); transition: background-color .15s, color .15s, transform .15s var(--ease); }
.kx .btn-ghost:hover { color: var(--ink); background: rgba(255,255,255,.04); transform: none; }
.kx .btn-ghost:active { transform: scale(.97); }
.kx .btn-sm { border-radius: 9px; }
/* Game action buttons (Mines start, Coinflip flip, Plinko drop...) */
.kx .kx-play {
  background: var(--white) !important; color: var(--on-white) !important; border: 1px solid var(--white); box-shadow: none !important;
  transition: background-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.kx .kx-play:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 28px -10px rgba(255,255,255,.45) !important; filter: none; }
.kx .kx-play:active:not(:disabled) { transform: scale(.98); }

/* Fields */
.kx .input, .kx .ak-input, .kx .ak-area {
  border-radius: 10px; border: 1px solid var(--l2); background: var(--field); color: var(--ink); font-family: var(--sans);
}
.kx .input::placeholder, .kx .ak-input::placeholder, .kx .ak-area::placeholder { color: var(--faint); }
.kx .input:focus, .kx .ak-input:focus, .kx .ak-area:focus {
  border-color: var(--l3); background: var(--field); box-shadow: 0 0 0 2px rgba(255,255,255,.14); outline: none;
}
.kx select.input option { background: var(--s2); }
.kx .label, .kx .stat-label, .kx .ak-stat .k {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}

/* Badges */
.kx .badge-muted, .kx .badge-brand {
  border-radius: 6px; padding: .25rem .5rem; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em;
}
.kx .badge-muted { background: var(--s3); color: var(--mut); box-shadow: inset 0 0 0 1px var(--l2); }
.kx .badge-brand { background: rgba(245,165,36,.12); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-line); }

/* Numbers */
.kx .stat-value { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; color: var(--white); }

/* Tables */
.kx .table-wrap { border-color: var(--l1); border-radius: 14px; }
.kx .table thead th {
  background: transparent; border-bottom: 1px solid var(--l1);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; color: var(--faint);
}
.kx .table tbody td { border-top-color: var(--l1); color: var(--ink2); font-variant-numeric: tabular-nums; }
.kx .table tbody tr:hover { background: rgba(255,255,255,.02); }

/* Application forms (anketos): monochrome like the rest. */
.kx .ak-icon { background: var(--s3); color: var(--ink); border-color: var(--l2); border-radius: 12px; }
.kx .ak-title { font-family: var(--sans); font-weight: 600; letter-spacing: -.035em; }
.kx .ak-lead { color: var(--mut); }
.kx .ak-stat .v { font-family: var(--sans); font-weight: 600; color: var(--ink); }
.kx .ak-stat .v b { color: var(--white); }
.kx .ak-stat + .ak-stat { border-left-color: var(--l2); }
.kx .ak-section-head h2 { font-family: var(--sans); font-weight: 600; }
.kx .ak-section-head svg { color: var(--mut); }
.kx .ak-pill { color: var(--mut); background: var(--s3); border-color: var(--l2); border-radius: 6px; font-family: var(--mono); font-weight: 500; }
.kx .ak-q { background: linear-gradient(180deg, var(--s1), rgba(13,13,13,.86)); border-color: var(--l1); border-radius: 14px; }
.kx .ak-num { background: var(--s3); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--l2); font-family: var(--mono); font-weight: 500; }
.kx .ak-label { color: var(--ink); font-weight: 500; }
.kx .ak-req { color: var(--red); }
.kx .ak-opt { background: var(--field); border-color: var(--l2); color: var(--ink2); border-radius: 10px; }
.kx .ak-opt:hover { border-color: var(--l3); }
.kx .ak-opt:has(input:checked) { border-color: var(--white); color: var(--ink); }
.kx .ak-dot { border-color: var(--l3); }
.kx .ak-opt:has(input:checked) .ak-dot { border-color: var(--white); box-shadow: inset 0 0 0 3px var(--bg); background: var(--white); }
.kx .ak-opt input:focus-visible + .ak-dot { outline: 2px solid var(--white); outline-offset: 2px; }
.kx .ak-submit { border-radius: 13px; background: var(--white); color: var(--on-white); box-shadow: none; transition: transform .15s var(--ease), box-shadow .15s, opacity .15s; }
.kx .ak-submit:hover:not(:disabled) { filter: none; transform: translateY(-1px); box-shadow: 0 8px 28px -10px rgba(255,255,255,.45); }
.kx .ak-submit:active:not(:disabled) { transform: scale(.98); }
.kx .ak-foot { color: var(--faint); }

/* Casino bits */
.kx .coin-side, .kx .coin-face { font-family: var(--sans); }
.kx .coin-pick { border-color: var(--l2); background: var(--s2); border-radius: 12px; }
.kx .coin-pick:hover { border-color: var(--l3); }
.kx .coin-pick.is-active { border-color: var(--white); background: var(--s3); box-shadow: 0 0 0 1px var(--white); }
.kx .side-btn { border-color: var(--l2); background: var(--s2); border-radius: 10px; color: var(--ink2); }
.kx .side-btn:hover { border-color: var(--l3); color: var(--ink); }
.kx .side-btn.is-active { border-color: var(--white); background: var(--s3); color: var(--white); box-shadow: 0 0 0 1px var(--white); }
.kx .shadow-glow { box-shadow: 0 0 0 1px var(--l2); }

/* VIP cards keep their tier colours, on the new surfaces. */
.kx .vipx { border-radius: 18px; background-color: var(--s1); }
.kx .vipx-name, .kx .vipx-amount { font-family: var(--sans); }
.kx .vipx-amount { font-weight: 700; letter-spacing: -.03em; }
.kx .vipx-tier { font-family: var(--mono); font-weight: 500; }
.kx .vipx-desc { color: var(--mut); }
.kx .vipx-perks { color: var(--ink2); }
.kx .vipx-card { background: var(--s2); border-color: var(--l2); color: var(--ink2); }

/* Shop item lists (Šokiai su muzika) */
.kx .dcard { background: linear-gradient(180deg, var(--s2), var(--s1)); border-color: var(--l1); border-radius: 14px; }
.kx .dcard:hover { border-color: var(--l3); }
.kx .dico { background: var(--s3); border-color: var(--l2); color: var(--ink2); }
.kx .dbuy { background: var(--white); color: var(--on-white); border-radius: 10px; }
.kx .dbuy:hover { background: #fff; box-shadow: 0 6px 20px -10px rgba(255,255,255,.45); }
.kx .dbuy.short { background: transparent; color: var(--mut); border: 1px dashed var(--l3); }
.kx .df.on { background: var(--s3); box-shadow: inset 0 0 0 1px var(--l2); }

/* Filter chips (Importai) */
.kx .brand-chip { border-color: var(--l2); background: var(--s2); border-radius: 999px; }
.kx .brand-chip:hover { border-color: var(--l3); }
.kx .brand-chip.is-active { border-color: var(--white); background: var(--s3); color: var(--white); }

/* Anketos list */
.kx .ma-avail a { background: var(--s2); border-color: var(--l1); border-radius: 12px; }
.kx .ma-avail a:hover { border-color: var(--l3); }

/* In-page notices injected by game-shop.js */
.kx .gs-notice { border-radius: 12px; }

/* ---------- Reduced motion ---------- */
/* Only the theme's own decorative motion is switched off here. Game pages keep
   their animations (reels, coin, wheel), since their code waits for them. */
@media (prefers-reduced-motion: reduce) {
  body.kx .app-content, body.kx .app-sidebar, body.kx .app-scrim, body.kx .app-nl,
  body.kx .panel, body.kx .panel-hover, body.kx .card-lift,
  body.kx .btn-primary, body.kx .btn-secondary, body.kx .btn-ghost, body.kx .kx-play,
  body.kx .kx-btn, body.kx .kx-toast, body.kx .kx-mbar, body.kx .ak-submit, body.kx .ak-opt, body.kx .dcard, body.kx .dbuy {
    animation: none !important; transition: none !important;
  }
  body.kx .panel-hover:hover, body.kx .card-lift:hover, body.kx .panel.card-lift:hover, body.kx .btn-primary:hover,
  body.kx .kx-btn-white:hover, body.kx .kx-play:hover, body.kx .ak-submit:hover, body.kx .dcard:hover { transform: none; }
  html:has(body.kx) { scroll-behavior: auto; }
}
