/* ==========================================================================
   3RB WORDS OF WONDERS (WOW) - Luxury Crossword & Anagram Wheel Styling
   ========================================================================== */

.wow-game-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 88vh;
  position: relative;
  background: url('/assets/wow/bg_wonder_pyramids.jpg') center/cover no-repeat;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(245, 158, 11, 0.4);
  color: #fff;
  font-family: 'Readex Pro', 'Cairo', sans-serif;
  user-select: none;
}

.wow-bg-dimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.5) 50%, rgba(15, 23, 42, 0.88) 100%);
  pointer-events: none;
}

.wow-content-layer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 88vh;
  box-sizing: border-box;
  padding: 16px 24px;
}

/* ── Top HUD ── */
.wow-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.wow-wonder-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wow-wonder-badge {
  font-size: 1.6rem;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 4px 10px;
}

.wow-wonder-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fef08a;
}

.wow-level-pill {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 600;
}

.wow-hud-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wow-coins-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid #f59e0b;
  border-radius: 20px;
  font-weight: 900;
  font-size: 0.95rem;
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.wow-bonus-jar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(168, 85, 247, 0.2);
  border: 1.5px solid #a855f7;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.88rem;
  color: #d8b4fe;
}

/* ── Crossword Grid Stage ── */
.wow-stage-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  position: relative;
}

.wow-crossword-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 28px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  max-width: 90%;
  max-height: 40vh;
  overflow-y: auto;
}

.wow-crossword-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wow-cw-cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.wow-cw-cell.empty-slot {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.wow-cw-cell.solved-cell {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fde68a;
  color: #0f172a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  animation: cell-reveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wow-cw-cell.hinted-cell {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #6ee7b7;
  color: #fff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
}

@keyframes cell-reveal {
  0% { transform: scale(0.6) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ── Word Preview Bar ── */
.wow-preview-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: 14px;
}

.wow-spelled-word-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 24px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 2px solid #f59e0b;
  border-radius: 25px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 2px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
  animation: preview-pop 0.15s ease-out;
}

@keyframes preview-pop {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ── Anagram Letter Circle Wheel ── */
.wow-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: auto;
  padding-bottom: 16px;
}

.wow-action-circle-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  font-size: 1.35rem;
  color: #fef08a;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  position: relative;
}

.wow-action-circle-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
}

.wow-action-circle-btn:active {
  transform: scale(0.92);
}

.btn-cost-tag {
  position: absolute;
  bottom: -6px;
  font-size: 0.62rem;
  font-weight: 900;
  background: #f59e0b;
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 8px;
}

/* The Anagram Wheel */
.wow-wheel-container {
  position: relative;
  width: 220px;
  height: 220px;
}

.wow-wheel-disk {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(18px);
  border: 3px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wow-letter-node {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(245, 158, 11, 0.6);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.wow-letter-node:hover {
  transform: scale(1.15) !important;
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), #1e293b);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.wow-letter-node.is-selected {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fef08a;
  color: #0f172a;
  transform: scale(1.18) !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.85);
}

/* Drag SVG Connector Line */
.wow-wheel-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.wow-drag-line {
  stroke: #f59e0b;
  stroke-width: 9px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.95)) drop-shadow(0 0 16px rgba(245, 158, 11, 0.6));
  pointer-events: none;
}

/* Flying Word Letters into Crossword Grid */
.wow-flying-letter {
  position: fixed;
  z-index: 9999;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 2px solid #6ee7b7;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.18, 0.9, 0.25, 1.15), opacity 0.42s ease-in;
}

/* Preview Pill Shaking on Invalid */
.wow-pill-shake-error {
  animation: wow-shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.25) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.7) !important;
}

@keyframes wow-shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Confetti Celebration Overlay */
.wow-confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ── Level Complete Modal ── */
.wow-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.wow-complete-card {
  width: 90%;
  max-width: 440px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #f59e0b;
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(245, 158, 11, 0.4);
  animation: complete-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes complete-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.wow-complete-icon {
  font-size: 3.8rem;
  margin-bottom: 8px;
}

.wow-complete-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #fbbf24;
  margin: 0 0 6px 0;
}

.wow-complete-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.wow-reward-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.wow-reward-badge {
  padding: 8px 16px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 1rem;
}

.wow-reward-badge.coins {
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid #f59e0b;
  color: #fef08a;
}

.wow-reward-badge.score {
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid #10b981;
  color: #6ee7b7;
}

.wow-next-level-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
}

.wow-next-level-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.6);
}
