/* Base Font Scaling & Theming */
:root {
  --fs-scale: 1.15;
}

html {
  font-size: calc(16px * var(--fs-scale));
}

/* Ensure small texts are completely legible without straining */
.text-\[8px\], .text-\[9px\] {
  font-size: 0.72rem !important;
  line-height: 1.15 !important;
}

.text-\[10px\], .text-\[11px\] {
  font-size: 0.8rem !important;
  line-height: 1.25 !important;
}

.text-xs {
  font-size: 0.86rem !important;
  line-height: 1.35 !important;
}

.text-sm {
  font-size: 0.98rem !important;
  line-height: 1.45 !important;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.8);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.8);
}

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

.animate-fade-in {
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bounceSubtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.animate-bounce-subtle {
  animation: bounceSubtle 1.8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
}

.pulse-glow {
  animation: pulseGlow 2s infinite ease-in-out;
}

/* Touch & Mobile UX */
button, path, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* State Map Path Transitions */
.state-path {
  transition: fill 0.3s ease, fill-opacity 0.3s ease, stroke 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.state-path:hover {
  filter: brightness(1.22);
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

.toast-item {
  pointer-events: auto;
  animation: fadeIn 0.25s ease-out;
  transition: all 0.3s ease;
}

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

/* --- LIGHT MODE OVERRIDES (HIGH CONTRAST & MODERN SLATE PALETTE) --- */
html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .bg-slate-950,
html.light .bg-slate-900,
html.light .bg-slate-800 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05) !important;
}

html.light [class*="bg-slate-950\/"],
html.light [class*="bg-slate-900\/"],
html.light [class*="bg-slate-800\/"] {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

html.light .border-slate-800,
html.light .border-slate-700,
html.light .border-slate-600 {
  border-color: #cbd5e1 !important;
}

/* Headings and body texts */
html.light h1,
html.light h2,
html.light h3,
html.light h4,
html.light h5,
html.light h6 {
  color: #0f172a !important;
}

html.light .text-slate-100,
html.light .text-slate-200,
html.light .text-slate-300 {
  color: #1e293b !important;
}

html.light .text-slate-400 {
  color: #475569 !important;
}

html.light .text-slate-500 {
  color: #64748b !important;
}

/* Text white outside of colored action buttons */
html.light div:not([class*="bg-emerald-"]):not([class*="bg-amber-"]):not([class*="bg-rose-"]):not([class*="bg-blue-"]):not([class*="bg-indigo-"]):not([class*="bg-purple-"]):not([class*="bg-red-"]):not([class*="bg-slate-800"]):not([class*="bg-slate-900"]):not([class*="bg-slate-950"]):not([class*="bg-black"]) > .text-white,
html.light span.text-white:not(button span):not([class*="bg-"]):not(.badge):not(.pill):not([class*="bg-slate-"] *),
html.light p.text-white:not([class*="bg-slate-"] *):not([class*="bg-black"] *) {
  color: #0f172a !important;
}

/* Ensure text on genuinely dark elements always stays bright white */
html.light [class*="bg-slate-800"] .text-white,
html.light [class*="bg-slate-900"] .text-white,
html.light [class*="bg-slate-950"] .text-white,
html.light [class*="bg-black"] .text-white,
html.light .dark-panel .text-white,
html.light .dark-panel h1,
html.light .dark-panel h2,
html.light .dark-panel h3 {
  color: #ffffff !important;
}

/* Accent texts in light mode */
html.light .text-emerald-400,
html.light .text-emerald-300 {
  color: #047857 !important;
}

html.light .text-amber-400,
html.light .text-amber-300 {
  color: #b45309 !important;
}

html.light .text-rose-400,
html.light .text-rose-300 {
  color: #be123c !important;
}

html.light .text-indigo-400,
html.light .text-blue-400 {
  color: #1d4ed8 !important;
}

/* Ensure text inside colored dark badges has high contrast */
html.light [class*="bg-slate-800"] .text-slate-300,
html.light [class*="bg-slate-900"] .text-slate-300,
html.light [class*="bg-slate-950"] .text-slate-300 {
  color: #cbd5e1 !important;
}
html.light [class*="bg-slate-800"] .text-slate-400,
html.light [class*="bg-slate-900"] .text-slate-400,
html.light [class*="bg-slate-950"] .text-slate-400 {
  color: #94a3b8 !important;
}

/* Soft tinted badge backgrounds in light mode */
html.light [class*="bg-emerald-950\/"],
html.light .bg-emerald-950 {
  background-color: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

html.light [class*="bg-amber-950\/"],
html.light .bg-amber-950 {
  background-color: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

html.light [class*="bg-rose-950\/"],
html.light .bg-rose-950 {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #9f1239 !important;
}

/* Action button labels always crisp white */
html.light button.bg-emerald-600,
html.light button.bg-emerald-500,
html.light button.bg-amber-600,
html.light button.bg-amber-500,
html.light button.bg-rose-600,
html.light button.bg-blue-600,
html.light button.bg-indigo-600,
html.light button.bg-purple-600,
html.light [class*="from-emerald-"] {
  color: #ffffff !important;
}

html.light button.bg-emerald-600 *,
html.light button.bg-emerald-500 *,
html.light button.bg-amber-600 *,
html.light button.bg-amber-500 *,
html.light [class*="from-emerald-"] * {
  color: #ffffff !important;
}

/* Container text overflow protections */
.debate-option-btn,
.debate-branch-btn,
.verdict-card,
.interview-box,
.news-ticker,
.card-content {
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

/* Backdrop blur for modals in light mode */
html.light .fixed.inset-0 {
  background-color: rgba(15, 23, 42, 0.65) !important;
}

/* --- PRIMARY ELECTION ORIGIN STORY IN LIGHT MODE --- */
html.light #primary-story-container {
  background-color: #fffbeb !important;
  border: 1.5px solid #fcd34d !important;
  color: #78350f !important;
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.08) !important;
}

html.light #primary-story-container * {
  color: #78350f !important;
}

html.light #primary-story-container .text-amber-400 {
  color: #b45309 !important;
  font-weight: 900 !important;
}

html.light #primary-story-container p {
  color: #451a03 !important;
  font-weight: 600 !important;
}

/* --- GLOBAL TOP-BAR MENU & DROPDOWN IN LIGHT MODE --- */
html.light #global-menu-bar > div {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08) !important;
}

html.light #global-menu-bar button {
  color: #0f172a !important;
}

html.light #gm-dropdown {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

html.light #gm-dropdown button {
  color: #1e293b !important;
}

html.light #gm-dropdown button:hover {
  background-color: #f1f5f9 !important;
  color: #0284c7 !important;
}

html.light #gm-dropdown #gm-account-item {
  color: #1d4ed8 !important;
}
html.light #gm-dropdown #gm-account-item:hover {
  background-color: #eff6ff !important;
  color: #1e40af !important;
}

html.light #gm-dropdown #gm-admin-item {
  color: #b45309 !important;
}
html.light #gm-dropdown #gm-admin-item:hover {
  background-color: #fffbeb !important;
  color: #92400e !important;
}

html.light #gm-dropdown #gm-multiplayer-item {
  color: #4338ca !important;
}
html.light #gm-dropdown #gm-multiplayer-item:hover {
  background-color: #eef2ff !important;
  color: #3730a3 !important;
}

html.light #gm-dropdown #gm-mobile-sim-item {
  color: #b45309 !important;
}
html.light #gm-dropdown #gm-mobile-sim-item:hover {
  background-color: #fffbeb !important;
  color: #78350f !important;
}

html.light #gm-dropdown #gm-restart-item {
  color: #be123c !important;
}
html.light #gm-dropdown #gm-restart-item:hover {
  background-color: #fff1f2 !important;
  color: #9f1239 !important;
}

/* --- PREVENT DARK HOVER MASKS ON ALL MENUS IN LIGHT MODE --- */
html.light button[class*="hover:bg-slate-"]:hover,
html.light [class*="hover:bg-slate-800"]:hover,
html.light [class*="hover:bg-slate-700"]:hover,
html.light [class*="hover:bg-slate-900"]:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light button[class*="hover:bg-slate-"]:hover *,
html.light [class*="hover:bg-slate-800"]:hover *,
html.light [class*="hover:bg-slate-700"]:hover * {
  color: #0f172a !important;
}

/* --- CANDIDATE & PARTY DOSSIERS IN LIGHT MODE --- */
html.light #candidate-dossier,
html.light #party-dossier {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

html.light #candidate-dossier span.bg-slate-900,
html.light #candidate-dossier span.bg-slate-950,
html.light #party-dossier span.bg-slate-900,
html.light #party-dossier span.bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html.light #candidate-dossier strong.text-white,
html.light #party-dossier strong.text-white {
  color: #0f172a !important;
}

/* --- VP CAROUSEL TABS & CHAT BUBBLES IN LIGHT MODE --- */
html.light .vp-tab-btn {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html.light .vp-tab-btn:hover {
  background-color: #f1f5f9 !important;
}

html.light .vp-tab-btn.scale-102 {
  background-color: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #78350f !important;
}

html.light #vp-chat-container div[class*="bg-slate-800"] {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light #vp-chat-container div[class*="bg-slate-800"] * {
  color: #1e293b !important;
}

html.light #vp-chat-container div[class*="bg-slate-800"] span.text-amber-300 {
  color: #b45309 !important;
}

/* ==========================================================================
   MOBILE SCREEN OPTIMIZATION & RESPONSIVENESS (PORTRAIT & LANDSCAPE)
   ========================================================================== */

/* Universal mobile viewport constraints */
@media (max-width: 640px) {
  :root {
    --fs-scale: 1.0;
  }

  html {
    font-size: calc(14px * var(--fs-scale));
  }

  body, #app {
    overflow-x: hidden !important;
    width: 100vw;
    max-width: 100vw;
  }

  #toast-container {
    left: 12px !important;
    right: 12px !important;
    bottom: 16px !important;
    max-width: calc(100vw - 24px) !important;
    width: auto !important;
  }

  button, a.button, [role="button"] {
    min-height: 38px;
  }

  #global-menu-bar {
    top: 6px !important;
    right: 6px !important;
    gap: 3px !important;
  }

  #global-menu-bar #gm-account-val {
    max-width: 65px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fixed.inset-0 > div[class*="max-w-"] {
    max-width: calc(100vw - 16px) !important;
    max-height: 92vh !important;
    margin: 10px auto !important;
  }

  .custom-scrollbar {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  svg {
    max-width: 100%;
    height: auto;
  }
}

/* Narrow mobile screens (< 480px) */
@media (max-width: 480px) {
  html {
    font-size: calc(13px * var(--fs-scale));
  }

  .p-4 {
    padding: 0.65rem !important;
  }

  .p-5 {
    padding: 0.75rem !important;
  }

  .p-6 {
    padding: 0.85rem !important;
  }
}

/* Mobile Landscape Orientation Optimization */
@media (orientation: landscape) and (max-height: 540px) {
  html {
    font-size: calc(12.5px * var(--fs-scale));
  }

  #global-menu-bar {
    top: 4px !important;
    right: 6px !important;
    transform: scale(0.9);
    transform-origin: top right;
  }

  .fixed.inset-0 > div[class*="max-w-"] {
    max-height: 95vh !important;
    margin: 2vh auto !important;
    overflow-y: auto !important;
  }

  /* Short landscape: every modal must be fully reachable.
     Fixed-height inner panels with overflow-hidden used to cut off the action
     buttons, so let the overlay itself scroll and relax the inner clamps. */
  .fixed.inset-0 {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start !important;
    padding-top: 2vh !important;
    padding-bottom: 2vh !important;
  }

  .fixed.inset-0 > div[class*="max-w-"] {
    max-height: none !important;
    overflow: visible !important;
  }

  .fixed.inset-0 [class*="max-h-["] {
    max-height: none !important;
  }

  .fixed.inset-0 [class*="overflow-hidden"] {
    overflow: visible !important;
  }

  .fixed.inset-0 [class*="overflow-y-auto"] {
    max-height: 62vh !important;
    -webkit-overflow-scrolling: touch;
  }

  .p-4, .p-5, .p-6 {
    padding: 0.55rem 0.8rem !important;
  }

  .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.55rem !important;
  }

  .space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem !important;
  }
}

/* ==========================================================================
   IN-GAME SMARTPHONE FRAME SIMULATOR (PORTRAIT & LANDSCAPE MODES)
   ========================================================================== */
body.mobile-simulator-active {
  background-color: #020617 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 100vh !important;
  padding: 15px 0 !important;
  overflow: hidden !important;
}

/* Portrait Phone Frame: 390px x 844px */
body.mobile-simulator-active #app {
  width: 390px !important;
  max-width: 390px !important;
  height: 844px !important;
  max-height: 844px !important;
  border: 12px solid #1e293b !important;
  border-radius: 48px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 0 2px rgba(255, 255, 255, 0.12) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  position: relative !important;
  background: #020617 !important;
  scrollbar-width: thin;
  transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease;
}

/* Portrait Simulated Dynamic Island Notch */
body.mobile-simulator-active #app::before {
  content: "";
  position: sticky;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 24px;
  background: #090d16;
  border-radius: 9999px;
  z-index: 99;
  display: block;
  margin: 0 auto -24px auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* Landscape Phone Frame: 844px x 390px */
body.mobile-simulator-active.mobile-simulator-landscape #app {
  width: 844px !important;
  max-width: 844px !important;
  height: 390px !important;
  max-height: 390px !important;
  border-radius: 40px !important;
}

body.mobile-simulator-active.mobile-simulator-landscape #app::before {
  top: 6px;
  width: 90px;
  height: 20px;
  margin: 0 auto -20px auto;
}

/* Force responsive mobile classes inside simulator */
body.mobile-simulator-active:not(.mobile-simulator-landscape) #app [class*="md:grid-cols-"],
body.mobile-simulator-active:not(.mobile-simulator-landscape) #app [class*="lg:grid-cols-"] {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

body.mobile-simulator-active:not(.mobile-simulator-landscape) #app [class*="md:col-span-"],
body.mobile-simulator-active:not(.mobile-simulator-landscape) #app [class*="lg:col-span-"] {
  grid-column: span 1 / span 1 !important;
}

body.mobile-simulator-active #global-menu-bar {
  position: sticky !important;
  top: 12px !important;
  right: 12px !important;
  margin-left: auto;
}

/* ==========================================================================
   OFFICIAL INEC CERTIFICATE OF RETURN PARCHMENT STYLES
   Ensures parchment background and emerald borders never fail to render
   ========================================================================== */
#certificate-card {
  background-color: #faf5e8 !important;
  background-image: linear-gradient(180deg, #fdfbf7 0%, #faf5e8 50%, #f4ede0 100%) !important;
  color: #0f172a !important;
  border: 10px double #064e3b !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7) !important;
}

#certificate-card.has-custom-template {
  background-color: #faf5e8 !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* ==========================================================================
   MOBILE LANDSCAPE ORIENTATION ANIMATION
   ========================================================================== */
@keyframes phoneRotate {
  0%, 10% {
    transform: rotate(0deg);
  }
  40%, 60% {
    transform: rotate(-90deg);
  }
  90%, 100% {
    transform: rotate(0deg);
  }
}

.animate-phone-rotate {
  animation: phoneRotate 2.4s ease-in-out infinite;
  transform-origin: center center;
}


/* ==========================================================================
   MOBILE LANDSCAPE OPTIMIZATION
   ========================================================================== */
@media (orientation: landscape) and (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  #global-menu-bar {
    transform: scale(0.88);
    transform-origin: top right;
  }

  /* Two-column dashboard layout even below Tailwind's lg breakpoint */
  [class*="lg:grid-cols-12"] {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  [class*="lg:col-span-8"] { grid-column: span 8 / span 8 !important; }
  [class*="lg:col-span-4"] { grid-column: span 4 / span 4 !important; }
  [class*="lg:col-span-12"] { grid-column: span 12 / span 12 !important; }

  /* Keep map column visible and prevent horizontal overflow */
  [class*="lg:col-span-8"] > div,
  .map-card,
  #nigeria-map {
    max-width: 100%;
    overflow: hidden;
  }

  /* Reduce vertical chrome */
  header .space-y-4 > * + *,
  .space-y-4 > :not([hidden]) ~ :not([hidden]),
  .space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.5rem !important;
  }

  .p-4, .p-5, .p-6, .px-4, .py-4 {
    padding: 0.6rem 0.75rem !important;
  }

  /* Make modals fit short landscape viewport */
  .fixed.inset-0 > div[class*="max-w-"] {
    max-height: 92vh !important;
    margin: 4vh auto !important;
    overflow-y: auto !important;
  }

  /* Compact typography in cramped landscape */
  .text-xs, .text-sm, .text-[10px], .text-[11px] {
    line-height: 1.25;
  }

  /* Ensure no map SVG forces page width overflow */
  svg {
    max-width: 100%;
    height: auto;
  }
}

/* Very short landscape phones */
@media (orientation: landscape) and (max-height: 430px) {
  html {
    font-size: 12px !important;
  }

  #global-menu-bar {
    transform: scale(0.82);
  }
}

/* ==========================================================================
   Tactile feedback for action tiles.
   Touch devices have no hover state, so a tap on a Ground Ops / pillar button
   must confirm itself instantly. :active fires before the click handler runs,
   so the player always sees the press even when the tile re-renders at once.
   ========================================================================== */
.local-action-btn,
#rest-candidate-btn,
.pillar-btn,
#end-turn-btn,
#open-fundraising-btn,
#open-media-btn,
#deploy-digital-btn {
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease, filter 80ms ease, box-shadow 120ms ease;
}

.local-action-btn:active,
#rest-candidate-btn:active,
.pillar-btn:active,
#end-turn-btn:active {
  transform: scale(0.96);
  filter: brightness(1.28) saturate(1.15);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.55), 0 0 18px rgba(16, 185, 129, 0.35);
}

.pillar-btn:active {
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.55), 0 0 18px rgba(129, 140, 248, 0.35);
}


/* ==========================================================================
   TW-GAPFILL: Missing Tailwind v3.4 gradient colour-stop utilities.
   The compiled css/tailwind.css predates these classes; without them the
   dashboard resource gauges (and other gradients) render transparent.
   Generated from the Tailwind v3 palette. The from and via rules deliberately
   avoid setting --tw-gradient-to and read it via var() so they never
   clobber a .to- color-stop utility regardless of source order.
   Safe to delete once css/tailwind.css is regenerated from source.
   ========================================================================== */
.from-rose-600{--tw-gradient-from:#e11d48 var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(225,29,72,0))}
.from-amber-950\/90{--tw-gradient-from:rgba(69,26,3,0.9) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(69,26,3,0))}
.from-indigo-950\/90{--tw-gradient-from:rgba(30,27,75,0.9) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(30,27,75,0))}
.via-amber-500{--tw-gradient-stops:var(--tw-gradient-from, rgba(245,158,11,0)),#f59e0b var(--tw-gradient-via-position),var(--tw-gradient-to, rgba(245,158,11,0))}
.to-amber-600{--tw-gradient-to:#d97706 var(--tw-gradient-to-position)}
.from-emerald-950\/80{--tw-gradient-from:rgba(2,44,34,0.8) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(2,44,34,0))}
.from-slate-800\/40{--tw-gradient-from:rgba(30,41,59,0.4) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(30,41,59,0))}
.from-amber-950\/20{--tw-gradient-from:rgba(69,26,3,0.2) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(69,26,3,0))}
.via-emerald-400{--tw-gradient-stops:var(--tw-gradient-from, rgba(52,211,153,0)),#34d399 var(--tw-gradient-via-position),var(--tw-gradient-to, rgba(52,211,153,0))}
.from-purple-950\/30{--tw-gradient-from:rgba(59,7,100,0.3) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(59,7,100,0))}
.to-purple-950\/30{--tw-gradient-to:rgba(59,7,100,0.3) var(--tw-gradient-to-position)}
.from-amber-950\/60{--tw-gradient-from:rgba(69,26,3,0.6) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(69,26,3,0))}
.from-indigo-950\/60{--tw-gradient-from:rgba(30,27,75,0.6) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(30,27,75,0))}
.to-emerald-400{--tw-gradient-to:#34d399 var(--tw-gradient-to-position)}
.to-blue-400{--tw-gradient-to:#60a5fa var(--tw-gradient-to-position)}
.from-purple-600{--tw-gradient-from:#9333ea var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(147,51,234,0))}
.to-purple-400{--tw-gradient-to:#c084fc var(--tw-gradient-to-position)}
.from-teal-600{--tw-gradient-from:#0d9488 var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(13,148,136,0))}
.to-rose-400{--tw-gradient-to:#fb7185 var(--tw-gradient-to-position)}
.from-emerald-950\/95{--tw-gradient-from:rgba(2,44,34,0.95) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(2,44,34,0))}
.from-indigo-950\/95{--tw-gradient-from:rgba(30,27,75,0.95) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(30,27,75,0))}
.from-amber-950\/95{--tw-gradient-from:rgba(69,26,3,0.95) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(69,26,3,0))}
.from-amber-950\/50{--tw-gradient-from:rgba(69,26,3,0.5) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(69,26,3,0))}
.to-amber-500{--tw-gradient-to:#f59e0b var(--tw-gradient-to-position)}
.from-indigo-600{--tw-gradient-from:#4f46e5 var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(79,70,229,0))}
.via-purple-600{--tw-gradient-stops:var(--tw-gradient-from, rgba(147,51,234,0)),#9333ea var(--tw-gradient-via-position),var(--tw-gradient-to, rgba(147,51,234,0))}
.from-slate-900\/90{--tw-gradient-from:rgba(15,23,42,0.9) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(15,23,42,0))}
.via-slate-900\/85{--tw-gradient-stops:var(--tw-gradient-from, rgba(15,23,42,0)),rgba(15,23,42,0.85) var(--tw-gradient-via-position),var(--tw-gradient-to, rgba(15,23,42,0))}
.to-amber-950\/90{--tw-gradient-to:rgba(69,26,3,0.9) var(--tw-gradient-to-position)}
.via-emerald-500{--tw-gradient-stops:var(--tw-gradient-from, rgba(16,185,129,0)),#10b981 var(--tw-gradient-via-position),var(--tw-gradient-to, rgba(16,185,129,0))}
.to-teal-500{--tw-gradient-to:#14b8a6 var(--tw-gradient-to-position)}
.to-rose-600{--tw-gradient-to:#e11d48 var(--tw-gradient-to-position)}
.to-red-700{--tw-gradient-to:#b91c1c var(--tw-gradient-to-position)}
.to-emerald-950\/80{--tw-gradient-to:rgba(2,44,34,0.8) var(--tw-gradient-to-position)}
.from-rose-950\/80{--tw-gradient-from:rgba(76,5,25,0.8) var(--tw-gradient-from-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to, rgba(76,5,25,0))}
.to-rose-950\/80{--tw-gradient-to:rgba(76,5,25,0.8) var(--tw-gradient-to-position)}
.to-rose-950\/90{--tw-gradient-to:rgba(76,5,25,0.9) var(--tw-gradient-to-position)}

/* --- Forced landscape fallback (OrientationPrompt) ---
   Used when the device cannot lock its screen orientation (notably iOS Safari).
   Rotates the whole app so the phone can be held sideways; cleared automatically
   when the device is physically rotated to landscape. */
html.forced-landscape {
  width: 100vh;
  height: 100vw;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 100vw;
  transform: rotate(90deg);
  transform-origin: top left;
  background: #020617;
}
html.forced-landscape body {
  width: 100vh;
  height: 100vw;
  overflow: hidden;
}

/* --- Mobile viewport polish (C2) ---
   `100dvh` tracks the collapsing browser address bar so the HUD is never
   clipped mid-scroll, and the safe-area insets keep the fixed toasts and the
   forced-landscape frame clear of notches and home indicators. The viewport
   meta carries `viewport-fit=cover` so these insets report real values. */
@supports (height: 100dvh) {
  body.min-h-screen,
  #app.min-h-screen {
    min-height: 100dvh !important;
  }
}

#toast-container {
  padding-bottom: env(safe-area-inset-bottom);
}

