/* ============================================================
   TASTE PARTIES — phone, shared screen, join and invitation pages
   Built on tokens.css: navy ground, sage accent, Inter + Plex Mono,
   plus one new material for the party: paper with handwriting.
   ============================================================ */

:root {
  --pt-paper: #F7F4EC;
  --pt-ink: #1f3350;
  --pt-ink-print: #56636f;
  --pt-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --pt-script: 'Homemade Apple', 'Caveat', cursive;
  --pt-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --pt-sweet: #f4d03f;
  --pt-salty: #aed6f1;
  --pt-sour: #f7c59f;
  --pt-umami: #9BB8A6;
  --pt-bitter: #C4A882;
  --pt-hate: #e07a5f;
  --pt-dislike: #8f5b4f;
  --pt-ok: #355062;
  --pt-like: #6f9a83;
  --pt-love: #acd4bb;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pt-page, body.ps-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--tx);
  background-color: var(--navy-deep);
  background-image:
    radial-gradient(900px 560px at 92% -10%, rgba(155,184,166,.16), transparent 60%),
    radial-gradient(800px 600px at -20% 110%, rgba(0,84,170,.20), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 55%, var(--navy-deeper) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--sage-light); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
[hidden] { display: none !important; }

.pt-mono { font-family: var(--pt-mono); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.pt-soft { color: var(--tx-soft); }
.pt-sage { color: var(--sage); }
.pt-amber { color: var(--amber); }

/* ---------- Buttons ---------- */
.pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 16px 26px; min-height: 52px;
  font-weight: 800; font-size: 16px; letter-spacing: -.005em; text-decoration: none;
  background: var(--sage); color: var(--navy-deeper);
  box-shadow: 0 14px 36px rgba(155,184,166,.26);
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.pt-btn:hover { background: #aecbbb; color: var(--navy-deeper); transform: translateY(-1px); }
.pt-btn:active { transform: translateY(1px) scale(.99); }
.pt-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.pt-btn.ghost { background: transparent; color: var(--tx); border: 1.5px solid var(--line-strong); box-shadow: none; }
.pt-btn.ghost:hover { border-color: var(--sage); color: #fff; background: rgba(155,184,166,.06); }
.pt-btn.quiet { background: rgba(255,255,255,.06); color: var(--tx); box-shadow: none; }
.pt-btn.quiet:hover { background: rgba(255,255,255,.1); color: #fff; }
.pt-btn.danger { background: transparent; color: #f2a08f; border: 1.5px solid rgba(242,160,143,.45); box-shadow: none; }
.pt-btn.block { width: 100%; }
.pt-btn.sm { min-height: 40px; padding: 9px 16px; font-size: 14px; }
.pt-btn.lg { min-height: 60px; padding: 18px 34px; font-size: 17px; }
.pt-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Avatars ---------- */
.pt-av {
  --s: 36px; --c: var(--sage);
  width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--c); color: var(--navy-deeper);
  font-weight: 800; font-size: calc(var(--s) * .42); line-height: 1;
  box-shadow: 0 0 0 2px rgba(0,21,35,.85);
}
.pt-av.ring { background: transparent; color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.pt-av.ghost { background: transparent; color: var(--tx-faint); box-shadow: inset 0 0 0 2px var(--line-strong); }
.c0 { --c: #9BB8A6; } .c1 { --c: #aed6f1; } .c2 { --c: #f7c59f; } .c3 { --c: #f4d03f; }
.c4 { --c: #e6a1b4; } .c5 { --c: #b9b3e8; } .c6 { --c: #d6e58f; } .c7 { --c: #C4A882; }
.c8 { --c: #E8B86A; } .c9 { --c: #8fd3c1; } .c10 { --c: #f29e8e; } .c11 { --c: #9cc3f0; }

/* ---------- Cards, chips, bars ---------- */
.pt-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(255,255,255,.065), rgba(255,255,255,.02));
  padding: 22px;
}
.pt-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.05); color: var(--tx);
}
.pt-chip.hot { border-color: rgba(232,184,106,.6); color: var(--amber); background: rgba(232,184,106,.08); }
.pt-chip.sage { border-color: rgba(155,184,166,.5); color: var(--sage-light); background: rgba(155,184,166,.1); }
.pt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 10px var(--sage); flex: none; }
.pt-dot.live { animation: pt-pulse 2.2s ease-in-out infinite; }
@keyframes pt-pulse { 50% { opacity: .35; } }
.pt-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.pt-bar > i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--sage); transition: width .5s var(--ease); }

/* ---------- Paper and handwriting ---------- */
.pt-paper {
  position: relative; color: var(--pt-ink); border-radius: 6px;
  background-color: var(--pt-paper);
  background-image:
    radial-gradient(120% 80% at 18% 0%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(214,201,176,.4), transparent 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 18px 40px rgba(0,0,0,.42), 0 2px 6px rgba(0,0,0,.25);
  padding: 22px 22px 18px;
}
.pt-paper .print { font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--pt-ink-print); margin: 0; }
.pt-hand { font-family: var(--pt-hand); font-weight: 600; font-size: 25px; line-height: 1.22; margin: 10px 0 0; }
.pt-hand .l { display: block; }
.pt-hand .l:nth-child(3n+1) { transform: rotate(-.6deg) translateX(1px); }
.pt-hand .l:nth-child(3n+2) { transform: rotate(.35deg) translateX(-2px); }
.pt-hand .l:nth-child(3n) { transform: rotate(-.15deg) translateX(3px); }
.pt-sign { font-family: var(--pt-script); font-size: 19px; text-align: right; margin: 10px 0 0; color: var(--pt-ink); }
.pt-paper.writing .pt-hand .l, .pt-paper.writing .pt-sign { animation: pt-write .9s steps(24, end) both; animation-delay: calc(var(--i, 0) * .6s); }
@keyframes pt-write { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -2% -20% 0); } }

/* ============================================================
   PHONE
   ============================================================ */
.pt-app {
  max-width: 560px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.pt-head { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.pt-head .mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(155,184,166,.12); border: 1px solid rgba(155,184,166,.25); flex: none; }
.pt-head .mark svg { width: 20px; height: 20px; color: var(--sage-light); }
.pt-head .title { min-width: 0; flex: 1; }
.pt-head .title b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-head .title span { display: block; font-size: 12.5px; color: var(--tx-soft); }
.pt-code { font-family: var(--pt-mono); font-weight: 600; letter-spacing: .22em; font-size: 13px; padding: 7px 10px 7px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(0,0,0,.18); }
.pt-main { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.pt-main.is-new > * { animation: pt-rise .55s var(--ease) both; }
.pt-main.is-new > *:nth-child(2) { animation-delay: .05s; }
.pt-main.is-new > *:nth-child(3) { animation-delay: .1s; }
.pt-main.is-new > *:nth-child(4) { animation-delay: .15s; }
@keyframes pt-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pt-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--sage); margin: 0; }
.pt-eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.pt-h1 { font-weight: 900; font-size: clamp(28px, 8vw, 38px); line-height: 1.05; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.pt-h1 em { font-style: normal; color: var(--sage); }
.pt-h2 { font-weight: 800; font-size: 21px; line-height: 1.2; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.pt-lead { color: var(--tx-soft); font-size: 16px; margin: 0; }

.pt-choices { display: grid; gap: 10px; }
.pt-choices.three { grid-template-columns: repeat(3, 1fr); }
.pt-choices.two { grid-template-columns: repeat(2, 1fr); }
.pt-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%;
  padding: 16px 18px; min-height: 58px; border-radius: 18px; text-align: left;
  border: 1.5px solid var(--line-strong); background: rgba(255,255,255,.04);
  font-weight: 800; font-size: 17px; transition: background .2s, border-color .2s, transform .15s;
}
.pt-choice small { font-weight: 500; font-size: 13.5px; color: var(--tx-soft); }
.pt-choice:hover { border-color: rgba(155,184,166,.55); }
.pt-choice:active { transform: scale(.985); }
.pt-choice.sel { background: var(--sage); border-color: var(--sage); color: var(--navy-deeper); }
.pt-choice.sel small { color: rgba(0,21,35,.72); }
.pt-choices.three .pt-choice, .pt-choices.two .pt-choice { align-items: center; text-align: center; justify-content: center; }

.pt-envelope {
  display: flex; align-items: center; gap: 16px;
  padding: 18px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(247,244,236,.1), rgba(247,244,236,.03));
  border: 1px solid rgba(247,244,236,.18);
}
.pt-envelope .letter {
  width: 66px; height: 66px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-weight: 900; font-size: 36px; letter-spacing: -.02em;
  background: var(--pt-paper); color: var(--pt-ink); box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.pt-envelope p { margin: 0; color: var(--tx-soft); font-size: 14.5px; }
.pt-envelope b { color: var(--tx); display: block; font-size: 16px; margin-bottom: 3px; }

.pt-wait { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); border: 1px dashed var(--line-strong); }
.pt-wait .who { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-wait .row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--tx-soft); }

.pt-food { display: flex; flex-direction: column; gap: 14px; }
.pt-food .photo { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.pt-food .photo img { width: 100%; height: 100%; object-fit: cover; }
.pt-food .photo .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 26px; color: var(--sage-light); padding: 20px; text-align: center; }
.pt-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pt-face {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 2px 10px; border-radius: 16px; min-height: 84px;
  border: 1.5px solid var(--line-strong); background: rgba(255,255,255,.04);
  color: var(--sage-light); font-size: 11.5px; font-weight: 700; line-height: 1.15; text-align: center;
  transition: background .2s, transform .15s, border-color .2s;
}
.pt-face svg { width: 36px; height: 36px; }
.pt-face:active { transform: scale(.96); }
.pt-face.sel { background: var(--sage); border-color: var(--sage); color: var(--navy-deeper); }
.pt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.pt-strips { display: grid; gap: 8px; }
.pt-strips div { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.035); font-weight: 600; }
.pt-strips b { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--pt-paper); color: var(--pt-ink); font-weight: 900; }
.pt-strips span { color: var(--tx-soft); font-weight: 500; margin-left: auto; font-size: 14px; text-align: right; }

.pt-guests { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.pt-guest { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; font-size: 12.5px; font-weight: 700; text-align: center; }
.pt-guest span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Personal breakdown */
.pt-persona { padding: 24px; border-radius: var(--r-xl); position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, rgba(155,184,166,.22), transparent 55%), linear-gradient(165deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(155,184,166,.28); }
.pt-persona .name { font-weight: 900; font-size: clamp(30px, 9vw, 42px); line-height: 1.02; letter-spacing: -.035em; margin: 8px 0 12px;
  background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--sage) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-wrap: balance; }
.pt-persona .headline { color: var(--tx-soft); margin: 0 0 16px; font-size: 15.5px; }
.pt-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-bars { display: grid; gap: 12px; }
.pt-bars .bar { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; font-size: 14.5px; font-weight: 600; }
.pt-bars .bar .pt-bar { height: 8px; }
.pt-bars .bar em { font-style: normal; font-family: var(--pt-mono); font-size: 12px; color: var(--tx-soft); min-width: 74px; text-align: right; }
.pt-tip { padding: 16px 18px; border-radius: 18px; background: rgba(155,184,166,.1); border: 1px solid rgba(155,184,166,.3); }
.pt-tip b { display: block; font-family: var(--pt-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-light); font-weight: 500; margin-bottom: 6px; }
.pt-tip p { margin: 0; font-size: 15px; line-height: 1.55; }
.pt-recipes { display: grid; gap: 10px; }
.pt-recipe { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.035); text-decoration: none; color: var(--tx); transition: border-color .2s, background .2s; }
.pt-recipe:hover { border-color: rgba(155,184,166,.5); color: #fff; background: rgba(255,255,255,.06); }
.pt-recipe img, .pt-recipe .ph { width: 64px; height: 64px; border-radius: 13px; object-fit: cover; flex: none; background: rgba(255,255,255,.08); }
.pt-recipe b { display: block; font-size: 15px; line-height: 1.25; }
.pt-recipe small { color: var(--tx-soft); font-size: 12.5px; }
.pt-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(232,184,106,.1); border: 1px solid rgba(232,184,106,.4); }
.pt-banner p { margin: 0; font-size: 14.5px; flex: 1; }
.pt-banner.sage { background: rgba(155,184,166,.1); border-color: rgba(155,184,166,.4); }

/* Host bar and sheet */
.pt-hostbar { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); margin-top: 18px; display: flex; gap: 10px; z-index: 5; }
.pt-hostbar .pt-btn { flex: 1; }
.pt-hostpill { box-shadow: 0 12px 30px rgba(0,0,0,.45); background: #0d2a3e; color: var(--tx); border: 1px solid var(--line-strong); }
.pt-hostpill:hover { background: #12344c; color: #fff; }
.pt-sheet-back { position: fixed; inset: 0; background: rgba(0,10,18,.6); backdrop-filter: blur(4px); z-index: 40; animation: pt-fade .2s ease both; }
.pt-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88dvh; overflow: auto;
  max-width: 560px; margin: 0 auto; border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #0b2638, #061a28); border: 1px solid var(--line-strong); border-bottom: 0;
  padding: 10px max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  animation: pt-up .35s var(--ease) both;
}
.pt-sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 4px auto 14px; }
.pt-sheet h3 { margin: 18px 0 10px; font-size: 13px; font-family: var(--pt-mono); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.pt-sheet h3:first-of-type { margin-top: 4px; }
.pt-list { display: grid; gap: 8px; }
.pt-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.pt-item .who { flex: 1; min-width: 0; }
.pt-item .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-list.titles .who b { white-space: normal; }
.pt-item .who small { color: var(--tx-soft); font-size: 12.5px; }
@keyframes pt-fade { from { opacity: 0; } }
@keyframes pt-up { from { transform: translateY(40px); opacity: 0; } }

.pt-qrbox { display: flex; gap: 16px; align-items: center; }
.pt-qrbox img { width: 132px; height: 132px; border-radius: 14px; background: #fff; padding: 6px; flex: none; }
.pt-toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  padding: 12px 18px; border-radius: 14px; background: #0d2a3e; border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: 14.5px; max-width: calc(100vw - 32px); animation: pt-up .3s var(--ease) both; }
.pt-offline { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
  padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(232,184,106,.16); color: var(--amber); border: 1px solid rgba(232,184,106,.45); }

/* ---------- Forms (join, new party, screen code) ---------- */
.pt-form-page { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.pt-form { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.pt-form .brand { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
/* The logo is blue on transparent and disappears on navy, so it sits on a paper pill. */
.pt-logo { display: inline-flex; padding: 8px 14px; border-radius: 14px; background: var(--pt-paper); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.pt-logo img { height: 30px; width: auto; }
.pt-seg.two-up { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
.pt-past { display: grid; gap: 8px; }
.pt-past a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.035); text-decoration: none; color: var(--tx); }
.pt-past a:hover { border-color: rgba(155,184,166,.5); color: #fff; }
.pt-past a span { flex: 1; min-width: 0; }
.pt-past a b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-past a small { color: var(--tx-soft); }
.pt-label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.pt-input {
  width: 100%; min-height: 56px; padding: 14px 16px; border-radius: 16px;
  border: 1.5px solid var(--line-strong); background: rgba(0,0,0,.25); color: var(--tx);
  font: 600 18px 'Inter', sans-serif;
}
.pt-input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(155,184,166,.18); }
.pt-input.code { font-family: var(--pt-mono); letter-spacing: .5em; text-transform: uppercase; text-align: center; font-size: 30px; padding-left: calc(16px + .5em); }
.pt-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.pt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pt-seg label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 10px; border-radius: 14px;
  border: 1.5px solid var(--line-strong); background: rgba(255,255,255,.04); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.pt-seg input:checked + label { background: var(--sage); border-color: var(--sage); color: var(--navy-deeper); }
.pt-seg input:focus-visible + label { outline: 2px solid var(--sage); outline-offset: 3px; }
.pt-switch { display: flex; align-items: center; gap: 14px; cursor: pointer; font-size: 14.5px; color: var(--tx-soft); }
.pt-switch input { width: 46px; height: 28px; appearance: none; border-radius: 99px; background: rgba(255,255,255,.14); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.pt-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.pt-switch input:checked { background: var(--sage); }
.pt-switch input:checked::after { transform: translateX(18px); background: var(--navy-deeper); }
.pt-error { padding: 12px 14px; border-radius: 14px; background: rgba(224,122,95,.12); border: 1px solid rgba(224,122,95,.45); color: #f6c3b6; font-size: 14.5px; }
.pt-fine { font-size: 13px; color: var(--tx-soft); text-align: center; margin: 0; }

/* ============================================================
   SHARED SCREEN — sized to the viewport so a tablet, a laptop
   and a 1080p TV all see the same layout, just larger or smaller.
   ============================================================ */
body.ps-page { overflow: hidden; font-size: clamp(14px, calc(.95vw + .55vh), 32px); }
.ps {
  height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 1.2em;
  padding: max(1.4em, env(safe-area-inset-top)) max(2.2em, env(safe-area-inset-right)) max(1.2em, env(safe-area-inset-bottom)) max(2.2em, env(safe-area-inset-left));
}
.ps-top { display: flex; align-items: center; gap: 1em; }
.ps-top .title { flex: 1; min-width: 0; }
.ps-top .title b { display: block; font-size: 1.05em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-top .title span { font-family: var(--pt-mono); font-size: .62em; letter-spacing: .16em; text-transform: uppercase; color: var(--sage); }
.ps-code { font-family: var(--pt-mono); font-weight: 600; letter-spacing: .24em; font-size: .9em; padding: .45em .6em .45em .8em; border-radius: .6em; border: 1px solid var(--line-strong); background: rgba(0,0,0,.2); }
.ps-main { min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 1em; }
.ps-main.is-new > * { animation: pt-rise .6s var(--ease) both; }
.ps-main.is-new > *:nth-child(2) { animation-delay: .08s; }
.ps-main.is-new > *:nth-child(3) { animation-delay: .16s; }
.ps-foot { display: flex; align-items: center; justify-content: space-between; gap: 1em; border-top: 1px solid var(--line); padding-top: .9em; color: var(--tx-soft); font-size: .78em; }
.ps-foot .pt-btn { font-size: 1.1em; min-height: 2.6em; padding: .7em 1.5em; }
.ps-h { font-weight: 900; font-size: 2.6em; line-height: 1.03; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.ps-h em { font-style: normal; color: var(--sage); }
.ps-h.sm { font-size: 1.9em; }
.ps-sub { color: var(--tx-soft); font-size: 1em; margin: 0; max-width: 46em; }
.ps-label { font-family: var(--pt-mono); font-size: .62em; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-light); margin: 0; }
.ps .pt-av { --s: 2.3em; }

.ps-lobby { flex: 1; display: grid; grid-template-columns: 1fr 1.1fr; gap: 3em; align-items: center; min-height: 0; }
.ps-bigcode { font-family: var(--pt-mono); font-weight: 600; font-size: 5.4em; letter-spacing: .2em; line-height: 1; margin: .2em 0 .25em; color: #fff; }
.ps-join { display: flex; align-items: center; gap: 1.2em; }
.ps-join img { width: 8.5em; height: 8.5em; border-radius: .7em; background: #fff; padding: .3em; flex: none; }
.ps-join p { margin: 0; color: var(--tx-soft); font-size: .9em; }
.ps-join b { color: #fff; }
.ps-guests { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2em .8em; }
.ps-guest { display: flex; flex-direction: column; align-items: center; gap: .45em; font-size: .82em; font-weight: 700; text-align: center; min-width: 0; animation: pt-pop .5s var(--ease) both; }
.ps-guest .pt-av { --s: 3.3em; }
.ps-guest span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-guest small { color: var(--amber); font-size: .78em; font-weight: 600; }
@keyframes pt-pop { from { opacity: 0; transform: scale(.6); } }

.ps-envelope { display: flex; align-items: center; gap: 1.4em; }
.ps-envelope .letter { width: 3.4em; height: 3.4em; border-radius: .6em; display: grid; place-items: center; font-weight: 900; font-size: 1.9em;
  background: var(--pt-paper); color: var(--pt-ink); box-shadow: 0 1em 2em rgba(0,0,0,.4); flex: none; }
.ps-seats { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8em; align-content: center; }
.ps-seat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .75em; padding: .8em .9em; border-radius: 1em;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); text-align: left; min-width: 0; font-size: .95em; }
.ps-seat .pt-av { grid-row: span 2; }
.ps-seat b { font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-seat small { font-size: .72em; color: var(--tx-soft); }
.ps-seat.done { border-color: rgba(155,184,166,.6); background: rgba(155,184,166,.16); }
.ps-seat.done small { color: var(--sage-light); }
.ps-seat.turn { border-color: rgba(232,184,106,.7); background: rgba(232,184,106,.1); cursor: pointer; }
.ps-seat.turn small { color: var(--amber); }
.ps-seat.turn:hover { background: rgba(232,184,106,.18); }
.ps-seat.waiting .pt-av { opacity: .55; }
.ps-seat .pt-bar { grid-column: 2; margin-top: .35em; height: .3em; }

.ps-wrap3 { flex: 0 1 24em; display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 1em; min-height: 0; }
.ps-panel { border: 1px solid var(--line); border-radius: 1.1em; background: rgba(255,255,255,.04); padding: 1.1em; display: flex; flex-direction: column; gap: .8em; min-width: 0; min-height: 0; }
.ps-cols { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6em; align-items: end; }
.ps-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-height: 0; }
.ps-col .stack { display: flex; flex-wrap: wrap-reverse; justify-content: center; align-content: flex-start; gap: .35em; padding: .7em .3em; border-radius: .8em .8em 0 0; min-height: 3em;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.08)); }
.ps-col.hot .stack { background: linear-gradient(180deg, rgba(232,184,106,.06), rgba(232,184,106,.24)); }
.ps-col .lab { border-top: 2px solid var(--line-strong); padding-top: .5em; text-align: center; font-family: var(--pt-mono); font-size: .58em; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-soft); }
.ps-col .lab b { display: block; font-family: 'Inter', sans-serif; font-size: 2.2em; letter-spacing: -.02em; color: var(--tx); text-transform: none; }
.ps-col.hot .lab, .ps-col.hot .lab b { color: var(--amber); }
.ps-rowp { display: flex; align-items: center; gap: .4em; flex-wrap: wrap; font-size: .9em; }
.ps-rowp b { min-width: 5.2em; font-weight: 700; }
.ps-rowp .pt-av { --s: 1.9em; }
.ps-meter { display: grid; grid-template-columns: 1.6em 1fr auto; gap: .6em; align-items: center; font-size: .9em; }
.ps-meter b { font-family: var(--pt-mono); color: var(--sage-light); }
.ps-meter .pt-bar { height: .45em; }
.ps-meter span { font-family: var(--pt-mono); font-size: .75em; color: var(--tx-soft); }

.ps-strips-wrap { flex: 0 1 auto; display: grid; grid-template-columns: 1.6fr .9fr; gap: 1.6em; align-items: center; }
.ps-strips { display: grid; grid-template-columns: auto repeat(var(--n), minmax(0, 1fr)); gap: .55em 1em; align-items: center; }
.ps-strips .env { justify-self: center; width: 2em; height: 2em; border-radius: .45em; display: grid; place-items: center; font-weight: 900; background: var(--pt-paper); color: var(--pt-ink); }
.ps-strips .nm { display: flex; align-items: center; gap: .6em; font-weight: 700; white-space: nowrap; }
.ps-strips .nm.soft { color: var(--tx-soft); font-weight: 500; font-size: .75em; }
.ps-strips .nm .pt-av { --s: 1.9em; }
.ps-strips .dot, .ps-key .dot { width: 1.3em; height: 1.3em; border-radius: 50%; justify-self: center; background: var(--c); display: inline-block; }
.ps-strips .dot.no, .ps-key .dot.no { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.ps-strips .dot.skip { background: transparent; width: .9em; height: 2px; border-radius: 2px; box-shadow: none; background: var(--line-strong); }
.ps-strips .ct { justify-self: center; font-family: var(--pt-mono); font-size: .7em; color: var(--tx-soft); }
.ps-heat { flex: 1; min-height: 0; display: grid; gap: .3em; align-content: center; }
.ps-heat .row { display: grid; grid-template-columns: 7.5em repeat(var(--n), minmax(0, 1fr)); gap: .3em; align-items: center; }
.ps-heat .nm { display: flex; align-items: center; gap: .5em; font-size: .8em; font-weight: 700; white-space: nowrap; overflow: hidden; }
.ps-heat .nm .pt-av { --s: 1.7em; }
.ps-heat .head { font-size: .5em; color: var(--tx-soft); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ps-heat .head img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .4em; opacity: .9; }
.ps-heat i { display: block; aspect-ratio: 1.15; border-radius: .3em; max-height: 2.4em; }
.h1 { background: var(--pt-hate); } .h2 { background: var(--pt-dislike); } .h3 { background: var(--pt-ok); } .h4 { background: var(--pt-like); } .h5 { background: var(--pt-love); }
.h0 { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }
.hx { background: transparent; }
.ps-heat i.fav { outline: 3px solid var(--sage-light); outline-offset: 1px; }
.ps-heat i.div { outline: 3px solid var(--amber); outline-offset: 1px; }
.ps-key { display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1.3em; font-size: .7em; color: var(--tx-soft); }
.ps-key span { display: inline-flex; align-items: center; gap: .45em; }
.ps-key i { width: 1.1em; height: 1.1em; border-radius: .25em; display: inline-block; }

.ps-guess { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em; align-content: center; }
.ps-option { padding: 1.3em 1.4em; border-radius: 1.1em; border: 1px solid var(--line-strong); background: rgba(255,255,255,.045); font-weight: 800; font-size: 1.25em; line-height: 1.2; display: flex; flex-direction: column; gap: .5em; }
.ps-option.right { border-color: var(--sage); background: rgba(155,184,166,.16); }
.ps-option .who { display: flex; flex-wrap: wrap; gap: .3em; min-height: 1.6em; }
.ps-option .pt-av { --s: 1.5em; }

.ps-reveal { flex: 1; display: grid; grid-template-columns: 1.4fr .8fr; gap: 2.2em; align-items: center; min-height: 0; }
.ps-who { display: flex; align-items: center; gap: .7em; font-size: 1.2em; font-weight: 700; color: var(--tx-soft); }
.ps-who .pt-av { --s: 2.6em; }
.ps-pname { font-weight: 900; font-size: 3.4em; line-height: 1.02; letter-spacing: -.035em; margin: .3em 0 .35em; text-wrap: balance;
  background: linear-gradient(100deg, #fff 0%, #fff 38%, var(--sage) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ps-reveal .headline { color: var(--tx-soft); font-size: 1.1em; margin: 0 0 1em; max-width: 30em; }
.ps-reveal .pt-badges .pt-chip { font-size: .8em; }
.ps-card { border-radius: 1.2em; border: 1px solid var(--line-strong); background: rgba(0,0,0,.18); padding: 1.3em; display: flex; flex-direction: column; gap: .8em; }
.ps-card .n { font-weight: 900; font-size: 3em; line-height: 1; letter-spacing: -.03em; }
.ps-card .row { display: flex; flex-wrap: wrap; gap: .35em; }
.ps-card .pt-av { --s: 2em; }
.ps-board { display: grid; gap: .4em; }
.ps-board div { display: grid; grid-template-columns: 1.6em auto 1fr auto; gap: .6em; align-items: center; font-size: .85em; }
.ps-board .pt-av { --s: 1.6em; }
.ps-board em { font-style: normal; font-family: var(--pt-mono); color: var(--sage-light); }
.ps-board .pt-bar { height: .35em; }
.reveal-in { animation: pt-reveal .9s var(--ease) both; }
@keyframes pt-reveal { from { opacity: 0; transform: translateY(.5em) scale(.97); filter: blur(6px); } }

.ps-map { flex: 1; min-height: 0; display: grid; grid-template-columns: auto repeat(5, minmax(0, .7fr)) auto minmax(0, 2.4fr); gap: .45em 1.1em; align-items: center; align-content: center; font-size: .95em; }
.ps-map .th { font-family: var(--pt-mono); font-size: .55em; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-soft); text-align: center; }
.ps-map .th.l { text-align: left; }
.ps-map .nm { display: flex; align-items: center; gap: .6em; font-weight: 700; }
.ps-map .nm .pt-av { --s: 1.9em; }
.ps-map .dot { width: 1.25em; height: 1.25em; border-radius: 50%; justify-self: center; background: var(--c); }
.ps-map .dot.no { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }
.ps-map .tt { font-family: var(--pt-mono); font-size: .6em; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-soft); }
.ps-map .tt.hot { color: var(--amber); }
.ps-map .pn { font-size: .85em; color: var(--sage-light); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ps-gp { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 2em; align-content: center; }
.ps-gp .col { display: flex; flex-direction: column; gap: .8em; min-width: 0; min-height: 0; }
.ps-gp .ps-pname { font-size: 2.5em; margin: .15em 0 .1em; }
.ps-gp .soft { color: var(--tx-soft); font-size: .9em; margin: 0; }
.ps-gp .pt-tip p { font-size: .85em; }
.ps-gp .pt-tip b { font-size: .55em; }
.ps-gp .pt-badges .pt-chip { font-size: .7em; }
.ps-radar { width: 100%; max-height: 14em; display: block; }
.ps-radar .grid { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 1; }
.ps-radar .axis { stroke: rgba(255,255,255,.1); stroke-width: 1; }
.ps-radar .shape { fill: rgba(155,184,166,.3); stroke: var(--sage); stroke-width: 2; stroke-linejoin: round; }
.ps-radar text { fill: #dbe6f0; font: 500 10px var(--pt-mono); letter-spacing: .08em; }
.ps-gp .pt-bars { gap: .55em; }
.ps-gp .pt-bars .bar { grid-template-columns: 4.2em 1fr 5.6em; font-size: .8em; gap: .7em; }
.ps-gp .pt-bars .bar em { font-size: .8em; min-width: 0; }
.ps-recipe { display: flex; gap: .8em; align-items: center; padding: .6em; border-radius: .9em; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.ps-recipe img { width: 3.6em; height: 3.6em; border-radius: .6em; object-fit: cover; flex: none; }
.ps-recipe b { font-size: .88em; line-height: 1.25; display: block; }
.ps-recipe small { font-size: .68em; color: var(--tx-soft); }
.ps-twin { display: flex; align-items: center; gap: .6em; font-size: .85em; color: var(--tx-soft); }
.ps-twin .pt-av { --s: 1.8em; }
.ps-twin b { color: var(--tx); }

.ps-titles { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1em; align-content: center; }
.ps-title { padding: 1.2em; border-radius: 1.1em; border: 1px solid var(--line); background: rgba(255,255,255,.045); display: flex; flex-direction: column; gap: .6em; min-width: 0; }
.ps-title.hot { border-color: rgba(232,184,106,.5); background: rgba(232,184,106,.07); }
.ps-title small { font-family: var(--pt-mono); font-size: .6em; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-soft); }
.ps-title b { display: flex; align-items: center; gap: .4em; flex-wrap: wrap; font-size: 1.2em; }
.ps-title .pt-av { --s: 1.8em; }
.ps-title > span { color: var(--tx-soft); font-size: .8em; }

.ps-menu { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em; align-content: center; }
.ps-dish { display: grid; grid-template-columns: 6.2em 1fr; gap: 1em; align-items: center; padding: .8em; border-radius: 1.1em; border: 1px solid var(--line); background: rgba(255,255,255,.045); min-width: 0; }
.ps-dish img { width: 6.2em; height: 6.2em; border-radius: .8em; object-fit: cover; }
.ps-dish .course { font-family: var(--pt-mono); font-size: .58em; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
.ps-dish b { display: block; font-size: 1.05em; line-height: 1.2; margin: .2em 0 .45em; }
.ps-dish .fits { display: flex; flex-wrap: wrap; gap: .25em; }
.ps-dish .pt-av { --s: 1.45em; }

.ps-turn-back { position: fixed; inset: 0; background: rgba(0,10,18,.72); backdrop-filter: blur(6px); z-index: 30; display: grid; place-items: center; padding: 2em; animation: pt-fade .2s ease both; }
.ps-turn { width: min(34em, 100%); max-height: 100%; overflow: auto; border-radius: 1.5em; background: linear-gradient(180deg, #0b2638, #061a28); border: 1px solid var(--line-strong); padding: 1.6em; display: flex; flex-direction: column; gap: 1em; font-size: .85em; animation: pt-up .35s var(--ease) both; }
.ps-turn .pt-choice { font-size: 1.05em; }
.ps-turn .pt-face { min-height: 5em; font-size: .75em; }
.ps-turn .pt-face svg { width: 2.4em; height: 2.4em; }
.ps-turn .pt-food .photo { aspect-ratio: 16 / 9; }
.ps-turn .pt-input { font-size: 1.1em; }

.ps-wait { flex: 1; display: grid; place-items: center; text-align: center; }
.ps-wait .ps-bigcode { font-size: 4em; }

@media (max-aspect-ratio: 4/3) {
  .ps-lobby { grid-template-columns: 1fr; gap: 1.5em; }
  .ps-strips-wrap { grid-template-columns: 1fr; }
  .ps-wrap3, .ps-gp { grid-template-columns: 1fr 1fr; }
  .ps-reveal { grid-template-columns: 1fr; }
  .ps-titles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-menu { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body.ps-page { overflow: auto; }
  .ps { height: auto; min-height: 100dvh; }
  .ps-seats, .ps-guests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-wrap3, .ps-gp, .ps-guess, .ps-titles { grid-template-columns: 1fr; }
}

/* ============================================================
   INVITATION (printable)
   ============================================================ */
.pt-invite-page { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.pt-invite { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 22px; align-items: stretch; }
.pt-invite .pt-paper { padding: 34px 32px 28px; transform: rotate(-.6deg); }
.pt-invite .pt-hand { font-size: 29px; }
.pt-invite .join { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(31,51,80,.25); }
.pt-invite .join img { width: 112px; height: 112px; flex: none; }
.pt-invite .join p { margin: 0; color: var(--pt-ink-print); font-size: 13.5px; }
.pt-invite .join b { display: block; font-family: var(--pt-mono); font-size: 26px; letter-spacing: .2em; color: var(--pt-ink); margin-top: 2px; }
@media print {
  body.pt-page { background: #fff; }
  .pt-invite-page { padding: 0; }
  .pt-invite .no-print { display: none !important; }
  .pt-invite .pt-paper { box-shadow: none; transform: none; border: 1px solid #ddd; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
