/* ==== CSS Variables ==== */
:root {
  --background-color-light: #444;
  --background-color-dark: #333;
  --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.6);
  --shadow-large: 0 4px 16px rgba(0, 0, 0, 0.6);
  --font-family: Arial, sans-serif;
  --font-size-small: 10px;
  --font-size-standard: 12px;
  --font-size-large: 14px;
  --font-size-title: 32px;
  --text-color-light: white;
  --text-color-mid: lightgray;
  --text-color-dark: black;

  --bg-color: #2b2b2b;
  --text-color: white;
  --text-dark: black;
  --accent-color: limegreen;
  --tile-border: black;
  --growth-bar-bg: rgba(0, 0, 0, 0.5);
  --font-family: Arial, sans-serif;
}

/* ==== Global Reset ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* outline: 1px red dashed; */
}

html, body {
  overflow: hidden;
}

/* ==== App Layout ==== */
body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: var(--bg-color);
}

.app {
  width: 370px;
  max-width: 370px;
  height: 640px;
  max-height: 640px;
  position: relative;
  border-radius: 12px;
  box-shadow: var(--shadow-large);
  font-family: var(--font-family);
  font-size: var(--font-size-standard);
  color: var(--text-color-light);
  margin: 10px;
}

/* ==== Main Container ==== */
#main {
  width: 370px;
  max-width: 370px;
  height: 640px;
  max-height: 640px;
  position: relative;
  border-radius: 12px;
  background-size: 370px 640px;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text-color);
  overflow: hidden;
}

/* ==== Sections ==== */
#title,
#status,
#field,
#tools,
#store {
  width: 100%;
}

#title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 120px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#title h1 {
  margin: 10px 10px;
  font-size: 20px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#title button {
  margin: 10px 10px;
}

#status {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 20px;
}  

#status span {
  margin: 10px 10px 0px 10px;
  font-size: 12px;
}

#field {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 320px;
}

#farmContainer {
  width: 300px;
  height: 300px;
  display: grid;
  border: 1px solid var(--tile-border);
}

/* ==== Components ==== */
#tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  height: 65px;
}

#store {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100px;
  color: var(--text-color);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* ==== Tiles ==== */
.tile {
  position: relative;
  border: 1px solid var(--tile-border);
  background-size: cover;
  background-repeat: no-repeat;
}

/* ==== Growth bar ==== */
.growth-bar {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  height: 5px;
  background: var(--growth-bar-bg);
}

.growth-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-color);
}

/* ==== Interaction and State ==== */
.toolBtn,
.seedBtn,
#resetBtn {
  background: none;
  border: none;
  cursor: pointer;
}

.seedBtn {
  font-size: 10px;
  line-height: 1.1;
  color: var(--text-color);
}

.toolBtn.selected,
.seedBtn.selected {
  outline: 2px solid var(--accent-color);
}

.seedBtn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==== Day/Night text color for title ==== */
#main.morning #title h1,
#main.day #title h1 {
  color: var(--text-dark) !important;
}

#main.evening #title h1,
#main.night #title h1 {
  color: var(--text-color) !important;
}

/* ==== Footer ==== */
.footer {
  width: 100%;
  height: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  font-size: var(--font-size-small);
  color: var(--text-color-mid);
  padding: 0 10px;
}

.footer-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.footer a {
  color: var(--text-color-mid);
  text-decoration: none;
}