/* ═══════════════════════════════════════════════════
   GODS OF THE ARENA — Global Styles
   Dark fantasy aesthetic: stone, gold, deep shadows
   Font: Cinzel (display) + Crimson Text (body)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Design Tokens ── */
:root {
  /* Colors */
  --gold:          #c9a84c;
  --gold-light:    #e8c96a;
  --gold-dark:     #8a6f2e;
  --stone:         #1a1714;
  --stone-mid:     #242018;
  --stone-light:   #2e2820;
  --parchment:     #d4c9a8;
  --parchment-dim: #a09070;
  --blood:         #8b1a1a;
  --blood-bright:  #c0392b;
  --frost-blue:    #4a8fa8;
  --void-purple:   #5a3a7a;
  --poison-green:  #3a6a2a;
  --white:         #f0ead8;
  --shadow:        rgba(0, 0, 0, 0.6);

  /* Mana colors */
  --mana-R: #c0392b;
  --mana-U: #2980b9;
  --mana-Y: #f39c12;
  --mana-C: #7f8c8d;

  /* Spacing */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  40px;

  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-body:    'Crimson Text', serif;

  /* Borders */
  --border-gold:   1px solid var(--gold-dark);
  --border-stone:  1px solid rgba(201, 168, 76, 0.15);
  --radius-sm:     4px;
  --radius-md:     8px;

  /* Shadows */
  --shadow-card:   0 4px 20px rgba(0, 0, 0, 0.8);
  --shadow-glow:   0 0 20px rgba(201, 168, 76, 0.2);
  --shadow-inset:  inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--stone);
  color: var(--parchment);
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle stone texture via noise */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(90, 58, 122, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 26, 26, 0.06) 0%, transparent 50%);
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p {
  line-height: 1.7;
  color: var(--parchment);
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--gold-light); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  margin: var(--gap-lg) 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--stone);
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: var(--border-gold);
}
.btn-ghost:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--gold);
}

.btn-danger {
  background: linear-gradient(135deg, #6b1111, var(--blood-bright));
  color: var(--white);
}
.btn-danger:hover {
  background: linear-gradient(135deg, var(--blood), #e74c3c);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm { padding: 6px 16px; font-size: 0.75rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Form Elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.form-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}
.form-input::placeholder { color: var(--parchment-dim); opacity: 0.6; }

.form-error {
  font-size: 0.85rem;
  color: var(--blood-bright);
  min-height: 1.2em;
}

/* ── Cards (UI containers, not game cards) ── */
.panel {
  background: linear-gradient(160deg, var(--stone-mid), var(--stone-light));
  border: var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--gap-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Corner decorations */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--gold);
  border-style: solid;
}
.panel::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.panel::after  { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }

/* ── Notification / Toast ── */
.toast {
  position: fixed;
  bottom: var(--gap-lg);
  right: var(--gap-lg);
  padding: 12px 20px;
  background: var(--stone-light);
  border: var(--border-gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-size: 0.85rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast.error  { border-color: var(--blood-bright); color: var(--blood-bright); }
.toast.success { border-color: var(--gold); color: var(--gold); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Loading spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--stone-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* ── Hero badge (small hero icon) ── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: var(--border-stone);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--parchment);
}

/* ── Mana pip ── */
.mana-pip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.mana-R { background: var(--mana-R); }
.mana-U { background: var(--mana-U); }
.mana-Y { background: var(--mana-Y); color: var(--stone); }
.mana-C { background: var(--mana-C); }

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--stone); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Utility ── */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm  { gap: var(--gap-sm); }
.gap-md  { gap: var(--gap-md); }
.gap-lg  { gap: var(--gap-lg); }
.text-center { text-align: center; }
.text-gold   { color: var(--gold); }
.text-dim    { color: var(--parchment-dim); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.mt-sm { margin-top: var(--gap-sm); }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.w-full { width: 100%; }
