:root {
  --color-bg-rgb: 15, 23, 42;
  --color-card-rgb: 30, 41, 59;
  --color-border-rgb: 51, 65, 85;
  --color-primary-rgb: 99, 102, 241;
  --color-accent-rgb: 236, 72, 153;
  --color-gold-rgb: 245, 158, 11;
  --color-cyan-rgb: 6, 182, 212;
  --color-emerald-rgb: 16, 185, 129;
  --color-black-rgb: 0, 0, 0;
  --color-white-rgb: 255, 255, 255;

  --font-retro: 'Press Start 2P', monospace;
  --font-ui: 'Outfit', sans-serif;
}

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

body.game-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: rgb(var(--color-bg-rgb));
  color: rgb(var(--color-white-rgb));
  font-family: var(--font-ui);
  position: relative;
  overflow-x: hidden;
  user-select: none;
}

.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-image: 
    radial-gradient(1px 1px at 25px 35px, rgba(var(--color-white-rgb), .6), transparent),
    radial-gradient(1px 1px at 85px 120px, rgba(var(--color-cyan-rgb), .7), transparent),
    radial-gradient(1.5px 1.5px at 150px 220px, rgba(var(--color-gold-rgb), .6), transparent),
    radial-gradient(1px 1px at 260px 80px, rgba(var(--color-primary-rgb), .8), transparent);
  background-size: 320px 320px;
  opacity: .45;
  z-index: 0;
}

.game-header {
  position: relative;
  z-index: 10;
  background-color: rgba(var(--color-card-rgb), .85);
  backdrop-filter: blur(.5rem);
  border-bottom: .125rem solid rgba(var(--color-primary-rgb), .3);
  padding: .75rem 1.5rem;
}

.game-logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 .5rem rgba(var(--color-primary-rgb), .8));
  animation: pulse-glow 2s infinite alternate;
}

.game-title {
  font-family: var(--font-retro);
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: .08rem;
  background: linear-gradient(135deg, #a5b4fc, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  font-size: .8rem;
  margin: 0;
  color: #94a3b8;
  letter-spacing: .04rem;
}

.main-content {
  position: relative;
  z-index: 5;
  padding: 1.5rem;
  min-height: calc(100vh - 4.5rem);
  display: flex;
  flex-direction: column;
}

/* Card Container */
.arcane-card {
  background-color: rgba(var(--color-card-rgb), .9);
  border: .125rem solid rgba(var(--color-border-rgb), .8);
  border-radius: .75rem;
  padding: 1.75rem;
  box-shadow: 0 1rem 2.5rem rgba(var(--color-black-rgb), .4);
}

.card-heading {
  font-family: var(--font-retro);
  font-size: 1.05rem;
  color: #e2e8f0;
  letter-spacing: .05rem;
  margin-bottom: .75rem;
}

.card-lead {
  color: #94a3b8;
  font-size: .92rem;
  margin-bottom: 1.25rem;
}

.alchemist-sigil {
  font-size: 3.5rem;
  margin-bottom: .75rem;
  animation: float-sigil 3s ease-in-out infinite;
}

.arcane-label {
  font-family: var(--font-retro);
  font-size: .75rem;
  color: #cbd5e1;
  letter-spacing: .04rem;
}

.arcane-input {
  background-color: rgba(var(--color-bg-rgb), .8);
  border: .125rem solid rgba(var(--color-primary-rgb), .5);
  color: rgb(var(--color-white-rgb));
  border-radius: .5rem;
  padding: .65rem 1rem;
  font-weight: 600;
  transition: all .2s ease;
}

.arcane-input:focus {
  background-color: rgba(var(--color-bg-rgb), .95);
  border-color: #818cf8;
  color: rgb(var(--color-white-rgb));
  box-shadow: 0 0 1rem rgba(var(--color-primary-rgb), .4);
}

.arcane-select {
  background-color: rgba(var(--color-bg-rgb), .8);
  border: .125rem solid rgba(var(--color-border-rgb), .8);
  color: rgb(var(--color-white-rgb));
  border-radius: .5rem;
  padding: .5rem .75rem;
  font-size: .9rem;
}

.arcane-select:focus {
  background-color: rgba(var(--color-bg-rgb), .95);
  color: rgb(var(--color-white-rgb));
  border-color: #818cf8;
}

/* Retro Arcade Buttons */
.arcade-btn-primary {
  font-family: var(--font-retro);
  font-size: .85rem;
  background: linear-gradient(180deg, #6366f1, #4338ca);
  color: rgb(var(--color-white-rgb));
  border: none;
  border-bottom: .25rem solid #312e81;
  border-radius: .5rem;
  padding: .85rem 1.25rem;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
  text-shadow: 0 .0625rem .125rem rgba(var(--color-black-rgb), .6);
}

.arcade-btn-primary:hover {
  filter: brightness(1.15);
}

.arcade-btn-primary:active {
  transform: translateY(.125rem);
  border-bottom-width: .125rem;
}

.arcade-btn-secondary {
  font-family: var(--font-retro);
  font-size: .75rem;
  background: linear-gradient(180deg, #475569, #334155);
  color: #f1f5f9;
  border: none;
  border-bottom: .2rem solid #1e293b;
  border-radius: .5rem;
  padding: .6rem 1rem;
  cursor: pointer;
}

.arcade-btn-secondary:hover {
  filter: brightness(1.2);
}

.arcade-btn-icon {
  background: rgba(var(--color-card-rgb), .8);
  border: .125rem solid rgba(var(--color-border-rgb), .7);
  border-radius: .5rem;
  padding: .4rem .65rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: rgb(var(--color-white-rgb));
}

.arcade-btn-sm {
  font-family: var(--font-retro);
  font-size: .65rem;
  background: #10b981;
  color: rgb(var(--color-white-rgb));
  border: none;
  border-bottom: .15rem solid #047857;
  border-radius: .35rem;
  padding: .4rem .6rem;
  cursor: pointer;
}

.arcade-btn-sm-danger {
  font-family: var(--font-retro);
  font-size: .65rem;
  background: #ef4444;
  color: rgb(var(--color-white-rgb));
  border: none;
  border-bottom: .15rem solid #b91c1c;
  border-radius: .35rem;
  padding: .4rem .6rem;
  cursor: pointer;
}

.separator-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-family: var(--font-retro);
  font-size: .65rem;
  margin: .5rem 0;
}

.separator-text::before,
.separator-text::after {
  content: '';
  flex: 1;
  border-bottom: .0625rem solid rgba(var(--color-border-rgb), .8);
}

.separator-text span {
  padding: 0 .75rem;
}

.error-banner {
  background-color: rgba(239, 68, 68, .2);
  border: .0625rem solid #ef4444;
  color: #fca5a5;
  border-radius: .5rem;
  padding: .6rem 1rem;
  margin-top: 1rem;
  font-size: .85rem;
}

/* Animations */
@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 .3rem rgba(var(--color-primary-rgb), .6)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 .8rem rgba(var(--color-accent-rgb), .9)); }
}

@keyframes float-sigil {
  0% { transform: translateY(0); }
  50% { transform: translateY(-.5rem); }
  100% { transform: translateY(0); }
}
