/* ============================================================
   PHONE — light, pastel, editorial Fraunces, rounded, mobile
   ============================================================ */
html, body { min-height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  background-image:
    radial-gradient(120% 55% at 100% 0%, rgba(247, 211, 68, .16), transparent 56%),
    radial-gradient(90% 45% at 0% 100%, rgba(57, 182, 216, .12), transparent 52%);
  background-attachment: fixed;
}
.phone {
  max-width: 520px; margin: 0 auto; min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}

/* top bar */
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 18px; }
.p-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 15px; height: 15px; border-radius: 5px; background: var(--grad); flex: 0 0 auto; }
.p-event { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-id { width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--r-pill); background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-weight: 600; font-size: 15px; display: grid; place-items: center; }

.field em { color: #B5651A; font-style: italic; font-weight: 600; }

/* view plumbing */
.view { display: none; flex: 1; min-height: 0; }
body[data-view="loading"] .view-loading,
body[data-view="register"] .view-register,
body[data-view="idle"] .view-idle,
body[data-view="vote"] .view-vote { display: flex; flex-direction: column; animation: vIn .5s var(--ease) both; }
@keyframes vIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view-loading { align-items: center; justify-content: center; }
.spinner { width: 34px; height: 34px; border: 2px solid var(--line); border-top-color: #E38330; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- register ---------- */
.reg { display: flex; flex-direction: column; justify-content: center; flex: 1; gap: 4px; }
.reg-kicker { color: #B5651A; }
.reg-title { font-weight: 600; font-size: clamp(40px, 12vw, 60px); line-height: .96; letter-spacing: -.018em; margin: 14px 0 14px; }
.reg-title em { font-style: italic; }
.reg-lead { color: var(--ink-soft); font-size: 17px; line-height: 1.45; max-width: 30ch; }
.reg-form { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .eyebrow { font-size: 11px; }
.field input {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; font-size: 17px; font-weight: 500; color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none;
}
.field input::placeholder { color: #a89f8b; }
.field input:focus { border-color: var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 24px;
  border-radius: var(--r-pill); font-weight: 600; font-size: 17px; transition: transform .12s, background .2s, color .2s; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary .arrow { transition: transform .2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-primary[disabled] { opacity: .4; pointer-events: none; }

/* ---------- idle ---------- */
.view-idle { align-items: flex-start; justify-content: center; }
.wait { display: flex; flex-direction: column; gap: 12px; flex: 1; justify-content: center; }
.wait-title { font-weight: 600; font-size: clamp(38px, 11vw, 54px); line-height: .98; letter-spacing: -.018em; margin: 10px 0; }
.wait-title em { font-style: italic; }
.wait-lead { color: var(--ink-soft); font-size: 17px; line-height: 1.45; max-width: 30ch; }
.orbit { position: relative; height: 60px; margin-top: 28px; }
.orbit i { position: absolute; top: 24px; width: 12px; height: 12px; border-radius: 50%; animation: orb 1.4s var(--ease) infinite; }
.orbit i:nth-child(1) { left: 0; background: var(--sky); } .orbit i:nth-child(2) { left: 24px; background: var(--butter); animation-delay: .18s; } .orbit i:nth-child(3) { left: 48px; background: var(--peach); animation-delay: .36s; }
@keyframes orb { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-14px); opacity: 1; } }

/* ---------- vote card ---------- */
.view-vote { gap: 16px; padding-bottom: 8px; }
.p-card { border-radius: var(--r-xl); background: var(--cream); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; }
.p-logo { width: 100%; aspect-ratio: 16/10; background: var(--butter); border-radius: var(--r-lg); font-size: clamp(46px, 16vw, 86px); letter-spacing: -.02em; }
.p-card-body { padding-top: 18px; }
.p-card-body .eyebrow { color: var(--dim); font-size: 11px; }
.p-card-body .eyebrow em { font-style: italic; text-transform: none; letter-spacing: 0; color: #B5651A; }
.p-name { font-weight: 600; font-size: clamp(32px, 9vw, 44px); line-height: 1; letter-spacing: -.018em; margin: 10px 0 8px; }
.p-tagline { font-size: 17.5px; line-height: 1.3; font-weight: 500; color: var(--ink); }
.p-desc { font-size: 14.5px; line-height: 1.5; color: var(--dim); margin-top: 10px; }
.p-ask { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.p-ask span:last-child { font-weight: 600; font-size: 19px; text-align: right; }

.p-live { font-size: 14px; font-weight: 500; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.p-live .arrow { color: #E38330; }
.p-live b { font-weight: 600; }

.p-status { font-size: 14.5px; font-weight: 500; padding: 14px 16px; border-radius: var(--r-md); display: flex; align-items: center; gap: 10px; }
.p-status.ok { background: var(--mint); color: #2f5e3e; }
.p-status.closed { background: var(--cream); color: var(--dim); }
.p-status .tick { font-weight: 700; }

/* actions */
.p-actions { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 10px; margin-top: auto; }
.act { border-radius: var(--r-lg); padding: 18px 10px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  transition: transform .12s, background .2s, color .2s; min-height: 92px; justify-content: space-between; border: 1px solid transparent; }
.act .eyebrow { font-size: 9.5px; letter-spacing: .12em; transition: color .2s; }
.act-lg { font-weight: 600; font-size: clamp(22px, 6.5vw, 30px); line-height: 1; letter-spacing: -.01em; }
.act:active { transform: translateY(1px) scale(.985); }
.act-no { background: var(--cream); border-color: var(--line); }
.act-no .eyebrow { color: var(--dim); }
.act-invest { background: var(--butter); }
.act-invest .eyebrow { color: #9a6a12; }
.act-meet { background: var(--sky); }
.act-meet .eyebrow { color: #2c6f86; }
.act.sel { background: var(--ink); color: var(--paper); }
.act.sel .eyebrow { color: rgba(251, 250, 246, .7); }
.p-actions.locked { opacity: .5; pointer-events: none; filter: grayscale(.2); }

/* timer */
.p-timer { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.p-timer-num { font-family: var(--font-display); font-weight: 600; font-size: 17px; min-width: 3.6ch; }
.p-timer-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--cream-2); position: relative; overflow: hidden; }
.p-timer-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--grad); transition: width .25s linear; }
.p-timer-fill.ending { background: #E38330; }

/* ---------- invest sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(11, 11, 11, .4); backdrop-filter: blur(3px); animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-card { position: relative; width: 100%; max-width: 520px; background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 14px 22px calc(26px + env(safe-area-inset-bottom));
  animation: sheetUp .42s var(--ease) both; box-shadow: 0 -20px 60px rgba(11, 11, 11, .18); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head .eyebrow { font-size: 11px; }
.sheet-x { width: 36px; height: 36px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: 14px; display: grid; place-items: center; }
.sheet-amt { font-weight: 600; font-size: clamp(58px, 19vw, 86px); line-height: 1; letter-spacing: -.025em; margin: 18px 0 18px; }
.sheet-amt .m-unit { font-style: italic; opacity: .8; }

/* slider */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; }
.slider::-webkit-slider-runnable-track { height: 7px; border-radius: 4px; background: linear-gradient(97deg, #39B6D8, #F7D344 50%, #E38330) no-repeat; background-size: var(--fill, 10%) 100%; background-color: var(--cream-2); }
.slider::-moz-range-track { height: 7px; border-radius: 4px; background: var(--cream-2); }
.slider::-moz-range-progress { height: 7px; border-radius: 4px; background: #F7D344; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); border: 4px solid var(--paper); margin-top: -11px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.slider::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); border: 4px solid var(--paper); }
.sheet-range { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); font-weight: 500; margin-top: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 22px; }
.chip { border-radius: var(--r-pill); border: 1px solid var(--line); padding: 11px 16px; font-weight: 600; font-size: 14.5px; background: var(--cream); transition: background .15s, color .15s, border-color .15s; }
.chip.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet-go { width: 100%; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 14px 22px; border-radius: var(--r-pill); font-weight: 600; font-size: 14.5px; z-index: 60; max-width: 90vw;
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #C8412B; }
.toast .arrow, .toast strong { color: var(--butter); }
