/* Lunchpedition design system — from docs/design/Lunchpedition Prototype.dc.html */
:root {
  --paper: #F5F0E6; --surface: #FFFFFF; --surface2: #FCF8F0;
  --ink: #232B26; --ink2: #3C443D; --muted: #6E736A;
  --green: #2F5D50; --green-d: #264A40;
  --amber: #E0A03A; --amber-d: #B27C1C; --star: #E0A03A;
  --clay: #B45C43; --clay-bg: #F4E4DE;
  --line: #E6DECE; --line2: #EFE9DC;
  --disp: 'Bricolage Grotesque', sans-serif;
  --body: 'Hanken Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --r: 12px; --r-lg: 18px; --r-sm: 9px;
  --sh: 0 6px 20px -12px rgba(35, 43, 38, .28);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--green); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,93,80,.45); } 70% { box-shadow: 0 0 0 7px rgba(47,93,80,0); } 100% { box-shadow: 0 0 0 0 rgba(47,93,80,0); } }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- layout shell ---------- */
.canvas { max-width: 820px; margin: 0 auto; padding: 0 0 90px; }
.desk-head {
  display: none; align-items: center; gap: 18px; padding: 14px 30px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.desk-head .m {
  width: 30px; height: 30px; border-radius: 8px; background: var(--green); color: var(--amber);
  display: grid; place-items: center; font-family: var(--disp); font-weight: 800; font-size: 16px;
}
.desk-head b { font-family: var(--disp); font-weight: 800; font-size: 17px; }
.desk-head a { font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.desk-head a.on { color: var(--green); }
.desk-head a.btn { color: #fff; }
.desk-head .sp { flex: 1; }
.link-button { background: none; border: none; color: var(--muted); padding: 0; font-size: 13px; text-decoration: underline; }

@media (min-width: 768px) {
  .desk-head { display: flex; }
  .canvas { padding: 26px 30px 60px; }
  .phone-only { display: none !important; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .grid2 > .list { display: contents; }
  .exp-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; align-items: start; }
}
@media (max-width: 767.98px) {
  .desk-only { display: none !important; }
}

/* ---------- shared ---------- */
.appbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; }
.ab-ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); font-size: 16px; color: var(--ink);
  text-decoration: none;
}
.ab-t { font-family: var(--disp); font-weight: 700; font-size: 16px; flex: 1; }
.pad { padding: 4px 16px 20px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: var(--r); font-weight: 700; font-size: 14.5px;
  font-family: var(--body); transition: transform .08s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-block { display: flex; width: 100%; }
.btn-pri { background: var(--green); color: #fff; }
.btn-amber { background: var(--amber); color: #3a2a08; }
.btn-outline { background: var(--surface); border: 1.5px solid var(--green); color: var(--green); }
.btn-ghost { background: var(--surface2); border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--surface); border: 1.5px solid var(--clay); color: var(--clay); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.live {
  display: inline-flex; align-items: center; gap: 6px; font: 600 10px var(--mono);
  text-transform: uppercase; letter-spacing: .08em; color: var(--green);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--ink2); }
.input, .textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface); font-family: var(--body); font-size: 15px; color: var(--ink);
}
.input:focus, .textarea:focus { outline: none; border-color: var(--green); }
.textarea { resize: none; min-height: 74px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px; box-shadow: var(--sh); }
.sec-h {
  display: flex; justify-content: space-between; align-items: center;
  font: 700 10.5px var(--mono); letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin: 18px 16px 9px;
}
.sec-h .anon { font-family: var(--body); text-transform: none; font-weight: 600; font-size: 10px; letter-spacing: .01em; display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
@media (min-width: 768px) {
  .pad, .list, .sec-h, .winner, .result, .cancelled { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
  .appbar { padding-left: 0; padding-right: 0; }
}

/* ---------- avatars / crew ---------- */
.avs { display: flex; }
.av {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font: 700 11px var(--body);
  border: 2px solid var(--paper); margin-left: -8px;
}
.av:first-child { margin-left: 0; }
.av.more { background: var(--muted); }
.av.you { background: var(--amber); color: #3a2a08; }
.crewrow { display: flex; align-items: center; gap: 10px; }
.crewn { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  font-size: 12.5px; font-weight: 600;
}
.chip .av { margin: 0; width: 22px; height: 22px; border: none; font-size: 9.5px; }

/* ---------- winner + ranking rows ---------- */
.winner {
  margin: 0 16px; border-radius: var(--r-lg); padding: 16px;
  background: linear-gradient(180deg, #FBEDD3, #F9E7C6); border: 1.5px solid #E6C889;
}
.wtag {
  display: inline-flex; align-items: center; gap: 5px; font: 700 9.5px var(--mono);
  letter-spacing: .08em; text-transform: uppercase; color: #7a5410;
  background: #F3D79A; padding: 4px 9px; border-radius: 20px; margin-bottom: 11px;
}
.wrow { display: flex; align-items: center; gap: 13px; }
.wrank { font-family: var(--disp); font-weight: 800; font-size: 38px; line-height: .8; color: var(--amber-d); }
.wname { flex: 1; font-family: var(--disp); font-weight: 700; font-size: 19px; line-height: 1.05; }
.wstars { font-size: 13px; letter-spacing: 1px; color: var(--star); margin-top: 4px; }
.wsub { color: #8a6a2a; font-size: 10.5px; font-weight: 600; margin-left: 5px; font-family: var(--body); }
.wscore { font-family: var(--mono); font-weight: 600; font-size: 22px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.rank {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--line); display: grid; place-items: center;
  font: 700 12px var(--mono); flex: none;
}
.rbody { flex: 1; min-width: 0; }
.rname { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rsub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stars-f { color: var(--star); letter-spacing: 1px; font-size: 12px; }
.stars-e { color: var(--line); letter-spacing: 1px; font-size: 12px; }
.score { font-family: var(--mono); font-weight: 600; font-size: 16px; }
.badge {
  font: 700 8.5px var(--mono); letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; background: var(--green); color: #fff;
}
.badge.ov { background: #EBD9B4; color: #7a5410; }
.row-veto { background: var(--clay-bg); border-color: #E4C4BA; }
.vic { width: 26px; height: 26px; border-radius: 8px; background: #EAC9C0; display: grid; place-items: center; font-size: 13px; flex: none; }
.vpill { font: 700 8.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--clay); padding: 3px 8px; border-radius: 20px; }
.row-nodata { border-style: dashed; background: transparent; }
.rank-empty { border-style: dashed; color: var(--muted); background: transparent; }

/* ---------- interactive stars ---------- */
.starinput { display: inline-flex; gap: 3px; }
.star-btn { font-size: 23px; line-height: 1; padding: 2px; transition: transform .1s; }
.star-btn:active { transform: scale(1.2); }
.star-btn.on { color: var(--star); }
.star-btn.off { color: #D8CFB9; }
.stars-sm .star-btn { font-size: 18px; }
/* radio-based star picker (inside the override sheet) */
.starpick { display: inline-flex; flex-direction: row-reverse; gap: 3px; }
.starpick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.starpick label { font-size: 26px; line-height: 1; padding: 2px; color: #D8CFB9; cursor: pointer; }
.starpick label:hover, .starpick label:hover ~ label { color: var(--amber-d); }
.starpick input:checked ~ label { color: var(--star); }

/* ---------- tab bar / fab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); z-index: 30;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 5px; text-decoration: none;
}
.tab .ti { font-size: 19px; line-height: 1; }
.tab.on { color: var(--green); }

/* ---------- home cards ---------- */
.expcard {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh);
  color: inherit; text-decoration: none;
}
.exp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exp-when { font-family: var(--disp); font-weight: 700; font-size: 16px; }
.exp-lead { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.exp-lead .lbl { font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.recent { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.recent .rd { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 34px; }
.recent a { color: inherit; text-decoration: none; font-weight: 600; }

/* ---------- result / cancelled heroes ---------- */
.result {
  margin: 8px 16px 0; border-radius: var(--r-lg); padding: 22px 18px; text-align: center;
  background: linear-gradient(180deg, #FBEDD3, #F7E2BF); border: 1.5px solid #E6C889;
}
.result .flag { font-size: 34px; }
.result .lbl { font: 700 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #8a6a2a; margin: 8px 0 4px; }
.result .dn { font-family: var(--disp); font-weight: 800; font-size: 30px; line-height: 1.02; }
.cancelled {
  margin: 8px 16px 0; border-radius: var(--r-lg); padding: 22px 18px; text-align: center;
  background: var(--surface2); border: 1.5px dashed var(--line);
}

/* ---------- override sheet (native dialog) ---------- */
dialog.sheet {
  border: none; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); width: 100%; max-width: 100%;
  border-radius: 22px 22px 0 0; margin: auto auto 0;
  animation: sheetup .26s cubic-bezier(.2, .8, .2, 1);
}
dialog.sheet::backdrop { background: rgba(24, 29, 24, .42); }
@media (min-width: 768px) {
  dialog.sheet { max-width: 360px; border-radius: 20px; margin: auto; animation: fadein .2s; }
}
.sheet-grip { width: 38px; height: 4px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
dialog.sheet h4 { font-family: var(--disp); font-size: 17px; margin: 0 0 3px; }
.sheet-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r);
  margin-top: 10px; background: var(--surface);
}
.sheet-opt:hover { border-color: var(--green); background: var(--surface2); }
.sheet-opt .so-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.sheet-opt b { display: block; font-size: 14.5px; }
.sheet-opt small { color: var(--muted); font-size: 11.5px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #20261F; color: #F5F0E6; padding: 10px 16px; border-radius: 22px;
  font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5);
  animation: toastin .22s; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.toast.error { background: var(--clay); }

/* ---------- login ---------- */
.login-wrap { padding: 40px 24px; min-height: 70vh; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto; }
.brandbig { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.brandbig .m {
  width: 56px; height: 56px; border-radius: 16px; background: var(--green); color: var(--amber);
  display: grid; place-items: center; font-family: var(--disp); font-weight: 800; font-size: 30px;
  margin-bottom: 14px; box-shadow: var(--sh);
}
.brandbig h1 { font-family: var(--disp); font-weight: 800; font-size: 27px; margin: 0; letter-spacing: -.02em; }
.brandbig p { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.notice { border-radius: var(--r); padding: 14px; font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.notice.ok { background: #E6F0EA; border: 1px solid #BBD8C8; color: var(--green-d); }
.notice.warn { background: var(--clay-bg); border: 1px solid #E4C4BA; color: #8a3d28; }

/* headings default */
h1, h2, h3 { font-family: var(--disp); }

/* ---------- footer (legal links) ---------- */
.site-footer {
  margin-top: 32px; padding: 18px 0 8px; text-align: center;
  border-top: 1px solid var(--line2); font-size: 12px; color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer span { margin: 0 8px; }
