:root {
  --bg1: #ffb27d;
  --bg2: #ffd5b3;
  --cream: #fff5eb;
  --cream-2: #ffe9d6;
  --orange: #f4873a;
  --orange-dark: #dd6a1c;
  --blue: #4d95ff;
  --blue-dark: #357ce8;
  --text: #34251c;
  --muted: #8a6a55;
  --shadow: 0 18px 40px rgba(152, 92, 38, 0.16);
  --shadow-soft: 0 10px 22px rgba(120, 74, 32, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  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, .42), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, .20), transparent 28%),
    linear-gradient(180deg, #ffd1ae 0%, #ffba8d 42%, #ffa66f 100%);
  display: flex;
  justify-content: center;
  padding: 18px;
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: min(920px, 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, .18), rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .30);
  box-shadow:
    0 30px 70px rgba(121, 67, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  position: relative;
  overflow: hidden;
}

.notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 28px;
  border-radius: 18px;
  background: rgba(52, 37, 28, .88);
}

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

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

h1 {
  margin: 12px 0 6px;
  font-size: 31px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.subtitle {
  margin: 0 auto;
  max-width: 310px;
  color: rgba(52, 37, 28, .72);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(255, 245, 235, .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, .95), transparent 28%),
    linear-gradient(180deg, #ffe9d7 0%, #ffd5b4 100%);
}

.scene {
  position: absolute;
  inset: auto 0 0;
  height: 118px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 243, 230, .28) 20%, rgba(244, 161, 111, .22) 100%);
}

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

.mascot-wrap img {
  width: 100%;
  max-width: 240px;
  margin: auto;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(129, 74, 31, .18));
}

.joke-card,
.favorites-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: #fff0de;
  color: #9a5a1f;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .04);
}

.favorites-count {
  background: #fff;
  color: #8d541f;
  box-shadow: var(--shadow-soft);
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .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;
}

.punchline-wrap {
  border-radius: 20px;
  background: linear-gradient(180deg, #fff8f0, #ffeedd);
  border: 1px solid rgba(232, 169, 107, .45);
  padding: 14px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

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

.punchline-placeholder {
  color: #bc9779;
  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 .15s ease, box-shadow .15s ease, opacity .2s ease;
  box-shadow: var(--shadow-soft);
}

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

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

button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

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

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

.btn-save {
  color: #8a4f17;
  background: linear-gradient(180deg, #fff4e6, #ffe5c7);
}

.saved-note {
  min-height: 22px;
  font-size: 13px;
  color: #9a744e;
  font-weight: 700;
  text-align: center;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.favorite-item {
  background: linear-gradient(180deg, #fff9f2, #ffeedc);
  border: 1px solid rgba(232, 169, 107, .40);
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.favorite-setup {
  font-weight: 900;
  line-height: 1.28;
  margin-bottom: 6px;
}

.favorite-punchline {
  color: #cf6b24;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
}

.favorite-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: none;
  background: #fff;
  color: #9a5b22;
  border: 1px solid rgba(232, 169, 107, .45);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9f2, #ffeedc);
  border: 1px dashed rgba(232, 169, 107, .45);
}