@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap");

* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #e0f7fa;
  background-image: linear-gradient(135deg, #81d4fa 0%, #b3e5fc 100%);
  margin: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

.side-panel {
  position: fixed;
  top: 0;
  width: 250px;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 10;
}

.left-panel {
  left: 0;
}

.right-panel {
  right: 0;
}

@media (min-width: 992px) {
  .main-container {
    max-width: calc(100% - 500px);
    margin: 0 auto;
  }

  .side-panel .score-display {
    width: 100%;
    margin: 20px 0;
  }

  .side-panel .button-container {
    flex-direction: column;
  }

  .side-panel .button-container button {
    max-width: 100%;
    margin-bottom: 15px;
  }

  .side-panel .feedback {
    width: 100%;
    margin: 20px 0;
  }
}

.side-panel .score-display,
.side-panel .button-container,
.side-panel .feedback {
  position: relative;
  opacity: 1;
  display: block;
}

.side-panel .feedback.visible {
  display: block;
  opacity: 1;
}

.main-container {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
  width: 100%;
}

h1 {
  color: #006064;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 2.5rem;
  margin-bottom: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 15px 25px;
  border-radius: 50px;
  display: inline-block;
  animation: bounceIn 1s;
}

.game-instructions {
  background-color: #fff;
  border-radius: 20px;
  padding: 15px;
  margin-bottom: 20px;
  max-width: 900px;
  width: 95%;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  font-size: 1.2rem;
  transition: all 0.3s;
  animation: fadeIn 1s;
  position: relative;
  overflow: hidden;
  border: 3px solid #4db6ac;
}

.game-instructions:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(77, 182, 172, 0.2) 0%,
    rgba(129, 212, 250, 0.2) 100%
  );
  z-index: -1;
}

.market-container {
  position: relative;
  width: 95%;
  max-width: 900px;
  margin-bottom: 30px;
  animation: slideInRight 0.8s;
}

.market-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #795548;
  border-radius: 20px;
  z-index: -1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.shelf {
  height: 20px;
  background-color: #5d4037;
  margin: 0 15px;
  border-radius: 5px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
}

.market-header {
  background-color: #4caf50;
  border-radius: 20px 20px 0 0;
  padding: 10px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.market-shelf {
  width: 100%;
  min-height: 300px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 15px;
  justify-content: center;
  align-items: center;
  padding: 25px 20px;
  position: relative;
  z-index: 1;
}

.food-item {
  width: 90px;
  height: 110px;
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: transform 0.3s, box-shadow 0.3s;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.food-item:hover {
  transform: scale(1.1) translateY(-10px);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.food-item:active {
  transform: scale(0.95);
}

.food-item img {
  width: 90%;
  height: 70%;
  object-fit: contain;
  transition: transform 0.3s;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

.food-item:hover img {
  transform: rotate(-5deg);
}

/* food-item span stili için mevcut kodlar kalabilir */
.food-item span {
  display: block;
  font-size: 14px;
  font-weight: bold;
  margin-top: 5px;
  color: #333;
  width: 100%;
}

.food-item marquee {
  width: 100%;
  font-size: 14px;
  font-weight: bold;
  margin-top: 5px;
  color: #333;
  height: 20px; /* Sabit bir yükseklik belirleyin */
}

.cart-area {
  background: linear-gradient(to bottom, #f5f5f5, #e0e0e0);
  border: 5px solid #546e7a;
  width: 95%;
  max-width: 900px;
  min-height: 220px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  animation: slideInLeft 0.8s;
}

.cart-handle {
  position: absolute;
  top: -15px;
  width: 120px;
  height: 30px;
  background-color: #546e7a;
  border-radius: 15px 15px 0 0;
  left: calc(50% - 60px);
}

.cart-header {
  display: flex;
  width: 100%;
  align-items: center;
  margin-bottom: 15px;
  background-color: #eceff1;
  padding: 10px 15px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cart-title {
  font-size: 20px;
  font-weight: bold;
  flex-grow: 1;
  text-align: center;
  color: #37474f;
}

.cart-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  width: 100%;
  min-height: 130px;
  padding: 15px;
  background-color: white;
  border-radius: 15px;
  overflow-y: auto;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
}

.cart-items .food-item {
  width: 80px;
  height: 100px;
  margin: 0;
}

.feedback {
  border-radius: 20px;
  padding: 20px;
  margin-top: 20px;
  min-height: 100px;
  width: 95%;
  max-width: 900px;
  text-align: center;
  display: none;
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.feedback.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: bounceIn 0.6s;
}

.feedback.positive {
  background-color: #c8e6c9;
  border: 3px solid #4caf50;
  color: #2e7d32;
}

.feedback.negative {
  background-color: #ffcdd2;
  border: 3px solid #f44336;
  color: #c62828;
}

.feedback:before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: inherit;
  filter: blur(10px);
  opacity: 0.7;
  z-index: -1;
}

.feedback-icon {
  font-size: 2rem;
  margin-right: 10px;
  vertical-align: middle;
}

.game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  width: 95%;
  max-width: 900px;
  animation: fadeIn 1s;
}

.score-display {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(to right, #4caf50, #8bc34a);
  padding: 15px 25px;
  border-radius: 50px;
  width: 100%;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.score-display:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  z-index: 1;
}

#score {
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}

.score-change {
  animation: pulse 0.5s;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.reset-button,
.level-button {
  background: linear-gradient(to bottom, #2196f3, #0d47a1);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  flex: 1;
  max-width: 250px;
  position: relative;
  overflow: hidden;
}

.reset-button:hover,
.level-button:hover {
  background: linear-gradient(to bottom, #1976d2, #0a3880);
  transform: translateY(-5px);
  box-shadow: 0 15px 20px rgba(0, 0, 0, 0.2);
}

.reset-button:active,
.level-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.reset-button:after,
.level-button:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  z-index: 1;
}

.level-button {
  background: linear-gradient(to bottom, #ff9800, #e65100);
}

.level-button:hover {
  background: linear-gradient(to bottom, #f57c00, #bf360c);
}

.falling-item {
  position: fixed;
  z-index: 1000;
  width: 50px;
  height: 50px;
  pointer-events: none;
}

.level-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #ff9800;
  color: white;
  padding: 8px 15px;
  border-radius: 50px;
  font-weight: bold;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.confetti {
  position: fixed;
  width: 15px;
  height: 15px;
  background-color: #f0f;
  z-index: 1000;
  opacity: 0.8;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0) rotate(0);
  }

  25% {
    transform: translateX(-10px) rotate(-5deg);
  }

  50% {
    transform: translateX(10px) rotate(5deg);
  }

  75% {
    transform: translateX(-10px) rotate(-5deg);
  }

  100% {
    transform: translateX(0) rotate(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-10px) rotate(5deg);
  }

  100% {
    transform: translateY(0) rotate(0);
  }
}

@keyframes glowBorder {
  0% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }

  100% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
    padding: 10px 20px;
  }

  .game-instructions {
    font-size: 1rem;
    padding: 12px;
  }

  .market-shelf {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    padding: 15px;
    min-height: 250px;
  }

  .food-item {
    width: 70px;
    height: 90px;
  }

  .cart-items {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }

  .cart-items .food-item {
    width: 60px;
    height: 80px;
  }

  .food-item span {
    font-size: 12px;
  }

  .feedback {
    font-size: 1rem;
    padding: 15px;
  }

  .score-display {
    font-size: 20px;
    padding: 12px 20px;
  }

  .button-container {
    flex-direction: column;
    align-items: center;
  }

  .reset-button,
  .level-button {
    width: 100%;
    max-width: 100%;
    padding: 12px 25px;
    font-size: 16px;
    margin-bottom: 10px;
  }
}

.wave-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  overflow: hidden;
  z-index: -1;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%2381d4fa" fill-opacity="0.4" d="M0,192L60,197.3C120,203,240,213,360,202.7C480,192,600,160,720,165.3C840,171,960,213,1080,218.7C1200,224,1320,192,1380,176L1440,160L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z"></path></svg>')
    repeat-x;
  background-size: 1440px 100px;
  animation: wave-animation 15s linear infinite;
}

.wave:nth-child(2) {
  bottom: 10px;
  animation: wave-animation 10s linear reverse infinite;
  opacity: 0.7;
}

.wave:nth-child(3) {
  bottom: 20px;
  animation: wave-animation 20s linear infinite;
  opacity: 0.5;
}

@keyframes wave-animation {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}
