/* ============================================ */
/* RESET & BASE */
/* ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1A1A2E;
  color: #EAEAEA;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  position: fixed;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* AR Camera Feed */
#ar-camera {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}

/* Three.js Canvas */
#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* ============================================ */
/* GESTURE OVERLAYS */
/* ============================================ */
.gesture-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 999;
  gap: 1em;
}

.gesture-emoji {
  font-size: 4em;
  filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.8));
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.progress-indicator {
  transform: rotate(-90deg);
}

.progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 6;
}

.progress-circle {
  fill: none;
  stroke: #6C5CE7;
  stroke-width: 6;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.1s linear;
  stroke-linecap: round;
}

.hint-text {
  margin-top: 1em;
  color: #EAEAEA;
  font-size: 1.2em;
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.8);
  font-weight: bold;
}

/* Gesture Hint Container */
.gesture-hint-container {
  display: flex;
  align-items: center;
  gap: 1em;
}

.gesture-emoji-large {
  font-size: 5em;
  filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.9));
}

.gesture-separator {
  font-size: 3em;
  color: #F9CA24;
  font-weight: bold;
  text-shadow: 0 0 15px rgba(249, 202, 36, 0.8);
}

.gesture-hint-text {
  font-size: 1.5em;
  color: #EAEAEA;
  text-shadow: 0 0 10px rgba(0, 206, 201, 0.8);
  font-weight: bold;
  text-align: center;
  max-width: 80vw;
}

/* Gesture Feedback */
#gesture-feedback-overlay {
  animation: feedbackPop 0.8s ease-out;
}

@keyframes feedbackPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.feedback-emoji {
  font-size: 6em;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.9));
}

#gesture-feedback-overlay.correct .feedback-emoji {
  filter: drop-shadow(0 0 30px rgba(0, 255, 0, 0.9));
}

#gesture-feedback-overlay.incorrect .feedback-emoji {
  filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.9));
}

/* ============================================ */
/* TUTORIAL OVERLAY */
/* ============================================ */
.tutorial-overlay {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 46, 0.95);
  border: 3px solid #6C5CE7;
  border-radius: 1em;
  padding: 2em;
  max-width: 80vw;
  text-align: center;
  pointer-events: auto;
  z-index: 998;
  box-shadow: 0 0 30px rgba(108, 92, 231, 0.6);
}

.step-counter {
  font-size: 1em;
  color: #A29BFE;
  margin-bottom: 0.5em;
  font-weight: bold;
}

.step-message {
  font-size: 1.3em;
  color: #EAEAEA;
  margin-bottom: 1em;
  line-height: 1.4;
}

.tutorial-gesture-emoji {
  font-size: 5em;
  margin: 0.5em 0;
  filter: drop-shadow(0 0 20px rgba(249, 202, 36, 0.8));
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.tutorial-skip {
  margin-top: 1.5em;
}

#skip-tutorial-btn {
  background: transparent;
  border: 2px solid #A0A0B8;
  color: #A0A0B8;
  padding: 0.5em 1.5em;
  border-radius: 0.5em;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s;
}

#skip-tutorial-btn:hover {
  border-color: #6C5CE7;
  color: #6C5CE7;
}

/* ============================================ */
/* TOAST NOTIFICATION */
/* ============================================ */
.toast {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 206, 201, 0.9);
  color: #1A1A2E;
  padding: 1em 2em;
  border-radius: 0.5em;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2000;
  font-size: 1.2em;
}

.toast.visible {
  opacity: 1;
}

/* ============================================ */
/* BOSS NAME BANNER */
/* ============================================ */
.boss-banner {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: rgba(26, 26, 46, 0.95);
  border: 4px solid #6C5CE7;
  border-radius: 1em;
  padding: 2em 3em;
  text-align: center;
  z-index: 997;
  box-shadow: 0 0 50px rgba(108, 92, 231, 0.8);
  opacity: 0;
}

.boss-banner.reveal {
  animation: bannerReveal 1s forwards;
}

.boss-banner.fade-out {
  animation: bannerFadeOut 1s forwards;
}

@keyframes bannerReveal {
  0% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

@keyframes bannerFadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) scale(0.8);
  }
}

.boss-name {
  font-size: 2.5em;
  color: #F9CA24;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(249, 202, 36, 0.8);
  margin: 0;
}

.banner-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid #6C5CE7;
  border-radius: 1em;
  pointer-events: none;
}

/* ============================================ */
/* ACHIEVEMENT NOTIFICATION */
/* ============================================ */
.achievement-notification {
  position: fixed;
  top: 10%;
  right: -400px;
  width: 350px;
  background: rgba(26, 26, 46, 0.95);
  border: 3px solid #F9CA24;
  border-radius: 0.5em;
  padding: 1em;
  display: flex;
  align-items: center;
  gap: 1em;
  z-index: 996;
  box-shadow: 0 0 30px rgba(249, 202, 36, 0.6);
}

.achievement-notification.slide-in {
  animation: slideInRight 0.5s forwards;
}

.achievement-notification.slide-out {
  animation: slideOutRight 0.5s forwards;
}

@keyframes slideInRight {
  to { right: 2%; }
}

@keyframes slideOutRight {
  to { right: -400px; }
}

.achievement-icon {
  font-size: 3em;
  filter: drop-shadow(0 0 15px rgba(249, 202, 36, 0.8));
}

.achievement-content {
  flex: 1;
}

.achievement-label {
  font-size: 0.8em;
  color: #A0A0B8;
  margin-bottom: 0.3em;
}

.achievement-title {
  font-size: 1.2em;
  color: #F9CA24;
  font-weight: bold;
  margin-bottom: 0.2em;
}

.achievement-desc {
  font-size: 0.9em;
  color: #EAEAEA;
}

/* ============================================ */
/* RUNE REVEAL OVERLAY */
/* ============================================ */
.rune-reveal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1A1A2E 0%, #3D3460 100%);
  background-size: cover;
  background-position: center;
  z-index: 995;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.sealed-state {
  position: relative;
  width: 200px;
  height: 200px;
}

.sealed-orb {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #6C5CE7 0%, #3D3460 70%);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(108, 92, 231, 0.8);
  animation: orbPulse 2s infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sealed-state.cracking .sealed-orb {
  animation: orbShake 0.3s infinite;
}

@keyframes orbShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.sealed-state.burst {
  animation: orbBurst 0.5s forwards;
}

@keyframes orbBurst {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

.rune-info {
  margin-top: 2em;
  text-align: center;
}

.rune-element {
  font-size: 3em;
  color: #F9CA24;
  text-transform: uppercase;
  margin-bottom: 0.2em;
  text-shadow: 0 0 20px rgba(249, 202, 36, 0.8);
}

.rune-rarity {
  font-size: 1.5em;
  margin-bottom: 1em;
}

.rune-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-size: 1.2em;
}

.stat-line {
  opacity: 0;
  transform: translateY(10px);
}

.stat-line.appear {
  animation: statAppear 0.3s forwards;
}

@keyframes statAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tap-to-continue {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  color: #A0A0B8;
  font-size: 1em;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================ */
/* RESPONSIVE ADJUSTMENTS */
/* ============================================ */
@media (max-width: 768px) {
  .gesture-emoji-large {
    font-size: 4em;
  }
  
  .gesture-separator {
    font-size: 2em;
  }
  
  .gesture-hint-text {
    font-size: 1.2em;
  }
  
  .tutorial-gesture-emoji {
    font-size: 4em;
  }
  
  .boss-name {
    font-size: 2em;
  }
  
  .achievement-notification {
    width: 90%;
    right: -100%;
  }
  
  @keyframes slideInRight {
    to { right: 5%; }
  }
  
  @keyframes slideOutRight {
    to { right: -100%; }
  }
}

/* ============================================ */
/* UTILITY ANIMATIONS */
/* ============================================ */
.pulse {
  animation: pulse 0.3s;
}

.fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
  to { opacity: 0; }
}