/* Food Production specific styles */
body {
  color: #f7edd7;
}

.container {
  background-color: rgba(32, 23, 17, 0.74);
}

.row {
  row-gap: 10px;
}

.collapse-area {
  position: relative;
  overflow: visible;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.collapse-header {
  position: relative;
  gap: 14px;
  margin: 0;
  padding: 8px 8px 8px 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f3c24a;
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: left;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.38);
}

.collapse-header::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #d79b42;
  transform: translateY(-50%) rotate(45deg);
}

.collapse-header::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  margin-left: 10px;
  background: linear-gradient(90deg, rgba(215, 155, 66, 0.7), rgba(215, 155, 66, 0.08));
}

.header-title {
  flex: 0 0 auto;
}

.collapse,
.calculator {
  padding: 0;
}

.calculator-bonuses-form {
  margin: 0;
  padding: 0;
  border: 1px solid rgba(215, 155, 66, 0.52);
  border-radius: 8px;
  overflow: hidden;
  background: #60412c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 3px 8px rgba(0, 0, 0, 0.28);
}

.calculator-bonuses-form.row,
.calculator-bonuses-form > .row {
  margin: 0;
  row-gap: 0;
}

.calculator-bonuses-form .form-group {
  min-height: 0;
  padding: 7px 10px;
  border-right: 1px solid rgba(215, 155, 66, 0.34);
  border-bottom: 1px solid rgba(215, 155, 66, 0.34);
  background: #60412c;
}

.calculator-bonuses-form .form-group:nth-child(2n) {
  background: #60412c;
}

.calculator-bonuses-form label {
  display: block;
  margin-bottom: 4px;
  color: #e6d1af;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.calculator-bonuses-form .form-group > br {
  display: none;
}

.calculator-bonuses-form .form-control,
.calculator-bonuses-form .form-select {
  height: 34px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(215, 155, 66, 0.72);
  border-radius: 5px;
  background-color: #f0d7ae;
  color: #56391f;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 1px 2px rgba(89, 56, 30, 0.18);
}

.calculator-bonuses-form .form-control:focus,
.calculator-bonuses-form .form-select:focus {
  background-color: #f5dfba;
  color: #4b311b;
  border-color: rgba(243, 194, 74, 0.95);
  box-shadow: 0 0 0 2px rgba(215, 155, 66, 0.25), inset 0 1px 2px rgba(89, 56, 30, 0.16);
}

.result .calculator-bonuses-form {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.result .results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  padding: 0;
  border: 1px solid rgba(215, 155, 66, 0.52);
  border-radius: 8px;
  overflow: hidden;
  background: #60412c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 3px 8px rgba(0, 0, 0, 0.28);
}

.results p {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 10px 12px;
  border-right: 1px solid rgba(215, 155, 66, 0.34);
  color: #e6d1af;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.results p:last-of-type {
  border-right: 0;
}

.results span {
  color: #fff4de;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: none;
}

.results .result-label {
  color: #e6d1af;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.results .result-value {
  display: block;
  margin-top: 0;
  color: #fff4de;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: none;
}

.results hr {
  display: none;
}

#buildings-container {
  background-color: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  row-gap: 6px;
  padding-top: 6px !important;
}

#buildings-container .box {
  background: #60412c;
}

#buildings-container .box-content {
  background: transparent;
}

.building-card-column {
  min-width: 0;
}

.buildings-header {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.warning-icon {
  font-size: 30px;
  margin-right: 20px;
  font-weight: bold;
}

.box {
  display: flex;
  min-width: 0;
  height: calc(100% - 6px);
  align-items: stretch;
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: #f7edd7;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(215, 155, 66, 0.56);
  margin-right: 4px;
  margin-left: 4px;
  overflow: hidden;
  background: #60412c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 3px 8px rgba(0, 0, 0, 0.28);
}

.box-icon {
  flex: 0 0 84px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid rgba(215, 155, 66, 0.42);
  margin: 0;
  background: #60412c;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.box-icon img {
  height: auto;
  width: 76%;
  max-height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.34));
}

.box-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background-color: #60412c;
  min-height: 114px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.box-content h2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  font-size: 16px;
  margin: 0;
  font-weight: 900;
  color: #f3c24a;
  padding: 3px 8px;
  background: #60412c;
  border-bottom: 1px solid rgba(215, 155, 66, 0.34);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.32);
}

.building-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.box-text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "productivity production"
    "primary relic";
  grid-template-rows: 40px 38px;
  align-items: stretch;
  gap: 0;
  flex: 1;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.box-text > * {
  min-width: 0;
}

.building-productivity {
  grid-area: productivity;
}

.building-production {
  grid-area: production;
}

.building-primary-item {
  grid-area: primary;
}

.building-relic-item {
  grid-area: relic;
}

.building-productivity,
.building-production,
.building-control {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  overflow: hidden;
}

.building-productivity,
.building-production {
  column-gap: 4px;
}

.building-productivity,
.building-production {
  border-bottom: 1px solid rgba(215, 155, 66, 0.28);
}

.building-production,
.building-relic-item {
  border-left: 1px solid rgba(215, 155, 66, 0.28);
}

.box-text p {
  font-weight: bold;
}

.box-content hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(215, 155, 66, 0.34);
  opacity: 1;
  margin: 0;
  color: rgba(215, 155, 66, 0.34);
}

.box-content p {
  margin: 0;
  font-size: 13px;
  color: #e6d1af;
  line-height: 1.15;
}

.box-content p span {
  color: #fff4de;
  font-size: 14px;
  font-weight: 900;
}

.box[disabled] {
  pointer-events: none;
  opacity: 0.5;
}

.dragging {
  opacity: 0.5;
  transform: scale(1.05);
}

.form-select,
.form-select option,
.form-control,
.select {
  display: flex;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  margin-left: 0;
}

.form-select:disabled,
.form-control:disabled {
  filter: saturate(0.75) brightness(0.9);
  cursor: not-allowed;
  background-color: #d4b98f;
  color: rgba(86, 57, 31, 0.74);
}

.fixSelector {
  width: min(100%, 180px);
  background-color: #f0d7ae;
  color: #56391f;
  font-weight: 900;
  border: 1px solid rgba(215, 155, 66, 0.72);
  border-radius: 5px;
  margin-left: 0;
  font-size: 13px;
  min-width: 0;
  min-height: 28px;
  padding: 3px 7px;
  box-shadow: inset 0 1px 2px rgba(89, 56, 30, 0.18);
}

.building-control .fixSelector {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
}

.levelSelector {
  width: auto;
  min-width: 92px;
  max-width: 130px;
}

.fixSelector option {
  width: auto;
  color: #56391f;
  background: #f0d7ae;
  font-weight: bold;
}

.fixSelector:focus {
  background-color: #f5dfba;
  border-color: rgba(243, 194, 74, 0.95);
  box-shadow: 0 0 0 2px rgba(215, 155, 66, 0.25), inset 0 1px 2px rgba(89, 56, 30, 0.16);
  outline: none;
}

.form-group {
  font-size: 1rem;
}

@media (max-width: 767px) {
  .result .results {
    grid-template-columns: 1fr;
  }

  .results p {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid rgba(215, 155, 66, 0.34);
  }

  .results p:last-of-type {
    border-bottom: 0;
  }

  .box-content h2 {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    font-size: 14px;
    padding-inline: 6px;
  }

  .box-icon {
    flex-basis: 72px;
  }

  .fixSelector {
    width: 100%;
    min-height: 24px;
    padding: 2px 5px;
    font-size: 11px;
  }

  .levelSelector {
    min-width: 74px;
    max-width: 92px;
  }

  .box-text {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .box-content p {
    font-size: 11px;
  }

  .box-content p span {
    font-size: 11px;
  }
}

@media (max-width: 575px) {
  .container {
    padding-inline: 6px;
  }

  .collapse-header {
    font-size: 1rem;
  }

  .calculator-bonuses-form .form-group {
    min-height: 0;
    padding: 7px;
  }

  .results span {
    font-size: 0.98rem;
  }
}

@media only screen and (max-width: 700px) {
  #overlay {
    background-color: rgba(0, 0, 0, 0);
  }

  body {
    margin: 0 !important;
  }
}

@media (hover: none) {
  .box-icon img {
    transform: none !important;
  }

  .box:hover {
    transform: none !important;
  }
}

.home-icon i {
  color: #4c473b;
}

.home-icon-link .home-icon i {
  color: #f8bc00;
}
