/* Shared design tokens mirroring Fighter/scripts/ui/ui_theme.gd & server/apps/api/src/pages.ts */

@font-face {
  font-family: "Marcellus SC";
  src: url("MarcellusSC-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant SC";
  src: url("CormorantSC-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("CormorantGaramond-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("Cinzel-Variable.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("BarlowCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Game UI Theme Palette (UiTheme) */
  --ground: #16120e;
  --abyss: #0f0d0b;
  --arena-slate: #101519;
  --panel: rgba(36, 31, 26, 0.94);
  --panel-solid: #1f1913;
  --surface: rgba(26, 22, 19, 0.92);
  --surface-solid: #17130f;

  --gold: #d1a861;
  --primary: #dbb266;
  --gold-bright: #f7e2b3;
  --bronze: #806642;

  --ink: #f0e3cc;
  --on-scene: #f7eed9;
  --ink-dark: #241a12;
  --muted: #b3a187;

  --blood: #c74d42;
  --blood-deep: #7a211f;
  --accent: #70bdad;
  --accent-soft: #2e4d47;

  /* Rarity palette */
  --rarity-common: #9c8f7e;
  --rarity-uncommon: #68b89a;
  --rarity-rare: #66a3e0;
  --rarity-epic: #b378e6;
  --rarity-legendary: #e8b85a;

  /* Typography */
  --font-title: "Marcellus SC", "Cinzel", Georgia, serif;
  --font-button: "Cormorant SC", "Marcellus SC", Georgia, serif;
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-hud: "Barlow Condensed", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --max-width: 1180px;
  --prose-width: 760px;
}

/* Cross-document MPA View Transitions (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  color: var(--ink);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.26rem);
  line-height: 1.58;
  font-variant-numeric: lining-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold);
  text-underline-offset: 3px;
  text-decoration-color: rgba(209, 168, 97, 0.45);
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

a:hover {
  color: var(--gold-bright);
  text-decoration-color: var(--gold-bright);
}

:focus-visible {
  outline: 3px solid #ffdb85;
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  background: var(--primary);
  color: var(--ink-dark);
  font-family: var(--font-button);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* Indie 3AM Owl micro-animations (respecting reduced motion & pause toggle) */
.owl-mascot .owl-lid {
  transform-origin: center;
  transform: scaleY(0);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-paused) .owl-mascot .owl-lid {
    animation: owl-blink 6.8s ease-in-out infinite;
  }

  body:not(.motion-paused) .owl-mascot .owl-steam {
    animation: owl-steam-rise 3.6s ease-in-out infinite;
  }

  body:not(.motion-paused) .owl-mascot .owl-sparks {
    animation: owl-sparkle 4.4s ease-in-out infinite;
  }
}

@keyframes owl-blink {
  0%, 92%, 100% {
    transform: scaleY(0);
    opacity: 0;
  }
  95% {
    transform: scaleY(1);
    opacity: 1;
  }
  97.5% {
    transform: scaleY(0);
    opacity: 0;
  }
}

@keyframes owl-steam-rise {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-5px);
    opacity: 0.82;
  }
}

@keyframes owl-sparkle {
  0%, 100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}
