:root {
  --bg-color: #ddd2b9;
  --container-bg: #F8F5EE;
  --text-main: #333333;
  --text-muted: #666666;
  --accent-color: #1e5c3a;
  --accent-hover: #16432a;
  --link-color: #32945e;
  --border-color: #eeeeee;
}

[data-theme='dark'] {
  --bg-color: #525252;
  --container-bg: #464646;
  --text-main: #f0f0f0;
  --text-muted: #bbbbbb;
  --accent-color: #d5cea9;
  --accent-hover: #ddd9bc;
  --link-color: var(--accent-color);
  --border-color: #3d3d3d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.container {
  max-width: 650px;
  width: 90%;
  margin: 4rem auto;
  position: relative;
  padding: 2rem;
  background: var(--container-bg);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 2px solid var(--accent-color);
}

header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.header-left {
  flex-shrink: 0;
}

.header-center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* Resetting margin to keep it centered properly */
  margin-right: 140px;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
}

.header-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

h1,
h2,
h3 {
  color: var(--accent-color);
  font-weight: 600;
  margin-top: 1.5em;
}

h1 {
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.email-link {
  margin-top: 0.3rem;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.email-link a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.email-link a:hover {
  opacity: 1;
  color: var(--accent-color);
}

.subtitle {
  margin: 0.4rem 0 0 0;
  opacity: 0.8;
  font-size: 0.95rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

ul {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9em;
  color: var(--text-muted);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.theme-toggle:hover {
  background: var(--accent-color);
  color: var(--bg-color);
}

.sun-icon,
.moon-icon {
  background-color: currentColor;
  transition: background-color 0.3s ease;
}

.sun-icon {
  width: 24px;
  height: 24px;
  mask: url('../images/sun-74.svg') no-repeat center / contain;
  -webkit-mask: url('../images/sun-74.svg') no-repeat center / contain;
  display: block;
}

.moon-icon {
  width: 20px;
  height: 20px;
  mask: url('../images/moon-25.svg') no-repeat center / contain;
  -webkit-mask: url('../images/moon-25.svg') no-repeat center / contain;
  display: none;
}

[data-theme='dark'] .sun-icon {
  display: none;
}

[data-theme='dark'] .moon-icon {
  display: block;
}

/* Garden Game Styles */
html {
  scroll-behavior: smooth;
}

#garden-game {
  width: 100%;
  height: 120px;
  margin-top: 4rem;
  position: relative;
}

.garden-jump {
  background: none;
  border: 1px solid var(--accent-color);
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.garden-jump:hover {
  background: var(--accent-color);
}

.garden-jump .icon {
  width: 20px;
  height: 20px;
  background-color: var(--accent-color);
  mask: url('../images/watering-can-icon.png') no-repeat center / contain;
  -webkit-mask: url('../images/watering-can-icon.png') no-repeat center / contain;
  transition: background-color 0.3s ease;
  animation: watering-tip 6s infinite ease-in-out;
}

@keyframes watering-tip {

  0%,
  80%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  85% {
    transform: rotate(-15deg) translateY(-3px);
  }

  90% {
    transform: rotate(0deg) translateY(0);
  }

  95% {
    transform: rotate(-15deg) translateY(-3px);
  }
}

.garden-jump:hover .icon {
  background-color: var(--container-bg);
}


.ground-strip {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4rem;
  border-bottom: 6px solid #5d4037;
  padding: 0 2rem;
}

.soil-patch {
  width: 40px;
  height: 10px;
  background: #3e2723;
  position: relative;
  border-radius: 5px 5px 0 0;
}

.plant {
  width: 3px;
  height: 0;
  background: #2e7d32;
  /* Cor fixa (Verde) mesmo em modo noturno */
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 2px 2px 0 0;
}

.plant::before,
.plant::after,
.plant span {
  content: '';
  width: 14px;
  height: 8px;
  background: #2e7d32;
  /* Cor fixa (Verde) */
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.5s;
  transition-delay: 0.5s;
}

.plant::before {
  top: 35px;
  left: 4px;
  transform: rotate(30deg);
}

.plant::after {
  top: 20px;
  left: -14px;
  transform: rotate(-30deg);
}

.plant span {
  width: 18px;
  height: 10px;
  top: 5px;
  right: -18px;
  transform: rotate(-20deg);
}

.plant.grow {
  height: 50px;
}

/* Cactus (Planta da Esquerda) */
.plant.cactus {
  width: 32px;
  background: #2e7d32;
  border-radius: 20px 20px 0 0;
  transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  /* Crop the rotated thorns */
}

.plant.cactus.grow {
  height: 32px;
}

.plant.cactus::after {
  content: '';
  width: 140%;
  height: 140%;
  /* Larger to cover rotation */
  position: absolute;
  top: -20%;
  left: -20%;
  background-image: radial-gradient(circle, #eee 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0;
  transition: opacity 0.5s 0.6s;
  transform: rotate(30deg);
  transform-origin: center;
}

.plant.cactus.grow::after {
  opacity: 0.8;
}

.plant.cactus::before,
.plant.cactus span {
  display: none;
}

/* Snake Plant (Espada de São Jorge) */
.plant.snake {
  width: 8px;
  background: #2e7d32;
  border-radius: 5px 5px 0 0;
  overflow: visible;
}

.plant.snake::before {
  content: '';
  width: 6px;
  height: 90%;
  position: absolute;
  left: -5px;
  top: 10%;
  background: #1b5e20;
  border-radius: 50% 50% 0 0;
  transform: rotate(-8deg);
  transform-origin: bottom;
  opacity: 0;
  transition: opacity 0.5s;
  transition-delay: 0.5s;
}

.plant.snake::after {
  content: '';
  width: 6px;
  height: 85%;
  position: absolute;
  left: 7px;
  top: 15%;
  background: #43a047;
  border-radius: 50% 50% 0 0;
  transform: rotate(8deg);
  transform-origin: bottom;
  opacity: 0;
  transition: opacity 0.5s;
  transition-delay: 0.5s;
}

.plant.snake span {
  display: none;
}


.plant.grow::before,
.plant.grow::after,
.plant.grow span {
  opacity: 1;
}

#watering-can {
  width: 60px;
  height: 60px;
  position: absolute;
  bottom: 60px;
  right: 90px;
  cursor: grab;
  z-index: 100;
  transition: transform 0.2s;
  user-select: none;
  -webkit-user-drag: none;
}

#watering-can img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#watering-can.active {
  cursor: grabbing;
  transform: rotate(-30deg);
}

#watering-can.active .water-droplets {
  transform: rotate(30deg);
}

.water-droplets {
  position: absolute;
  top: 25px;
  left: 0px;
  pointer-events: none;
  transition: transform 0.2s;
}

.droplet {
  position: absolute;
  width: 4px;
  height: 6px;
  background: #4fc3f7;
  border-radius: 50%;
  animation: fall 0.6s linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(100px) scale(0.5);
    opacity: 0;
  }
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 650px) {
  .container {
    padding: 1.5rem 1rem;
    margin: 1.5rem auto;
    width: 88%;
    /* Deixamos 10% da tela para mostrar a cor de fundo (5% de cada lado) */
  }

  header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
  }

  .header-center {
    margin-right: 0;
    /* Remove a margem que causava a quebra de tela */
    width: 100%;
  }

  h1 {
    font-size: 1.6rem;
    white-space: normal;
    /* Permite que o texto quebre linha se precisar */
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  /* Posição de "descanso" do regador na tela inicial (Mobile) */
  #watering-can {
    bottom: 100px;
    /* Mais para cima para sair de cima da planta */
    right: 40px;
    /* Mais para a direita (quase colado na borda) */
  }
}