/* =================================================================
   PAES Practice · Game Shell
   Shared styles for all game-mode units.
   ================================================================= */

:root {
  --paes-navy: #0F2E4C;
  --paes-navy-2: #1a3d65;
  --paes-navy-deep: #081A2D;
  --paes-teal: #1D8B8B;
  --paes-gold: #D9A441;
  --paes-cream: #F7F3EC;
  --paes-charcoal: #2B2B2B;
  --paes-text-soft: #4A5878;
  --paes-border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(15,46,76,0.08);
  --shadow-md: 0 6px 18px rgba(15,46,76,0.12);
  --shadow-lg: 0 16px 40px rgba(15,46,76,0.18);
  --shadow-xl: 0 24px 60px rgba(15,46,76,0.24);
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--paes-charcoal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  background: var(--paes-navy-deep);
}

button { font-family: inherit; cursor: pointer; border: none; outline: none; }

/* ---------- GAME LAYOUT ---------- */

.game-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--paes-navy-deep) 0%, var(--paes-navy) 100%);
  color: #fff;
}

.game-header {
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 10;
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.game-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--paes-gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--paes-gold);
}

.game-brand .practice {
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  margin-left: 2px;
}

.game-brand .arrow {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin: 0 8px;
}

.game-title {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.game-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat .icon { font-size: 14px; }
.stat.score { background: linear-gradient(135deg, rgba(217,164,65,0.25), rgba(217,164,65,0.1)); border-color: rgba(217,164,65,0.4); color: var(--paes-gold); }
.stat.timer { background: linear-gradient(135deg, rgba(29,139,139,0.25), rgba(29,139,139,0.1)); border-color: rgba(29,139,139,0.4); color: #6BD0D0; }
.stat.streak { background: linear-gradient(135deg, rgba(217,164,65,0.3), rgba(220,80,40,0.15)); border-color: rgba(217,164,65,0.5); color: var(--paes-gold); }

.exit-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 100px;
  transition: all 0.15s var(--easing);
  text-decoration: none;
  display: inline-block;
}

.exit-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

/* ---------- GAME STAGE ---------- */

.game-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}

.game-stage .ambient-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(29,139,139,0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(217,164,65,0.14) 0%, transparent 45%);
  pointer-events: none;
}

.task-card {
  background: linear-gradient(180deg, #fff 0%, var(--paes-cream) 100%);
  color: var(--paes-charcoal);
  border-radius: 16px;
  padding: 16px 22px;
  box-shadow: var(--shadow-md);
  font-size: 14.5px;
  position: relative;
  z-index: 5;
  max-width: 720px;
}

.task-card .label {
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--paes-gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.task-card .text {
  color: var(--paes-navy);
  font-weight: 600;
  line-height: 1.4;
}

/* ---------- BUTTONS ---------- */

.btn-game {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.18s var(--easing);
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
}

.btn-game.primary {
  background: linear-gradient(135deg, var(--paes-gold) 0%, #C68F2F 100%);
  color: var(--paes-navy);
  box-shadow: 0 6px 18px rgba(217,164,65,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}

.btn-game.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(217,164,65,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}

.btn-game.primary:active { transform: translateY(0); }

.btn-game.secondary {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}

.btn-game.secondary:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}

/* ---------- CELEBRATION OVERLAY ---------- */

.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 26, 45, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--easing);
}

.win-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.win-card {
  background: linear-gradient(180deg, #fff 0%, var(--paes-cream) 100%);
  color: var(--paes-navy);
  border-radius: 22px;
  padding: 44px 52px;
  text-align: center;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.4s var(--easing-bounce);
}

.win-overlay.show .win-card { transform: scale(1) translateY(0); }

.win-card .badge-circle {
  width: 88px;
  height: 88px;
  background: linear-gradient(135deg, var(--paes-gold) 0%, #C68F2F 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin: 0 auto 22px;
  box-shadow: 0 12px 32px rgba(217,164,65,0.45);
  animation: badge-pop 0.6s var(--easing-bounce) 0.2s both;
}

@keyframes badge-pop {
  0% { transform: scale(0) rotate(-180deg); }
  70% { transform: scale(1.1) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.win-card h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
  color: var(--paes-navy);
}

.win-card .subline {
  font-size: 15px;
  color: var(--paes-text-soft);
  margin-bottom: 28px;
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.win-stats .stat-block {
  background: var(--paes-cream);
  border-radius: 12px;
  padding: 14px 8px;
}

.win-stats .stat-block .label {
  font-size: 9.5px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--paes-text-soft);
  font-weight: 700;
  margin-bottom: 4px;
}

.win-stats .stat-block .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--paes-navy);
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.win-stats .stat-block.gold .value { color: var(--paes-gold); }

.win-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ---------- TOAST ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(8,26,45,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transition: transform 0.3s var(--easing), opacity 0.3s var(--easing);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.good {
  background: linear-gradient(135deg, rgba(29,139,139,0.95) 0%, rgba(15,46,76,0.95) 100%);
  border-color: rgba(107,208,208,0.4);
}

.toast.bad {
  background: linear-gradient(135deg, rgba(180,60,60,0.95) 0%, rgba(15,46,76,0.95) 100%);
  border-color: rgba(220,90,90,0.4);
}

.toast .icon { font-size: 16px; }

/* ---------- PARTICLES ---------- */

.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 1100;
  inset: 0;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  top: -20px;
  animation: confetti-fall 2.6s linear forwards;
  border-radius: 2px;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.2;
  }
}

/* ---------- HINT BUTTON ---------- */

.hint-btn {
  position: absolute;
  bottom: 22px;
  right: 22px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 100px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  transition: all 0.15s var(--easing);
}

.hint-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.hint-bubble {
  position: absolute;
  bottom: 78px;
  right: 22px;
  background: linear-gradient(180deg, var(--paes-gold) 0%, #C68F2F 100%);
  color: var(--paes-navy);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  max-width: 280px;
  box-shadow: var(--shadow-md);
  z-index: 20;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}

.hint-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.hint-bubble:after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 30px;
  width: 14px;
  height: 14px;
  background: #C68F2F;
  transform: rotate(45deg);
}

/* ---------- DRAG HELPERS ---------- */

.draggable {
  cursor: grab;
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
}

.draggable.dragging {
  cursor: grabbing;
  transform: scale(1.05);
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.drop-zone {
  transition: all 0.2s var(--easing);
}

.drop-zone.over {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(217,164,65,0.4);
}

.drop-zone.correct {
  box-shadow: 0 0 0 4px rgba(29,139,139,0.55);
  background: rgba(29,139,139,0.15) !important;
}

.drop-zone.wrong {
  animation: shake 0.4s var(--easing);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

/* ---------- LOCKED STATES ---------- */

.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,26,45,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}
