/* VIP Game Club — theme tokens. Colours sampled from the approved homepage screenshot. */
:root {
  --bg: #0b0620;
  --bg-glow: #2a0f55;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.88);
  --gold-1: #fff6c8;
  --gold-2: #ffd34d;
  --gold-3: #d48a12;
  --gold-4: #8a4a05;
  --tile-radius: 16px;
  --tile-height: 128px;
  --gap: 11px;
  --pad: 11px;
  --titlebar-bg: #f7f7f9;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-top: 0px; /* Telegram fullscreen controls band, set from app.js */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(90% 35% at 50% 8%, var(--bg-glow) 0%, transparent 70%),
    var(--bg);
  padding: 0 var(--pad) calc(var(--safe-bottom) + 14px);
  max-width: 540px;
  margin: 0 auto;
}
body.fullscreen { padding-top: calc(var(--safe-top) + var(--content-top)); }

/* ---------- Fullscreen title bar (replaces Telegram's header, without its "mini app" label) ---------- */
.titlebar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--safe-top) + var(--content-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: center;
  background: var(--titlebar-bg);
  color: #000; font: 600 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.titlebar[hidden] { display: none; }

/* ---------- Splash / loading ---------- */
.splash {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity .3s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-mark {
  font-size: 64px; line-height: 1; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pulse 1.2s ease-in-out infinite;
}
.splash-sub { margin-top: 6px; font-weight: 800; letter-spacing: 4px; color: var(--gold-2); font-size: 14px; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Hero ---------- */
.hero { position: relative; margin: 0 calc(var(--pad) * -1); text-align: center; }
.lang-toggle {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--gold-1); background: rgba(10, 5, 30, .65);
  border: 1px solid rgba(255, 211, 77, .6);
}
.lang-toggle[hidden] { display: none; }
.hero-art { margin: 0; line-height: 0; }
.hero-art img { width: 100%; height: auto; display: block; }
.tagline {
  margin: -2px 0 14px; font-size: clamp(11px, 3.6vw, 14.5px); font-weight: 600; color: var(--text-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.tagline span { margin: 0 3px; }

/* ---------- Provider tiles ---------- */
.providers { display: flex; flex-direction: column; gap: var(--gap); }

.tile {
  position: relative; display: block; width: 100%; height: var(--tile-height);
  padding: 0; border-radius: var(--tile-radius);
  border: 1.5px solid var(--edge);
  background:
    linear-gradient(120deg, transparent 55%, rgba(255, 255, 255, .10) 62%, transparent 70%),
    radial-gradient(70% 90% at 62% 55%, var(--deep) 0%, transparent 75%),
    linear-gradient(90deg, var(--mid) 0%, var(--deep) 45%, var(--bright) 100%);
  box-shadow: 0 0 10px var(--glow), inset 0 0 12px rgba(255, 255, 255, .12);
  color: var(--text); font: inherit; cursor: pointer; overflow: hidden;
  transition: transform .12s ease, filter .12s ease;
}
.tile.featured { animation: featured 1.4s ease-in-out 3; }
@keyframes featured { 50% { box-shadow: 0 0 22px var(--glow), 0 0 0 3px var(--gold-2); } }
.tile:active { transform: scale(.98); filter: brightness(1.1); }
.tile:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 2px; }
.tile[aria-busy="true"] { filter: brightness(.85); }

.tile[data-accent="red"]    { --deep: #4b0000; --mid: #7a0004; --bright: #b00210; --edge: #ff6a3a; --glow: rgba(255, 60, 30, .45); --ring: #ff3a2a; }
.tile[data-accent="blue"]   { --deep: #060c45; --mid: #0a2a8a; --bright: #2a10a0; --edge: #4fb6ff; --glow: rgba(60, 150, 255, .45); --ring: #3fa8ff; }
.tile[data-accent="green"]  { --deep: #012d01; --mid: #035a05; --bright: #07800a; --edge: #4dff5a; --glow: rgba(60, 255, 80, .40); --ring: #3cff52; }
.tile[data-accent="purple"] { --deep: #2a0253; --mid: #4a0388; --bright: #6b07a8; --edge: #e05cff; --glow: rgba(210, 70, 255, .45); --ring: #d24cff; }
.tile[data-accent="gold"]   { --deep: #4a1701; --mid: #8a3c02; --bright: #c96a06; --edge: #ffd35a; --glow: rgba(255, 190, 50, .50); --ring: #ffc23a; }

.tile-art {
  position: absolute; left: 0; top: 0; bottom: 0; width: 38%;
  background-size: cover; background-position: left center;
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
}
.tile-art.letter {
  display: flex; align-items: center; justify-content: center;
  -webkit-mask-image: none; mask-image: none;
  font-size: 48px; font-weight: 900; font-style: italic; color: var(--gold-2);
}

.tile-body {
  position: absolute; left: 33%; right: 58px; top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.tile-title {
  font-size: clamp(26px, 9vw, 36px); line-height: .95; font-weight: 900; letter-spacing: -.5px; white-space: nowrap;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55)) drop-shadow(0 3px 6px rgba(0, 0, 0, .4));
}
.tile-title.long { font-size: clamp(20px, 7vw, 28px); letter-spacing: -1px; }
.tile-title.gold {
  background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 40%, var(--gold-3) 70%, var(--gold-4) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tile-title.silver {
  font-style: italic;
  background: linear-gradient(180deg, #ffffff 0%, #f2f4ff 50%, #b9c3dc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tile-kind {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: clamp(12px, 4vw, 15px); font-weight: 800; letter-spacing: 2px; color: var(--kind, var(--gold-2));
  text-shadow: 0 2px 2px rgba(0, 0, 0, .5);
}
.tile-kind.italic { font-style: italic; }
.tile-kind::before, .tile-kind::after { content: ""; width: 18px; height: 1.5px; background: currentColor; opacity: .7; }
.tile-tagline {
  margin-top: 8px; max-width: 100%; font-size: clamp(10px, 2.9vw, 12px); line-height: 1.2; font-weight: 600; letter-spacing: -.2px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}

/* Per-provider title treatments, as in the reference. */
.tile[data-id="bdg"]     { --kind: var(--gold-2); }
.tile[data-id="sikkim"]  { --kind: #ffffff; }
.tile[data-id="tiranga"] { --kind: #c9ff4a; }
.tile[data-id="goa"]     { --kind: var(--gold-2); }
.tile[data-id="tashan"]  { --kind: var(--gold-1); }
.tile[data-id="bdg"] .tile-kind::before, .tile[data-id="bdg"] .tile-kind::after { display: none; }

.tile-go {
  position: absolute; right: 16px; top: 50%; width: 46px; height: 46px; margin-top: -23px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #1a0a0a 0%, #050208 100%);
  border: 2px solid var(--ring); box-shadow: 0 0 8px var(--glow);
}
.tile-go svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 370px) {
  :root { --tile-height: 116px; }
  .tile-body { right: 52px; }
  .tile-go { width: 40px; height: 40px; margin-top: -20px; right: 12px; }
}

/* ---------- Footer trust bar ---------- */
.trust {
  display: flex; justify-content: space-around; align-items: center; gap: 6px;
  margin-top: 18px; padding: 4px 0;
  font-size: clamp(10px, 3vw, 12.5px); font-weight: 600; color: #fff;
}
.trust-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.trust svg { width: 20px; height: 20px; flex: none; }
.trust .fill { fill: var(--gold-2); }
.trust .line { fill: none; stroke: var(--gold-2); stroke-width: 2.4; }
.trust .tick { fill: none; stroke: #4a2a00; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 350px) { .trust { font-size: 10.5px; gap: 2px; } .trust-item { gap: 4px; } .trust svg { width: 18px; height: 18px; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 20px); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; z-index: 20;
  background: #2a0d14; border: 1px solid #ff6b6b; color: #fff; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.noscript { text-align: center; padding: 40px 16px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
