/* SpellCaster — neon cyberpunk styling */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #06070d;
  color: #e8e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

/* ===================== Boot screen ===================== */

#boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(120, 30, 200, 0.25), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 200, 255, 0.18), transparent 50%),
    #06070d;
}

.boot-card {
  text-align: center;
  padding: 48px 56px;
  background: rgba(15, 18, 30, 0.85);
  border: 1px solid rgba(120, 80, 255, 0.4);
  border-radius: 16px;
  box-shadow:
    0 0 60px rgba(120, 80, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  max-width: 480px;
}

.boot-card h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #b794ff 0%, #ff6ec7 50%, #6ec1ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  text-shadow: 0 0 40px rgba(183, 148, 255, 0.5);
}

.tagline {
  font-size: 18px;
  color: #b794ff;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hint {
  font-size: 14px;
  color: #8a8aa0;
  line-height: 1.6;
  margin-bottom: 28px;
}

#start-btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #06070d;
  background: linear-gradient(135deg, #b794ff, #6ec1ff);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(183, 148, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(183, 148, 255, 0.8);
}

.perm-note {
  margin-top: 18px;
  font-size: 11px;
  color: #5a5a70;
}

/* ===================== Main stage ===================== */

#stage {
  position: fixed;
  inset: 0;
}

#canvas-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcam {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);   /* mirror so it feels like a mirror */
  filter: brightness(0.55) saturate(0.8) contrast(1.05);
}

#overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===================== HUD ===================== */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.hud-row {
  display: flex;
  gap: 12px;
}

.hud-row.top {
  justify-content: flex-start;
}

.hud-row.bottom {
  justify-content: center;
}

.hud-cell {
  background: rgba(10, 12, 24, 0.7);
  border: 1px solid rgba(120, 80, 255, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 110px;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 20px rgba(120, 80, 255, 0.15);
}

.hud-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8a8aa0;
  margin-bottom: 4px;
}

.hud-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #b794ff;
  text-shadow: 0 0 12px rgba(183, 148, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

#spell-name {
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 12px currentColor;
}

/* ===================== Spell grid ===================== */

.spell-grid {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 8px;
  background: rgba(10, 12, 24, 0.7);
  border: 1px solid rgba(120, 80, 255, 0.35);
  border-radius: 12px;
  padding: 10px;
  backdrop-filter: blur(6px);
}

.spell-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 80px;
  transition: all 0.15s ease;
}

.spell-slot.active {
  background: rgba(183, 148, 255, 0.18);
  border-color: rgba(183, 148, 255, 0.7);
  box-shadow: 0 0 16px rgba(183, 148, 255, 0.4);
  transform: translateY(-3px);
}

.spell-slot.cooling {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.spell-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.spell-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b0b0c0;
  font-weight: 600;
}

.spell-slot.active .spell-name {
  color: #fff;
}

.spell-cooldown {
  font-size: 9px;
  color: #6a6a80;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ===================== Mute button ===================== */

#mute-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 12, 24, 0.7);
  border: 1px solid rgba(120, 80, 255, 0.35);
  color: #b794ff;
  font-size: 18px;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#mute-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(183, 148, 255, 0.4);
}

/* ===================== Mobile ===================== */

@media (max-width: 720px) {
  .boot-card { padding: 32px 24px; }
  .boot-card h1 { font-size: 36px; }
  .hud-cell { min-width: 80px; padding: 8px 10px; }
  .hud-value { font-size: 18px; }
  #spell-name { font-size: 14px; }
  .spell-grid { grid-template-columns: repeat(3, auto); }
  .spell-slot { min-width: 64px; padding: 6px 8px; }
  .spell-icon { font-size: 18px; }
  .spell-name { font-size: 9px; }
}
