:root {
  --bg: #14110f;
  --cream: #f4ece3;
  --mute: #c8b8a8;
  --coral: #e57a4a;
  --ink: #1b1613;
  --glass: rgba(20, 17, 15, 0.42);
  --safe-b: max(18px, env(safe-area-inset-bottom));
  --safe-t: max(14px, env(safe-area-inset-top));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: Outfit, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow: hidden;
}

#app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: var(--safe-t) 18px var(--safe-b);
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mark {
  letter-spacing: 0.18em;
  text-transform: lowercase;
  font-size: 13px;
  font-weight: 650;
}

.now-btn {
  border: 0;
  background: transparent;
  color: var(--coral);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.deck {
  position: relative;
  min-height: 0;
}

.card {
  height: 100%;
  min-height: 46vh;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 24px 32px;
  isolation: isolate;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s ease, opacity 0.28s ease;
  touch-action: pan-y;
}

.card.away {
  transform: translateY(-18%) scale(0.96);
  opacity: 0;
}

.card.in {
  animation: rise 0.42s ease;
}

@keyframes rise {
  from {
    transform: translateY(12%) scale(0.98);
    opacity: 0;
  }
}

.wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, 0.16), transparent 50%),
    linear-gradient(180deg, transparent 20%, rgba(12, 9, 8, 0.55) 100%),
    var(--mood, #3a2a24);
}

.kind,
.hint {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--mute);
}

.wish {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: clamp(28px, 8vw, 46px);
  line-height: 1.08;
  margin: 10px 0 16px;
  max-width: 12ch;
  text-wrap: balance;
}

.rate {
  padding: 2px 0 0;
}

.pills {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.pill {
  appearance: none;
  border: 0;
  height: 46px;
  border-radius: 999px;
  background: #2a2420;
  color: var(--mute);
  font: inherit;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
}

.pill:hover,
.pill:focus-visible {
  background: #3a332e;
  color: var(--cream);
}

.pill.on {
  background: var(--coral);
  color: var(--ink);
  transform: translateY(-2px);
}

.dock {
  display: grid;
  gap: 12px;
}

.recent {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: 38px;
}

.recent::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #241f1c;
  color: var(--cream);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip b {
  color: var(--coral);
  margin-right: 6px;
  font-weight: 650;
}

.actions {
  display: flex;
  gap: 10px;
}

.ghost,
.plus {
  flex: 1;
  height: 48px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--mute);
  border: 1px solid #3a332e;
}

.plus {
  background: var(--cream);
  color: var(--ink);
}

.sheet {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100%;
  width: min(440px, 100%);
  margin: auto auto 0;
}

.sheet::backdrop {
  background: rgba(8, 6, 5, 0.72);
}

.sheet-inner {
  background: #1c1815;
  color: var(--cream);
  border-radius: 28px 28px 0 0;
  padding: 28px 22px calc(22px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}

.sheet h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}

.sub {
  color: var(--mute);
  font-size: 15px;
}

.ladder {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 8px 0 6px;
}

.ladder li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #241f1c;
  border-radius: 16px;
  font-size: 15px;
}

.ladder span {
  color: var(--coral);
  font-weight: 650;
}

textarea {
  width: 100%;
  min-height: 110px;
  border: 0;
  border-radius: 18px;
  padding: 14px;
  background: #241f1c;
  color: var(--cream);
  font: inherit;
  resize: none;
}

textarea:focus {
  outline: 2px solid var(--coral);
}
