/* Pumpkin Please: one card at a time, like flipping through hand-painted farm signs at dusk.
   A deliberate single dark look, so it reads the same on every phone. */
:root {
  --bg: #1f2a1f;
  --bg2: #2b3a29;
  --card: #f6ead2;
  --paper: #fff8ec;
  --ink: #2a1d14;
  --pumpkin: #e8741e;
  --pumpkin-d: #b8530c;
  --straw: #f2c14e;
  --muted: #7a6a55;
  --spot: #2a1d14;
  --cow: #fffaf2;
  --soft: rgba(42, 29, 20, 0.12);
  --display: "Grandstander", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg2), var(--bg) 70%) var(--bg);
  background-attachment: fixed;
  color: var(--card);
  font-family: var(--body);
  font-size: 16px;
  padding-inline: 16px;
  padding-block: calc(20px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
#leaves { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.wrap { position: relative; z-index: 1; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--card); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.progress { display: flex; gap: 6px; flex-wrap: wrap; }
.progress span { width: 22px; height: 6px; border-radius: 3px; background: rgba(246, 234, 210, 0.18); transition: background 0.3s; }
.progress span.on { background: var(--straw); }
.music {
  font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; border: 0;
  background: rgba(246, 234, 210, 0.12); color: var(--card); border-radius: 999px; padding: 8px 14px; margin-left: auto; white-space: nowrap;
}
.music[aria-pressed="true"] { background: var(--straw); color: var(--ink); }

.card {
  position: relative; background: var(--card); color: var(--ink); border-radius: 22px;
  padding: 28px 22px 24px;
  box-shadow: 0 10px 0 -4px var(--pumpkin-d), 0 20px 36px rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column; gap: 18px; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: -18px; right: -18px; width: 86px; height: 86px; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 60%, var(--spot) 0 9px, transparent 10px),
    radial-gradient(circle at 62% 34%, var(--spot) 0 13px, transparent 14px),
    radial-gradient(circle at 70% 72%, var(--spot) 0 6px, transparent 7px),
    var(--cow);
  opacity: 0.9; pointer-events: none;
}
.card.enter { animation: enter 0.28s ease-out; }
@keyframes enter { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.eyebrow { font-weight: 800; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pumpkin-d); position: relative; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.08; text-wrap: balance; position: relative; }
h1 { font-size: clamp(28px, 8vw, 38px); font-weight: 800; }
h2 { font-size: clamp(23px, 6.5vw, 29px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 800; }
p { margin: 0; line-height: 1.5; color: var(--muted); }
.sign { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--pumpkin-d); }

.hero { display: flex; justify-content: center; align-items: flex-end; }
.hero svg { width: 100%; max-width: 280px; height: auto; }
.hero.small svg { max-width: 200px; }
.bob { animation: bob 3s ease-in-out infinite; transform-origin: 50% 100%; width: 100%; display: flex; justify-content: center; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-1deg); } }

.btns { display: flex; gap: 12px; flex-wrap: wrap; position: relative; }
button { font: inherit; cursor: pointer; border: 0; }
.btn {
  flex: 1 1 140px; font-family: var(--display); font-weight: 800; font-size: 20px;
  padding: 14px 18px; border-radius: 16px; background: var(--pumpkin); color: #fff8ec; text-align: center; text-decoration: none;
  box-shadow: 0 4px 0 var(--pumpkin-d); transition: transform 0.1s, box-shadow 0.1s, opacity 0.2s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--pumpkin-d); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(42, 29, 20, 0.25); }
.btn.small { font-size: 16px; padding: 10px 14px; flex: 0 1 auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible, .music:focus-visible, .swatch-dot:focus-visible, .cal button:focus-visible, .seg button:focus-visible, .linkish:focus-visible {
  outline: 3px solid var(--straw); outline-offset: 3px;
}
.linkish { background: none; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: underline dotted; padding: 4px 8px; align-self: center; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.three { grid-template-columns: 1fr 1fr 1fr; }
.opt {
  text-align: left; background: var(--paper); color: var(--ink); border-radius: 14px;
  padding: 12px 14px; box-shadow: inset 0 0 0 2px var(--soft);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: box-shadow 0.15s, background 0.15s;
}
.opt b { font-family: var(--display); font-size: 17px; font-weight: 600; }
.opt small { color: var(--muted); font-size: 13px; }
.opt .ic { font-size: 22px; line-height: 1; }
.opt[aria-pressed="true"] { background: #ffe2c4; box-shadow: inset 0 0 0 3px var(--pumpkin); }
.opts.three .opt { align-items: center; text-align: center; padding: 12px 6px; }
.opt.off { opacity: 0.55; }
.full { grid-column: 1 / -1; display: flex; flex-direction: column; }
.size-row { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; }
.size-row .opt { align-items: center; text-align: center; flex: 1; padding: 14px 6px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }
input[type="text"], textarea {
  width: 100%; font: inherit; font-weight: 600; color: var(--ink); background: var(--paper); border: 0; border-radius: 14px;
  padding: 12px 14px; box-shadow: inset 0 0 0 2px var(--soft);
}
textarea { min-height: 80px; resize: vertical; }
input[type="text"]:focus, textarea:focus { outline: 3px solid var(--straw); }
.err { color: #b3261e; font-weight: 700; font-size: 14px; min-height: 1.2em; }

.summary { background: var(--paper); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 0 2px var(--soft); }
.row { display: flex; gap: 10px; align-items: baseline; }
.row .k { flex: 0 0 78px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pumpkin-d); }
.row .v { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.toast { text-align: center; font-weight: 800; color: var(--pumpkin-d); min-height: 1.4em; }
.foot { text-align: center; font-size: 13px; color: rgba(246, 234, 210, 0.55); }
.foot a { color: inherit; }
.speech {
  position: relative; align-self: center; background: var(--paper); border-radius: 14px; padding: 8px 14px;
  font-family: var(--display); font-weight: 600; font-size: 15px; box-shadow: inset 0 0 0 2px var(--soft);
}
.copybox { width: 100%; min-height: 90px; font-size: 14px; }

/* couple preview panel */
.stage { display: flex; justify-content: center; background: var(--paper); border-radius: 16px; padding: 10px; box-shadow: inset 0 0 0 2px rgba(42, 29, 20, 0.08); }
.stage svg { width: 100%; max-width: 260px; height: auto; }

/* outfit colors */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { flex-direction: row; align-items: center; gap: 8px; padding: 10px; }
.swatch b { font-size: 15px; }
.dot { flex: 0 0 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(42, 29, 20, 0.25); }

/* evil cow */
.evil {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 40%, #5a0d0d, #140303 75%); color: #ffd9d0; animation: evilIn 0.35s ease-out;
}
.evil-cow svg { width: min(70vw, 260px); height: auto; animation: shake 0.12s linear infinite; filter: drop-shadow(0 0 24px rgba(255, 40, 40, 0.55)); }
.evil-text { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 13vw, 64px); color: #ff3b30; letter-spacing: 0.04em; text-shadow: 0 4px 0 #3a0000; }
.evil p { color: #ffd9d0; font-size: 17px; font-weight: 700; }
.evil .btn { flex: 0 0 auto; width: min(80vw, 280px); font-size: 24px; }
@keyframes evilIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes shake { 0% { transform: translate(0, 0); } 25% { transform: translate(-3px, 1px) rotate(-1deg); } 50% { transform: translate(2px, -2px) rotate(1deg); } 75% { transform: translate(-1px, 2px); } 100% { transform: translate(0, 0); } }

/* game */
.gamebox { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(#9fd3e8, #cfeaf2 60%, #8cbf5a 60%, #6fa544); touch-action: none; user-select: none; -webkit-user-select: none; }
#game { display: block; width: 100%; height: 360px; touch-action: none; }
.hud { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; justify-content: space-between; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink); pointer-events: none; }
.hud span { background: rgba(255, 250, 242, 0.85); border-radius: 10px; padding: 2px 10px; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(31, 42, 31, 0.6); color: var(--card); text-align: center; padding: 16px; }
.overlay h2 { color: var(--card); }
.overlay p { color: var(--card); }
.overlay .btn { flex: 0 0 auto; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* builder */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(42, 29, 20, 0.08); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { background: transparent; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 16px; padding: 10px 8px; border-radius: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 2px 0 rgba(42, 29, 20, 0.15); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group > .lbl { font-weight: 800; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.dots { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch-dot { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(42, 29, 20, 0.2); }
.swatch-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pumpkin); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--paper); border-radius: 14px; padding: 6px 4px 8px; box-shadow: inset 0 0 0 2px var(--soft); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); min-width: 0; }
.tile svg { width: 100%; max-width: 64px; height: auto; }
.tile b { font-family: var(--display); font-weight: 600; font-size: 13px; }
.tile[aria-pressed="true"] { background: #ffe2c4; box-shadow: inset 0 0 0 3px var(--pumpkin); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.cal button {
  aspect-ratio: 1; border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 16px;
  box-shadow: inset 0 0 0 2px var(--soft); font-variant-numeric: tabular-nums; max-width: 100%;
}
.cal button.wk { background: #fdf0d8; }
.cal button[aria-pressed="true"] { background: var(--pumpkin); color: #fff8ec; box-shadow: 0 3px 0 var(--pumpkin-d); }
.cal button:disabled { opacity: 0.3; cursor: not-allowed; }

.toggle { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 2px var(--soft); text-align: left; color: var(--ink); width: 100%; }
.toggle .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toggle b { font-family: var(--display); font-weight: 600; font-size: 17px; }
.toggle small { color: var(--muted); font-size: 13px; }
.switch { flex: 0 0 46px; height: 28px; border-radius: 14px; background: rgba(42, 29, 20, 0.2); position: relative; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle[aria-pressed="true"] .switch { background: var(--pumpkin); }
.toggle[aria-pressed="true"] .switch::after { transform: translateX(18px); }

.linkbox { background: var(--paper); border-radius: 14px; padding: 14px; box-shadow: inset 0 0 0 2px var(--soft); display: flex; flex-direction: column; gap: 10px; }
.linkbox.private { box-shadow: inset 0 0 0 2px var(--pumpkin); }
.linkbox .url { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.linkbox .btns { gap: 8px; }
.mine { display: flex; flex-direction: column; gap: 8px; }
.mine a { display: flex; justify-content: space-between; gap: 10px; background: var(--paper); color: var(--ink); text-decoration: none; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 2px var(--soft); font-weight: 700; }
.mine a span:last-child { color: var(--pumpkin-d); white-space: nowrap; }
/* optional tip */
#tipBox:empty { display: none; }
.tip #tipBody, .tip .pay, .tipcard { display: flex; flex-direction: column; gap: 10px; }
.tip .pay > div { min-width: 0; }
.tipcard .lbl { font-weight: 800; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.tipcard .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipcard .pair > div { min-width: 0; }
.tipcard .btn { flex: 0 0 auto; }
.tipmsg { font-weight: 700; font-size: 14px; color: var(--pumpkin-d); }
.tipmsg:empty { display: none; }

.status { display: inline-flex; align-self: flex-start; gap: 6px; align-items: center; font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: #fdf0d8; color: var(--pumpkin-d); }
.status.yes { background: #e2f0d4; color: #3d6b1f; }
.note-small { font-size: 13px; }

@media (max-width: 380px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .opts.three { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
