@import url("./design-system/colors_and_type.css");

/* ============ TOSS Bet — site styles ============ */
:root {
  color-scheme: light;
  --tb-bg: #ffffff;
  --tb-bg-alt: #f7f7f8;
  --tb-bg-card: #ffffff;
  --tb-line: rgba(112, 115, 124, 0.22);
  --tb-line-soft: rgba(112, 115, 124, 0.12);
  --tb-text: #1b1c1e;
  --tb-text-soft: rgba(46, 47, 51, 0.72);
  --tb-text-mute: rgba(55, 56, 60, 0.51);
  --tb-text-disable: rgba(55, 56, 60, 0.28);
  --tb-fill-soft: rgba(112, 115, 124, 0.06);
  --tb-fill: rgba(112, 115, 124, 0.10);
  --tb-fill-strong: rgba(112, 115, 124, 0.16);
  --tb-primary: #0066ff;
  --tb-primary-strong: #005eeb;
  --tb-primary-tint: #eaf2fe;
  --tb-positive: #00872f;
  --tb-positive-tint: #e0fcec;
  --tb-negative: #e53030;
  --tb-negative-tint: #ffe7e7;
  --tb-caution: #ed5b00;
  --tb-caution-tint: #fff1e6;
  --tb-shadow-card: 0 1px 3px 0 rgba(23, 23, 23, 0.06), 0 0 0 1px rgba(112, 115, 124, 0.10);
  --tb-shadow-strong: 0 6px 16px 0 rgba(0, 0, 0, 0.10), 0 0 1px 0 rgba(0, 0, 0, 0.08);
  --tb-shadow-emphasize: 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  color-scheme: dark;
  --tb-bg: #131316;
  --tb-bg-alt: #1b1c1e;
  --tb-bg-card: #1f2024;
  --tb-line: rgba(255, 255, 255, 0.10);
  --tb-line-soft: rgba(255, 255, 255, 0.06);
  --tb-text: #ffffff;
  --tb-text-soft: rgba(255, 255, 255, 0.72);
  --tb-text-mute: rgba(255, 255, 255, 0.51);
  --tb-text-disable: rgba(255, 255, 255, 0.28);
  --tb-fill-soft: rgba(255, 255, 255, 0.04);
  --tb-fill: rgba(255, 255, 255, 0.08);
  --tb-fill-strong: rgba(255, 255, 255, 0.14);
  --tb-primary: #3385ff;
  --tb-primary-strong: #5b8fec;
  --tb-primary-tint: rgba(51, 133, 255, 0.14);
  --tb-positive: #38d27c;
  --tb-positive-tint: rgba(56, 210, 124, 0.14);
  --tb-negative: #ff5555;
  --tb-negative-tint: rgba(255, 85, 85, 0.14);
  --tb-caution: #ff7733;
  --tb-caution-tint: rgba(255, 119, 51, 0.14);
  --tb-shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --tb-shadow-strong: 0 6px 16px 0 rgba(0, 0, 0, 0.5), 0 0 1px 0 rgba(0, 0, 0, 0.4);
  --tb-shadow-emphasize: 0 1px 4px 0 rgba(0, 0, 0, 0.3), 0 0 4px 0 rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--w-font-sans);
  background: var(--tb-bg-alt);
  color: var(--tb-text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" on;
  transition: background-color .2s cubic-bezier(.2,0,0,1), color .2s cubic-bezier(.2,0,0,1);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* utility */
.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" on; }

/* Dark mode: monochrome (currentColor) icons render black via <img>, so flip
   them to white. Icons with an inline `filter` (brand tints, already-white
   icons on colored fills) override this and keep their intended color. */
[data-theme="dark"] .tb-icon { filter: brightness(0) invert(1); }
/* Quick-games shortcut icons: override their brand-tint inline filter so they go white in dark mode. */
[data-theme="dark"] .qg-icon { filter: brightness(0) invert(1) !important; }

/* Hero CTA button box — visible in both themes.
   Light: #70737c @ 6% on the light card · Dark: #ffffff @ 8% on the dark card.
   (Arrow follows the icon's theme color: dark on the light box, white on the dark box.) */
.tb-hero-cta {
  background: rgba(112, 115, 124, 0.06);
  color: var(--tb-primary);
}
[data-theme="dark"] .tb-hero-cta {
  background: rgba(255, 255, 255, 0.08);
}

/* Hero slide indicator dots — theme-aware so they show on the card in both modes. */
.tb-hero-dot { background: rgba(112, 115, 124, 0.32); }
.tb-hero-dot.active { background: rgba(112, 115, 124, 0.85); }
[data-theme="dark"] .tb-hero-dot { background: rgba(255, 255, 255, 0.4); }
[data-theme="dark"] .tb-hero-dot.active { background: #ffffff; }

/* Header nav hover submenu — vertical roll-down reveal (panel + staggered items). */
@keyframes tb-nav-roll-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tb-nav-roll {
  transform-origin: top center;
  animation: tb-nav-roll-in .18s cubic-bezier(.2,0,0,1) both;
}
.tb-nav-roll-item {
  opacity: 0;
  animation: tb-nav-roll-in .3s cubic-bezier(.2,0,0,1) both;
  transition: background .12s;
}

/* Dark mode: design-system h1–h5 rules hardcode a light-theme label color that
   the dark theme doesn't remap. Force headings to the theme text color. */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5 { color: var(--tb-text); }
.elev-card { box-shadow: var(--tb-shadow-card); }
.elev-strong { box-shadow: var(--tb-shadow-strong); }

/* scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--tb-fill-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* keyframes */
@keyframes tb-fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes tb-shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes tb-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes tb-pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
@keyframes tb-flash { 0% { background: var(--tb-primary-tint); } 100% { background: transparent; } }

.tb-fade-up { animation: tb-fade-up .22s cubic-bezier(.2,0,0,1) both; }
.tb-flash { animation: tb-flash .8s cubic-bezier(.2,0,0,1); }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--tb-negative); animation: tb-pulse-dot 1.4s ease-in-out infinite; }

/* hero gradient (uses brand blue, no slop) */
.tb-hero-blue {
  background:
    radial-gradient(120% 140% at 90% 10%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, #0066ff 0%, #004cc1 100%);
}
.tb-hero-dark {
  background:
    radial-gradient(120% 140% at 90% 10%, rgba(51,133,255,0.28), transparent 55%),
    linear-gradient(135deg, #1b1c1e 0%, #000 100%);
}

/* ============ Micro-interactions ============
   Decorative hover/press polish. Gated on prefers-reduced-motion so users who
   opt out of motion get the plain, unanimated UI. */
@media (prefers-reduced-motion: no-preference) {
  /* Hoverable cards — gentle lift + elevated shadow */
  .tb-card.tb-hoverable { transition: transform .2s cubic-bezier(.2,0,0,1), box-shadow .2s cubic-bezier(.2,0,0,1), border-color .2s; }
  .tb-card.tb-hoverable:hover { transform: translateY(-3px); box-shadow: var(--tb-shadow-strong); }
  .tb-card.tb-hoverable:active { transform: translateY(-1px); transition-duration: .08s; }

  /* Quick-game shortcuts — each game lights up in its own brand tint */
  .qg-card { position: relative; overflow: hidden; }
  .qg-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(125% 120% at 100% 0%, var(--qg-tint, var(--tb-primary)), transparent 58%);
    transition: opacity .3s cubic-bezier(.2,0,0,1);
  }
  .qg-card:hover::before { opacity: .10; }
  .qg-card.tb-hoverable:hover { border-color: color-mix(in srgb, var(--qg-tint, var(--tb-primary)) 40%, var(--tb-line-soft)); }
  .qg-icon-wrap { transition: transform .32s cubic-bezier(.34,1.56,.64,1), filter .3s cubic-bezier(.2,0,0,1); will-change: transform; }
  .qg-card:hover .qg-icon-wrap {
    transform: scale(1.12) rotate(-5deg);
    filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--qg-tint, var(--tb-primary)) 50%, transparent));
  }
  .qg-label { transition: color .2s; }
  .qg-card:hover .qg-label { color: var(--qg-tint, var(--tb-primary)); }

  /* "전체보기 →" style links — arrow nudges, text firms up */
  .tb-link { transition: color .15s; }
  .tb-link:hover { color: var(--tb-text); }
  .tb-link .tb-icon, .tb-link-arrow .tb-icon { transition: transform .2s cubic-bezier(.2,0,0,1); }
  .tb-link:hover .tb-icon, .tb-link-arrow:hover .tb-icon { transform: translateX(3px); }

  /* List rows (notices etc.) — soft highlight on hover */
  .tb-row { transition: background .14s; border-radius: 8px; }
  .tb-row:hover { background: var(--tb-fill-soft); }

  /* Promo tiles — lean toward the pointer */
  .tb-promo { transition: transform .16s cubic-bezier(.2,0,0,1); cursor: pointer; }
  .tb-promo:hover { transform: translateX(3px); }

  /* Buttons — tactile press + faint brighten */
  .tb-btn:hover { filter: brightness(1.04); }
  .tb-btn:active { transform: scale(.97); }

  /* Odds buttons — quick press */
  .tb-odds:active { transform: scale(.96); }

  /* Casino tiles — slow image push-in beneath the card lift */
  .tb-casino-media { transition: transform .45s cubic-bezier(.2,0,0,1); will-change: transform; }
  .tb-card.tb-hoverable:hover .tb-casino-media { transform: scale(1.06); }

  /* Hero CTA — arrow nudge + press */
  .tb-hero-cta { transition: background .15s, transform .12s; }
  .tb-hero-cta:hover { background: rgba(112,115,124,0.12); }
  .tb-hero-cta:active { transform: scale(.97); }
}
[data-theme="dark"] .tb-hero-cta:hover { background: rgba(255,255,255,0.14); }
