/* ========== Slice of Life - Fruit Slicing Minigame Styles ========== */
#LGS_app_limeGame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;

  --knife_height: 442px;
}

#LGS_app_limeGame.playing {
  cursor: none;
}

/* Background - extended and centered by height */
.LGS_background {
  position: absolute;
  pointer-events: none;
  height: 100%;
  z-index: 0;
}
.LGS_background img {
  position: absolute;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* Main container for positioned elements (1920x1080 reference) */
.LGS_mainCont {
  position: absolute;
  pointer-events: none;
  height: 1080px;
  width: 1920px;
  z-index: 1;
}

/* ========== Basket ========== */
.LGS_basket_cont {
  position: absolute;
  right: -698px;
  top: 43px;
  height: calc(2030px / 2);
  pointer-events: none;
  z-index: 5;
}
.LGS_basket_cont img {
  height: 100%;
}

/* ========== Knife Standby (idle position) ========== */
.LGS_knife_standby {
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%);
  height: 560px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}
.LGS_knife_standby img {
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}
#LGS_app_limeGame.playing .LGS_knife_standby {
  opacity: 0;
}

/* ========== Knife Cursor ========== */
.LGS_knife_cont {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  width: 160px;
  transform: translate(-50%, calc(-0.5 * var(--knife_height) - 120px));
  display: none;
}
.LGS_knife_cont img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.6));
  opacity: 0.7;
  transform: translateX(50px) translateY(50px);

  transition: transform 0.05s ease;
}
.LGS_knife_cont.slicing img{
  opacity: 1;
  transform: translateX(0) translateY(0);
}
#LGS_app_limeGame.playing .LGS_knife_cont {
  display: flex;
}

/* ========== Slice Preview Line ========== */
.LGS_slicePreview_line {
  position: absolute;
  pointer-events: none;
  z-index: 199;
  width: 2px;
  height: var(--knife_height);
  top: 0;
  transform: translate(-50%, calc(-0.5 * var(--knife_height)));
  /* background-color: white; */
  background: linear-gradient(transparent, white 30%, white 70%, transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  display: none;
}
#LGS_app_limeGame.playing .LGS_slicePreview_line {
  display: block;
}

/* ========== Fruits Container ========== */
.LGS_fruits_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Individual fruit */
.LGS_fruit {
  position: absolute;
  pointer-events: all;
  cursor: none;
  transform-origin: center center;
  transition: opacity 0.2s ease;
}
.LGS_fruit video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Fruit states */
.LGS_fruit.rolling video {
  /* Video plays rolling animation */
}
.LGS_fruit.fadingOut {
  animation: fruitFadeOut 0.8s ease-out forwards;
}
.LGS_fruit.sliced {
  pointer-events: none;
}
.LGS_fruit.sliced video {
  /* Keep video visible but paused to show the fruit standing still */
}
.LGS_fruit.fading {
  opacity: 0;
}

@keyframes fruitFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* DEV: Zone hitbox visualization */
.LGS_fruit_zones_debug {
  position: absolute;
  top: 0;
  left: 0;
  /* Width and left offset set dynamically in JS based on actual fruit size */
  height: 100%;
  display: flex;
  pointer-events: none;
  opacity: 0.0;
}
.LGS_zone_debug {
  height: 100%;
}
.LGS_zone_debug.yellow.left {
  width: 30%;
  background: yellow;
}
.LGS_zone_debug.green {
  width: 40%;
  background: lime;
}
.LGS_zone_debug.yellow.right {
  width: 30%;
  background: yellow;
}

/* Slice indicator - vertical line showing where the cut was made */
.LGS_slice_indicator {
  position: absolute;
  left: 0;
  top: -10%;
  width: 6px;
  height: 120%;
  border-radius: 3px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  animation: sliceIndicatorPop 0.3s ease-out forwards;
}
.LGS_slice_indicator.perfect {
  background: linear-gradient(180deg, transparent, #00FF00, #90EE90, #00FF00, transparent);
  box-shadow: 0 0 15px #00FF00, 0 0 30px rgba(0, 255, 0, 0.5);
}
.LGS_slice_indicator.ok {
  background: linear-gradient(180deg, transparent, #FFD700, #FFA500, #FFD700, transparent);
  box-shadow: 0 0 10px #FFD700, 0 0 20px rgba(255, 215, 0, 0.4);
}

@keyframes sliceIndicatorPop {
  0% {
    transform: translateX(-50%) scaleY(0.3);
    opacity: 0;
  }
  30% {
    transform: translateX(-50%) scaleY(1.1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
  }
}

/* Slice zones indicator (appears when clicked) */
.LGS_fruit_zones {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  display: none;
}
.LGS_fruit.showZones .LGS_fruit_zones {
  display: block;
}
.LGS_fruit_zone {
  position: absolute;
  left: 0;
  width: 100%;
  opacity: 0.3;
}
.LGS_fruit_zone.green {
  top: 30%;
  height: 40%;
  background: lime;
}
.LGS_fruit_zone.yellow.top {
  top: 0;
  height: 30%;
  background: yellow;
}
.LGS_fruit_zone.yellow.bottom {
  bottom: 0;
  height: 30%;
  background: yellow;
}

/* ========== Particles ========== */
.LGS_particles_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.LGS_particle {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFly 0.6s ease-out forwards;
}
.LGS_particle.lemon { background: #FFE135; box-shadow: 0 0 8px #FFE135; }
.LGS_particle.lime { background: #32CD32; box-shadow: 0 0 8px #32CD32; }
.LGS_particle.orange { background: #FFA500; box-shadow: 0 0 8px #FFA500; }
.LGS_particle.rotten { background: #6B4423; box-shadow: 0 0 8px #6B4423; }

@keyframes particleFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.3);
    opacity: 0;
  }
}

/* Slash effect */
.LGS_slash {
  position: absolute;
  width: 200px;
  height: 8px;
  background: linear-gradient(90deg, transparent, white, transparent);
  border-radius: 4px;
  pointer-events: none;
  transform-origin: center center;
  animation: slashFade 0.2s ease-out forwards;
  box-shadow: 0 0 20px white, 0 0 40px rgba(255,255,255,0.5);
}

@keyframes slashFade {
  0% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1.5); }
}

/* ========== Floating Text ========== */
.LGS_floatingText_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

.LGS_floatingText {
  position: absolute;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  white-space: nowrap;
}
.LGS_floatingText.positive { color: #90EE90; }
.LGS_floatingText.negative { color: #FF6B6B; }
.LGS_floatingText.perfect {
  color: #FFD700;
  font-size: 56px;
  text-shadow: 0 0 20px #FFD700, 0 2px 8px rgba(0,0,0,0.8);
}
.LGS_floatingText.miss { color: #888; font-size: 36px; }

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}

/* ========== Screen Effects ========== */
.LGS_screenEffect_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* Vignette for combo effects */
.LGS_screenEffect_vignette {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: inset 0 0 150px 50px rgba(255, 140, 0, 0.4);
}
.LGS_screenEffect_vignette.active {
  opacity: 1;
}
.LGS_screenEffect_vignette.intense {
  box-shadow: inset 0 0 200px 80px rgba(255, 100, 0, 0.6);
  animation: vignetteIntensePulse 0.5s ease-in-out infinite;
}

@keyframes vignetteIntensePulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Red flash for rotten fruit */
.LGS_screenEffect_flash {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
}
.LGS_screenEffect_flash.active {
  animation: redFlash 0.3s ease-out forwards;
}

@keyframes redFlash {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* Screen shake */
.LGS_mainCont.shake {
  animation: screenShake 0.1s ease-in-out;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 3px); }
}

/* ========== UI Elements ========== */
.LGS_ui_topLeft,
.LGS_ui_topRight {
  position: absolute;
  top: 30px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#LGS_app_limeGame.playing .LGS_ui_topLeft,
#LGS_app_limeGame.playing .LGS_ui_topRight,
#LGS_app_limeGame.results .LGS_ui_topLeft,
#LGS_app_limeGame.results .LGS_ui_topRight {
  opacity: 1;
}

.LGS_ui_topLeft {
  left: 40px;
}
.LGS_ui_topRight {
  right: 40px;
  align-items: flex-end;
}

.LGS_ui_score,
.LGS_ui_timer,
.LGS_ui_combo {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 15px 25px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.LGS_ui_label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  font-weight: 500;
}

.LGS_ui_value {
  color: white;
  font-size: 42px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.LGS_ui_timer {
  background: rgba(50, 0, 0, 0.8);
  border-color: rgba(255, 100, 100, 0.5);
}
.LGS_ui_timer .LGS_ui_value {
  color: #FF6B6B;
  font-size: 56px;
}
.LGS_ui_timer.warning .LGS_ui_value {
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); color: #FF4444; }
}

.LGS_ui_combo {
  transition: all 0.2s ease;
}
.LGS_ui_combo.glowing {
  border-color: rgba(255, 200, 100, 0.8);
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.5);
  animation: comboGlow 0.3s ease-in-out infinite alternate;
}

@keyframes comboGlow {
  0% { box-shadow: 0 0 15px rgba(255, 140, 0, 0.4); }
  100% { box-shadow: 0 0 30px rgba(255, 140, 0, 0.7); }
}

.LGS_ui_multiplier {
  color: #FFD700;
  font-size: 28px;
  font-weight: bold;
  margin-left: 5px;
}

/* ========== Citrus Counter Boxes ========== */
.LGS_ui_citrus_cont {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.LGS_ui_citrus_box {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 70px;
  transition: all 0.2s ease;
}

.LGS_ui_citrus_box:hover {
  border-color: rgba(255, 200, 100, 0.6);
  box-shadow: 0 0 10px rgba(255, 200, 100, 0.3);
}

.LGS_ui_citrus_box img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.LGS_ui_citrus_count {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ========== Center Text (combo milestones, YUCK!) ========== */
.LGS_centerText_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 70;
}

.LGS_centerText {
  font-size: 96px;
  font-weight: bold;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.5);
  transition: none;
}
.LGS_centerText.show {
  animation: centerTextPop 1s ease-out forwards;
}
.LGS_centerText.nice { color: #90EE90; }
.LGS_centerText.onfire { color: #FFA500; }
.LGS_centerText.amazing { color: #FFD700; text-shadow: 0 0 30px #FFD700, 0 4px 20px rgba(0,0,0,0.8); }
.LGS_centerText.yuck { color: #FF4444; font-size: 120px; }
.LGS_centerText.citrusReward { color: #32CD32; text-shadow: 0 0 25px #32CD32, 0 4px 20px rgba(0,0,0,0.8); }

@keyframes centerTextPop {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1.2); }
  40% { transform: scale(1); }
  100% { opacity: 0; transform: scale(1) translateY(-30px); }
}

/* ========== Idle State ========== */
.LGS_idle_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  pointer-events: all;
  z-index: 5;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
  transition: opacity 0.3s ease;
}
#LGS_app_limeGame.playing .LGS_idle_cont,
#LGS_app_limeGame.results .LGS_idle_cont {
  opacity: 0;
  pointer-events: none;
}

.LGS_idle_title {
  font-size: 96px;
  font-weight: bold;
  color: #90EE90;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 40px rgba(50, 205, 50, 0.5);
  letter-spacing: 8px;
}

.LGS_idle_startBtn {
  font-size: 36px;
  font-weight: bold;
  color: white;
  background: linear-gradient(180deg, #5cb85c 0%, #4cae4c 50%, #449d44 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 20px 80px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}
.LGS_idle_startBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  background: linear-gradient(180deg, #6ccf6c 0%, #5cb85c 50%, #4cae4c 100%);
}
.LGS_idle_startBtn:active {
  transform: scale(0.98);
}

/* ========== Results Screen ========== */
.LGS_results_cont {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: all;
  z-index: 95;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.5s ease;
}
#LGS_app_limeGame.results .LGS_results_cont {
  opacity: 1;
}
.LGS_results_cont.displayNone {
  display: none !important;
}

.LGS_results_box {
  background: rgba(30, 30, 30, 0.95);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 50px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.8);
  animation: resultsSlideIn 0.5s ease-out;
}

@keyframes resultsSlideIn {
  0% { transform: translateY(-50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.LGS_results_title {
  font-size: 72px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
  letter-spacing: 4px;
}

.LGS_results_stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.LGS_results_stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 40px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.LGS_results_label {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.7);
}

.LGS_results_value {
  font-size: 42px;
  font-weight: bold;
  color: #90EE90;
}

.LGS_results_citrus_title {
  font-size: 32px;
  font-weight: bold;
  color: #FFA500;
  text-shadow: 0 2px 8px rgba(255, 165, 0, 0.5);
  margin-top: 20px;
  text-align: center;
  letter-spacing: 2px;
}

.LGS_results_citrus_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;
}

.LGS_results_citrus_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 200, 100, 0.3);
  border-radius: 10px;
  min-width: 80px;
}

.LGS_results_citrus_item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.LGS_results_citrus_count {
  color: #FFD700;
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 6px rgba(255, 215, 0, 0.6);
}

.LGS_results_hint {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 20px;
  animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
