/* OpenSpire Design Tokens and Base Styles */
/* Converted from web/src/index.css for server-rendered templates */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600;700&family=Sora:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --color-spire-bg: #0A0E27;
  --color-spire-bg-card: #1C1917;
  --color-spire-bg-elevated: #292524;
  --color-spire-border: #374151;

  --color-spire-gold: #B8963C;
  --color-spire-gold-bright: #D4AF37;

  --color-spire-ironclad: #DC2626;
  --color-spire-silent: #14B8A6;
  --color-spire-defect: #3B82F6;
  --color-spire-watcher: #A855F7;
  --color-spire-regent: #F59E0B;
  --color-spire-necrobinder: #22D3EE;

  --color-spire-text: #E8DDD0;
  --color-spire-text-muted: #6E6860;
  --color-spire-text-dim: #525252;

  --color-spire-attack: #EF4444;
  --color-spire-skill: #3B82F6;
  --color-spire-power: #A855F7;
  --color-spire-curse: #6B7280;
  --color-spire-status: #4B5563;

  --color-win: #3DBF7A;
  --color-loss: #C0392B;

  /* Fonts */
  --font-spire-heading: 'Cinzel', serif;
  --font-spire-body: 'Fira Sans', sans-serif;
  --font-spire-mono: 'Fira Code', monospace;
  --font-nav: 'Sora', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-spire-body);
  background:
    radial-gradient(ellipse 80% 80% at 0% 0%, rgba(10, 14, 39, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse 80% 80% at 100% 0%, rgba(10, 14, 39, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse 80% 80% at 0% 100%, rgba(10, 14, 39, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse 80% 80% at 100% 100%, rgba(10, 14, 39, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 30%, rgba(40, 30, 60, 0.4) 0%, transparent 60%),
    linear-gradient(rgba(10, 14, 39, 0.75), rgba(10, 14, 39, 0.75)),
    url('/background.webp');
  background-size: auto, auto, auto, auto, auto, auto, cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-spire-text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100svh;
}

.spire-nav {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-spire-border);
  margin-bottom: 1.5rem;
}

.spire-logo {
  font-family: var(--font-spire-heading);
  font-size: 1.25rem;
  color: var(--color-spire-gold);
  text-decoration: none;
}

.spire-logo:hover {
  opacity: 0.8;
}

.spire-nav-link {
  color: var(--color-spire-text-muted);
  text-decoration: none;
}

.spire-nav-link:hover {
  color: var(--color-spire-gold);
}

.spire-container {
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem 2rem;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: 0.03;
}

#root {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-spire-heading);
  font-weight: 500;
  color: var(--color-spire-text);
  letter-spacing: 0.5px;
}

h1 { font-size: 2.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.75rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }

a {
  color: var(--color-spire-gold);
  text-decoration: none;
}

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

::selection {
  background: var(--color-spire-gold);
  color: var(--color-spire-bg);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-spire-bg); }
::-webkit-scrollbar-thumb { background: var(--color-spire-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-spire-text-dim); }

/* Utility classes */
.glow-gold { box-shadow: 0 0 20px rgba(184, 150, 60, 0.3); }
.glow-gold-subtle { box-shadow: 0 0 15px rgba(184, 150, 60, 0.15); }
.glow-win { box-shadow: 0 0 12px rgba(61, 191, 122, 0.2); }
.glow-loss { box-shadow: 0 0 12px rgba(192, 57, 43, 0.2); }
.cursor-pointer { cursor: pointer; }
.transition-colors-200 { transition: all 200ms ease; }
.transition-all-200 { transition: all 200ms ease; }

/* Card component */
.card {
  background: rgba(26, 25, 23, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(55, 65, 81, 0.2);
  border-radius: 12px;
  transition: all 200ms ease;
}

.card:hover {
  border-color: rgba(184, 150, 60, 0.4);
  box-shadow: 0 0 30px rgba(184, 150, 60, 0.1);
}

.card-elevated {
  background: rgba(41, 37, 36, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(55, 65, 81, 0.2);
  border-radius: 12px;
  transition: all 200ms ease;
}

.card-elevated:hover {
  border-color: rgba(184, 150, 60, 0.3);
}

/* Badge component */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-victory {
  background: rgba(61, 191, 122, 0.15);
  color: #3DBF7A;
  border: 1px solid rgba(61, 191, 122, 0.3);
  box-shadow: 0 0 10px rgba(61, 191, 122, 0.1);
}

.badge-death {
  background: rgba(192, 57, 43, 0.15);
  color: #C0392B;
  border: 1px solid rgba(192, 57, 43, 0.3);
  box-shadow: 0 0 10px rgba(192, 57, 43, 0.1);
}

.badge-saved, .badge-abandoned {
  background: rgba(110, 104, 96, 0.15);
  color: var(--color-spire-text-muted);
  border: 1px solid rgba(110, 104, 96, 0.3);
}

/* Character badges */
.character-ironclad {
  color: var(--color-spire-ironclad);
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.1);
}
.character-silent {
  color: var(--color-spire-silent);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.1);
}
.character-defect {
  color: var(--color-spire-defect);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}
.character-watcher {
  color: var(--color-spire-watcher);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
}
.character-regent {
  color: var(--color-spire-regent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.1);
}
.character-necrobinder {
  color: var(--color-spire-necrobinder);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.1);
}

.focus-visible:focus {
  outline: 2px solid var(--color-spire-gold);
  outline-offset: 2px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6860' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

select option {
  background: var(--color-spire-bg-card);
  color: var(--color-spire-text);
  padding: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-icipation-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Layout utilities */
.flex-1 { flex: 1; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.p-8 { padding: 2rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.pt-12 { padding-top: 3rem; }
.mb-4 { margin-bottom: 1rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }
.text-center { text-align: center; }
.max-w-md { max-width: 28rem; }
.text-lg { font-size: 1.125rem; }
.leading-relaxed { line-height: 1.625; }
.inline-block { display: inline-block; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.rounded-full { border-radius: 9999px; }
.animate-spin { animation: spin 1s linear infinite; }
.border-2 { border-width: 2px; }
.border-t-transparent { border-top-color: transparent; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.hover\:bg-spire-gold:hover { background: #B8963C; }
.hover\:text-spire-bg:hover { color: #0A0E27; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.underline { text-decoration: underline; }
.gap-3 { gap: 0.75rem; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.max-w-4xl { max-width: 56rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.overflow-hidden { overflow: hidden; }
.group { }
.group-hover\:-translate-y-1\/2 { transition: transform 2s ease linear; }
.group:hover .group-hover\:-translate-y-1\/2 { transform: translateY(-50%); }
.h-44 { height: 11rem; }
.object-cover { object-fit: cover; }
.object-top { object-position: top; }
.transition-transform { transition: transform; }
.transition-all { transition: all; }
.duration-200 { transition-duration: 200ms; }
.duration-\[2s\] { transition-duration: 2s; }
.ease-linear { transition-timing-function: linear; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.font-semibold { font-weight: 600; }
.text-2xl { font-size: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.rounded-xl { border-radius: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.min-w-\[1\.5rem\] { min-width: 1.5rem; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.border {
  border-width: 1px;
}

/* ── Utility classes for Jinja2 templates ── */

/* Text */
.text-5xl { font-size: 3rem; line-height: 1; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-spire-text-muted { color: var(--color-spire-text-muted); }
.text-spire-gold { color: var(--color-spire-gold); }
.text-spire-attack { color: var(--color-spire-attack); }
.text-spire-skill { color: var(--color-spire-skill); }
.text-red-400 { color: #EF4444; }
.text-red-500 { color: #EF4444; }
.text-green-500 { color: #22C55E; }
.text-spire-bg { color: var(--color-spire-bg); }
.text-spire-gold-bright { color: var(--color-spire-gold-bright); }

/* Fonts */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--font-spire-mono); }
.font-spire-heading { font-family: var(--font-spire-heading); }
.font-spire-mono { font-family: var(--font-spire-mono); }

/* Spacing */
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-2 { margin-top: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Sizing */
.h-4 { height: 1rem; }
.h-8 { height: 2rem; }
.h-44 { height: 11rem; }
.h-\[200\%\] { height: 200%; }
.h-full { height: 100%; }
.w-6 { width: 1.5rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-40 { width: 10rem; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.inline-flex { display: inline-flex; }

/* Grid */
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Backgrounds */
.bg-spire-bg { background-color: var(--color-spire-bg); }
.bg-spire-bg-elevated { background-color: var(--color-spire-bg-elevated); }
.bg-spire-attack { background-color: var(--color-spire-attack); }
.bg-spire-gold { background-color: var(--color-spire-gold); }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; }
.border-spire-gold { border-color: var(--color-spire-gold); }

/* Rounded */
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }

/* Transitions */
.transition-colors { transition: color 200ms, background-color 200ms, border-color 200ms; }
.transition-transform { transition: transform; }
.duration-\[2s\] { transition-duration: 2s; }
.ease-linear { transition-timing-function: linear; }

/* Group hover */
.group-hover\:-translate-y-1\/2 { --tw-group-hover-transform: translateY(-50%); }
.group:hover .group-hover\:-translate-y-1\/2 { transform: translateY(-50%); }

/* Utilities */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.cursor-pointer { cursor: pointer; }
.leading-relaxed { line-height: 1.625; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-cover { object-fit: cover; }
.object-top { object-position: top; }
.underline { text-decoration: underline; }
.hover\:text-spire-gold:hover { color: var(--color-spire-gold); }
.hover\:text-spire-gold-bright:hover { color: var(--color-spire-gold-bright); }
.hover\:bg-spire-gold:hover { background-color: var(--color-spire-gold); }
.hover\:text-spire-bg:hover { color: var(--color-spire-bg); }
