@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@400;500;700;900&family=Noto+Serif+SC:wght@600;700;900&family=Prompt:wght@400;500;600;700;800&family=ZCOOL+KuaiLe&display=swap');

:root {
  --font-thai: 'Kanit', 'Prompt', sans-serif;
  --font-chinese: 'Noto Sans SC', sans-serif;
  --font-calligraphy: 'Ma Shan Zheng', cursive;
  --font-game: 'ZCOOL KuaiLe', cursive, sans-serif;
  --font-imperial: 'Noto Serif SC', serif;
  
  --bg-parchment: #fbf8f3;
  --vermilion: #dc2626;
  --vermilion-dark: #991b1b;
  --imperial-gold: #d97706;
  --jade-green: #059669;
  --ink-black: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-thai);
  background-color: var(--bg-parchment);
  color: #1e293b;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#f1e7d8 1px, transparent 1px),
    linear-gradient(to bottom, #fcfaf6, #f7f2e8);
  background-size: 24px 24px, 100% 100%;
}

/* Chinese Typography Classes */
.chinese-text {
  font-family: var(--font-chinese);
}

.chinese-calligraphy {
  font-family: var(--font-calligraphy);
  letter-spacing: 2px;
}

.chinese-game-title {
  font-family: var(--font-game);
  letter-spacing: 1px;
}

.chinese-imperial {
  font-family: var(--font-imperial);
}

/* Chinese Red Seal Stamp (朱砂印章) */
.seal-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b91c1c;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  font-family: var(--font-calligraphy);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35), inset 0 0 4px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
  user-select: none;
  font-weight: bold;
}

.seal-stamp-lg {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.seal-stamp-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

/* Chinese Ornate Game Cards */
.chinese-card {
  background: #ffffff;
  border: 1.5px solid #e7dfd3;
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(120, 80, 40, 0.07), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chinese-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -4px rgba(180, 83, 9, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  border-color: #d97706;
}

/* Chinese Traditional Corner Flourishes (回纹角花) */
.chinese-corners::before,
.chinese-corners::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #d97706;
  border-style: solid;
  pointer-events: none;
  opacity: 0.65;
}

.chinese-corners::before {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 4px;
}

.chinese-corners::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 4px;
}

/* Auspicious Scroll Ribbon Badges */
.chinese-ribbon {
  background: linear-gradient(90deg, #fef3c7, #fffbeb, #fef3c7);
  border: 1px solid #f59e0b;
  color: #92400e;
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.chinese-ribbon-red {
  background: linear-gradient(90deg, #fee2e2, #fff1f2, #fee2e2);
  border: 1px solid #ef4444;
  color: #991b1b;
}

.chinese-ribbon-jade {
  background: linear-gradient(90deg, #d1fae5, #ecfdf5, #d1fae5);
  border: 1px solid #10b981;
  color: #065f46;
}

/* Game Action Buttons with Chinese Flair */
.chinese-btn-vermilion {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border: 1px solid #991b1b;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s ease;
}

.chinese-btn-vermilion:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
  transform: translateY(-1px);
}

.chinese-btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #b45309;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.chinese-btn-amber:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.chinese-btn-jade {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid #047857;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.chinese-btn-jade:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.chinese-btn-navy {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
  transition: all 0.2s ease;
}

.chinese-btn-navy:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.45);
  transform: translateY(-1px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f5ede1;
}
::-webkit-scrollbar-thumb {
  background: #d8c8b4;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b8a288;
}

/* Shadows */
.card-shadow {
  box-shadow: 0 4px 20px -2px rgba(90, 60, 30, 0.06), 0 2px 6px -1px rgba(90, 60, 30, 0.04);
}

.card-shadow-lg {
  box-shadow: 0 12px 36px -4px rgba(90, 60, 30, 0.1), 0 4px 12px -2px rgba(90, 60, 30, 0.05);
}

/* Faction Accent Borders */
.border-team-turtle {
  border-color: #10b981 !important;
}
.border-team-rabbit {
  border-color: #f59e0b !important;
}
.border-team-panda {
  border-color: #6366f1 !important;
}
.border-team-dragon {
  border-color: #ef4444 !important;
}

/* 4-Lane Track Styling */
.race-lane-card {
  background: #ffffff;
  border: 1.5px solid #e7ded1;
  box-shadow: 0 2px 8px rgba(120, 80, 40, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.race-lane-card.active-lane {
  border-color: #dc2626 !important;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.18);
  background: #fffbfa;
}

.track-bg {
  background: #f6efe4;
  border: 1px solid #e5d8c5;
}

/* Runner Pin / Figurine */
.runner-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid #ffffff;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.runner-pin.pin-turtle {
  background: #10b981;
}
.runner-pin.pin-rabbit {
  background: #f59e0b;
}
.runner-pin.pin-panda {
  background: #6366f1;
}
.runner-pin.pin-dragon {
  background: #ef4444;
}

/* Mobile Choice Buttons */
.mobile-choice-btn {
  transition: all 0.15s ease;
  transform: translateY(0);
}

.mobile-choice-btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.99);
}

/* Canvas Confetti */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Swipable Carousel & Cards */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.snap-card {
  scroll-snap-align: center;
  flex-shrink: 0;
}

/* Tinder-Style Stacked Card Deck */
#tinder-card-deck {
  position: relative;
  width: 100%;
  height: 275px;
  perspective: 1000px;
}

.tinder-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  background: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

.tinder-card:active {
  cursor: grabbing;
}

.tinder-card.is-animating {
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.tinder-card.is-swiping-out {
  transition: transform 0.35s ease-out, opacity 0.25s ease-out;
}

.tinder-badge {
  position: absolute;
  top: 14px;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease;
}

.tinder-badge-like {
  left: 14px;
  border: 2.5px solid #10b981;
  color: #047857;
  background: rgba(236, 253, 245, 0.95);
  transform: rotate(-12deg);
}

.tinder-badge-pass {
  right: 14px;
  border: 2.5px solid #ef4444;
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.95);
  transform: rotate(12deg);
}

