/* ==========================================================================
   ADF PDF — Play & Rewards Center Stylesheet
   Theme: Modern Dark Navy & Neon Emerald Accent
   ========================================================================== */

:root {
  --play-bg: #070d1e;
  --play-surface: #0f1a36;
  --play-card: #152248;
  --play-card-hover: #1b2c5c;
  --play-border: #233569;
  --play-text: #f8fafc;
  --play-text-muted: #94a3b8;
  --play-primary: #10b981;
  --play-primary-hover: #059669;
  --play-accent-gold: #f59e0b;
  --play-accent-purple: #8b5cf6;
  --play-accent-cyan: #06b6d4;
  --play-accent-coral: #ef4444;
  --play-radius-sm: 8px;
  --play-radius-md: 14px;
  --play-radius-lg: 20px;
  --play-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

.play-wrapper {
  background: var(--play-bg);
  color: var(--play-text);
  min-height: 80vh;
  padding: 30px 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.play-container {
  max-width: 1040px;
  margin: 0 auto;
}

/* ==========================================================================
   Top Header & Sound Control
   ========================================================================== */
.play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.play-brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  border-radius: var(--play-radius-sm);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.play-title-text h1 {
  font-size: 24px;
  font-weight: 850;
  margin: 0;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.play-title-text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--play-text-muted);
}

.play-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-btn-pill {
  background: var(--play-card);
  border: 1px solid var(--play-border);
  color: var(--play-text);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.play-btn-pill:hover {
  background: var(--play-card-hover);
  border-color: var(--play-primary);
}

/* ==========================================================================
   Energy & Regeneration Status Hub
   ========================================================================== */
.play-energy-card {
  background: var(--play-surface);
  border: 1.5px solid var(--play-border);
  border-radius: var(--play-radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--play-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.energy-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.energy-balance-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
}

.energy-val {
  color: var(--play-primary);
  font-size: 20px;
  font-weight: 900;
}

.energy-countdown-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.energy-countdown-pill.full {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* 12-Slot Battery Indicators */
.energy-meter-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}

.energy-slot {
  height: 12px;
  border-radius: 4px;
  background: #1e2c52;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.energy-slot.filled {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  border-color: #6ee7b7;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.play-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 22px;
  scrollbar-width: thin;
}

.play-tab-btn {
  background: var(--play-surface);
  border: 1px solid var(--play-border);
  color: var(--play-text-muted);
  padding: 10px 18px;
  border-radius: var(--play-radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.play-tab-btn:hover {
  color: #fff;
  border-color: var(--play-primary);
}

.play-tab-btn.active {
  background: var(--play-primary);
  border-color: var(--play-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Tab View Panes
   ========================================================================== */
.play-pane {
  display: none;
}

.play-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-stage-card {
  background: var(--play-surface);
  border: 1.5px solid var(--play-border);
  border-radius: var(--play-radius-lg);
  padding: 28px 24px;
  box-shadow: var(--play-shadow);
  margin-bottom: 28px;
}

/* ==========================================================================
   GAME 1: 6x6 Number Challenge (36 Number Boxes)
   ========================================================================== */
.number-game-header {
  text-align: center;
  max-width: 580px;
  margin: 0 auto 22px;
}

.number-game-header h2 {
  font-size: 22px;
  font-weight: 850;
  margin: 0 0 6px;
}

.number-selection-tray {
  background: var(--play-card);
  border: 1px solid var(--play-border);
  border-radius: var(--play-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.tray-slots {
  display: flex;
  gap: 10px;
}

.tray-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0b1429;
  border: 2px dashed var(--play-border);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 850;
  color: var(--play-text-muted);
  transition: all 0.25s ease;
}

.tray-bubble.filled {
  border-style: solid;
  border-color: #fff;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.6); }
  100% { transform: scale(1); }
}

/* 6x6 Grid of 36 boxes */
.number-grid-36 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  max-width: 540px;
  margin: 0 auto 24px;
}

.num-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
  color: #fff;
}

/* Repeating 6 Distinct Color Groups */
.num-tile.c-coral   { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.num-tile.c-amber   { background: linear-gradient(145deg, #f59e0b, #b45309); }
.num-tile.c-emerald { background: linear-gradient(145deg, #10b981, #047857); }
.num-tile.c-cyan    { background: linear-gradient(145deg, #06b6d4, #0e7490); }
.num-tile.c-indigo  { background: linear-gradient(145deg, #6366f1, #4338ca); }
.num-tile.c-violet  { background: linear-gradient(145deg, #8b5cf6, #6d28d9); }

.num-tile:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.num-tile:active {
  transform: scale(0.95);
}

.num-tile.selected {
  outline: 3.5px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px) scale(1.03);
}

.num-tile.matched {
  outline: 3.5px solid #22c55e !important;
  box-shadow: 0 0 20px #22c55e !important;
  animation: matchedPulse 1s infinite alternate;
}

@keyframes matchedPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.number-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-game-submit {
  background: var(--play-primary);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--play-radius-sm);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-game-submit:hover:not(:disabled) {
  background: var(--play-primary-hover);
  transform: translateY(-1px);
}

.btn-game-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   GAME 2: 3D Coin Flip
   ========================================================================== */
.coin-stage {
  text-align: center;
  padding: 20px 0;
}

.coin-viewport {
  perspective: 1000px;
  width: 140px;
  height: 140px;
  margin: 0 auto 30px;
}

.coin-disc {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  border: 4px solid #fef08a;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.coin-front {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #78350f;
}

.coin-back {
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  color: #1e293b;
  border-color: #ffffff;
  transform: rotateY(180deg);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
}

.coin-disc.flip-heads {
  animation: flipToHeads 1.6s forwards cubic-bezier(0.2, 0.8, 0.3, 1);
}

.coin-disc.flip-tails {
  animation: flipToTails 1.6s forwards cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes flipToHeads {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(1080deg) scale(1.35); }
  100% { transform: rotateY(2160deg) scale(1); }
}

@keyframes flipToTails {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(1080deg) scale(1.35); }
  100% { transform: rotateY(2340deg) scale(1); }
}

/* ==========================================================================
   GAME 3: Lucky Spin Wheel
   ========================================================================== */
.wheel-stage {
  text-align: center;
  position: relative;
  max-width: 360px;
  margin: 0 auto;
  padding: 10px 0 20px;
}

.wheel-pointer {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid #ef4444;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.wheel-canvas-box {
  width: 300px;
  height: 300px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 6px solid #233569;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

#spinCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 4s cubic-bezier(0.15, 0.9, 0.2, 1);
}

/* ==========================================================================
   GAME 4 & 5: Sliding Puzzle & Memory Cards
   ========================================================================== */
.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 330px;
  aspect-ratio: 1;
  margin: 0 auto 20px;
  background: var(--play-card);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--play-border);
}

.puzzle-tile {
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid var(--play-border);
  color: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.puzzle-tile.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 0 auto 20px;
}

.memory-card {
  aspect-ratio: 1;
  background: var(--play-card);
  border: 1.5px solid var(--play-border);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 26px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
}

.memory-card.flipped {
  background: var(--play-surface);
  border-color: var(--play-primary);
  transform: rotateY(180deg);
}

.memory-card.matched {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--play-primary);
  opacity: 0.85;
  cursor: default;
}

/* ==========================================================================
   Player Dashboard & Achievements
   ========================================================================== */
.play-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-metric-card {
  background: var(--play-surface);
  border: 1px solid var(--play-border);
  border-radius: var(--play-radius-md);
  padding: 16px 20px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--play-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-val {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
}

.badge-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-chip {
  background: var(--play-card);
  border: 1px solid var(--play-border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-chip.earned {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* ==========================================================================
   Guest Welcome Hero
   ========================================================================== */
.play-guest-card {
  background: var(--play-surface);
  border: 1.5px solid var(--play-border);
  border-radius: var(--play-radius-lg);
  padding: 48px 24px;
  text-align: center;
  max-width: 620px;
  margin: 40px auto;
  box-shadow: var(--play-shadow);
}

.play-guest-card h2 {
  font-size: 28px;
  font-weight: 900;
  margin: 16px 0 8px;
}

.play-guest-card p {
  color: var(--play-text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ==========================================================================
   Accessibility & Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 520px) {
  .number-grid-36 {
    gap: 6px;
  }
  .num-tile {
    font-size: 15px;
    border-radius: 8px;
  }
  .tray-bubble {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .play-title-text h1 {
    font-size: 20px;
  }
}