:root {
  --bg1: #4d95ff;
  --bg2: #a8c8ff;
  --cream: #eef4ff;
  --cream-2: #ddeaff;
  --orange: #f28a2e;
  --orange-dark: #de6f17;
  --blue: #4d95ff;
  --blue-dark: #357ce8;
  --text: #0d1f3c;
  --muted: #4a6080;
  --shadow: 0 18px 40px rgba(18, 60, 133, 0.18);
  --shadow-soft: 0 10px 22px rgba(18, 60, 120, 0.13);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --pill-bg: #ddeaff;
  --pill-text: #1a3a70;
  --punchline-bg-start: #eaf2ff;
  --punchline-bg-end: #d6e8ff;
  --punchline-border: rgba(74, 144, 233, 0.25);
  --punchline-text: #1a5cbf;
  --placeholder-text: #6a90b8;
  --note-text: #3a5a90;
  --btn-reveal-start: #5fa8ff;
  --btn-reveal-end: #357ce8;
  --btn-next-start: #2d6fd4;
  --btn-next-end: #1a50a8;
  --btn-save-start: #ddeaff;
  --btn-save-end: #bfd5ff;
  --btn-save-text: #1a3a70;
  --eyebrow-bg: rgba(255, 255, 255, 0.55);
  --eyebrow-text: #1a4080;
  --subtitle-color: rgba(220, 235, 255, 0.85);
  --notch-bg: rgba(10, 30, 70, 0.88);
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 26%),
    radial-gradient(circle at bottom right, rgba(150, 200, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #6db3ff 0%, var(--bg1) 42%, #2f7de0 100%);
  display: flex;
  justify-content: center;
  padding: 18px;
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: min(880px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  padding: 14px 14px 18px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    0 30px 70px rgba(10, 40, 100, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 28px;
  border-radius: 18px;
  background: var(--notch-bg);
}

.hero {
  padding: 34px 10px 4px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--eyebrow-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 700;
  color: var(--eyebrow-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 12px 0 6px;
  font-size: 31px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(10, 40, 100, 0.2);
}

.subtitle {
  margin: 0 auto;
  max-width: 310px;
  color: var(--subtitle-color);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(235, 245, 255, 0.97));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.mascot-card {
  position: relative;
  padding: 22px 20px 16px;
  overflow: hidden;
  min-height: 318px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(180deg, var(--cream-2) 0%, var(--bg2) 100%);
}

.scene {
  position: absolute;
  inset: auto 0 0;
  height: 118px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(210, 232, 255, 0.25) 20%, rgba(74, 144, 255, 0.18) 100%);
}

.mascot-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 280px;
}

.mascot-img {
  width: 100%;
  max-width: 240px;
  margin: auto;
  display: block;
}

.joke-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.favorites-count {
  background: var(--white);
  color: var(--pill-text);
  box-shadow: var(--shadow-soft);
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}

.setup {
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 900;
  min-height: 94px;
  color: var(--text);
}

.punchline-wrap {
  border-radius: 20px;
  background: linear-gradient(180deg, var(--punchline-bg-start), var(--punchline-bg-end));
  border: 1px solid var(--punchline-border);
  padding: 14px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.punchline {
  font-size: 18px;
  line-height: 1.35;
  color: var(--punchline-text);
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.28s ease;
}

.punchline.visible {
  opacity: 1;
  transform: translateY(0);
}

.punchline-placeholder {
  color: var(--placeholder-text);
  font-weight: 700;
  font-size: 15px;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  min-height: 56px;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  box-shadow: var(--shadow-soft);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px) scale(0.995);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-reveal {
  color: var(--white);
  background: linear-gradient(180deg, var(--btn-reveal-start), var(--btn-reveal-end));
}

.btn-next {
  color: var(--white);
  background: linear-gradient(180deg, var(--btn-next-start), var(--btn-next-end));
}

.btn-save {
  color: var(--btn-save-text);
  background: linear-gradient(180deg, var(--btn-save-start), var(--btn-save-end));
}

.saved-note {
  min-height: 22px;
  font-size: 13px;
  color: var(--note-text);
  font-weight: 700;
  text-align: center;
}