/* ==========================================================================
   Game 4: ShapeUp (Geometry & Shape Recognition Quest) Stylesheet
   ========================================================================== */

#shapeup-app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px 20px 30px;
  gap: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Main ShapeUp Workspace Layout */
.shapeup-workspace {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1024px) {
  .shapeup-workspace {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Left/Center Stage: Object Showcase & Fire Layer
   ========================================================================== */

.shapeup-main-stage {
  background: var(--bg-card);
  border: 2px solid rgba(0, 85, 191, 0.3);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.shapeup-stage-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.shapeup-stage-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.shapeup-stage-title span {
  color: #FBBF24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.shapeup-stage-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.shapeup-hint-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(0, 210, 255, 0.4);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  margin-top: 2px;
  transition: all 0.3s ease;
}

.shapeup-hint-meter.level-1 { border-color: #00FFFF; color: #00FFFF; box-shadow: 0 0 12px rgba(0, 255, 255, 0.4); }
.shapeup-hint-meter.level-2 { border-color: #38BDF8; color: #38BDF8; }
.shapeup-hint-meter.level-3 { border-color: #FBBF24; color: #FBBF24; }
.shapeup-hint-meter.level-4 { border-color: #F97316; color: #F97316; }
.shapeup-hint-meter.level-5 { border-color: #C084FC; color: #E879F9; box-shadow: 0 0 16px rgba(192, 132, 252, 0.5); }

.hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Object Showcase Frame */
.object-showcase-frame {
  position: relative;
  width: 360px;
  height: 340px;
  background: radial-gradient(circle at 50% 50%, #172554 0%, #0c1527 60%, #030712 100%);
  border: 4px solid #1e3a8a;
  border-radius: var(--radius-xl);
  box-shadow: 
    0 0 0 2px var(--accent-cyan),
    0 0 35px rgba(0, 210, 255, 0.25),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.object-showcase-frame.hint-level-5 {
  border-color: #7C3AED;
  box-shadow: 
    0 0 0 2px #A855F7,
    0 0 35px rgba(168, 85, 247, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.object-svg-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.3s ease;
}

/* ==========================================================================
   Progressive Difficulty: Highlight Diminishes As User Gets Answers Correct
   ========================================================================== */

/* Level 1: Full Neon Cyan Glowing Dashed Outline (Streak 0) */
.object-showcase-frame.hint-level-1 .shape-highlight-neon,
.shape-highlight-neon {
  stroke: #00FFFF !important;
  stroke-width: 4 !important;
  stroke-dasharray: 8, 4;
  animation: neonShapeDash 1.6s linear infinite, shapePulseGlow 1.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #00FFFF) drop-shadow(0 0 18px rgba(0, 255, 255, 0.8));
}

/* Level 2: Soft Solid Cyan Outline - No Dashed Motion (Streak 1) */
.object-showcase-frame.hint-level-2 .shape-highlight-neon {
  stroke: #00E5FF !important;
  stroke-width: 2.5 !important;
  stroke-dasharray: none !important;
  animation: none !important;
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.6)) !important;
}

/* Level 3: Faint Outline - Zero Glow (Streak 2) */
.object-showcase-frame.hint-level-3 .shape-highlight-neon {
  stroke: rgba(0, 229, 255, 0.45) !important;
  stroke-width: 1.5 !important;
  stroke-dasharray: none !important;
  animation: none !important;
  filter: none !important;
}

/* Level 4: Subtle Dotted Trace (Streak 3) */
.object-showcase-frame.hint-level-4 .shape-highlight-neon {
  stroke: rgba(255, 255, 255, 0.28) !important;
  stroke-width: 1.2 !important;
  stroke-dasharray: 3, 3 !important;
  animation: none !important;
  filter: none !important;
}

/* Level 5: EXPERT MODE - Zero Hints / Zero Outlines (Streak 4+) */
.object-showcase-frame.hint-level-5 .shape-highlight-neon {
  stroke: none !important;
  stroke-width: 0 !important;
  stroke-dasharray: none !important;
  animation: none !important;
  filter: none !important;
}

@keyframes neonShapeDash {
  to { stroke-dashoffset: -24; }
}

@keyframes shapePulseGlow {
  0% { filter: drop-shadow(0 0 6px #00FFFF) drop-shadow(0 0 12px rgba(0, 210, 255, 0.6)); }
  100% { filter: drop-shadow(0 0 12px #FFFFFF) drop-shadow(0 0 24px rgba(0, 255, 255, 1)); }
}

/* ==========================================================================
   Animated Fire Emitter Layer (Engulfs object on wrong answer)
   ========================================================================== */

.fire-emitter-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fire-emitter-layer.fire-active {
  opacity: 1;
}

.fire-flames-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  background: radial-gradient(ellipse at bottom, rgba(255, 85, 0, 0.4) 0%, transparent 70%);
}

.fire-flame-tongue {
  width: 50px;
  height: 140px;
  background: radial-gradient(ellipse at bottom, #FFFFFF 0%, #FFD700 25%, #FF6600 65%, #FF0000 90%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  filter: drop-shadow(0 0 15px #FF6600) drop-shadow(0 0 30px #FF0000);
  transform-origin: bottom center;
  animation: flameErupt 0.3s infinite alternate;
}

.fire-flame-tongue:nth-child(1) { height: 160px; animation-duration: 0.25s; animation-delay: 0.05s; }
.fire-flame-tongue:nth-child(2) { height: 210px; animation-duration: 0.32s; }
.fire-flame-tongue:nth-child(3) { height: 180px; animation-duration: 0.28s; animation-delay: 0.1s; }
.fire-flame-tongue:nth-child(4) { height: 220px; animation-duration: 0.35s; animation-delay: 0.02s; }
.fire-flame-tongue:nth-child(5) { height: 170px; animation-duration: 0.27s; animation-delay: 0.08s; }
.fire-flame-tongue:nth-child(6) { height: 150px; animation-duration: 0.3s; }

@keyframes flameErupt {
  0% { transform: scaleY(0.85) scaleX(0.9) skewX(-4deg); }
  100% { transform: scaleY(1.2) scaleX(1.1) skewX(4deg); }
}

.fire-smoke-puff {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 116, 139, 0.7) 0%, rgba(51, 65, 85, 0.4) 60%, transparent 80%);
  filter: blur(10px);
  animation: smokeRise 1.2s infinite;
}

@keyframes smokeRise {
  0% { transform: translate(-50%, 40px) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -60px) scale(1.6); opacity: 0; }
}

/* ==========================================================================
   Right Panel: 3 Shape Options & Companion Sidebar
   ========================================================================== */

.shapeup-options-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.options-prompt-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.shape-options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.shape-option-btn {
  background: radial-gradient(circle at 35% 35%, #172554 0%, #0b1528 100%);
  border: 3px solid var(--lego-blue);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  box-shadow: 
    0 6px 0 var(--lego-blue-dark),
    0 10px 20px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(0, 85, 191, 0.25);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  user-select: none;
}

.shape-option-btn::before,
.shape-option-btn::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  top: 8px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 2px 3px rgba(0, 0, 0, 0.5);
}

.shape-option-btn::before { left: 10px; }
.shape-option-btn::after { right: 10px; }

.shape-option-btn:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #00D2FF;
  box-shadow: 
    0 10px 0 var(--lego-blue-dark),
    0 16px 28px rgba(0, 85, 191, 0.5),
    0 0 25px rgba(0, 210, 255, 0.5);
}

.shape-option-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 2px 0 var(--lego-blue-dark), 0 4px 8px rgba(0, 0, 0, 0.6);
}

.shape-option-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Option Flash Reactions */
.shape-option-btn.flash-correct {
  border-color: #00E676 !important;
  background: radial-gradient(circle at 35% 35%, #0e381b 0%, #072410 100%) !important;
  box-shadow: 0 0 30px #00E676, 0 6px 0 #006636 !important;
  transform: scale(1.05);
}

.shape-option-btn.flash-wrong {
  border-color: #FF3B30 !important;
  background: radial-gradient(circle at 35% 35%, #380e0e 0%, #240707 100%) !important;
  box-shadow: 0 0 30px #FF3B30, 0 6px 0 #80100a !important;
  animation: cardShake 0.4s ease;
}

/* ==========================================================================
   Giraffe Hub Card Styles in Main 12-Box Hub
   ========================================================================== */

#box-game-shapeup.active-game-box {
  background: linear-gradient(180deg, #2b2207 0%, #151103 100%);
  border-color: #FBBF24;
  box-shadow: 
    0 6px 0 #B45309,
    0 10px 25px rgba(251, 191, 36, 0.35),
    0 0 15px rgba(251, 191, 36, 0.3);
}

#box-game-shapeup.active-game-box:hover {
  border-color: #FDE047;
  box-shadow: 
    0 8px 0 #B45309,
    0 16px 35px rgba(251, 191, 36, 0.6),
    0 0 30px rgba(253, 224, 71, 0.6);
}

#box-game-shapeup .box-ribbon-badge {
  background: #FBBF24;
  color: #151103;
}

.giraffe-avatar-stage {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
}

.giraffe-avatar-stage svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.active-game-box:hover .giraffe-avatar-stage {
  transform: scale(1.12) rotate(-3deg);
}
