/* ============================================================================
   SORT IT — SPORTS EDITION | Animations, Visual Feedback & 15-Tier Mechanics
   ============================================================================ */

@keyframes pulseCta {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.pulse-cta {
  animation: pulseCta 2.2s infinite ease-in-out;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.floating-badge.b1 { animation: floatBadge 2.4s infinite ease-in-out 0s; }
.floating-badge.b2 { animation: floatBadge 2.4s infinite ease-in-out 0.3s; }
.floating-badge.b3 { animation: floatBadge 2.4s infinite ease-in-out 0.6s; }
.floating-badge.b4 { animation: floatBadge 2.4s infinite ease-in-out 0.9s; }

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-3deg); }
  40% { transform: translateX(7px) rotate(3deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.shake-error {
  animation: shakeError 0.38s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.7) !important;
}

@keyframes binSuccessPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: 0 0 20px rgba(16, 185, 129, 0.8); }
  100% { transform: scale(1); }
}

.bin-success-pop {
  animation: binSuccessPop 0.32s ease-out;
}

@keyframes scoreFloatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -36px) scale(1.1);
  }
}

.floating-feedback {
  position: fixed;
  pointer-events: none;
  z-index: 950;
  font-weight: 900;
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 999px;
  animation: scoreFloatUp 0.75s ease-out forwards;
}

.floating-feedback.plus {
  background: rgba(16, 185, 129, 0.95);
  color: #052e16;
}

.floating-feedback.minus {
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
}

/* ==================== MENU SPLIT ROW & ENDLESS MODE BUTTON ==================== */
.menu-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-endless {
  background: rgba(30, 41, 59, 0.85);
  border: 1px dashed rgba(250, 204, 21, 0.45);
  color: #94a3b8;
  font-size: 12px !important;
  padding: 12px 10px !important;
}

.btn-endless.unlocked {
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  border: 1px solid #e9d5ff;
  color: #ffffff;
  box-shadow: 0 4px 0 #581c87, 0 6px 16px rgba(168, 85, 247, 0.4);
}

/* ==================== CONTINUOUS TIMER PROGRESS BAR ==================== */
.hud-timer-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.hud-timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 999px;
  transition: width 0.35s linear, background 0.25s ease;
}

.hud-timer-bar-fill.caution {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.hud-timer-bar-fill.critical {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.hud-timer-bar-fill.zen {
  background: linear-gradient(90deg, #a855f7, #38bdf8);
}

@keyframes urgentTimerPulse {
  0%, 100% { transform: scale(1); background: rgba(239, 68, 68, 0.14); }
  50% { transform: scale(1.04); background: rgba(239, 68, 68, 0.32); }
}

.pulse-timer-urgent {
  animation: urgentTimerPulse 0.65s infinite ease-in-out;
  border-color: rgba(239, 68, 68, 0.65) !important;
}

/* ==================== DECOY WHISTLE & CHAMPION MODAL ==================== */
.sport-item.decoy-item {
  border-color: rgba(239, 68, 68, 0.65);
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.2) 0%, #0f172a 100%);
}

.badge-decoy {
  background: #ef4444;
  color: #ffffff;
}

.champion-crest {
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.22), rgba(15, 23, 42, 0.92));
  border: 2px solid #facc15;
  border-radius: 16px;
  padding: 12px;
  margin: 8px 0 14px;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.28);
}

.crest-crown {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}

.crest-name {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.crest-rank {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #facc15;
  margin-top: 2px;
}

/* ==================== 15-TIER ARENA VISUAL MECHANIC MODIFIERS ==================== */
.arena-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Tier 3: Moving & Bouncing Gear (Controlled, gentle sway that never blocks touch) */
@keyframes itemSway {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
}

@keyframes itemBounce {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

@keyframes itemSwayAndBounce {
  0%, 100% { transform: translate(-2px, 0px); }
  25% { transform: translate(0px, -3px); }
  50% { transform: translate(2px, 0px); }
  75% { transform: translate(0px, -3px); }
}

#screen-game.mech-moving .sport-item:not(.selected):not(.dragging-source) {
  animation: itemSway 2.2s infinite ease-in-out;
}

#screen-game.mech-bouncing .sport-item:not(.selected):not(.dragging-source) {
  animation: itemBounce 1.5s infinite ease-in-out;
}

#screen-game.mech-moving.mech-bouncing .sport-item:not(.selected):not(.dragging-source) {
  animation: itemSwayAndBounce 1.8s infinite ease-in-out;
}

/* Tier 5: Rain & Thunder Weather */
#screen-game.mech-rain .arena-fx-layer {
  background: repeating-linear-gradient(
    105deg,
    transparent 0px,
    transparent 18px,
    rgba(56, 189, 248, 0.06) 18px,
    rgba(56, 189, 248, 0.06) 20px
  );
}

#screen-game.mech-rain .sport-item {
  border-color: rgba(56, 189, 248, 0.42);
}

@keyframes thunderFlashAnim {
  0% { background: rgba(255, 255, 255, 0.45); }
  100% { background: transparent; }
}

.arena-fx-layer.thunder-flash-now {
  animation: thunderFlashAnim 0.4s ease-out;
}

/* Tier 6: Night Stadium, Spotlight, Power Cut & Moonlight */
#screen-game.mech-darkness .items-tray {
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.96), #030712);
  border-color: rgba(56, 189, 248, 0.35);
}

#screen-game.mech-spotlight .sport-item {
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.22);
}

#screen-game.mech-spotlight .sport-item.selected,
#screen-game.mech-spotlight .sport-item:hover {
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.75);
}

#screen-game.mech-shadow .item-svg-wrap svg {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.55)) contrast(1.15);
}

@keyframes powerCutPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

#screen-game.mech-powercut .items-tray {
  animation: powerCutPulse 3.2s infinite ease-in-out;
}

#screen-game.mech-moonlight {
  background: linear-gradient(180deg, #08142c 0%, #030914 100%);
}

/* Tier 11: Chaos League (Falling Items, Reverse, Mirror) */
@keyframes itemDropIn {
  0% { transform: translateY(-6px); opacity: 0.85; }
  100% { transform: translateY(0); opacity: 1; }
}

#screen-game.mech-falling .sport-item {
  animation: itemDropIn 0.28s ease-out;
}

/* Level 54: Reverse Flow — flips arena vertically (bins at top, tray at bottom) AND reverses tray flow */
#screen-game.mech-reverse .arena-container {
  flex-direction: column-reverse;
}

#screen-game.mech-reverse .items-tray {
  direction: rtl;
  border-color: rgba(249, 115, 22, 0.55);
}

#screen-game.mech-reverse .sport-item {
  direction: ltr;
}

.reverse-drag-ghost {
  border-color: #f97316 !important;
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.75) !important;
}

/* Phase 2 Mechanics: Wet Bins (Lv 22, 25), Muddy Trail (Lv 23), Golden Timer (Lv 33),
   Golden Sparkle (Lv 34, 35), Masked Transformation (Lv 38), Timer Acceleration (Lv 19, 44) */
.timer-accelerated {
  border-color: #f97316 !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

.wet-puddle-bin {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(14, 116, 144, 0.28) 100%);
  border-color: rgba(56, 189, 248, 0.55);
}

.wet-puddle-badge {
  font-size: 11px;
  margin-left: 2px;
}

@keyframes wetBinSplashAnim {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.85); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.25); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(56, 189, 248, 0); }
}

.wet-bin-splash {
  animation: wetBinSplashAnim 0.48s ease-out;
  border-color: #38bdf8 !important;
}

.wet-splash-ring {
  position: absolute;
  right: 8px;
  bottom: 6px;
  background: rgba(56, 189, 248, 0.92);
  color: #082f49;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  pointer-events: none;
}

@keyframes muddyTrailFade {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
}

.muddy-trail-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.85) 0%, rgba(56, 189, 248, 0.55) 100%);
  border: 1px solid rgba(251, 191, 36, 0.65);
  pointer-events: none;
  z-index: 940;
  animation: muddyTrailFade 0.6s ease-out forwards;
}

.badge-golden-timer {
  background: linear-gradient(90deg, #facc15, #f97316);
  color: #0f172a;
}

.golden-expired-item {
  border-color: rgba(148, 163, 184, 0.45) !important;
}

.badge-expired {
  background: #475569;
  color: #e2e8f0;
}

@keyframes goldenSparklePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(250, 204, 21, 0.45), inset 0 0 8px rgba(250, 204, 21, 0.2); }
  50% { box-shadow: 0 0 20px rgba(250, 204, 21, 0.9), inset 0 0 14px rgba(250, 204, 21, 0.45); }
}

.sparkle-golden-item {
  animation: goldenSparklePulse 1.4s infinite ease-in-out;
}

.golden-sparkle-fx {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  color: #fde047;
  text-shadow: 0 0 6px #facc15;
  pointer-events: none;
}

.masked-disguise-item {
  border: 1.5px dashed #c084fc !important;
  background: linear-gradient(160deg, rgba(168, 85, 247, 0.22) 0%, rgba(15, 23, 42, 0.96) 100%) !important;
}

.masked-svg-wrap {
  filter: hue-rotate(45deg) contrast(1.1);
  opacity: 0.85;
}

.badge-masked {
  background: #9333ea;
  color: #ffffff;
}

@keyframes transformRevealPop {
  0% { transform: scale(0.86) rotateY(90deg); }
  100% { transform: scale(1) rotateY(0deg); }
}

.transformed-item {
  animation: transformRevealPop 0.36s ease-out;
  border-color: #38bdf8 !important;
}

.badge-morphed {
  background: #0284c7;
  color: #ffffff;
}

/* Tier 12: Mind Games (Phantom Ghost, Inverted, Echo, Retro, Glitch, Fake-out) */
@keyframes ghostPulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.52; }
}

#screen-game.mech-ghost .sport-item:not(.selected) {
  animation: ghostPulse 2.0s infinite ease-in-out;
}

#screen-game.mech-inverted .items-tray {
  background: radial-gradient(circle at center, rgba(88, 28, 135, 0.35), rgba(15, 23, 42, 0.95));
  border-color: #e879f9;
}

#screen-game.mech-echo .category-bin.bin-success-pop {
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.45), 0 0 22px rgba(16, 185, 129, 0.9);
}

#screen-game.mech-retro .sport-item {
  transition-timing-function: steps(3, end);
}

#screen-game.mech-glitch .arena-fx-layer {
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(168, 85, 247, 0.05) 3px,
    rgba(168, 85, 247, 0.05) 4px
  );
}

#screen-game.mech-fakeout .category-bin.bin-success-pop {
  border-color: #a855f7 !important;
}

/* Tier 14: Surprise Zone (Upside Down, Tiny, Giant, Rainbow, Minimal, Maximal) */
#screen-game.mech-upside-down .arena-container {
  flex-direction: column-reverse;
}

/* Tiny items shrink only the inner SVG graphic slightly so the card hitbox stays 100% full-sized! */
#screen-game.mech-tiny .item-svg-wrap {
  transform: scale(0.72);
}

#screen-game.mech-giant .item-svg-wrap {
  transform: scale(1.18);
}

@keyframes rainbowGlow {
  0% { border-color: #ef4444; }
  25% { border-color: #facc15; }
  50% { border-color: #10b981; }
  75% { border-color: #38bdf8; }
  100% { border-color: #a855f7; }
}

#screen-game.mech-rainbow .items-tray,
#screen-game.mech-rainbow .game-hud {
  animation: rainbowGlow 4s infinite linear;
}

#screen-game.mech-minimal .sport-item,
#screen-game.mech-minimal .category-bin {
  background: #090f24;
  border-style: solid;
  box-shadow: none;
}

#screen-game.mech-maximal .sport-item {
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.28);
}

/* Tier 15: The Wall & Stealth Clock */
.arena-wall-divider {
  background: repeating-linear-gradient(
    45deg,
    rgba(249, 115, 22, 0.22),
    rgba(249, 115, 22, 0.22) 10px,
    rgba(15, 23, 42, 0.9) 10px,
    rgba(15, 23, 42, 0.9) 20px
  );
  border: 1px solid rgba(249, 115, 22, 0.6);
  color: #fed7aa;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 3px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

@keyframes stealthClockFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.18; }
}

#screen-game.mech-stealth-clock #hud-timer {
  animation: stealthClockFade 2.6s infinite ease-in-out;
}
