/* ========================================================
   YK FAMILY - PURE CRIMSON ARCHITECTURE (#A90000)
   Designed to match the Official Server Welcome Theme
   ======================================================== */
:root {
  --om-bg: #fff5f5;
  --om-card: rgba(255, 255, 255, 0.94);
  --om-border: rgba(169, 0, 0, 0.15);
  --om-border-hover: #A90000;
  --om-font: 'Prompt', 'Kanit', sans-serif;
  
  /* Primary Signature Crimson Palette */
  --brand-crimson: #A90000;
  --brand-crimson-bright: #C91111;
  --brand-crimson-dark: #750000;
  --brand-crimson-deep: #4D0000;
  --brand-crimson-glow: rgba(169, 0, 0, 0.42);
  --brand-crimson-subtle: rgba(169, 0, 0, 0.08);

  /* Legacy Theme Compatibility Aliases */
  --theme-red: #A90000;
  --theme-red-light: #C91111;
  --theme-red-dark: #750000;
  --pastel-pink: #A90000;
  --pastel-pink-dark: #750000;
  --pastel-blue: #A90000;
  --pastel-lavender: #750000;
}

body {
  font-family: var(--om-font);
  background-color: #0d080a;
  color: #334155;
  background: 
    linear-gradient(180deg, rgba(13, 8, 10, 0.20) 0%, rgba(13, 8, 10, 0.35) 100%),
    linear-gradient(180deg, rgba(169, 0, 0, 0.06) 0%, rgba(169, 0, 0, 0.15) 100%),
    url('/assets/bg.png') no-repeat center top / cover fixed;
  overflow-x: hidden;
}

/* ========================================================
   FLOATING NAVBAR & ORBS - CRIMSON PALETTE
   ======================================================== */
.om-nav-header {
  position: sticky;
  top: 0.75rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .om-nav-header {
    top: 1rem;
    padding: 0 1rem;
  }
}

.om-nav-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 1220px;
}

@media (min-width: 640px) {
  .om-nav-container {
    gap: 0.75rem;
  }
}

.om-nav-pill {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1.5px solid rgba(169, 0, 0, 0.20);
  border-radius: 9999px;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 32px -8px rgba(169, 0, 0, 0.28), 0 4px 12px rgba(169, 0, 0, 0.08);
  transition: all 0.25s ease;
}

@media (min-width: 640px) {
  .om-nav-pill {
    min-height: 60px;
    padding: 0.45rem 1rem;
  }
}

.om-nav-orb {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1.5px solid rgba(169, 0, 0, 0.20);
  box-shadow: 0 12px 32px -8px rgba(169, 0, 0, 0.28), 0 4px 12px rgba(169, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .om-nav-orb {
    width: 58px;
    height: 58px;
  }
}

.om-nav-orb:hover {
  transform: scale(1.06);
  border-color: #A90000;
  box-shadow: 0 14px 34px -6px rgba(169, 0, 0, 0.45);
}

.om-nav-auth {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(169, 0, 0, 0.35);
  box-shadow: 0 4px 14px -2px rgba(169, 0, 0, 0.25);
  padding: 0.25rem 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .om-nav-auth {
    height: 48px;
    padding: 0.35rem 0.85rem;
  }
}

.om-nav-auth:hover {
  border-color: #A90000;
  box-shadow: 0 8px 24px -4px rgba(169, 0, 0, 0.45);
}

.om-nav-link {
  font-family: 'Prompt', 'Kanit', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  height: 42px;
  border-radius: 1rem;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1e293b;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .om-nav-link {
    padding: 0.48rem 1.25rem;
    font-size: 15.5px;
    height: 44px;
  }
}

.om-nav-link i {
  font-size: 0.9rem;
  transition: transform 0.2s ease, color 0.2s ease;
  color: #A90000;
}

.om-nav-link:hover {
  color: #550000;
  background: rgba(169, 0, 0, 0.12);
  transform: translateY(-1.5px);
}

.om-nav-link:hover i {
  transform: scale(1.1);
  color: #750000;
}

/* ACTIVE NAV STATE */
.om-nav-link.active {
  background: linear-gradient(135deg, #A90000 0%, #750000 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  border-radius: 1rem;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px 0 rgba(169, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1.5px) scale(1.02);
}

.om-nav-link.active i {
  color: #ffffff !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.om-nav-link.active:hover {
  background: linear-gradient(135deg, #C91111 0%, #550000 100%) !important;
  box-shadow: 0 8px 24px 0 rgba(169, 0, 0, 0.65);
  transform: translateY(-2px) scale(1.04);
}

.om-nav-link:active {
  transform: scale(0.96) !important;
}

/* ========================================================
   TILES & CARDS
   ======================================================== */
.tiles-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
}

.tile-fx {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(169, 0, 0, 0.16);
  border-radius: 1.6rem;
  overflow: hidden;
  position: relative;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 30px -8px rgba(169, 0, 0, 0.20), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.tile-fx:hover {
  transform: translateY(-8px);
  border-color: #A90000;
  box-shadow: 0 22px 45px -10px rgba(169, 0, 0, 0.40), 0 0 25px -4px rgba(169, 0, 0, 0.35);
}

.tile-fx .tile-btn {
  background: linear-gradient(135deg, #A90000 0%, #750000 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px -2px rgba(169, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tile-fx:hover .tile-btn {
  opacity: 0.96;
}

/* Float Animations */
@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

.hero-float {
  animation: heroFloat 3.2s ease-in-out infinite;
  display: inline-block;
  will-change: transform;
}

/* Solid Crisp Card */
.glass-card {
  background: #ffffff;
  border: 1.5px solid rgba(169, 0, 0, 0.14);
  border-radius: 1.6rem;
  box-shadow: 0 10px 25px -5px rgba(169, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

/* Tab Panes */
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fff5f5;
}
::-webkit-scrollbar-thumb {
  background: #ffaaaa;
  border-radius: 9999px;
  border: 2px solid #fff5f5;
}
::-webkit-scrollbar-thumb:hover {
  background: #A90000;
}

/* ========================================================
   DARK THEME ARCHITECTURE (#A90000 CRIMSON OBSIDIAN)
   ======================================================== */
html.dark body {
  color: #f1f5f9;
  background: 
    radial-gradient(circle at 50% 0%, rgba(169, 0, 0, 0.22) 0%, rgba(13, 8, 10, 0.96) 60%, #0d080a 100%),
    linear-gradient(180deg, rgba(13, 8, 10, 0.88) 0%, rgba(13, 8, 10, 0.98) 100%),
    url('/assets/bg.png') no-repeat center top / cover fixed;
}

html.dark .om-nav-pill,
html.dark .om-nav-orb,
html.dark .om-nav-auth {
  background: rgba(18, 10, 13, 0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-color: rgba(169, 0, 0, 0.35);
  box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.75), 0 4px 16px rgba(169, 0, 0, 0.20);
}

html.dark .om-nav-orb:hover,
html.dark .om-nav-auth:hover {
  border-color: #A90000;
  box-shadow: 0 14px 34px -6px rgba(169, 0, 0, 0.55);
}

html.dark .om-nav-link {
  color: #e2e8f0;
}

html.dark .om-nav-link i {
  color: #A90000;
}

html.dark .om-nav-link:hover {
  color: #ffffff;
  background: rgba(169, 0, 0, 0.22);
}

html.dark .om-nav-link.active {
  background: linear-gradient(135deg, #A90000 0%, #750000 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 6px 22px rgba(169, 0, 0, 0.65) !important;
}

html.dark .om-nav-link.active i {
  color: #ffffff !important;
}

html.dark .glass-card {
  background: rgba(20, 12, 15, 0.95) !important;
  border-color: rgba(169, 0, 0, 0.30) !important;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(169, 0, 0, 0.15) !important;
}

html.dark .tile-fx {
  background: rgba(22, 13, 17, 0.94) !important;
  border-color: rgba(169, 0, 0, 0.30) !important;
  box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.65) !important;
}

html.dark .tile-fx:hover {
  border-color: #A90000 !important;
  box-shadow: 0 22px 45px -10px rgba(0, 0, 0, 0.8), 0 0 25px -4px rgba(169, 0, 0, 0.45) !important;
}

html.dark #mobile-menu {
  background: rgba(18, 10, 13, 0.98) !important;
  border-color: rgba(169, 0, 0, 0.35) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8) !important;
}

html.dark #mobile-menu button {
  color: #f1f5f9 !important;
}

html.dark #mobile-menu button:hover {
  background: rgba(169, 0, 0, 0.22) !important;
}

html.dark .ranking-podium-slot {
  background: linear-gradient(180deg, rgba(28, 15, 19, 0.95) 0%, rgba(18, 10, 13, 0.92) 100%) !important;
  border-color: rgba(169, 0, 0, 0.35) !important;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65) !important;
}

html.dark .ranking-rank-grid .group {
  background: rgba(22, 13, 17, 0.94) !important;
  border-color: rgba(169, 0, 0, 0.25) !important;
}

html.dark .bg-white,
html.dark .bg-white\/95,
html.dark .bg-white\/90,
html.dark .bg-white\/80,
html.dark .bg-white\/70 {
  background-color: rgba(20, 12, 15, 0.94) !important;
}

html.dark .border-red-100,
html.dark .border-red-100\/90,
html.dark .border-red-100\/80,
html.dark .border-red-100\/60,
html.dark .border-red-200,
html.dark .border-red-200\/60,
html.dark .border-red-200\/80,
html.dark .border-red-200\/90,
html.dark .border-red-300,
html.dark .border-red-50 {
  border-color: rgba(169, 0, 0, 0.30) !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: #f8fafc !important;
}

html.dark .text-slate-700 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark .text-slate-400 {
  color: #64748b !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: rgba(15, 8, 11, 0.95) !important;
  color: #f8fafc !important;
  border-color: rgba(169, 0, 0, 0.35) !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #A90000 !important;
  box-shadow: 0 0 0 3px rgba(169, 0, 0, 0.25) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark #cart-drawer,
html.dark #login-modal .glass-card,
html.dark #promptpay-modal .glass-card,
html.dark #payment-success-modal .glass-card {
  background-color: rgba(18, 10, 13, 0.98) !important;
  border-color: rgba(169, 0, 0, 0.35) !important;
}

footer,
html.dark footer {
  border-color: transparent !important;
  background-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.dark ::-webkit-scrollbar-track {
  background: #0d080a;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #4a151b;
  border: 2px solid #0d080a;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #A90000;
}

/* ========================================================
   FLOATING GAMING SIDEBAR (ISLAND DESIGN)
   ======================================================== */
.gaming-side-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  text-align: left;
  user-select: none;
}

.dark .gaming-side-btn {
  color: #94a3b8;
}

.gaming-side-btn:hover {
  color: #A90000;
  background: rgba(169, 0, 0, 0.10);
  border-color: rgba(169, 0, 0, 0.30);
  transform: translateX(3px);
}

.gaming-side-btn.active {
  background: linear-gradient(135deg, #A90000 0%, #750000 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 6px 20px rgba(169, 0, 0, 0.50);
  transform: translateX(3px);
}

.gaming-side-btn.active .side-icon-box {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.gaming-side-btn.active .side-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.side-icon-box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.side-btn-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  border-radius: 0.5rem;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(169, 0, 0, 0.35);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #A90000;
}

/* ========================================================
   TOPUP CHIPS & ACTION BUTTONS
   ======================================================== */
.topup-chip {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .topup-chip {
  background-color: rgba(22, 13, 17, 0.94) !important;
  border-color: rgba(169, 0, 0, 0.30) !important;
  color: #f8fafc !important;
}

html.dark .topup-chip:hover {
  background-color: rgba(169, 0, 0, 0.25) !important;
  border-color: #A90000 !important;
  color: #ffffff !important;
}

html.dark .topup-chip.active-chip,
.topup-chip.active-chip {
  background: linear-gradient(135deg, #A90000 0%, #750000 100%) !important;
  border-color: #C91111 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 16px rgba(169, 0, 0, 0.55) !important;
}

/* Signature Crimson Welcome Banner Container */
.crimson-welcome-banner {
  background: #A90000;
  box-shadow: 0 8px 24px -4px rgba(169, 0, 0, 0.45);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
