html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, #eef9df 0%, #dff4c8 42%, #c9eab0 100%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  touch-action: manipulation;
  position: relative;
}

body.mobile-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

#app {
  width: 100%;
  height: 100%;
}

body.mobile-scroll #app {
  height: auto;
  min-height: 100%;
}

canvas {
  display: block;
  position: relative;
  z-index: 1;
}

body.mobile-scroll canvas {
  width: 100% !important;
  height: auto !important;
}

#start-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(224, 243, 204, 0.26);
}

.start-card {
  width: min(560px, 100%);
  padding: 28px 24px;
  border-radius: 24px;
  background: rgba(255, 248, 227, 0.95);
  box-shadow: 0 18px 50px rgba(64, 91, 39, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.start-card h1 {
  margin: 0;
  max-width: 560px;
  text-align: center;
  color: #26492b;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.start-card p {
  margin: 0 0 8px;
  color: #4b5d44;
  font-size: 1.05rem;
}

.goal-box {
  width: min(380px, 78vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(221, 241, 196, 0.82);
  color: #29472e;
  text-align: center;
  line-height: 1.4;
  box-sizing: border-box;
}

.goal-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.goal-box span {
  display: block;
  font-size: 0.95rem;
}

.start-card input {
  width: min(320px, 72vw);
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #8bb36f;
  outline: none;
  font-size: 18px;
  box-sizing: border-box;
}

.start-card input.input-error {
  border-color: #bf4f4f;
  background: #fff4f4;
}

.form-error {
  margin: -4px 0 0;
  width: min(320px, 72vw);
  color: #a43f3f;
  font-size: 0.95rem;
  text-align: left;
}

.start-card button {
  width: min(320px, 72vw);
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: #3b6b35;
  color: #f6ffe7;
  font-size: 18px;
  cursor: pointer;
}

.start-card button:hover {
  background: #31592e;
}

@media (max-width: 920px) {
  #start-overlay {
    padding: 14px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .start-card {
    width: min(100%, 560px);
    margin: 12px 0 24px;
    padding: 22px 16px;
    border-radius: 20px;
  }

  .start-card h1 {
    font-size: clamp(1.45rem, 6vw, 2rem);
  }

  .start-card p,
  .goal-box span,
  .form-error {
    font-size: 0.95rem;
  }

  .goal-box,
  .start-card input,
  .start-card button {
    width: min(100%, 360px);
  }

  .start-card input,
  .start-card button {
    min-height: 48px;
    font-size: 17px;
  }
}

@media (max-width: 640px), (max-height: 720px) {
  #start-overlay {
    padding: 10px;
  }

  .start-card {
    gap: 10px;
    padding: 18px 14px;
    border-radius: 18px;
  }

  .start-card h1 {
    font-size: clamp(1.3rem, 6vw, 1.7rem);
  }

  .start-card p,
  .goal-box span,
  .form-error {
    font-size: 0.9rem;
  }

  .goal-box {
    padding: 10px 12px;
  }

  .start-card input,
  .start-card button {
    min-height: 44px;
    font-size: 16px;
  }
}
