/* ========== Cherry Shake & Catch Minigame Styles ========== */
#CGS_app_cherryGame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Background - extended and centered by height */
.CGS_background {
  position: absolute;
  pointer-events: none;
  height: 100%;
  z-index: 0;
}
.CGS_background img {
  position: absolute;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* ========== Particle System ========== */
.CGS_particles_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.CGS_particle {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  animation: CGS_floatParticle linear infinite;
}

@keyframes CGS_floatParticle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-110vh) translateX(var(--drift));
    opacity: 0;
  }
}

/* Main container for positioned elements */
.CGS_mainCont {
  position: absolute;
  pointer-events: none;
  height: 1080px;
  width: 1920px;
  z-index: 1;
  opacity: 1;
}
.CGS_mainCont.visible {
  pointer-events: auto;
}

/* ========== Tree Group ========== */
.CGS_tree_group {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 100%;

  display: flex;
  justify-content: center;


  transform: translateX(-50%);
  transform-origin: center bottom;
  pointer-events: auto;
  cursor: pointer;
}

/* Shaking animations - applied to group */
.CGS_tree_group.shaking.light {
  animation: treeShakeLight 0.2s ease-in-out infinite;
}
.CGS_tree_group.shaking.medium {
  animation: treeShakeMedium 0.15s ease-in-out infinite;
}
.CGS_tree_group.shaking.heavy {
  animation: treeShakeHeavy 0.1s ease-in-out infinite;
}

@keyframes treeShakeLight {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-1deg); }
  75% { transform: translateX(-50%) rotate(1deg); }
}
@keyframes treeShakeMedium {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-2deg); }
  75% { transform: translateX(-50%) rotate(2deg); }
}
@keyframes treeShakeHeavy {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-3deg); }
  75% { transform: translateX(-50%) rotate(3deg); }
}

.CGS_tree_cont {
  position: relative;
  height: 100%;
}
.CGS_tree_cont img {
  height: 100%;
  object-fit: contain;
}

/* Tree overlay (leaves over cherries) */
.CGS_tree_overlay {
  position: absolute;
  left: 50%;
  top: 0;
  height: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 10;
}
.CGS_tree_overlay img {
  height: 100%;
  object-fit: contain;
}

/* ========== Falling Cherries ========== */
.CGS_cherries_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.CGS_cherry {
  position: absolute;
  width: 50px;
  height: 50px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.CGS_cherry img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.CGS_cherry.caught {
  opacity: 0;
  transform: scale(0.5) !important;
}

/* ========== DEV HITBOXES ========== */
.CGS_dev_hitbox .CGS_cherry {
  outline: 2px solid rgba(0, 255, 255, 0.9);
  outline-offset: -2px;
}

.CGS_dev_spawnArea {
  position: absolute;
  border: 3px dashed rgba(0, 255, 0, 0.9);
  background: rgba(0, 255, 0, 0.08);
  pointer-events: none;
  z-index: 6;
}

.CGS_dev_basketHitbox {
  position: absolute;
  transform: translateX(-50%);
  border: 3px solid rgba(255, 0, 0, 0.9);
  background: rgba(255, 0, 0, 0.08);
  pointer-events: none;
  z-index: 1116;
}

/* ========== Basket Group ========== */
.CGS_basket_group {
  position: absolute;
  left: 960px;
  top: 900px;
  width: 300px;
  height: 200px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

/* Basket jiggle animation */
.CGS_basket_group.jiggle {
  animation: basketJiggle 0.3s ease;
}
@keyframes basketJiggle {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-3deg); }
  75% { transform: translateX(-50%) rotate(3deg); }
}

.CGS_basket_cont {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.CGS_basket_cont img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.CGS_basket_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
}
.CGS_basket_overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Basket jiggle animation */
.CGS_basket_cont.jiggle {
  animation: basketJiggle 0.3s ease;
}
@keyframes basketJiggle {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-3deg); }
  75% { transform: translateX(-50%) rotate(3deg); }
}

/* ========== Shake Meter ========== */
.CGS_shakeMeter {
  position: absolute;
  left: 50%;
  top: 120px;
  transform: translateX(-50%);
  width: 400px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s ease;
}
.CGS_shakeMeter.visible {
  opacity: 1;
}

.CGS_shakeMeter_fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #4ade80, #fbbf24, #ef4444);
  transition: width 0.05s linear;
}

.CGS_shakeMeter_zones {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  pointer-events: none;
}

.CGS_shakeMeter_zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}
.CGS_shakeMeter_zone:last-child {
  border-right: none;
}
.CGS_shakeMeter_zone.light {
  background: rgba(74, 222, 128, 0.1);
}
.CGS_shakeMeter_zone.medium {
  background: rgba(251, 191, 36, 0.1);
}
.CGS_shakeMeter_zone.heavy {
  background: rgba(239, 68, 68, 0.1);
}

/* ========== UI Elements ========== */
.CGS_ui_topLeft {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 4;
  pointer-events: none;
}

.CGS_ui_topCenter {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.CGS_ui_topRight {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 4;
  pointer-events: none;
}

.CGS_ui_stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.CGS_ui_timer {
  display: flex;
  align-items: baseline;
  gap: 5px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 30px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.CGS_ui_label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: normal;
}

.CGS_ui_value {
  font-size: 22px;
  color: #ffffff;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  min-width: 32px;
  text-align: right;
}

.CGS_legend_panel {
  min-width: 260px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(29, 18, 18, 0.9), rgba(14, 9, 9, 0.82));
  border: 2px solid rgba(255, 230, 230, 0.28);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.CGS_legend_title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe5e5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.CGS_legend_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.CGS_legend_row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.CGS_legend_icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.CGS_legend_name {
  font-size: 15px;
  font-weight: 600;
  color: #fff5f5;
}

.CGS_legend_points {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  color: #fff;
}

.CGS_legend_points.is-positive {
  color: #86efac;
}

.CGS_legend_points.is-neutral {
  color: #fde68a;
}

.CGS_legend_points.is-negative {
  color: #fca5a5;
}

/* ========== Idle Screen ========== */
.CGS_idle_cont {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
}

.CGS_idle_title {
  font-size: 72px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
  margin-bottom: 20px;
  text-align: center;
}

.CGS_idle_startBtn {
  font-size: 36px;
  font-weight: bold;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #dc2626);
  padding: 20px 60px;
  border: 4px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.CGS_idle_startBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}
.CGS_idle_startBtn:active {
  transform: scale(0.98);
}

/* ========== Results Screen ========== */
.CGS_results_cont {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.CGS_results_box {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(50, 50, 50, 0.95));
  border: 4px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 60px 80px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
  text-align: center;
  min-width: 600px;
}

.CGS_results_title {
  font-size: 64px;
  font-weight: bold;
  color: #fbbf24;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 1);
  margin-bottom: 40px;
}

.CGS_results_stats {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 40px;
}

.CGS_results_stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.CGS_results_label {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: normal;
  text-align: left;
}

.CGS_results_value {
  font-size: 48px;
  color: #ffffff;
  font-weight: bold;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  min-width: 100px;
  text-align: right;
}

.CGS_results_hint {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 20px;
}

/* ========== Utility Classes ========== */
.displayNone {
  display: none !important;
}

/* ========== Cherry icon in HUD ========== */
.CGS_ui_cherry_icon {
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ========== Results – cherry rewards section ========== */
.CGS_results_cherry_title {
  font-size: 32px;
  font-weight: bold;
  color: #e11d48;
  text-shadow: 0 2px 8px rgba(225, 29, 72, 0.5);
  margin-top: 20px;
  text-align: center;
  letter-spacing: 2px;
}

.CGS_results_cherry_cont {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.CGS_results_cherry_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(225, 29, 72, 0.4);
  border-radius: 10px;
  min-width: 120px;
}

.CGS_results_cherry_item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.CGS_results_cherry_count {
  color: #fda4af;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 0 2px 6px rgba(253, 164, 175, 0.7);
}
