/* --- RESET & GLOBAL STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background-color: #7ec850;
  background-image: radial-gradient(#5ca033 15%, transparent 16%);
  background-size: 24px 24px;
  color: #3e2723;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- TOP HEADER (HUD) --- */
.hud {
  background-color: #8d5b28;
  color: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid #5d3a1a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hud-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffc107;
  text-shadow: 1px 1px 2px #000000;
}

.hud-stats {
  display: flex;
  gap: 12px;
}

.stat-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
}

/* --- RESPONSIVE CONTAINER (DESKTOP & MOBILE) --- */
.game-container {
  max-width: 1150px;
  margin: 20px auto;
  padding: 0 15px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  align-items: flex-start;
}

.left-col {
  flex: 2;
  min-width: 0; /* Prevents PC desktop overflow */
}

.right-col {
  flex: 1;
  min-width: 300px;
}

/* Mobile Layout Override */
@media (max-width: 800px) {
  .game-container {
    flex-direction: column;
  }
  .left-col, .right-col {
    width: 100%;
    min-width: 100%;
  }
}

/* --- PANELS & CARDS --- */
.panel {
  background-color: #fff8e7;
  border: 4px solid #8d5b28;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 6px 0px #8d5b28, 0 8px 15px rgba(0, 0, 0, 0.15);
  width: 100%;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 12px;
  border-bottom: 2px dashed #8d5b28;
  padding-bottom: 6px;
  color: #8d5b28;
}

/* --- FARM FIELD PLOTS --- */
.grid-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.plot {
  height: 110px;
  background-color: #8b5a2b;
  border: 4px solid #a66e38;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: transform 0.1s ease-in-out;
}

.plot:hover {
  transform: scale(1.03);
}

.plot .crop-icon {
  font-size: 2.2rem;
}

.plot .timer {
  font-size: 0.75rem;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 8px;
  margin-top: 4px;
}

/* --- CROP SELECTOR BUTTONS --- */
.seed-selector {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.seed-btn {
  flex: 1;
  background-color: #ffffff;
  border: 3px solid #8d5b28;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  color: #3e2723;
  transition: all 0.1s ease-in-out;
}

.seed-btn.active {
  background-color: #ffc107;
  border-color: #d39e00;
  transform: translateY(-2px);
}

/* --- BAKERY & ORDERS --- */
.bakery-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card {
  background-color: #ffffff;
  border: 2px solid #8d5b28;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-reqs {
  font-size: 0.9rem;
  font-weight: bold;
}

.barn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.barn-item {
  background-color: #ffffff;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #8d5b28;
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}

/* --- BUTTONS --- */
.btn {
  background-color: #5ca033;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 #3a681f;
}

.btn:disabled {
  background-color: #a0a0a0;
  box-shadow: 0 3px 0 #707070;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  filter: brightness(1.1);
}

.btn-danger {
  background-color: #e53935;
  box-shadow: 0 3px 0 #992220;
}