:root {
  --ink: #3d2108;
  --ink-soft: #6e4217;
  --cream: #fffaf0;
  --yellow: #ffd84d;
  --sunny: #ffbd24;
  --orange: #ff7a18;
  --orange-deep: #e9540d;
  --peach: #ffe0a6;
  --white-glass: rgba(255, 255, 255, 0.64);
  --border-glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 20px 60px rgba(132, 62, 3, 0.18);
  --shadow-soft: 0 12px 34px rgba(147, 72, 8, 0.13);
  --radius-lg: 30px;
  --radius-md: 22px;
  --page-width: 1120px;
  --nav-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 250, 194, 0.95) 0 12%, transparent 34%),
    radial-gradient(circle at 90% 30%, rgba(255, 198, 74, 0.72) 0 10%, transparent 34%),
    linear-gradient(135deg, #fff8b7, #ffcf4e 42%, #ff9a29 75%, #ff7a18);
  background-size: 180% 180%;
  animation: backgroundFlow 16s ease-in-out infinite alternate;
}

body.modal-open {
  overflow: hidden;
}

button,
[role="button"] {
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid rgba(79, 41, 0, 0.9);
  outline-offset: 3px;
}

p {
  margin: 0;
  line-height: 1.65;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.35rem, 11vw, 5.4rem);
}

h2 {
  font-size: clamp(2rem, 8vw, 3.7rem);
}

h3 {
  font-size: clamp(1.45rem, 5.5vw, 2rem);
}

[hidden] {
  display: none !important;
}

.glass-panel {
  border: 1px solid var(--border-glass);
  background: var(--white-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sunrise-glow {
  position: fixed;
  z-index: -3;
  top: -35vmax;
  left: 50%;
  width: 85vmax;
  height: 85vmax;
  border-radius: 50%;
  background: rgba(255, 255, 213, 0.55);
  filter: blur(18px);
  transform: translateX(-50%);
  pointer-events: none;
}

.background-decor {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.flower,
.sparkle,
.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  opacity: 0.55;
  animation: floatDecor 9s ease-in-out infinite;
}

.flower {
  font-size: clamp(1.4rem, 6vw, 3.2rem);
  filter: drop-shadow(0 8px 13px rgba(121, 57, 0, 0.18));
}

.flower-one { top: 9%; left: 3%; }
.flower-two { top: 44%; right: 3%; animation-delay: -3s; }
.flower-three { top: 76%; left: 5%; animation-delay: -6s; }
.flower-four { top: 21%; right: 14%; animation-delay: -1.5s; }
.sparkle-one { top: 17%; left: 30%; animation-delay: -2s; }
.sparkle-two { top: 66%; right: 25%; animation-delay: -5s; }
.sparkle-three { top: 86%; left: 35%; animation-delay: -7s; }

.bubble {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.27);
}

.bubble-one { top: 13%; right: 6%; width: 76px; height: 76px; }
.bubble-two { top: 59%; left: -20px; width: 95px; height: 95px; animation-delay: -4s; }
.bubble-three { bottom: 9%; right: 8%; width: 54px; height: 54px; animation-delay: -7s; }

.welcome-screen,
.success-screen,
.secret-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding:
    max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 217, 0.94), transparent 43%),
    linear-gradient(150deg, rgba(255, 220, 79, 0.96), rgba(255, 121, 19, 0.98));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.welcome-screen.is-closing {
  opacity: 0;
  visibility: hidden;
}

.welcome-card {
  position: relative;
  width: min(100%, 620px);
  padding: clamp(28px, 7vw, 56px);
  border-radius: 38px;
  text-align: center;
  overflow: hidden;
}

.welcome-card::before,
.success-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  top: -95px;
  right: -70px;
  background: rgba(255, 255, 255, 0.24);
}

.mini-sun {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 26px;
  font-size: 2.2rem;
  background: linear-gradient(145deg, #fff3a9, #ffb320);
  box-shadow: 0 12px 32px rgba(227, 93, 0, 0.24);
  animation: friendlyWiggle 3s ease-in-out infinite;
}

.eyebrow,
.section-kicker,
.game-label {
  color: #9d3e09;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome-card h1 {
  margin: 10px 0 18px;
  font-size: clamp(2.15rem, 10vw, 4.2rem);
}

.welcome-card p:not(.eyebrow, .tiny-note) {
  color: var(--ink-soft);
  font-size: clamp(1rem, 4.2vw, 1.15rem);
}

.welcome-lead {
  margin-bottom: 8px !important;
  font-weight: 800;
}

.primary-button,
.card-button,
.answer-button,
.game-option,
.next-question-button,
.challenge-button {
  width: 100%;
  min-height: 54px;
  border-radius: 17px;
  padding: 13px 18px;
  font-weight: 900;
  line-height: 1.25;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  box-shadow: 0 13px 26px rgba(218, 74, 0, 0.27);
}

.primary-button:active,
.card-button:active,
.answer-button:active,
.game-option:active,
.next-question-button:active,
.challenge-button:active {
  transform: scale(0.975);
}

.welcome-button {
  margin-top: 26px;
  min-height: 60px;
  font-size: 1.08rem;
}

.tiny-note {
  margin-top: 15px;
  color: rgba(61, 33, 8, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
}

.welcome-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.welcome-orbit span {
  position: absolute;
  font-size: clamp(1.8rem, 6vw, 3rem);
  animation: floatDecor 5s ease-in-out infinite;
}

.welcome-orbit span:nth-child(1) { left: 7%; top: 13%; }
.welcome-orbit span:nth-child(2) { right: 7%; bottom: 14%; animation-delay: -1.5s; }
.welcome-orbit span:nth-child(3) { right: 12%; top: 10%; animation-delay: -3s; }

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + max(30px, env(safe-area-inset-bottom)));
  animation: appReveal 0.65s ease both;
}

.sound-toggle {
  position: fixed;
  z-index: 45;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.icon-button {
  width: 50px;
  min-width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  font-weight: 900;
}

.hero,
.content-section,
footer {
  width: min(calc(100% - 28px), var(--page-width));
  margin-inline: auto;
}

.hero {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  gap: 28px;
  padding:
    max(94px, calc(env(safe-area-inset-top) + 70px))
    0
    66px;
}

.special-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.73);
  border-radius: 999px;
  color: #753507;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 8px 25px rgba(143, 74, 4, 0.11);
  font-size: 0.84rem;
  font-weight: 900;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 10px 0 18px;
  text-wrap: balance;
}

.hero-description {
  max-width: 630px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 4vw, 1.28rem);
  font-weight: 700;
}

.hero-button {
  width: auto;
  min-width: min(100%, 220px);
  margin-top: 28px;
}

.hero-visual {
  position: relative;
  width: min(84vw, 310px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  text-align: center;
}

.sun-face {
  font-size: clamp(4rem, 20vw, 7rem);
  filter: drop-shadow(0 16px 20px rgba(171, 74, 2, 0.21));
  animation: friendlyWiggle 4s ease-in-out infinite;
}

.hero-visual p {
  position: absolute;
  bottom: 23px;
  padding: 8px 15px;
  border-radius: 999px;
  color: #713306;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orbit-dot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.67);
  box-shadow: var(--shadow-soft);
  font-size: 1.4rem;
  animation: floatDecor 5s ease-in-out infinite;
}

.dot-one { top: -3px; left: 17%; }
.dot-two { right: -8px; top: 44%; animation-delay: -1.7s; }
.dot-three { bottom: 8%; left: 2%; animation-delay: -3.2s; }

.content-section {
  padding: 70px 0;
}

.section-heading {
  max-width: 690px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 9px 0 12px;
}

.section-heading > p {
  color: var(--ink-soft);
  font-size: 1.04rem;
  font-weight: 650;
}

.mood-grid,
.games-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.mood-card {
  position: relative;
  min-width: 0;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mood-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 145px;
  height: 145px;
  right: -55px;
  top: -65px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.mood-card > * {
  position: relative;
  z-index: 1;
}

.mood-happy { background: linear-gradient(145deg, rgba(255, 250, 194, 0.92), rgba(255, 190, 37, 0.76)); }
.mood-funny { background: linear-gradient(145deg, rgba(255, 236, 175, 0.94), rgba(255, 139, 31, 0.76)); }
.mood-angry { background: linear-gradient(145deg, rgba(255, 218, 127, 0.94), rgba(255, 103, 42, 0.72)); }
.mood-peaceful { background: linear-gradient(145deg, rgba(255, 254, 221, 0.94), rgba(247, 182, 44, 0.72)); }
.mood-friendship { background: linear-gradient(145deg, rgba(255, 239, 186, 0.94), rgba(255, 160, 31, 0.73)); }

.mood-special {
  border: 2px solid rgba(255, 122, 24, 0.86);
  background: linear-gradient(145deg, rgba(255, 250, 170, 0.96), rgba(255, 135, 19, 0.88));
  box-shadow: 0 0 0 5px rgba(255, 222, 91, 0.28), 0 20px 48px rgba(180, 67, 2, 0.27);
  animation: specialPulse 2.4s ease-in-out infinite;
}

.card-number {
  align-self: flex-end;
  color: rgba(93, 42, 4, 0.43);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.card-emoji {
  margin: 16px 0 19px;
  font-size: clamp(2.25rem, 10vw, 3.25rem);
  letter-spacing: -0.15em;
  filter: drop-shadow(0 8px 9px rgba(114, 50, 0, 0.14));
}

.mood-card h3 {
  margin-bottom: 8px;
}

.mood-card p {
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-weight: 700;
}

.card-button {
  margin-top: auto;
  color: #5f2d08;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 22px rgba(111, 47, 0, 0.12);
}

.special-button {
  color: #fff;
  background: linear-gradient(135deg, #ff8d19, #e9570a);
}

.warning-badge {
  position: absolute;
  top: 20px;
  left: 22px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #7d2b00;
  background: #fff4a8;
  box-shadow: 0 8px 18px rgba(126, 44, 0, 0.14);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.games-section {
  padding-top: 90px;
}

.game-card {
  min-width: 0;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.game-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.game-icon {
  flex: 0 0 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff6ad, #ff9b1f);
  box-shadow: var(--shadow-soft);
  font-size: 1.65rem;
}

.game-card h3 {
  margin-top: 5px;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
}

.progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.progress-track {
  flex: 1 1 130px;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(135, 67, 7, 0.13);
}

.progress-track span {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffcc31, #ff6c14);
  transition: width 0.35s ease;
}

.game-question {
  min-height: 55px;
  margin-bottom: 16px;
  font-size: clamp(1.15rem, 4.8vw, 1.38rem);
  font-weight: 900;
  line-height: 1.35;
}

.game-options,
.answer-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.game-option,
.answer-button {
  min-width: 0;
  color: var(--ink);
  border: 1px solid rgba(255, 177, 39, 0.38);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 17px rgba(120, 56, 2, 0.08);
  text-align: left;
  overflow-wrap: anywhere;
}

.game-option.selected,
.answer-button.selected {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ffb51f, #f16b10);
}

.game-option:disabled,
.answer-button:disabled {
  cursor: default;
  opacity: 0.78;
}

.result-card {
  padding: 22px;
  border: 1px solid rgba(255, 187, 32, 0.45);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 249, 194, 0.94), rgba(255, 181, 50, 0.6));
  text-align: center;
  animation: popIn 0.45s ease both;
}

.result-card .result-emoji {
  display: block;
  margin-bottom: 10px;
  font-size: 2.6rem;
}

.result-card h4 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.result-card p {
  color: var(--ink-soft);
  font-weight: 700;
}

.restart-game {
  margin-top: 16px;
}

.kind-note {
  padding-bottom: 90px;
}

.kind-note-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: clamp(24px, 7vw, 44px);
  border-radius: var(--radius-lg);
}

.note-flower {
  flex: 0 0 auto;
  font-size: clamp(3rem, 13vw, 6rem);
  filter: drop-shadow(0 12px 15px rgba(122, 55, 0, 0.16));
}

.kind-note-card h2 {
  margin: 7px 0 9px;
  font-size: clamp(1.75rem, 7vw, 3rem);
}

.kind-note-card p {
  color: var(--ink-soft);
  font-weight: 700;
}

footer {
  padding: 0 0 35px;
  color: rgba(72, 36, 5, 0.74);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  min-height: var(--nav-height);
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background: rgba(255, 250, 231, 0.88);
  box-shadow: 0 15px 45px rgba(89, 39, 0, 0.24);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-button {
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 18px;
  color: #7a461a;
  background: transparent;
  font-weight: 900;
}

.nav-button span {
  font-size: 1.25rem;
  line-height: 1;
}

.nav-button small {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
}

.nav-button.active {
  color: #fff;
  background: linear-gradient(145deg, #ffbd24, #f47112);
  box-shadow: 0 8px 18px rgba(213, 81, 0, 0.22);
}

.secret-smile {
  position: fixed;
  z-index: 41;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(var(--nav-height) + max(20px, env(safe-area-inset-bottom)));
  width: 57px;
  min-width: 57px;
  height: 57px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff18b, #ff9e1c);
  box-shadow: 0 12px 28px rgba(131, 52, 0, 0.25);
  font-size: 1.65rem;
  transition: transform 0.15s ease;
}

.secret-smile:active {
  transform: rotate(8deg) scale(0.92);
}

.secret-count {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 28px;
  padding: 3px 5px;
  border-radius: 999px;
  color: #fff;
  background: #d84f09;
  font-size: 0.62rem;
  font-weight: 900;
}

.sheet-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(20px, env(safe-area-inset-top));
  background: rgba(70, 31, 3, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: overlayIn 0.25s ease both;
}

.bottom-sheet {
  width: min(100%, 720px);
  max-width: 100%;
  max-height: min(88dvh, 860px);
  padding:
    11px
    max(17px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(17px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 208, 69, 0.34), transparent 35%),
    #fffaf0;
  box-shadow: 0 -24px 60px rgba(93, 41, 0, 0.23);
  animation: sheetUp 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet-handle {
  width: 46px;
  height: 5px;
  margin: 0 auto 13px;
  border-radius: 999px;
  background: rgba(104, 51, 8, 0.22);
}

.sheet-header {
  position: sticky;
  z-index: 3;
  top: -11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-inline: -3px;
  padding: 10px 3px 15px;
  background: linear-gradient(#fffaf0 80%, rgba(255, 250, 240, 0));
}

.sheet-header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-header h2 {
  font-size: clamp(1.45rem, 6.5vw, 2rem);
}

.sheet-emoji {
  font-size: 1.8rem;
}

.close-button {
  flex: 0 0 50px;
  color: #6d380e;
  background: #fff1ca;
}

.sheet-content {
  padding: 8px 0 4px;
}

.sheet-intro {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--orange);
  border-radius: 0 15px 15px 0;
  color: var(--ink-soft);
  background: rgba(255, 209, 78, 0.19);
  font-weight: 800;
}

.question-step {
  animation: questionIn 0.35s ease both;
}

.question-count {
  margin-bottom: 9px;
  color: #a74609;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-text {
  margin-bottom: 18px;
  font-size: clamp(1.22rem, 5.8vw, 1.62rem);
  font-weight: 900;
  line-height: 1.35;
}

.answer-response {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid rgba(255, 184, 37, 0.4);
  border-radius: 18px;
  color: #63330c;
  background: linear-gradient(135deg, #fff7bd, #ffd26e);
  font-weight: 900;
  animation: popIn 0.35s ease both;
}

.next-question-button {
  margin-top: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  box-shadow: 0 10px 20px rgba(202, 68, 0, 0.2);
}

.emoji-burst {
  min-height: 68px;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.emoji-burst span {
  position: absolute;
  left: 50%;
  bottom: 0;
  font-size: 1.65rem;
  animation: emojiExplode 1.25s ease-out both;
}

.meter-list {
  display: grid;
  gap: 10px;
}

.meter-button {
  position: relative;
  overflow: hidden;
}

.meter-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--meter-width, 10%);
  background: linear-gradient(90deg, rgba(255, 214, 48, 0.4), rgba(255, 102, 22, 0.34));
  pointer-events: none;
}

.meter-button span {
  position: relative;
}

.match-icon {
  display: grid;
  place-items: center;
  height: 78px;
  margin-top: 10px;
  font-size: 3rem;
  animation: iconBounce 0.7s ease both;
}

.challenge-note {
  margin-bottom: 18px;
  padding: 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff1a2, #ffc252);
  font-weight: 900;
  text-align: center;
}

.challenge-arena {
  position: relative;
  width: 100%;
  min-height: 225px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px dashed rgba(179, 74, 4, 0.38);
  border-radius: 22px;
  background: rgba(255, 210, 75, 0.12);
}

.challenge-button {
  position: absolute;
  left: 12px;
  max-width: calc(100% - 24px);
  transition: left 0.32s ease, top 0.32s ease, transform 0.18s ease, background 0.25s ease;
}

.challenge-yes {
  top: 12px;
  width: calc(100% - 24px);
  color: #fff;
  background: linear-gradient(135deg, #ffad19, #ef650d);
}

.challenge-move {
  top: 86px;
  width: min(230px, calc(100% - 24px));
  border: 1px solid rgba(238, 114, 18, 0.38);
  background: #fff9dd;
}

.challenge-move.accepted {
  width: calc(100% - 24px);
  color: #fff;
  background: linear-gradient(135deg, #ffd33d, #f07110);
}

.secret-overlay {
  z-index: 110;
  background: rgba(75, 35, 4, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.secret-card {
  position: relative;
  width: min(100%, 520px);
  padding: clamp(28px, 8vw, 46px);
  border-radius: 32px;
  text-align: center;
  animation: popIn 0.42s ease both;
}

.secret-card .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.secret-lock {
  margin-bottom: 12px;
  font-size: 3.5rem;
}

.secret-card h2 {
  margin: 8px 0 15px;
  font-size: clamp(1.85rem, 8vw, 3rem);
}

.secret-card p:not(.eyebrow) {
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-weight: 700;
}

.success-screen {
  z-index: 120;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 218, 0.95), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(255, 196, 51, 0.8), transparent 35%),
    linear-gradient(145deg, #ffeb70, #ff9e20 60%, #ff7217);
}

.success-card {
  position: relative;
  width: min(100%, 750px);
  margin: auto;
  padding: clamp(26px, 7vw, 50px);
  border-radius: 36px;
  text-align: center;
  overflow: hidden;
  animation: successRise 0.65s cubic-bezier(0.2, 0.85, 0.25, 1.2) both;
}

.success-emojis {
  margin-bottom: 12px;
  font-size: clamp(2rem, 8vw, 3.4rem);
  letter-spacing: 0.1em;
  animation: friendlyWiggle 3s ease-in-out infinite;
}

.success-card h2 {
  margin: 8px 0 20px;
  font-size: clamp(2rem, 8.8vw, 3.7rem);
}

.success-card > p:not(.eyebrow, .signature, .highlight-message) {
  margin: 10px auto;
  color: var(--ink-soft);
  font-weight: 700;
}

.highlight-message {
  margin: 20px 0 10px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 231, 103, 0.55);
  font-weight: 900;
}

.signature {
  margin: 13px 0 22px;
  font-weight: 900;
}

.celebration-piece {
  position: fixed;
  z-index: 121;
  top: -30px;
  width: 12px;
  height: 22px;
  border-radius: 4px;
  pointer-events: none;
  animation: confettiFall var(--fall-time, 3s) linear forwards;
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(62, 29, 4, 0.92);
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover,
  .card-button:hover,
  .answer-button:hover,
  .game-option:hover,
  .next-question-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 28px rgba(141, 54, 0, 0.22);
  }

  .mood-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 25px 48px rgba(132, 58, 1, 0.2);
  }
}

@media (min-width: 680px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  }

  .mood-grid,
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-options,
  .answer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-visual {
    width: min(38vw, 370px);
  }
}

@media (min-width: 960px) {
  :root {
    --nav-height: 68px;
  }

  .app-shell {
    padding-top: 80px;
    padding-bottom: 0;
  }

  .hero {
    min-height: calc(100dvh - 80px);
    padding-top: 40px;
  }

  .mood-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bottom-nav {
    top: 14px;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(520px, calc(100% - 150px));
    min-height: 60px;
    transform: translateX(-50%);
  }

  .nav-button {
    min-height: 50px;
    flex-direction: row;
    gap: 7px;
  }

  .secret-smile {
    bottom: 22px;
  }

  footer {
    padding-bottom: 35px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .welcome-screen {
    place-items: start center;
  }

  .welcome-card {
    padding-block: 24px;
  }

  .mini-sun {
    width: 55px;
    height: 55px;
    margin-bottom: 10px;
  }

  .welcome-card h1 {
    margin-block: 6px 10px;
    font-size: clamp(1.85rem, 7vw, 3rem);
  }

  .welcome-button {
    margin-top: 16px;
  }

  .hero {
    min-height: 620px;
  }

  .bottom-sheet {
    max-height: 94dvh;
  }
}

@media (max-width: 390px) {
  .welcome-card {
    border-radius: 28px;
  }

  .mood-card,
  .game-card {
    padding: 21px;
  }

  .kind-note-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .note-flower {
    font-size: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes backgroundFlow {
  to { background-position: 100% 80%; }
}

@keyframes floatDecor {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
  50% { transform: translate3d(0, -18px, 0) rotate(5deg); }
}

@keyframes friendlyWiggle {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.06); }
}

@keyframes appReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes questionIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes specialPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 222, 91, 0.22), 0 20px 48px rgba(180, 67, 2, 0.24); }
  50% { box-shadow: 0 0 0 9px rgba(255, 222, 91, 0.38), 0 25px 58px rgba(180, 67, 2, 0.34); }
}

@keyframes emojiExplode {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.7) rotate(0); }
  100% { opacity: 0; transform: translate(var(--burst-x), -66px) scale(1.25) rotate(var(--burst-rotate)); }
}

@keyframes iconBounce {
  0% { opacity: 0; transform: scale(0.4) rotate(-15deg); }
  60% { transform: scale(1.2) rotate(6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes successRise {
  from { opacity: 0; transform: translateY(28px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes confettiFall {
  0% { transform: translate3d(0, -5vh, 0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--drift, 20px), 110vh, 0) rotate(720deg); opacity: 0.8; }
}
