/* Mini-game: tap the swimmer */
.game-screen { padding-bottom: 8px; }

.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.game-stat {
  flex: 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.game-stat-val {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
}
.game-stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }

.game-pool {
  position: relative;
  height: 220px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(14,165,233,0.4);
  background: linear-gradient(180deg, #0369a1 0%, #0c4a6e 40%, #075985 100%);
  margin-bottom: 12px;
  touch-action: manipulation;
  user-select: none;
}

.game-pool:active { transform: scale(0.995); }

.pool-lanes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 43px,
    rgba(255,255,255,0.08) 43px,
    rgba(255,255,255,0.08) 44px
  );
}

.pool-waves {
  position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.1));
  animation: poolWave 2s ease-in-out infinite;
}

@keyframes poolWave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(10px); }
}

.swimmer {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  transition: left 0.15s ease-out;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  z-index: 2;
}

.swimmer.swimming {
  animation: swimKick 0.3s ease-in-out infinite;
}

@keyframes swimKick {
  0%, 100% { transform: translateY(-50%) rotate(-5deg); }
  50% { transform: translateY(calc(-50% - 6px)) rotate(5deg); }
}

.swimmer-gear {
  position: absolute;
  font-size: 16px;
  pointer-events: none;
}
.gear-cap { top: -8px; left: 50%; transform: translateX(-50%); }
.gear-goggles { top: 8px; left: 50%; transform: translateX(-50%); font-size: 12px; }
.gear-fins { bottom: -4px; right: -8px; }
.gear-suit { font-size: 10px; opacity: 0.8; }

.tap-burst {
  position: absolute;
  pointer-events: none;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  animation: tapBurst 0.6s ease-out forwards;
  z-index: 10;
  text-shadow: 0 0 8px rgba(251,191,36,0.8);
}

@keyframes tapBurst {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.3); }
}

.splash {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  pointer-events: none;
  animation: splashAnim 0.5s ease-out forwards;
  z-index: 5;
}

@keyframes splashAnim {
  0% { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

.game-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.game-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 12px;
  background: rgba(14,165,233,0.08);
  border: 1px solid var(--card-border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.game-tab.active {
  background: rgba(14,165,233,0.25);
  color: var(--accent);
  border-color: var(--accent);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-item {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  transition: all 0.2s;
}
.shop-item.owned {
  border-color: var(--green);
  background: rgba(34,197,94,0.1);
  opacity: 0.7;
}
.shop-item.can-buy {
  cursor: pointer;
  border-color: var(--gold);
}
.shop-item.can-buy:active { transform: scale(0.97); }
.shop-item-icon { font-size: 32px; margin-bottom: 6px; }
.shop-item-name { font-size: 12px; font-weight: 600; }
.shop-item-price { font-size: 11px; color: var(--gold); margin-top: 4px; }
.shop-item-bonus { font-size: 10px; color: var(--green); margin-top: 2px; }

.game-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.speed-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--green);
  z-index: 3;
}

.finish-line {
  position: absolute;
  right: 16px;
  top: 10%;
  bottom: 10%;
  width: 4px;
  background: repeating-linear-gradient(
    0deg,
    #fff 0px, #fff 8px,
    #ef4444 8px, #ef4444 16px
  );
  border-radius: 2px;
  opacity: 0.7;
}

.game-panel.hidden { display: none; }

.coin-pop {
  animation: coinPop 0.3s ease;
}
@keyframes coinPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--gold); }
  100% { transform: scale(1); }
}

/* Isometric pool + SVG swimmer */
.isometric-pool { height: 260px; perspective: 600px; }
.pool-perspective { position: absolute; inset: 0; transform-style: preserve-3d; }
.pool-floor {
  position: absolute; inset: 10% 5% 15% 5%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0c4a6e 100%);
  transform: rotateX(52deg);
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.3);
}
.pool-lane-markers {
  position: absolute; inset: 10% 5% 15% 5%;
  transform: rotateX(52deg);
  background: repeating-linear-gradient(90deg, transparent, transparent 18%, rgba(255,255,255,0.06) 18%, rgba(255,255,255,0.06) 19%);
  pointer-events: none;
}
.pool-wall {
  position: absolute; top: 8%; right: 8%; width: 12px; height: 35%;
  background: repeating-linear-gradient(0deg, #fff 0 6px, #ef4444 6px 12px);
  transform: rotateX(52deg) translateZ(10px);
  border-radius: 2px;
  opacity: 0.85;
}
.swimmer-wrap {
  position: absolute; bottom: 28%; z-index: 5;
  width: 90px; height: 70px;
  transition: left 0.12s ease-out;
  pointer-events: none;
}
.swimmer-wrap.stroking .swimmer-svg { animation: swimmerDrive 0.35s ease-in-out; }
.swimmer-svg { width: 100%; height: 100%; }

@keyframes swimmerDrive {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
.swimmer-wrap.stroking .sw-arm-l { animation: armPullL 0.35s ease-in-out; transform-origin: 50px 38px; }
.swimmer-wrap.stroking .sw-arm-r { animation: armPullR 0.35s ease-in-out; transform-origin: 48px 42px; }
.swimmer-wrap.stroking .sw-legs { animation: legFlutter 0.35s ease-in-out; transform-origin: 30px 55px; }

@keyframes armPullL { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(-25deg)} }
@keyframes armPullR { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(20deg)} }
@keyframes legFlutter { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(6deg)} }

@keyframes armLeft { 0%,100%{} 50%{} }
@keyframes armRight { 0%,100%{} 50%{} }
@keyframes legKick { 0%,100%{} 50%{} }

.sw-bubble { animation: bubbleRise 1.5s ease-in-out infinite; }
.sw-bubble.b2 { animation-delay: 0.5s; }
@keyframes bubbleRise { 0%{opacity:0.5;transform:translateX(0)} 100%{opacity:0;transform:translateX(-15px) translateY(-8px)} }

/* Wall progress */
.wall-progress { margin-bottom: 10px; }
.wall-progress-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.wall-progress-bar { height: 8px; background: rgba(0,0,0,0.3); border-radius: 4px; overflow: hidden; }
.wall-progress-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #fbbf24); border-radius: 4px; transition: width 0.2s; }

/* Focus picker */
.focus-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: rgba(14,165,233,0.1); border: 1px solid var(--card-border);
  color: var(--muted); cursor: pointer;
}
.focus-chip.active { background: rgba(14,165,233,0.3); border-color: var(--accent); color: var(--accent); }
.focus-chip.locked { opacity: 0.4; cursor: not-allowed; }

/* Stats panel */
.stat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stat-label { font-size: 11px; width: 100px; flex-shrink: 0; }
.stat-bar { flex: 1; height: 8px; background: rgba(0,0,0,0.3); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 4px; transition: width 0.4s; }
.stat-pct { font-size: 11px; font-weight: 700; width: 36px; text-align: right; color: var(--gold); }

.efficiency-warn {
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--red);
  margin-bottom: 10px; text-align: center;
}

/* QTE */
.qte-overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}
.qte-overlay.hidden { display: none; }
.qte-title { font-family: var(--font-display); font-size: 18px; color: var(--gold); }
.qte-sub { font-size: 12px; color: var(--muted); }
.qte-ring-wrap {
  position: relative; width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.qte-ring-outer {
  position: absolute; width: 120px; height: 120px;
  border: 4px solid rgba(14,165,233,0.6); border-radius: 50%;
  transition: border-color 0.1s;
}
.qte-ring-outer.qte-ready { border-color: var(--green); box-shadow: 0 0 20px rgba(34,197,94,0.6); }
.qte-ring-target {
  width: 70px; height: 70px;
  border: 3px solid var(--gold); border-radius: 50%;
  box-shadow: 0 0 12px rgba(251,191,36,0.5);
}
.qte-btn { font-size: 18px !important; padding: 14px 40px !important; animation: qtePulse 1s ease-in-out infinite; }
@keyframes qtePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }

/* Achievements in game */
.ach-card {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: 12px; margin-bottom: 8px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--card-border);
  position: relative;
}
.ach-card.ach-confirmed { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.08); }
.ach-card.ach-pending { border-color: rgba(251,191,36,0.45); background: rgba(251,191,36,0.06); }
.ach-card.ach-locked {
  border-color: rgba(100,116,139,0.25);
  background: rgba(15,23,42,0.35);
  opacity: 0.72;
  filter: grayscale(0.85);
}
.ach-card.ach-locked .ach-icon { opacity: 0.5; }
.ach-card.ach-locked .ach-name { color: #94a3b8; }
.ach-locked-label { font-size: 10px; color: #64748b; margin-top: 4px; }
.ach-card.ach-super:not(.ach-locked) { border-color: rgba(168,85,247,0.6); background: rgba(88,28,135,0.15); }
.ach-cat-block { margin-bottom: 16px; }
.ach-cat-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); margin-bottom: 8px; display: flex; justify-content: space-between;
}
.ach-cat-count { font-size: 11px; color: var(--muted); font-weight: 600; }
.ach-game-stats { font-size: 13px; margin-top: 8px; color: var(--gold); }
.rank-row-king { color: var(--gold); font-weight: 700; }
.rank-board .result-row { padding: 4px 0; }
.ach-icon { font-size: 28px; }
.ach-name { font-weight: 700; font-size: 13px; }
.ach-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ach-bonus { font-size: 10px; color: var(--green); margin-top: 4px; }
.ach-pending-label { font-size: 10px; color: var(--gold); margin-top: 4px; }
.ach-super-badge {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; font-weight: 800; color: #a855f7;
  background: rgba(168,85,247,0.2); padding: 2px 6px; border-radius: 6px;
}
.ach-coach-card {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px; border-radius: 14px; margin-bottom: 10px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--card-border);
}
.ach-coach-card.ach-super { border-color: rgba(168,85,247,0.5); }
.ach-super-warn { font-size: 11px; color: #c084fc; margin-top: 4px; }
.ach-coach-actions { display: flex; gap: 6px; margin-left: auto; }

.game-hud { flex-wrap: wrap; }
.game-hud .game-stat { min-width: 22%; }

.passive-card-live {
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(14,165,233,0.12));
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 16px; padding: 14px; margin-bottom: 12px;
}
.passive-live-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.passive-tick { font-size: 10px; color: var(--green); margin-top: 6px; font-weight: 600; }
.passive-boosts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.passive-boost-chip {
  font-size: 10px; padding: 3px 8px; border-radius: 10px;
  background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.35); color: #86efac;
}
.shop-section { margin-bottom: 16px; }
.shop-section-title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--accent); margin-bottom: 8px; text-transform: uppercase;
}
.shop-item-desc { font-size: 9px; color: var(--muted); margin: 4px 0; min-height: 22px; }
.shop-buy-btn { margin-top: 6px; }
.shop-emoji-card { min-height: 48px; display: flex; align-items: center; justify-content: center; }
.shop-emoji-icon { font-size: 32px; }
.shop-item.can-buy { border-color: rgba(34,197,94,0.4); }
