:root {
  --bg: #11130f;
  --panel: #1b1d16;
  --paper: #f1e8d2;
  --paper2: #c7b99a;
  --ink: #17150f;
  --line: rgba(241,232,210,.18);
  --sprout: #a7d182;
  --rose: #d98b78;
  --blue: #8fc4cf;
  --gold: #d5b46b;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% -10%, rgba(143,196,207,.22), transparent 26rem),
    radial-gradient(circle at 80% 88%, rgba(167,209,130,.12), transparent 22rem),
    var(--bg);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(115deg, transparent 0 94%, rgba(255,255,255,.18) 95% 96%, transparent 97%);
  background-size: 44px 120px;
  animation: rain 16s linear infinite;
}
@keyframes rain { to { background-position: -120px 360px; } }
button, input {
  font: inherit;
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(255,255,255,.06);
}
button { cursor: pointer; }
.phone-shell {
  width: min(430px, 100vw);
  height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kicker {
  margin: 0 0 3px;
  color: var(--gold);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font: 700 clamp(27px, 8vw, 38px)/1.02 Georgia, serif;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}
.meters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.meters div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  padding: 9px;
}
.meters b {
  display: block;
  font: 800 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.meters span {
  color: var(--paper2);
  font-size: 11px;
}
.surfaces {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.surfaces button {
  min-width: 0;
  min-height: 36px;
  border-radius: 999px;
  color: var(--paper2);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .03em;
}
.surfaces button.active {
  color: var(--bg);
  background: var(--gold);
  border-color: transparent;
}
.stage {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
}
.shadow-card {
  position: absolute;
  width: calc(100% - 42px);
  height: calc(100% - 42px);
  max-height: 470px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(241,232,210,.14);
  transform: translateY(12px) scale(.94);
}
.card {
  position: relative;
  width: calc(100% - 16px);
  height: calc(100% - 18px);
  max-height: 490px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 70% 18%, rgba(213,180,107,.22), transparent 9rem),
    linear-gradient(160deg, #fbf2dc, #dfcfaa);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  touch-action: none;
  will-change: transform;
}
.card.snap { transition: transform .22s cubic-bezier(.2,.8,.3,1); }
.card.fly { transition: transform .28s cubic-bezier(.5,.05,.8,.4), opacity .28s; }
.card-meta {
  display: flex;
  justify-content: space-between;
  color: rgba(23,21,15,.58);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.card h2 {
  margin: 18px 0 10px;
  font: 800 31px/1.02 Georgia, serif;
}
.card p {
  margin: 0;
  color: rgba(23,21,15,.76);
  font-size: 18px;
}
.card-cite {
  margin-top: 12px !important;
  color: #6f5730 !important;
  font: 700 11px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: .04em;
}
.swipe-hints {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.swipe-hints span {
  min-height: 54px;
  border: 1px solid rgba(23,21,15,.14);
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  font: 700 13px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
}
#leftHint { color: #934532; }
#rightHint { color: #235e62; }
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choices button, .maker button {
  border-radius: 14px;
  min-height: 46px;
  padding: 10px;
}
.choices button:first-child { background: rgba(217,139,120,.16); }
.choices button:last-child { background: rgba(143,196,207,.16); }
.maker {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  padding: 11px;
}
.maker label {
  display: block;
  color: var(--paper2);
  font-size: 12px;
  margin-bottom: 8px;
}
.maker div {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 8px;
}
.maker input {
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  padding: 9px 10px;
}
.maker p {
  margin: 8px 0 0;
  color: var(--paper2);
  font-size: 12px;
}
@media (max-height: 700px) {
  .maker { display: none; }
  .card h2 { font-size: 27px; }
  .card p { font-size: 16px; }
}
@media (max-width: 360px) {
  .phone-shell { padding-inline: 10px; }
  .surfaces { gap: 4px; }
  .surfaces button { font-size: 9px; }
  .meters div { padding: 7px 5px; }
}
