@import url("https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Fredoka:wght@400;600&family=Jua&display=swap");

:root {
  --tone-lightest: #fff6fb;
  --tone-light: #ffe0ed;
  --tone-mid: #ffc5db;
  --tone-bold: #ff7aa2;
  --tone-deep: #ff4f87;
  --bg: radial-gradient(circle at top, var(--tone-lightest) 0%, #ffe8f2 40%, #ffd0e3 70%, #ffb8d7 100%);
  --card: rgba(255, 255, 255, 0.92);
  --border: rgba(255, 122, 162, 0.35);
  --accent: var(--tone-deep);
  --text-main: #3c1b2d;
  --text-muted: rgba(60, 27, 45, 0.7);
  --shadow-soft: 0 25px 55px rgba(255, 122, 162, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-main);
  font-family: "Jua", "Fredoka", "Gowun Dodum", "Gill Sans", sans-serif;
  letter-spacing: 0.01em;
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero-kicker {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 122, 162, 0.18);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 18px 0 14px;
}

.stacked-title {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-transform: none;
  letter-spacing: 0.02em;
}

.stacked-title span {
  display: block;
  text-align: center;
  width: auto;
  padding: 0 8px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-copy {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.6;
}

.weather-stage {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(255, 197, 219, 0.85));
  border-radius: 36px;
  padding: 36px;
  text-align: center;
  margin-bottom: 36px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 122, 162, 0.3);
  transition: background 0.6s ease, transform 0.6s ease, box-shadow 0.6s ease;
}

.weather-stage[data-weather="sunny"] {
  background: linear-gradient(140deg, #fff4f8, #ffd5e7);
}

.weather-stage[data-weather="cloudy"] {
  background: linear-gradient(140deg, #ffe9f3, #ffcfe3);
}

.weather-stage[data-weather="rain"] {
  background: linear-gradient(140deg, #ffdcec, #ffbad8);
}

.weather-stage[data-weather="storm"] {
  background: linear-gradient(140deg, #ffd0e5, #ffaed0);
}

.weather-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 122, 162, 0.3);
  background: rgba(255, 122, 162, 0.12);
  font-size: 0.95rem;
  font-weight: 600;
}

.weather-state {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  margin: 16px 0 8px;
}

.weather-emoji {
  font-size: clamp(3rem, 6vw, 5rem);
  margin: 12px 0;
}

.weather-label,
.weather-updated {
  color: var(--text-muted);
  margin: 4px 0;
}

.mood-panel,
.stats-panel {
  background: var(--card);
  border-radius: 30px;
  padding: 30px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 122, 162, 0.25);
}

.selected-mood {
  margin: 8px 0 20px;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
}

.mood-panel h2,
.stats-panel h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.panel-copy {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.story-panel,
.recent-panel {
  background: var(--card);
  border-radius: 30px;
  padding: 30px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 122, 162, 0.25);
}

.mood-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-label {
  font-weight: 600;
  margin-bottom: 6px;
  display: inline-block;
}

.mood-form textarea,
.mood-form input[type="text"] {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(255, 122, 162, 0.35);
  padding: 14px 18px;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mood-form input[type="text"]:disabled {
  opacity: 0.6;
}

.mood-form textarea:focus,
.mood-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 162, 0.2);
}

.name-fieldset {
  border: 1px dashed rgba(255, 122, 162, 0.4);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.name-fieldset legend {
  font-weight: 600;
  padding: 0 6px;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 18px;
  background: rgba(255, 122, 162, 0.08);
  border: 1px solid rgba(255, 122, 162, 0.25);
  cursor: pointer;
}

.radio-chip input {
  accent-color: var(--accent);
}

.name-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.input-block {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
}

.send-btn {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(120deg, var(--tone-bold), var(--tone-deep));
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(255, 79, 135, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.send-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.mood-card {
  border: 1px solid rgba(255, 122, 162, 0.4);
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(145deg, #fff, rgba(255, 197, 219, 0.45));
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 16px 35px rgba(255, 122, 162, 0.2);
}

.mood-card:focus-visible,
.mood-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 22px 40px rgba(255, 122, 162, 0.35);
}

.mood-card.selected {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 122, 162, 0.45));
  box-shadow: 0 24px 48px rgba(255, 79, 135, 0.35);
}

.mood-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.mood-emoji {
  font-size: 2.2rem;
}

.mood-title {
  font-weight: 600;
}

.mood-weather {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stats-card {
  border: 1px solid rgba(255, 122, 162, 0.3);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 208, 226, 0.75));
  box-shadow: 0 14px 28px rgba(255, 122, 162, 0.18);
}

.stats-card.wide {
  grid-column: span 2;
}

.stats-label {
  color: var(--text-muted);
  margin: 0 0 8px;
}

.stats-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

.stats-list {
  display: grid;
  gap: 8px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 122, 162, 0.08);
  font-size: 1rem;
  border: 1px solid rgba(255, 122, 162, 0.15);
}

.recent-list {
  display: grid;
  gap: 16px;
}

.recent-card {
  border-radius: 26px;
  border: 1px solid rgba(255, 122, 162, 0.25);
  padding: 20px 22px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.95), rgba(255, 197, 219, 0.5));
  box-shadow: 0 12px 28px rgba(255, 122, 162, 0.18);
}

.recent-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-reason {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.5;
}

.recent-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.recent-empty {
  text-align: center;
  padding: 24px;
  border-radius: 24px;
  border: 1px dashed rgba(255, 122, 162, 0.35);
  color: var(--text-muted);
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.status-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(150%);
  background: var(--accent);
  color: white;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 0 15px 40px rgba(255, 79, 135, 0.4);
  transition: transform 0.4s ease;
  max-width: calc(100% - 40px);
  font-weight: 600;
}

.status-toast.show {
  transform: translateX(-50%) translateY(0);
}

.status-toast.error {
  background: #c9184a;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 32px 16px 56px;
  }

  .mood-card,
  .stats-card {
    padding: 16px;
  }
}
