/* VODA team matcher. Design notes: conventions/design.md */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e3e6ea;
  --text: #1d2228;
  --muted: #6b7480;
  --accent: #2c5fd9;
  --accent-weak: #e9effc;
  --warn-bg: #fff6e5;
  --warn-line: #f0d39b;
  --radius: 10px;
  --gap: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex: none; }

.top {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.brand svg.lucide { width: 20px; height: 20px; color: var(--accent); }
.model { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.model select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

.layout { display: grid; grid-template-columns: 380px 1fr; height: calc(100% - 52px); }
.side {
  display: flex; flex-direction: column; gap: var(--gap); padding: 16px;
  border-right: 1px solid var(--line); background: var(--bg); overflow: auto;
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.panel.grow { flex: 1 0 auto; min-height: 300px; max-height: 60vh; }
.panel h2 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.step {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent-weak); color: var(--accent);
  font-size: 12px; display: inline-grid; place-items: center;
}
.count { color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; }
.meta { margin: 0; color: var(--muted); font-size: 12.5px; }
.meta a { color: var(--accent); }

.input {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); resize: vertical;
}
.input:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }

.btn {
  font: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #c9ced5; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 7px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #244fb8; }
.btn.wide { justify-content: center; width: 100%; padding: 9px; }
.btn:disabled { opacity: .55; cursor: default; }

.roster { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; border-top: 1px solid var(--line); }
.roster li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.roster li.off { color: var(--muted); }
.roster input { width: 16px; height: 16px; accent-color: var(--accent); }
.roster .nm { font-weight: 600; min-width: 52px; }
.roster .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster .wish { margin-left: auto; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: #c9ced5; }

.result { overflow: auto; padding: 24px; }
.empty, .loading { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.empty svg.lucide { width: 36px; height: 36px; stroke-width: 1.5; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.out-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.out-head h2 { margin: 0 0 2px; font-size: 20px; }
.notes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.hint { display: flex; align-items: center; gap: 6px; margin: 6px 0 12px; }
.hint svg.lucide { width: 14px; height: 14px; }

.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.team { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.team.drop { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.team header { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.team h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; }
.team h3 .n { color: var(--muted); font-weight: 500; font-size: 13px; }
.team .summary { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.stat { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--bg); color: var(--muted); }
.members { list-style: none; margin: 0; padding: 6px 8px 10px; min-height: 40px; }
.member { padding: 6px; border-radius: 6px; cursor: grab; }
.member:hover { background: var(--bg); }
.member.dragging { opacity: .4; }
.member .line1 { display: flex; gap: 8px; align-items: baseline; }
.member .nm { font-weight: 600; }
.member .sub { color: var(--muted); font-size: 12.5px; }
.member .why { color: var(--accent); font-size: 12px; margin-top: 1px; }
.member .moved { color: #b06b00; font-size: 11.5px; }

.stage { position: fixed; inset: 0; background: #11151a; color: #f2f4f7; padding: 36px 44px; overflow: auto; z-index: 10; }
.stage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.stage-head h1 { margin: 0; font-size: 34px; }
.stage .btn { color: #f2f4f7; border-color: #3a424c; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.stage-card { background: #1b2129; border: 1px solid #2c343e; border-radius: 14px; padding: 20px 24px; }
.stage-card h2 { margin: 0 0 12px; font-size: 26px; color: #8fb0ff; }
.stage-card ul { list-style: none; margin: 0; padding: 0; }
.stage-card li { font-size: 24px; font-weight: 600; padding: 4px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stage-card li b { font-weight: 600; white-space: nowrap; }
.stage-card li span { font-size: 15px; font-weight: 400; color: #98a2ae; text-align: right; min-width: 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 20; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .side { border-right: none; overflow: visible; }
  .panel.grow { max-height: 420px; }
  .result { padding: 16px; }
  .out-head { flex-direction: column; }
  .stage { padding: 20px; }
  .stage-card li { font-size: 20px; }
}

.row.between { justify-content: space-between; }
.wants { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.wants-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.attend-pick { display: flex; align-items: center; gap: 8px; }

/* /wants page */
.w-body { min-height: 100%; }
.w-main { max-width: 460px; margin: 0 auto; padding: 32px 16px; display: flex; flex-direction: column; gap: 14px; }
.w-title { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.w-title svg.lucide { width: 22px; height: 22px; color: var(--accent); }
.w-label { font-weight: 600; font-size: 13px; }
.w-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.w-pick { font: inherit; width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.w-pick:hover { border-color: var(--accent); }
.w-pick .nm { font-weight: 600; }
.w-pick svg.lucide { margin-left: auto; color: var(--muted); }
.w-badge { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--accent-weak); color: var(--accent); }
.w-who { display: flex; align-items: center; gap: 8px; }
.w-who strong { font-size: 17px; }
.w-who .btn { margin-left: auto; }
.w-done { align-items: center; text-align: center; }
.w-done > svg.lucide { width: 36px; height: 36px; color: #1f9d61; }
.w-done p { margin: 0; }

/* published result bar */
.pubbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-weak); border: 1px solid #c8d6f6; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.pub-state { font-size: 13px; color: var(--accent); font-weight: 600; }
.pub-state.dirty { color: #b06b00; }
a.btn { text-decoration: none; }
.btn.danger { color: #c0392b; }
.stage-head { gap: 20px; }
.stage-qr { display: flex; align-items: center; gap: 12px; margin-left: auto; color: #98a2ae; font-size: 15px; }
.stage-qr svg { width: 110px; height: 110px; background: #fff; border-radius: 6px; display: block; }

/* /teams page */
.t-main { max-width: 980px; margin: 0 auto; padding: 28px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.t-head h1 { margin: 0; font-size: 22px; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.t-card h2 { margin: 0 0 6px; font-size: 16px; color: var(--accent); display: flex; justify-content: space-between; }
.t-card h2 span { color: var(--muted); font-weight: 500; font-size: 13px; }
.t-card ul { list-style: none; margin: 0; padding: 0; }
.t-card li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.t-card li .meta { white-space: nowrap; }
.t-card.hit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.t-card li.hit { background: var(--accent-weak); font-weight: 700; }
.t-empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* session box */
.sess, .recent { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sess-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sess-id { display: flex; flex-direction: column; }
.sess-id strong { font-size: 30px; letter-spacing: 6px; line-height: 1.2; }
.sess-qr svg { width: 84px; height: 84px; display: block; }
.sess-link { color: var(--accent); word-break: break-all; }

.input.code { width: 140px; text-align: center; font-size: 20px; letter-spacing: 6px; font-weight: 700; }

/* check-in (organizer) */
.ck { display: flex; flex-direction: column; gap: 8px; }
.ck-live { background: var(--accent-weak); border: 1px solid #c8d6f6; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ck-pin-row { display: flex; align-items: baseline; gap: 10px; }
.ck-pin-row strong { font-size: 26px; letter-spacing: 4px; color: var(--accent); font-variant-numeric: tabular-nums; }
.ck-big { display: flex; gap: 56px; align-items: center; justify-content: center; min-height: 70vh; flex-wrap: wrap; }
.ck-qr svg { width: min(42vh, 380px); height: min(42vh, 380px); background: #fff; border-radius: 12px; display: block; }
.ck-info { display: flex; flex-direction: column; gap: 10px; }
.ck-url { font-size: 22px; color: #98a2ae; }
.ck-label { font-size: 22px; color: #98a2ae; margin-top: 12px; }
.ck-pinbig { font-size: clamp(72px, 12vw, 160px); font-weight: 800; letter-spacing: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.ck-leftbig { font-size: 26px; color: #8fb0ff; }
.ck-countbig { font-size: 26px; }

.small-note { font-size: 12px; text-align: center; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; flex: 1; padding: 10px; border: none; background: var(--surface); color: var(--text); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.input.code.pin { width: 170px; }

/* hub (voda.hermen.duckdns.org/) */
.hub { max-width: 920px; margin: 0 auto; padding: 48px 20px 64px; }
.hub-head h1 { margin: 0 0 4px; font-size: 28px; }
.hub-sec { font-size: 14px; color: var(--muted); margin: 32px 0 10px; font-weight: 600; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hub-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); text-decoration: none; }
.hub-card:hover { border-color: var(--accent); }
.hub-card svg.lucide { width: 22px; height: 22px; color: var(--accent); }
.hub-card strong { font-size: 16px; }
.hub-card span { color: var(--muted); font-size: 13.5px; }
.hub-card code { margin-top: 4px; font-size: 12px; color: var(--muted); }
