/* ==========================================================================
   BigWin Gaming — Shared Styles (loaded on every page)
   1. Theme tokens  2. Reset  3. Typography  4. Buttons  5. Avatars
   6. Forms  7. Header  8. Footer  9. Chat widget  10. Utilities
   ========================================================================== */

/* 1. Theme tokens --------------------------------------------------------- */
:root {
  --bg: #0e0e0e;
  --bg-elev: #141414;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --border: #2b2b2b;
  --border-strong: #3a3a3a;

  --gold: #c9a74b;
  --gold-light: #e2c46a;
  --gold-dark: #a8893a;
  --gold-tint: #1c180d;          /* pinned / highlighted rows */
  --gold-glow: 0 0 28px rgba(201, 167, 75, 0.28);

  --text: #f2eee5;
  --text-muted: #9b978e;
  --text-dim: #6f6c66;
  --on-gold: #15120a;

  --online: #22c55e;
  --live: #ef4444;
  --danger: #f05252;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cinzel", Georgia, serif;

  --container: 1180px;
  --header-h: 68px;
}

/* 2. Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Kill the 300ms double-tap-to-zoom delay on taps (pinch zoom still works) */
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 3. Typography ----------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.display { font-family: var(--font-display); letter-spacing: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding: 72px 0; }
.section-title {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 2rem); letter-spacing: 2px; color: var(--gold);
}
.section-sub { text-align: center; color: var(--text-muted); font-size: 0.85rem; letter-spacing: 3px; text-transform: uppercase; margin-top: 6px; }

/* 4. Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--gold { background: var(--gold); color: var(--on-gold); }
.btn--gold:hover { background: var(--gold-light); box-shadow: var(--gold-glow); }
.btn--outline-gold { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn--outline-gold:hover { background: var(--gold-tint); }
.btn--dark { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--dark:hover { border-color: var(--gold); }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; padding: 0 40px; font-size: 1.05rem; letter-spacing: 1px; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 0.85rem; }

/* 5. Avatars -------------------------------------------------------------- */
.avatar {
  position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.15rem;
  background: var(--surface-2); color: var(--text);
}
.avatar--gold { background: var(--gold); color: var(--on-gold); }
.avatar--ring { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--gold); }
.avatar--sm { width: 40px; height: 40px; font-size: 0.9rem; }
.avatar--lg { width: 112px; height: 112px; font-size: 2.4rem; }
.avatar .status {
  position: absolute; right: 0; bottom: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--online); border: 2.5px solid var(--bg);
}

/* 6. Forms ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.9rem; font-weight: 700; }
.field label .req { color: var(--gold); }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong); font-size: 1rem;
  transition: border-color 0.2s;
}
.input::placeholder { color: var(--text-dim); }
.input:focus { outline: none; border-color: var(--gold); }
.input-action {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--gold); font-weight: 700; font-size: 0.85rem; padding: 6px;
}
.hint { font-size: 0.78rem; color: var(--text-muted); }
.error { font-size: 0.78rem; color: var(--danger); min-height: 1em; }
.field.invalid .input { border-color: var(--danger); }

.divider { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

/* 7. Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(14, 14, 14, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--gold); }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--text-muted); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav a:hover, .nav a.active { color: var(--gold); }
.header-actions { display: flex; gap: 10px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle span { width: 20px; height: 2px; background: var(--gold); transition: transform 0.25s, opacity 0.25s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .menu-toggle { display: flex; }
  .nav-panel {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 0 16px;
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s;
  }
  .nav-panel.open { max-height: calc(100dvh - var(--header-h)); overflow-y: auto; padding: 12px 16px 20px; }
  .nav { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .header-actions { margin-top: 16px; }
  .header-actions .btn { flex: 1; }
}
@media (min-width: 821px) {
  .nav-panel { display: flex; align-items: center; gap: 32px; }
}

/* 8. Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 28px; text-align: center; background: var(--bg-elev); }
.site-footer .brand { justify-content: center; margin-bottom: 18px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; margin-bottom: 18px; font-size: 0.9rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--gold); }
.footer-links li:not(:last-child)::after { content: "·"; margin-left: 6px; color: var(--text-dim); }
.footer-note { font-size: 0.8rem; color: var(--text-dim); }
.footer-note + .footer-note { margin-top: 6px; }

/* 9. Live chat widget ----------------------------------------------------- */
.chat-widget { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
/* The widget box spans the (hidden) card's area — let taps fall through to the page */
.chat-widget { pointer-events: none; }
.chat-widget > * { pointer-events: auto; }
.chat-card {
  width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform-origin: bottom right; transition: transform 0.25s, opacity 0.25s;
}
.chat-card[hidden] { display: block; opacity: 0; transform: scale(0.9); pointer-events: none; visibility: hidden; }
.chat-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.chat-card__head strong { display: block; }
.chat-card__head small { color: var(--online); font-size: 0.8rem; }
.chat-card__close { margin-left: auto; background: none; border: none; color: var(--text-muted); font-size: 1.1rem; padding: 4px; }
.chat-card__msg { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: 0.9rem; margin-bottom: 14px; }
.chat-card__msg p + p { margin-top: 6px; color: var(--text-muted); }
.chat-card__msg time { display: block; margin-top: 8px; font-size: 0.72rem; color: var(--text-dim); }
.chat-fab {
  width: 60px; height: 60px; border-radius: 50%; border: none; background: var(--gold); color: var(--on-gold);
  display: grid; place-items: center; box-shadow: var(--gold-glow);
}
.chat-fab svg { width: 28px; height: 28px; }

/* Facebook / Telegram "message us" buttons */
.social { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.social[hidden], [data-social-wrap][hidden] { display: none; }
.social-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; color: #fff; transition: filter 0.2s;
}
.social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.social-btn:hover { filter: brightness(1.12); }
.social-btn--facebook { background: #0866ff; }
.social-btn--telegram { background: #229ed9; }
.social-btn--off { opacity: 0.55; cursor: default; }
.social-btn--off:hover { filter: none; }.social-label { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 10px; }

/* 9b. Mobile ------------------------------------------------------------ */
/* iOS Safari auto-zooms on focus when a field's font-size is under 16px. */
input, select, textarea { font-size: max(16px, 1em); }
.input, select.input, textarea.input { font-size: 16px; }

@media (max-width: 600px) {
  :root { --header-h: 60px; }
  .section { padding: 48px 0; }
  .brand { font-size: 1.05rem; }
  .brand img { width: 34px; height: 34px; }
  .btn--lg { padding: 0 28px; width: 100%; max-width: 340px; }
  .chat-fab { width: 54px; height: 54px; }
  .chat-fab svg { width: 24px; height: 24px; }
  .footer-links { font-size: 0.85rem; }
  .site-footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); } /* clear the chat button */
}
/* No sticky hover effects on touch screens */
@media (hover: none) {
  .btn--gold:hover { background: var(--gold); box-shadow: none; }
  .btn--dark:hover { border-color: var(--border-strong); }
}

/* 10. Utilities ----------------------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.stack { display: flex; flex-direction: column; }
.gap-12 { gap: 12px; }
.gap-20 { gap: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
