@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #090e1b;
  --panel: #121b2d;
  --panel-2: #17243a;
  --line: rgba(174, 197, 235, .13);
  --muted: #9aa9c2;
  --text: #f4f7ff;
  --cyan: #25d7e8;
  --blue: #4c76ff;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; padding: 38px 20px 28px;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  background: radial-gradient(ellipse at 50% -15%, #24365c 0, #111a2d 38%, var(--bg) 76%);
}
.app { width: min(900px, 100%); margin: 0 auto; }
.hero { text-align: center; margin: 8px 0 30px; }
.eyebrow { color: #7f94bb; font-size: 10px; font-weight: 700; letter-spacing: .23em; }
h1 { margin: 8px 0 5px; font: 700 clamp(42px, 8vw, 62px)/1 'Space Grotesk', sans-serif; letter-spacing: -.065em; }
h1 span { background: linear-gradient(100deg, #37d6ec, #6484ff 58%, #ba70ef); color: transparent; background-clip: text; }
.hero p, .panel-heading p, .result-heading p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.input-panel, .result-panel {
  background: linear-gradient(145deg, rgba(27, 40, 63, .97), rgba(17, 27, 45, .98));
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}
.input-panel { padding: 23px; }
.panel-heading, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { margin: 0; font: 600 18px 'Space Grotesk', sans-serif; }
.counter { color: #8294b2; font-size: 12px; white-space: nowrap; }
textarea {
  display: block; width: 100%; min-height: 145px; margin-top: 19px; padding: 17px;
  resize: vertical; border: 1px solid rgba(171,194,232,.16); border-radius: 13px;
  outline: none; color: #f3f6ff; background: rgba(7,14,28,.54);
  font: 14px/1.65 'DM Sans', sans-serif; transition: border-color .2s, box-shadow .2s;
}
textarea:focus { border-color: #4e8dff; box-shadow: 0 0 0 3px rgba(78,141,255,.12); }
textarea::placeholder { color: #687b9b; }
.controls { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 15px; }
.color-control { display: grid; gap: 7px; color: #9eacc4; font-size: 12px; }
select {
  min-width: 150px; padding: 11px 34px 11px 12px; color: #eaf0ff;
  background: #202e47; border: 1px solid var(--line); border-radius: 10px; font: inherit;
}
button { border: 0; cursor: pointer; font: 600 13px 'DM Sans', sans-serif; transition: transform .15s, opacity .15s, filter .15s; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
button:disabled { opacity: .38; cursor: not-allowed; }
.primary-btn { min-height: 44px; padding: 0 20px; color: white; border-radius: 11px; background: linear-gradient(100deg, #08b9d5, #2869ee); box-shadow: 0 7px 20px rgba(30,113,235,.2); }
.primary-btn span { margin-left: 12px; font-size: 17px; }
.hint { min-height: 17px; margin: 12px 0 0; color: #8497b7; font-size: 11px; }
.result-panel { margin-top: 20px; padding: 22px; }
.secondary-btn { padding: 10px 13px; color: #dce8ff; border: 1px solid rgba(166,190,230,.2); border-radius: 9px; background: rgba(255,255,255,.045); white-space: nowrap; }
.cloud-wrap { position: relative; min-height: 390px; margin-top: 18px; overflow: hidden; border: 1px solid rgba(174,197,235,.08); border-radius: 15px; background: radial-gradient(ellipse at center, #1c2b45 0, #142139 65%, #111b2e 100%); }
canvas { display: block; width: 100%; height: 390px; }
.empty-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; color: #9aabc6; text-align: center; pointer-events: none; }
.empty-state strong { color: #dce6fa; font: 600 15px 'Space Grotesk', sans-serif; }
.empty-state span { font-size: 12px; }
.empty-icon { color: #55cde8; font-size: 35px; margin-bottom: 4px; }
.result-footer { display: flex; justify-content: space-between; margin-top: 13px; color: #667b9d; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
footer { padding: 23px 0 0; color: #6f819f; text-align: center; font-size: 11px; }
footer span { padding: 0 6px; color: #3b9abf; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  body { padding: 25px 13px; }
  .input-panel, .result-panel { padding: 17px; border-radius: 16px; }
  .controls { align-items: stretch; flex-direction: column; }
  .color-control select, .primary-btn { width: 100%; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .cloud-wrap { min-height: 330px; }
  canvas { height: 330px; }
  .counter { font-size: 10px; }
}

/* Ensure the placeholder disappears after generating the cloud. */
.empty-state[hidden] { display: none !important; }
