* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #68B03D;
  font-family: "Fredoka", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* load-bearing: without this iPad Safari eats flicks (DEC-005) */
}

#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #68B03D;
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@media (orientation: portrait) {
  #rotate-overlay { display: flex; }
}

.rotate-card {
  text-align: center;
  color: #FFFFFF;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 2px 0 rgba(61, 43, 31, 0.4);
}

.rotate-emoji { font-size: 4rem; margin-bottom: 1rem; }

/* Idea box (R53): the one piece of DOM UI over the canvas — iPad Safari only
   raises its keyboard for a real <textarea>. */
#idea-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 43, 31, 0.55);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#idea-overlay[hidden] { display: none; }

.idea-card {
  width: min(560px, 100%);
  background: #FFF6E4;
  border: 4px solid #3D2B1F;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 8px 0 rgba(61, 43, 31, 0.35);
}

.idea-card h2 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: #3D2B1F;
  text-align: center;
}

#idea-text {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1.15rem;
  color: #3D2B1F;
  background: #FFFFFF;
  border: 3px solid #3D2B1F;
  border-radius: 16px;
  padding: 0.75rem;
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}

#idea-msg {
  margin: 0.6rem 0 0;
  min-height: 1.4em;
  font-size: 1rem;
  color: #3D2B1F;
  text-align: center;
}

.idea-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.idea-actions button {
  flex: 1;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: #3D2B1F;
  background: #8FD960;
  border: 3px solid #3D2B1F;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.idea-actions button:disabled { opacity: 0.5; }
#idea-cancel { background: #E8DCC4; }
