/*
* Allgemeine styles
*/
html,
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}
body {
  background-image: url("/public/backgroundimage.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
.reset-game {
  padding: 4px 15px;
  background-color: #78e08f;
  border: 2px solid #38673c;
  border-radius: 8px;
  font-weight: bold;
  font-family: sans-serif;
  cursor: pointer;
}
/*
* Ende Allgemeine styles
*/

/*
* Überschrift bzw. Game-Title
*/
h1 {
  font-family: sans-serif;
}
.game-title {
  font-family:
    "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #2d5a27;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;

  animation: highlight 2s infinite;
}
.title-wrapper {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  margin: 0;
  padding: 10px 20px;
  display: inline-flex;
  background-color: #fbf5eb;
  border: 3px solid #2d5a27;
  border-radius: 8px;
  box-shadow: 4px 4px 0px #2d5a27;
  z-index: 100;
}
@keyframes highlight {
  0% {
    scale: 1;
  }
  50% {
    scale: 1.1;
  }
  100% {
    scale: 1;
  }
}
/*
* Ende Überschrift bzw. Game-Title
*/

/*
* Game-View und slots
*/
.center-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
}
.game-view {
  width: 100%;
  height: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.farm-grid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 15px;
  margin-bottom: 20px;

  background-color: #6d4c41;
  padding: 20px;
  border-radius: 20px;
  justify-content: center;
}
.active-slot {
  width: 100px;
  height: 100px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #8b5a2b;
  border: 4px solid #5c3a21;
  border-radius: 12px;

  color: #fff;
  font-family: sans-serif;
  font-weight: bold;

  cursor: pointer;
  transition:
    transform 0.1s,
    filter 0.2s;
}
.active-slot:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
}
.active-slot:active {
  transform: scale(0.95);
}
.active-slot.corn {
  background-color: #d4a373;
  border-color: #ffd700;
  box-shadow:
    0px 0px 15px #ffd700,
    inset 0px 0px 10px rgba(0, 0, 0, 0.3);
  color: transparent;
  text-shadow: none;
}
.active-slot.wheat {
  background-color: #d4a373;
  border-color: #ffd700;
  box-shadow:
    0px 0px 15px #ffd700,
    inset 0px 0px 10px rgba(0, 0, 0, 0.3);
  color: transparent;
  text-shadow: none;
}
.active-slot.rape {
  background-color: #d4a373;
  border-color: #ffd700;
  box-shadow:
    0px 0px 15px #ffd700,
    inset 0px 0px 10px rgba(0, 0, 0, 0.3);
  color: transparent;
  text-shadow: none;
}
.active-slot.oats {
  background-color: #d4a373;
  border-color: #ffd700;
  box-shadow:
    0px 0px 15px #ffd700,
    inset 0px 0px 10px rgba(0, 0, 0, 0.3);
  color: transparent;
  text-shadow: none;
}
.active-slot.corn::after,
.active-slot.wheat::after,
.active-slot.rape::after,
.active-slot.oats::after {
  content: "";
  display: block;
  width: 65px;
  height: 65px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;

  border-radius: 50%;
  border: 3px solid #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);

  animation: pulse 1.5s infinite alternate;
}
.active-slot.corn::after {
  background-image: url("/public/corn.jpeg");
}
.active-slot.wheat::after {
  background-image: url("/public/wheat.avif");
}
.active-slot.rape::after {
  background-image: url("/public/rape.jpg");
}
.active-slot.oats::after {
  background-image: url("/public/oats.jpg");
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.3);
  }
}
.locked-slot {
  width: 100px;
  height: 100px;
  margin: 0;

  background-color: #3e2723;
  border: 4px solid #1b0000;
  border-radius: 12px;

  color: #fff;
  font-family: sans-serif;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: center;
}
/*
* Ende Game-view und slots
*/

/*
* Menü, Anzeige von Coins Level und Seed-Ständen
*/
.menu-wrapper {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);

  width: 60%;

  padding: 5px 25px;
  display: flex;
  justify-content: center;
  align-items: center;

  background-color: #f4ebd0;
  border: 4px solid #b87d4b;
  border-radius: 15px;

  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
.menu {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 90%;
  justify-content: center;
}
/*
* Ende Menü, Anzeige von Coins Level und Seed-Ständen
*/

/*
* Design von Coins und Seeds
*/
.stares {
  width: 24px;
  height: 24px;
  border: 2px solid #b87d4b;
  border-radius: 50%;
  margin: 0;
}
.stares-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #b87d4b;
  border-radius: 8px;
  margin: 0;
  padding: 2px 10px;
}
.stares-value {
  padding: 2px 30px;
  font-size: 16px;
  margin: 0;
}
/*
* Ende Design von Coins und Seeds
*/

/* KI generriertes Level-Badge, das den aktuellen Level anzeigt */
/*
/*
/*
/* Die äußere Plakette (Das Schild) */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Knalliger Spiele-Verlauf von hellem Grün zu saftigem Grasgrün */
  background: linear-gradient(135deg, #a8ff78, #78e08f);

  /* Eine fette, dunkelgrüne Spiele-Border */
  border: 3px solid #38673c;
  border-radius: 12px;

  /* Innenabstand: oben/unten schmaler, links/rechts breiter */
  padding: 4px 18px;

  /* Ein fetter 3D-Schatten nach unten, der das Schild plastisch wirken lässt */
  box-shadow:
    0px 4px 0px #274e2a,
    0px 6px 10px rgba(0, 0, 0, 0.3);

  /* Leicht schräg stellen für den typischen Comic/Gaming-Look */
  transform: rotate(-2deg);

  /* Verhindert, dass man den Text aus Versehen markiert */
  user-select: none;

  /* Eine sanfte Animation beim Drüberfahren (Hover) */
  transition: transform 0.1s ease;
}

/* Wenn man mit der Maus drüberfährt, wackelt es cool */
.level-badge:hover {
  transform: rotate(2deg) scale(1.05);
}

/* Der Text im Inneren */
.level-text {
  margin: 0; /* Entfernt den Standard-Abstand von h3 */
  font-family: "Arial Black", "Impact", sans-serif; /* Schön fette Schriftart */
  font-size: 1.1rem;
  text-transform: uppercase; /* Macht ALLES IN GROSSBUCHSTABEN */
  color: #1e3f20; /* Sehr dunkles Grün für perfekten Kontrast */

  /* Ein feiner, heller Textschatten, der den Text "ausstanzt" */
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
  letter-spacing: 1px; /* Leicht gezogene Buchstaben */
}
/*
/*
/*
/* KI generriertes Level-Badge, das den aktuellen Level anzeigt */

/*
* Level-Up Info
*/
.level-up {
  position: absolute;
  top: 10%;
  right: 30%;
  display: none;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  z-index: 100;
}

#level-button:hover + .level-up,
.level-up:hover {
  display: block;
}
/*
* Ende Level-Up Info
*/

/*
* Seed-Cards
*/
.seeds-container {
  position: absolute;
  bottom: 30px;
  left: 30px;
  display: flex;
  gap: 15px;
  z-index: 100;
}
.seed-card {
  position: relative;
  background-color: #f4ebd0;
  border: 3px solid #b87d4b;
  border-radius: 12px;
  padding: 10px 15px;
  width: 90px;
  text-align: center;
  cursor: pointer;
  box-shadow:
    0px 6px 0px #b87d4b,
    0px 8px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease;
  user-select: none;
}
.seed-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0px 10px 0px #b87d4b,
    0px 12px 20px rgba(0, 0, 0, 0.2);
}
.seed-card.active {
  background-color: #e2f0d9;
  border-color: #78e08f;
  transform: translateY(4px);
  box-shadow:
    0px 2px 0px #78e08f,
    0px 4px 10px rgba(0, 0, 0, 0.1);
}
.seed-icon {
  border: 2px solid #b87d4b;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.seed-name {
  font-weight: bold;
  color: #5c3d24;
  font-size: 0.9rem;
  font-family: sans-serif;
}
.seed-card:hover .info-card {
  display: block;
}
/*
* Ende Seed-Cards
*/

/*
* Shop Design
*/
.shop-wrapper {
  position: absolute;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);

  width: 160px;
  padding: 15px;

  background-color: #f4ebd0;
  border: 3px solid #b87d4b;
  border-radius: 12px;
  z-index: 100;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.shop-header {
  padding: 0;
  margin: 0;
  font-family: sans-serif;
  color: #5c3d24;
}

.shop-crops {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.shop-crops select,
.shop-crops input {
  width: 100%;
  padding: 5px;
  border: 2px solid #b87d4b;
  border-radius: 8px;
  background-color: #fbf5eb;
  font-family: sans-serif;
  font-size: 0.85rem;
}

.shop-crops h4 {
  margin: 0;
  font-family: sans-serif;
  color: #5c3d24;
  font-size: 0.85rem;
}

.shop-sellButton {
  width: 100%;
  padding: 8px;
  background-color: #78e08f;
  border: 2px solid #38673c;
  border-radius: 8px;
  font-weight: bold;
  font-family: sans-serif;
  cursor: pointer;
  transition: filter 0.1s;
}

.shop-sellButton:hover {
  filter: brightness(1.1);
}

.buyfield-wrapper {
  position: absolute;
  left: 3%;
  top: 50%;
  transform: translateY(-50%);

  width: 160px;
  padding: 15px;

  background-color: #f4ebd0;
  border: 3px solid #b87d4b;
  border-radius: 12px;
  z-index: 100;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.buyfield-header {
  padding: 0;
  margin: 0;
  font-family: sans-serif;
  color: #5c3d24;
}

.buy-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.buy-field h4 {
  margin: 0;
  font-family: sans-serif;
  color: #5c3d24;
  font-size: 0.85rem;
}
/*
* Ende Shop Design
*/

/*
* Info Cards Design
*/
.info-card {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  background-color: #f4ebd0;
  border: 3px solid #b87d4b;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  box-shadow:
    0px 6px 0px #b87d4b,
    0px 8px 15px rgba(0, 0, 0, 0.2);
  z-index: 200;
  display: none;
}

.info-card-img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #b87d4b;
  object-fit: cover;
}

.info-card-title {
  margin: 5px 0;
  font-size: 0.85rem;
  color: #5c3d24;
  font-family: sans-serif;
  font-weight: bold;
}

.info-card-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  font-family: sans-serif;
  color: #5c3d24;
  text-align: left;
}
/*
* Info Cards Design
*/

/* KI generiertes Design */
/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1450px) {
  .menu-wrapper {
    width: 90%;
    top: 10px;
    padding: 5px 10px;
  }

  .menu {
    gap: 6px;
    flex-wrap: wrap;
  }

  .stares-wrapper {
    gap: 4px;
    padding: 2px 6px;
  }

  .stares-value {
    padding: 2px 8px;
    font-size: 13px;
  }

  .shop-wrapper {
    width: 130px;
    right: 1%;
    font-size: 0.85rem;
  }

  .buyfield-wrapper {
    width: 130px;
    left: 1%;
    font-size: 0.85rem;
  }
}

@media (max-width: 900px) {
  .farm-grid {
    grid-template-columns: repeat(3, 75px);
    gap: 10px;
    padding: 12px;
  }

  .active-slot,
  .locked-slot {
    width: 75px;
    height: 75px;
    font-size: 0.7rem;
  }

  .active-slot.corn::after,
  .active-slot.wheat::after,
  .active-slot.rape::after,
  .active-slot.oats::after {
    width: 48px;
    height: 48px;
  }

  /* Seed Cards zentriert unten */
  .seeds-container {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    gap: 8px;
  }

  .seed-card {
    width: 70px;
    padding: 6px 8px;
  }

  .seed-icon {
    width: 30px;
    height: 30px;
  }

  .seed-name {
    font-size: 0.75rem;
  }

  .title-wrapper {
    display: none;
  }

  /* Shop und BuyField nach unten, über Seed Cards */
  .shop-wrapper {
    top: auto;
    bottom: 110px;
    right: 10px;
    transform: none;
    width: 120px;
    padding: 10px;
  }

  .buyfield-wrapper {
    top: auto;
    bottom: 110px;
    left: 10px;
    transform: none;
    width: 120px;
    padding: 10px;
  }
}

@media (max-height: 700px) {
  .farm-grid {
    grid-template-columns: repeat(3, 65px);
    gap: 8px;
    padding: 10px;
  }

  .active-slot,
  .locked-slot {
    width: 65px;
    height: 65px;
    font-size: 0.65rem;
  }

  .active-slot.corn::after,
  .active-slot.wheat::after,
  .active-slot.rape::after,
  .active-slot.oats::after {
    width: 42px;
    height: 42px;
  }

  .menu-wrapper {
    top: 5px;
    padding: 3px 8px;
  }

  .seeds-container {
    bottom: 8px;
  }

  .seed-card {
    width: 65px;
    padding: 4px 6px;
  }

  .shop-wrapper {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    right: 2%;
    width: 125px;
    max-height: 80vh;
    overflow-y: auto;
  }

  .buyfield-wrapper {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    left: 2%;
    width: 125px;
  }
}

@media (max-height: 500px) {
  .farm-grid {
    grid-template-columns: repeat(3, 50px);
    gap: 6px;
    padding: 8px;
  }

  .active-slot,
  .locked-slot {
    width: 50px;
    height: 50px;
    font-size: 0.55rem;
  }

  .active-slot.corn::after,
  .active-slot.wheat::after,
  .active-slot.rape::after,
  .active-slot.oats::after {
    width: 32px;
    height: 32px;
  }

  .seed-card {
    width: 55px;
  }

  .seed-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .farm-grid {
    grid-template-columns: repeat(3, 60px);
    gap: 8px;
    padding: 10px;
  }

  .active-slot,
  .locked-slot {
    width: 60px;
    height: 60px;
    font-size: 0.6rem;
  }

  .active-slot.corn::after,
  .active-slot.wheat::after,
  .active-slot.rape::after,
  .active-slot.oats::after {
    width: 38px;
    height: 38px;
  }

  .menu-wrapper {
    width: 98%;
    top: 5px;
  }

  .stares {
    width: 18px;
    height: 18px;
  }

  .stares-value {
    font-size: 11px;
    padding: 2px 4px;
  }

  .seeds-container {
    gap: 5px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
  }

  .seed-card {
    width: 58px;
    padding: 5px 6px;
  }

  .shop-wrapper {
    top: auto;
    bottom: 100px;
    right: 5px;
    transform: none;
    width: 110px;
  }

  .buyfield-wrapper {
    top: auto;
    bottom: 100px;
    left: 5px;
    transform: none;
    width: 110px;
  }
}
