/* TonFight visual-only theme. No game, wallet or accounting code.
   Compatibility selectors intentionally target the existing production DOM.
   Keep values/positions within canvases, wheels and custom art untouched. */
@font-face {
  font-family: "TF Money";
  src: url("anton-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 950;
  font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212;
}
:root, .dark {
  --vc-pink: #ff4fbd;
  --vc-cyan: #51e2ff;
  --vc-gold: #ffda6b;
  --vc-glass: rgba(35, 10, 65, .67);
  --vc-edge: rgba(255, 130, 225, .65);
  --vc-shadow: 0 0 14px rgba(255, 55, 190, .20), 0 8px 24px rgba(10, 0, 30, .3);
  --vc-money: "TF Money", Impact, "Arial Narrow", var(--app-font-sans, sans-serif);
  --vc-blur: 7px;
  --background: 270 60% 7%;
  --foreground: 290 60% 97%;
  --card: 272 55% 14%;
  --card-foreground: 290 60% 97%;
  --popover: 270 60% 11%;
  --popover-foreground: 290 60% 97%;
  --primary: 322 100% 65%;
  --primary-foreground: 290 100% 98%;
  --secondary: 265 85% 60%;
  --accent: 188 100% 62%;
  --accent-foreground: 270 60% 8%;
  --muted: 270 40% 18%;
  --muted-foreground: 280 25% 80%;
  --border: 285 50% 40%;
  --input: 285 45% 30%;
  --ring: 322 100% 65%;
}
html, body { background-color: #14052b !important; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20,4,44,.12), rgba(30,6,58,.2) 50%, rgba(14,3,32,.5)),
    url("vice-city-night.webp") center center / cover no-repeat;
}
#root {
  position: relative;
  z-index: 1;
  background: transparent !important;
}
/* The fixed-height scrolling shell remains unchanged, including keyboard and
   Telegram safe-area sizing. Do not add a second scroll container. */
/* Only the actual tabbed shell is transparent. Never match arbitrary root
   children by their color: that also matches the opaque startup splash. */
div.max-w-md.bg-background {
  background: transparent !important;
}
div.max-w-md > .bg-primary\/10,
div.max-w-md > .bg-secondary\/10 {
  /* The supplied backdrop already provides the glow. Do not composite two
     additional oversized 100px-blur layers on every tab. */
  display: none;
}
main.flex-1 { scrollbar-width: thin; scrollbar-color: #ad4594 transparent; }
/* Standalone games do not use the tabbed Layout component. */
[style*="min-height: 100vh"][style*="background: rgb(13, 13, 20)"],
[style*="min-height: 100dvh"][style*="background: rgb(13, 13, 20)"] {
  background: linear-gradient(rgba(25,5,48,.55), rgba(16,4,35,.82)),
    url("vice-city-sunset.webp") center / cover no-repeat !important;
}
[style*="position: sticky"][style*="background: rgb(13, 13, 20)"] {
  background: rgba(27,7,51,.96) !important;
  border-bottom-color: var(--vc-edge) !important;
}
/* Existing card components, including Home statistics and Featured Cases.
   Images and giveaway category artwork retain their own backgrounds. */
.gold-shine-card,
.bg-card,
[data-slot="card"],
main > div > section[style*="border-radius"],
main > div > div[style*="border-radius: 28px"][style*="overflow: hidden"] {
  background: linear-gradient(135deg, rgba(78,20,105,.52), rgba(26,9,58,.63)) !important;
  border-color: var(--vc-edge) !important;
  box-shadow: var(--vc-shadow), inset 0 1px 0 rgba(255,255,255,.16) !important;
}
/* A backdrop filter on every card adds GPU work and creates containing blocks
   for fixed overlays nested inside cards. The tinted gradient supplies glass
   contrast without changing the positioning/stacking of those overlays. */
.gold-shine-card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.gold-shine-card::after { background: linear-gradient(110deg, transparent 25%, rgba(255,150,230,.09), transparent 52%) !important; }
/* Existing Profile and Jackpot panel signatures, not prize artwork/boards. */
[style*="linear-gradient(145deg, rgba(245, 158, 11, 0.1)"],
[style*="linear-gradient(145deg, rgba(245, 158, 11, 0.13)"],
[style*="linear-gradient(145deg, rgba(28, 20, 4, 0.97)"],
[style*="linear-gradient(160deg, rgb(30, 33, 51)"] {
  background: linear-gradient(145deg, rgba(73,17,103,.74), rgba(26,8,53,.86)) !important;
  border-color: var(--vc-edge) !important;
  box-shadow: var(--vc-shadow) !important;
}
[style*="background: rgba(12, 10, 4, 0.95)"],
[style*="background: rgba(12, 10, 4, 0.9)"],
[style*="background: rgba(10, 8, 2, 0.94)"],
[style*="background: rgba(12, 10, 4, 0.94)"] {
  background: linear-gradient(145deg, rgba(49,14,77,.88), rgba(24,8,45,.92)) !important;
  border-color: var(--vc-edge) !important;
}
/* Profile menu needs a dark backing over the bright street, not just a glow. */
button[style*="border-radius: 15px"][style*="rgba(255, 255, 255, 0.035)"] {
  background: rgba(27,8,48,.86) !important;
  border-color: rgba(223,144,245,.3) !important;
}
main :is(div,span,p)[style*="color: rgba(255, 255, 255, 0.3)"],
main :is(div,span,p)[style*="color: rgba(255, 255, 255, 0.35)"],
main :is(div,span,p)[style*="color: rgba(255, 255, 255, 0.4)"] {
  color: #c5b5d3 !important;
}
header[style*="rgba(15, 15, 20, 0.92)"] {
  background: linear-gradient(135deg, rgba(60,14,96,.42), rgba(30,8,60,.42)) !important;
  backdrop-filter: blur(var(--vc-blur)) !important;
  -webkit-backdrop-filter: blur(var(--vc-blur)) !important;
}
/* Intentionally no wordmark/icon selectors: preserve TonFight identity. */
button[style*="rgba(124, 58, 237, 0.18)"] {
  background: linear-gradient(145deg, rgba(124,40,190,.6), rgba(50,10,90,.54)) !important;
  border-color: rgba(232,120,255,.8) !important;
  box-shadow: var(--vc-shadow) !important;
}
/* Financial numbers retain real text, exact precision and conversion logic. */
.gold-shine-card [style*="font-size: 29px"],
.gold-shine-card [style*="font-size: 17px"][style*="font-weight: 900"],
.gold-shine-card [style*="font-size: 20px"][style*="font-weight: 900"],
[style*="font-size: 20px"][style*="font-weight: 900"][style*="letter-spacing: -0.5px"],
[class~="font-mono"][class*="text-2xl"],
[class~="font-mono"][class*="text-3xl"],
[class~="font-mono"][class*="text-4xl"] {
  font-family: var(--vc-money) !important;
  font-weight: 400 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .65px !important;
  -webkit-text-stroke: 1px rgba(24,3,38,.9);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 #20062d, 0 0 10px rgba(255,200,80,.2);
}
/* Shared money fields in wallet, stake selectors, prizes and game totals.
   These only affect typeface, never numerical content or game positioning. */
.font-mono,
[style*="font-variant-numeric: tabular-nums"],
[style*="font-weight: 900"][style*="font-size: 24px"],
[style*="font-weight: 900"][style*="font-size: 28px"],
[style*="font-weight: 900"][style*="font-size: 32px"],
[style*="font-weight: 900"][style*="font-size: 36px"],
[style*="font-weight: 900"][style*="font-size: 40px"],
[style*="font-weight: 950"][style*="font-size: 24px"],
[style*="font-weight: 950"][style*="font-size: 28px"],
[style*="font-weight: 950"][style*="font-size: 32px"] {
  font-family: var(--vc-money) !important;
  font-weight: 400 !important;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 1px rgba(15,0,28,.9);
}
.gold-shine-card [style*="font-size: 29px"] {
  font-size: clamp(28px, 7.5vw, 35px) !important;
  color: #fff7df;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}
.gold-shine-card [style*="font-size: 29px"] > span {
  font-family: var(--app-font-sans, sans-serif);
  color: var(--vc-gold) !important;
  font-size: 13px !important;
  letter-spacing: .2px;
  -webkit-text-stroke: 0;
}
.gold-shine-card [style*="font-size: 17px"][style*="font-weight: 900"] { font-size: 23px !important; line-height: 1.15 !important; }
.gold-shine-card [style*="font-size: 11px"][style*="height: 14px"] { color: rgba(255,241,255,.72) !important; }
h1, h2, h3 { text-wrap: balance; }
:is(h1,h2,h3):lang(en) {
  font-family: var(--vc-money);
  font-weight: 400;
  letter-spacing: .4px;
  text-shadow: 0 2px 0 #240638;
}
/* Native-script glyphs fall back to the already installed app fonts. */
:is(h1,h2,h3):is(:lang(fa),:lang(ar),:lang(ru),:lang(zh)) {
  font-family: var(--app-font-sans, sans-serif);
  text-transform: none;
}
button[style*="linear-gradient(135deg, rgb(255, 241, 162)"] {
  background: linear-gradient(180deg, #ffe993, #ffc33d 65%, #eea321) !important;
  color: #271203 !important;
  border-color: rgba(255,240,180,.8) !important;
  box-shadow: 0 0 14px rgba(255,190,60,.32), inset 0 1px 0 rgba(255,255,255,.4) !important;
}
.gold-shine-card button[style*="height: 37px"][style*="rgba(255, 255, 255"]:not([style*="rgb(255, 241, 162)"]) {
  background: linear-gradient(135deg, rgba(122,41,190,.65), rgba(32,51,135,.6)) !important;
  border-color: rgba(170,186,255,.65) !important;
}
button.bg-primary, a.bg-primary {
  background: linear-gradient(180deg, #e650bf, #a81e97) !important;
  color: #fff !important;
}
:is(button,a,input,textarea,select):focus-visible {
  outline: 2px solid var(--vc-cyan) !important;
  outline-offset: 3px;
}
/* The existing five-tab interaction, labels, badges and hit targets stay intact. */
nav[style*="rgba(8, 11, 22, 0.96)"] {
  background: linear-gradient(180deg, transparent, rgba(16,3,36,.6)) !important;
  border-top-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
nav > div[style*="border-radius: 24px"] {
  background: linear-gradient(145deg, rgba(53,13,95,.9), rgba(20,10,60,.92)) !important;
  border-color: var(--vc-edge) !important;
  box-shadow: var(--vc-shadow), inset 0 0 0 1px rgba(62,232,255,.15) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
nav a[style*="rgba(245, 158, 11, 0.2)"] {
  background: linear-gradient(160deg, rgba(255,200,70,.26), rgba(255,63,180,.13)) !important;
  border-color: rgba(255,218,107,.8) !important;
  box-shadow: 0 0 12px rgba(255,190,60,.4) !important;
}
nav a svg[style*="rgba(255, 255, 255, 0.32)"],
nav a span[style*="rgba(255, 255, 255, 0.28)"] { color: #d8c9f1 !important; }
.text-muted-foreground { color: #cdb9df !important; }
.bg-popover, [role="dialog"], [role="alertdialog"], [data-vaul-drawer],
[class~="rounded-t-3xl"][style*="max-height"],
[data-sonner-toast] {
  background: linear-gradient(160deg, rgba(54,14,85,.98), rgba(22,6,48,.98)) !important;
  color: #fbeeff;
  border-color: var(--vc-edge) !important;
  box-shadow: var(--vc-shadow) !important;
}
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea, select {
  background-color: rgba(14,4,32,.88) !important;
  color: #fff !important;
  border-color: rgba(211,164,255,.58) !important;
  caret-color: var(--vc-pink);
}
input::placeholder, textarea::placeholder { color: #b8a2cb !important; }
/* Keep status/danger/success colors and the game canvases unchanged. */
@media (min-width: 600px) {
  body::before { background-size: cover, auto 100%; background-color: #14052b; }
  div.max-w-md.bg-background { border-inline: 1px solid rgba(255,130,225,.2); }
}
@media (max-width: 360px) {
  /* Preserve Layout's 1rem content inset: Giveaway's full-bleed landing
     offsets that same 1rem. Reducing only this side caused horizontal scroll. */
  .gold-shine-card [style*="font-size: 29px"] { font-size: 28px !important; }
  nav > div[style*="border-radius: 24px"] { padding-inline: 4px !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --vc-blur: 0px; }
  .gold-shine-card { background: #251039 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .gold-shine-card::after, .neon-case-card::before,
  .home-ticker-track, .floaty, .star-pulse-anim { animation: none !important; }
}

/* Shared application surfaces: explicit dark panel signatures, not arbitrary
   root nodes, prize artwork, colored status badges or game-board geometry. */
.tf-page [style*="background: rgba(12, 14, 20, 0.93)"],
.tf-page [style*="background: rgba(12, 13, 18, 0.95)"],
.tf-page [style*="background: rgba(12, 14, 20, 0.95)"],
.tf-page [style*="background: rgba(10, 12, 18, 0.95)"] {
  background: linear-gradient(135deg, rgba(63,15,91,.86), rgba(24,8,51,.93)) !important;
  border-color: var(--vc-edge) !important;
  box-shadow: var(--vc-shadow) !important;
}
.tf-page [style*="backdrop-filter: blur"] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.tf-page .gv-page {
  background: transparent;
  color: #fbeeff;
  min-height: 0;
  padding-bottom: 24px;
}
.tf-page :is(.gv-panel,.gv-fieldset,.gv-draft,.gv-tabs,.gv-empty) {
  background: linear-gradient(135deg, rgba(63,15,91,.86), rgba(24,8,51,.93));
  border-color: var(--vc-edge);
}
.tf-page {
  overscroll-behavior: contain;
  touch-action: pan-y;
  overflow-x: clip;
}
.tf-page h1, .tf-page h2, .tf-page h3 { overflow-wrap: anywhere; }
.tf-page button, .tf-page a { touch-action: manipulation; }
.tf-page [data-testid="page-loading"] {
  min-height: 180px;
  border: 1px solid rgba(255,130,225,.3);
  border-radius: 20px;
  background: rgba(27,8,48,.9);
}
nav a { -webkit-tap-highlight-color: transparent; }
nav:not(.ltb-nav) a[aria-current="page"] {
  border-color: var(--vc-gold) !important;
  background: linear-gradient(160deg, rgba(255,200,70,.26), rgba(255,63,180,.13)) !important;
}
