:root {
  --bg1: #ffe56e;
  --bg2: #ffd64d;
  --cream: #fff7df;
  --cream-2: #fff2c7;
  --orange: #f28a2e;
  --orange-dark: #de6f17;
  --blue: #4d95ff;
  --blue-dark: #357ce8;
  --text: #2e241a;
  --muted: #7b6a55;
  --shadow: 0 18px 40px rgba(133, 95, 18, 0.16);
  --shadow-soft: 0 10px 22px rgba(90, 67, 15, 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, 0.38), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 42%, #ffc640 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, 0.16), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 30px 70px rgba(90, 60, 8, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 28px;
  border-radius: 18px;
  background: rgba(46, 36, 26, 0.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, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 700;
  color: #8a5e00;
  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;
}

.subtitle {
  margin: 0 auto;
  max-width: 310px;
  color: rgba(46, 36, 26, 0.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, 0.92), rgba(255, 249, 232, 0.96));
  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, #fef3bc 0%, #ffe58d 100%);
}

.scene {
  position: absolute;
  inset: auto 0 0;
  height: 118px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 247, 219, 0.25) 20%, rgba(244, 184, 74, 0.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(110, 76, 16, 0.22));
}

.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: #fff3cd;
  color: #7a5600;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.favorites-count {
  background: #fff;
  color: #805400;
  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;
}

.punchline-wrap {
  border-radius: 20px;
  background: linear-gradient(180deg, #fff8ea, #fff2d7);
  border: 1px solid rgba(233, 180, 74, 0.35);
  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: #ca6615;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.28s ease;
}

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

.punchline-placeholder {
  color: #b19772;
  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: 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: #754300;
  background: linear-gradient(180deg, #fff6dd, #ffe9b0);
}

.saved-note {
  min-height: 22px;
  font-size: 13px;
  color: #8b6d41;
  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, #fff9ec, #fff2d7);
  border: 1px solid rgba(233, 180, 74, 0.35);
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.favorite-punchline {
  color: #ca6615;
  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: #8b5c00;
  border: 1px solid rgba(233, 180, 74, 0.4);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9ec, #fff2d7);
  border: 1px dashed rgba(233, 180, 74, 0.45);
}