@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);
  /* 시안 2026-08-27: 단색 배경 -> 디자이너 배경 아트(파도 결). 실패 시 기존 단색으로 떨어지도록
     색을 아래 레이어로 남긴다. `fixed` 라 페이지가 길어져도 이미지가 늘어나거나 반복되지 않는다.
     ⚠️ 모바일은 `mobile.css` 의 `html.tb-is-mobile body` 가 이 값을 덮는다(시안이 PC 전용). */
  background: url(/assets/page-bg.webp) center top / cover no-repeat fixed, 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; }

/* 실시간 잭팟 롤링 숫자 (components/jackpot-strip.tsx)
   -------------------------------------------------------------
   한 자리(.jp-cell)는 1em 높이의 창이고, 그 안의 스트립(.jp-roll)에 [이전 글자, 새 글자]가
   세로로 쌓여 있다. 평소에는 -1em 으로 밀려 **아래 칸(새 글자)** 만 보이고, 글자가 바뀌어
   재마운트되면 0 → -1em 애니메이션이 재생되어 새 글자가 아래에서 위로 올라온다.

   ⚠️ 방향이 항상 '위'인 것이 핵심이다. 0~9 스트립을 통째로 굴리는 흔한 방식은
      9 → 0 에서 **아래로 되감기**가 보이는데, 끝자리는 초당 몇 번씩 9를 넘어가므로
      그 역회전이 계속 눈에 띈다. 두 칸만 쓰면 어떤 전환이든 위로만 흐른다.

   ⚠️ `height: 1em` 창에 글자가 잘리지 않는 이유: Pretendard-Black(woff, upem 2048) 실측으로
      typo 메트릭(USE_TYPO_METRICS=ON, ascent .9517 / descent .2412)이 쓰이므로 line-height:1
      줄상자의 baseline 이 위에서 .8552em 이고, 숫자 ink 는 baseline 위 .7168em ~ 아래 .0098em
      = 창 안 **0.138em~0.865em** 구간이라 1em 안에 넉넉히 들어온다.
      (콤마는 baseline 아래 .21em 까지 내려가 이 창에 넣으면 잘린다 — 그래서 창 밖에 둔다.)
      폰트를 바꾸면 재확인할 것. */
.jp-cell { display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.jp-roll { display: block; transform: translateY(-1em); animation: jp-roll-up .38s cubic-bezier(.22,1,.36,1); }
.jp-roll > span { display: block; height: 1em; }
@keyframes jp-roll-up { from { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .jp-roll { animation: none; } }

/* 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%);
}

/* 게임 바로가기 — 전용 칩/플레잉카드 아트를 밝게 눌러 텍스트 뒤에 배치한다. */
.qg-card {
  --qg-surface: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.qg-decoration {
  position: absolute;
  z-index: 0;
  width: 160px;
  height: 160px;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.82;
  pointer-events: none;
  user-select: none;
}
.qg-decoration-left {
  left: -44px;
  top: -34px;
  transform: rotate(-8deg);
}
.qg-decoration-right {
  right: -28px;
  top: -58px;
  transform: rotate(11deg);
}
.qg-card-slot .qg-decoration-left { width: 145px; height: 145px; opacity: 0.78; }
.qg-card-slot .qg-decoration-right { width: 108px; height: 108px; opacity: 0.62; }
.qg-card-casino .qg-decoration-left { width: 118px; height: 118px; top: -54px; opacity: 0.3; }
.qg-card-casino .qg-decoration-right { width: 170px; height: 170px; top: -28px; right: -48px; opacity: 0.5; }
/* 모바일 카드도 2026-08-26 부터 PC 와 같은 **배너 아트**(qg-card-art)를 쓴다.
   장식 이미지(qg-decoration) 방식은 더 이상 쓰지 않으므로 모바일 전용 크기 보정도 제거했다.
   ⚠️ `.qg-card-art .qg-decoration { display:none }` 가 아래에 있어 혹시 남은 장식이 섞여도 안 보인다. */
/* PC 홈의 배너 아트 카드 — 카드 1장이 디자이너 이미지 1장(570x126)이다.
   배경 지정은 인라인(Card 프리미티브가 background 를 인라인으로 박아 클래스가 진다).
   여기서는 예전 방식의 장식 이미지가 섞여 들어오지 못하게만 막는다. */
.qg-card-art .qg-decoration { display: none; }
.qg-card::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  pointer-events: none;
}
.qg-content { position: relative; z-index: 1; }
.qg-label {
  color: #0a2948;
  text-shadow: 0 1px 0 #fff, 0 2px 6px rgba(10,41,72,0.12);
}
.qg-button:focus-visible { outline: 3px solid var(--tb-primary-tint); outline-offset: 3px; border-radius: 18px; }

/* ============ 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; }

  /* 아트는 고정하고 글자색과 테두리만 반응시켜 이미지가 흔들리지 않게 한다. */
  .qg-card.tb-hoverable:hover { border-color: color-mix(in srgb, var(--tb-primary) 28%, var(--tb-line-soft)); }
  .qg-label { transition: color .2s; }
  .qg-card.tb-hoverable:hover .qg-label { color: 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 */
  /* ⚠️ will-change: transform 를 상시 걸지 않는다 — 도쿄와 동일 이슈(상세는 tokyo styles.css 주석).
     카드가 많은 카지노 그리드에서 레이어가 상시 승격되면 Chrome 이 승격/강등을 반복하고,
     같은 카드의 wheel(filter: drop-shadow)이 매 프레임 재래스터화돼 깜빡인다.
     제거해도 hover scale 은 transition 으로 그대로 동작한다(시각 변화 없음). */
  .tb-casino-media { transition: transform .45s cubic-bezier(.2,0,0,1); }
  .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); }
