/* ---- fonts (self-hosted, SIL Open Font License: see assets/fonts/OFL-*.txt) --------------------
   Exo 2 has real italic cuts for the casino headlines; system fonts like Arial Black have none,
   so browsers slant them artificially, which looks jagged. Inter is a crisp screen font for text. */
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap; src: url("../fonts/exo-2-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 900; font-display: swap; src: url("../fonts/exo-2-latin-900-italic.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-style: normal; font-weight: 800 900; font-display: swap; src: url("../fonts/exo-2-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); }

/* ==========================================================================
   SLOT VEGAS - BIT CITY  |  base: design tokens, background, buttons, forms
   ========================================================================== */
:root {
  --side-reserve: 360px;     /* room kept free on big screens for the recent wins panel (left) and the chat (right) */
  --bg: #0a0612;
  --bg-2: #130a24;
  --panel: rgba(28, 16, 52, .62);
  --panel-solid: #1a0f33;
  --line: rgba(255, 255, 255, .12);
  --text: #f4eeff;
  --muted: #a99cc6;
  --gold: #ffc928;
  --gold-2: #ff9d00;
  --violet: #9b5cff;
  --pink: #ff2d95;
  --cyan: #22e3ff;
  --green: #2bff88;
  --red: #ff4d6d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Exo 2", "Arial Black", "Segoe UI Black", Impact, Arial, sans-serif;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; font-synthesis: none;      /* never fake bold/italic: real cuts only */
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--cyan); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ---- animated city-light background ------------------------------------ */
.bg-city {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(155, 92, 255, .28), transparent 60%),
    radial-gradient(900px 500px at 95% 10%, rgba(255, 45, 149, .2), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(34, 227, 255, .14), transparent 60%),
    linear-gradient(180deg, rgba(10, 6, 18, .25), rgba(10, 6, 18, .1) 55%, rgba(10, 6, 18, .55)),
    url("../images/bg-city.svg") center bottom / cover no-repeat,
    #0a0612;
}
/* inside a slot (and during a battle round) the scene of that slot becomes the backdrop */
.bg-city::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease;
  background: center / cover no-repeat;
}
.bg-city::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; background: radial-gradient(ellipse at 50% 45%, rgba(8, 4, 16, .5), rgba(8, 4, 16, .86) 75%); }
body[data-scene] .bg-city::before { opacity: 1; }
body[data-scene] .bg-city::after { opacity: 1; }
body[data-scene="neon"] .bg-city::before { background-image: url("../images/card-neon.svg"); }
body[data-scene="pharaoh"] .bg-city::before { background-image: url("../images/card-pharaoh.svg"); }
body[data-scene="sakura"] .bg-city::before { background-image: url("../images/card-sakura.svg"); }
body[data-scene="gems"] .bg-city::before { background-image: url("../images/card-gems.svg"); }
body[data-scene] .bg-city span { opacity: .12; }
.bg-city span {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(70px); opacity: .22; will-change: transform; transition: opacity .6s;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-city span:nth-child(1) { background: #7b2cff; left: -12vmax; top: -10vmax; }
.bg-city span:nth-child(2) { background: #ff2d95; right: -16vmax; top: 20vmax; animation-duration: 32s; animation-delay: -8s; }
.bg-city span:nth-child(3) { background: #ffb300; left: 30vmax; bottom: -30vmax; opacity: .16; animation-duration: 38s; animation-delay: -15s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); }
}

/* ---- glass panels -------------------------------------------------------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/* ---- logo typography ------------------------------------------------------ */
.logo-text {
  display: inline-flex; flex-direction: column; line-height: 1;
  font-family: var(--font-display); font-style: italic; letter-spacing: .04em; font-size: 20px; font-weight: 900;
}
.logo-text > span {
  background: linear-gradient(180deg, #fff6c9 0%, var(--gold) 45%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 190, 40, .45));
}
.logo-text > small {
  font-size: .5em; letter-spacing: .52em; margin-top: 4px; font-style: normal;
  color: var(--cyan); text-shadow: 0 0 10px rgba(34, 227, 255, .8);
}
.logo-text--xl { font-size: clamp(30px, 7vw, 54px); align-items: center; }

/* ---- buttons --------------------------------------------------------------- */
.btn {
  --btn-bg: rgba(255, 255, 255, .08);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--btn-bg); color: var(--text); font-weight: 700; letter-spacing: .03em;
  text-decoration: none; position: relative; overflow: hidden; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn::after {                                     /* light sweep on hover */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transition: transform .55s ease;
}
.btn:hover:not(:disabled)::after { transform: translateX(120%) skewX(-20deg); }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-gold {
  border: 0; color: #2a1500;
  background: linear-gradient(180deg, #fff3b0 0%, var(--gold) 40%, var(--gold-2) 100%);
  box-shadow: 0 6px 22px rgba(255, 170, 0, .38), inset 0 -3px 0 rgba(120, 60, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .6);
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255, 170, 0, .6), inset 0 -3px 0 rgba(120, 60, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .6); }
.btn-violet {
  border: 0; background: linear-gradient(180deg, #c29bff, var(--violet) 45%, #5a1fd6);
  box-shadow: 0 6px 22px rgba(155, 92, 255, .45), inset 0 -3px 0 rgba(30, 0, 90, .4), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.btn-pink {
  border: 0; background: linear-gradient(180deg, #ff8cc4, var(--pink) 45%, #b3005f);
  box-shadow: 0 6px 22px rgba(255, 45, 149, .45), inset 0 -3px 0 rgba(90, 0, 40, .4), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.btn-ghost { background: rgba(255, 255, 255, .05); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); box-shadow: 0 0 18px rgba(155, 92, 255, .35); }
.btn-danger { border-color: rgba(255, 77, 109, .5); color: #ffb3c1; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); font-size: 20px; line-height: 1; display: inline-grid; place-items: center;
  transition: transform .15s ease, box-shadow .2s ease, background .2s; flex: none; padding: 0;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.06); background: rgba(255, 255, 255, .12); box-shadow: 0 0 18px rgba(255, 201, 40, .45); }
.icon-btn--sm { width: 34px; height: 34px; font-size: 14px; }

/* ---- form fields ------------------------------------------------------------ */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; letter-spacing: .04em; }
.field em { font-style: normal; opacity: .7; }
input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(8, 4, 18, .6); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(155, 92, 255, .25); outline: none; }
select option { background: #1a0f33; color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--gold); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .bg-city span { animation: none; }
  .btn::after { display: none; }
}

/* ---- performance --------------------------------------------------------------------------
   Live blur behind big fixed panels has to be recalculated for every frame while anything behind them
   moves (reels, background). The large panels get a solid background instead; inside a slot or battle the
   drifting background lights stand still, so the reels get the full frame budget. */
.topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(22, 12, 42, .94); }
.chat, .wins, .potdraw { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body[data-scene] .bg-city span { animation-play-state: paused; }
