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

/* ============ SPACE 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);
  --tb-glow-primary: none;
}

/* ============ TOKYO CASINO — dark (단일 테마) ============
   먹빛 자주(#0A0610) 캔버스 · 사쿠라 핑크 강조 · 금박(#E9B85C) 보조.
   유리 패널 + 절제된 네온 글로우는 그대로 두고 색상환만 도쿄로 옮겼다.

   ⚠️ 보조색 매핑 주의 — 도쿄 시안에는 '초록(positive)/주황(caution)'이 없다.
      시안이 쓰는 강조는 **핑크 2단계 + 금박** 세 가지뿐이라 아래처럼 접었다:
        positive → 금박 #E9B85C  (적중 · 보상 · 환전 — 시안의 '좋은 결과' 색)
        caution  → 연핑크 #FF87C0 (홈 이벤트 카드가 3색을 순환하므로 자리를 비울 수 없다)
      negative(패/손실)만 붉은 계열을 유지한다 — 금박과 붙으면 승패 구분이 사라진다. */
[data-theme="dark"] {
  color-scheme: dark;
  --tb-bg: #0A0610;          /* 가장 깊은 먹자주 — 헤더 / 사이드바 / 푸터 베이스 */
  --tb-bg-alt: #0E0713;      /* 페이지 캔버스 */
  --tb-bg-card: #17101C;     /* 유리 패널 베이스 */
  --tb-line: rgba(255, 150, 200, 0.16);
  --tb-line-soft: rgba(255, 150, 200, 0.10);
  --tb-text: #F6EDF3;
  --tb-text-soft: rgba(243, 222, 234, 0.72);
  --tb-text-mute: rgba(230, 200, 218, 0.50);
  --tb-text-disable: rgba(230, 200, 218, 0.28);
  --tb-fill-soft: rgba(255, 150, 200, 0.06);
  --tb-fill: rgba(255, 150, 200, 0.10);
  --tb-fill-strong: rgba(255, 150, 200, 0.18);
  --tb-primary: #FF4E9B;     /* 사쿠라 핑크 */
  --tb-primary-strong: #D82074;
  --tb-primary-tint: rgba(255, 78, 155, 0.16);
  --tb-positive: #E9B85C;    /* 금박 — 적중 / 보상 / 환전 */
  --tb-positive-tint: rgba(233, 184, 92, 0.16);
  --tb-negative: #FF5C6C;
  --tb-negative-tint: rgba(255, 92, 108, 0.15);
  --tb-caution: #FF87C0;     /* 연핑크 */
  --tb-caution-tint: rgba(255, 135, 192, 0.14);
  --tb-shadow-card: 0 10px 30px 0 rgba(6, 2, 10, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(255, 150, 200, 0.08);
  --tb-shadow-strong: 0 18px 44px 0 rgba(6, 2, 10, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 150, 200, 0.12);
  --tb-shadow-emphasize: 0 4px 16px 0 rgba(6, 2, 10, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  --tb-glow-primary: 0 0 0 1px rgba(255, 78, 155, 0.35), 0 8px 22px rgba(255, 78, 155, 0.40);
  /* 금박 그라디언트 — 사이드바 아이콘 · 뱃지에서 반복 사용 */
  --tk-gold: linear-gradient(135deg, #FFF6D0 0%, #F4D27E 24%, #E3A93F 48%, #B8801F 72%, #7E5210 100%);
}

/* 캔버스는 단색만 칠한다.
   ⚠️ 사쿠라 오라 · 세이가이하(青海波) 물결 · 벚꽃 파티클은 전부
      `chrome/tokyo-backdrop.tsx` 의 고정 오버레이가 그린다 — 패턴이
      `mix-blend-mode: screen` + 낮은 opacity 를 쓰는데 body 배경으로는
      레이어마다 blend/opacity 를 따로 줄 수 없기 때문이다(시안도 오버레이 방식).
      여기에 그라디언트를 또 넣으면 오버레이와 이중으로 겹친다. */
[data-theme="dark"] body {
  background-color: #0A0610;
}

/* 유리 패널: 자주 베이스 + 상단 내부광 + 부드러운 그림자/림.
   자체 그라디언트를 가진 히어로 카드는 제외한다. */
[data-theme="dark"] .tb-card:not(.tb-hero-blue):not(.tb-hero-dark) {
  background:
    linear-gradient(180deg, rgba(255, 140, 190, 0.07), rgba(255, 140, 190, 0) 44%),
    var(--tb-bg-card) !important;
  border-color: var(--tb-line-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(6, 2, 10, 0.45);
}
[data-theme="dark"] .tb-card.tb-hoverable:not(.tb-hero-blue):not(.tb-hero-dark):hover {
  border-color: rgba(255, 78, 155, 0.45) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 38px rgba(6, 2, 10, 0.6),
    0 0 26px rgba(255, 78, 155, 0.24);
}

* { 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;
}

/* Active header-nav item — blue bar + downward neon glow */
@keyframes tb-nav-bar-in {
  from { opacity: 0; transform: translateX(-50%) scaleX(0.5); }
  to   { opacity: 1; transform: translateX(-50%) scaleX(1); }
}
.tb-nav-active-bar {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: calc(100% - 14px);
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #FF4E9B 0%, #FFA8D2 100%);
  box-shadow:
    0 1px 8px 1px rgba(255,78,155,0.9),
    0 4px 16px 2px rgba(255,78,155,0.55),
    0 8px 26px 4px rgba(255,78,155,0.32);
  pointer-events: none;
  transform: translateX(-50%);
  transform-origin: bottom center;
}
@media (prefers-reduced-motion: no-preference) {
  .tb-nav-active-bar { animation: tb-nav-bar-in .22s cubic-bezier(.2,0,0,1) both; }
}

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

/* 히어로 그라디언트 (사쿠라 자주 — 절제된 글로우).
   !important 는 Card 프리미티브가 배경을 인라인으로 넣기 때문이다. */
.tb-hero-blue {
  background:
    radial-gradient(120% 140% at 88% 8%, rgba(255,150,200,0.30), transparent 55%),
    linear-gradient(135deg, #FF4E9B 0%, #7A1746 100%) !important;
}
[data-theme="dark"] .tb-hero-blue {
  background:
    radial-gradient(120% 140% at 88% 8%, rgba(255,140,190,0.32), transparent 55%),
    linear-gradient(135deg, #D82074 0%, #4A0F2C 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 0 0 1px rgba(255,120,180,0.26), 0 16px 44px rgba(40,4,22,0.55);
}
.tb-hero-dark {
  background:
    radial-gradient(120% 140% at 90% 10%, rgba(255,111,178,0.28), transparent 55%),
    linear-gradient(135deg, #2A0E22 0%, #0E0713 100%);
}
[data-theme="dark"] .tb-hero-dark {
  background:
    radial-gradient(120% 140% at 88% 8%, rgba(255,78,155,0.34), transparent 55%),
    linear-gradient(140deg, #2A0E22 0%, #0E0713 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 0 1px rgba(255,150,200,0.16), 0 16px 44px rgba(6,2,10,0.6);
}
[data-theme="dark"] .tb-hero-cta:hover { background: rgba(255,255,255,0.16); }

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

/* ============ 버튼 — 도쿄 시안 ============
   1차: #FF5FA6→#D82074 그라디언트 + 3px 하드 바텀 엣지 + 핑크 글로우.
   2차: 자주 그라디언트(#2A1826→#3D1E30) + 핑크 테두리.

   ⚠️ 스페이스벳에 있던 시안(cyan) 네온 ::before 레이어는 제거했다.
      도쿄 시안에는 대응 효과가 없고, 남겨두면 핑크 위에 청록이 번져
      브랜드 색이 흐려진다. */
.tb-btn--primary {
  color: #fff;
  border: 1px solid transparent;
  background-image: linear-gradient(180deg, #FF5FA6 0%, #D82074 100%);
  box-shadow: 0 3px 0 0 rgba(0,0,0,0.45), 0 0 20px 0 rgba(255,78,155,0.45);
}
.tb-btn--navy {
  background: linear-gradient(180deg, #2A1826 0%, #3D1E30 100%);
  color: var(--tb-text);
  border: 1px solid rgba(255,150,200,0.24);
  box-shadow: 0 6px 16px rgba(6,2,10,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
@media (prefers-reduced-motion: no-preference) {
  .tb-btn--primary { transition: box-shadow .22s ease, filter .18s ease, transform .15s cubic-bezier(.2,0,0,1); }
  .tb-btn--navy { transition: box-shadow .18s ease, border-color .18s ease, transform .15s cubic-bezier(.2,0,0,1); }
}
.tb-btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 0 0 rgba(0,0,0,0.45), 0 0 30px 3px rgba(255,78,155,0.62);
}
.tb-btn--primary:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(0,0,0,0.45), 0 0 18px 0 rgba(255,78,155,0.5); }
.tb-btn--navy:hover {
  border-color: rgba(255,150,200,0.55);
  box-shadow:
    0 8px 22px rgba(255,78,155,0.22),
    0 6px 16px rgba(6,2,10,0.55),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
.tb-btn--navy:active { transform: translateY(1px); }

/* ============ 좌측 사이드바 메뉴 — 도쿄 시안 ============
   시안은 hover 에 배경 + **좌측 핑크 인셋 바 + 2px 밀림**을 함께 준다.
   아이콘은 상태와 무관하게 항상 금박(--tk-gold)이다(스페이스벳은 비활성 회청 →
   활성 파랑으로 바뀌었지만, 도쿄는 금박 하나로 통일). */
.tb-sb-item {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 9px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.012em;
  color: var(--tb-text); background: transparent;
  transition: background .15s, transform .12s, box-shadow .15s;
}
.tb-sb-item:hover {
  background: rgba(255,150,200,0.10);
  box-shadow: inset 2px 0 0 0 #FF4E9B;
  transform: translateX(2px);
}
.tb-sb-item:active { transform: translateX(1px) scale(.99); }
.tb-sb-item.active {
  background: rgba(255,78,155,0.14);
  box-shadow: inset 2px 0 0 0 #FF4E9B;
}
/* 아이콘 자체는 컴포넌트가 `MaskIcon`(background: var(--tk-gold))으로 그린다.
   시안의 우측 셰브론은 쓰지 않는다 — 항목이 전부 단일 링크라 화살표가 정보를 더하지 않는다. */
