/* cantunderstand. Design notes: conventions/design.md */
:root {
  --bg: #f6f7f9; --surface: #fff; --line: #e3e6ea; --text: #1d2228; --muted: #6b7480;
  --accent: #2c5fd9; --accent-weak: #e9effc; --alert: #e0483e; --alert-weak: #fdeceb; --ok: #1f9d61;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Pretendard", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.input:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
.btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c9ced5; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.icon { padding: 9px; }
.select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.btn.danger { color: var(--alert); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #c1c7cf; }
.pill.on .dot { background: var(--ok); }
.pill.off .dot { background: var(--alert); }

/* landing */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.landing h1 { margin: 0; font-size: 30px; }
.landing p { margin: 0 0 8px; }
.join { display: flex; gap: 8px; }
.input.code { width: 160px; text-align: center; font-size: 20px; letter-spacing: 6px; font-weight: 700; }

/* participant */
.part { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; }
.part-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.big { position: relative; width: min(78vw, 340px); aspect-ratio: 1; border-radius: 50%; border: none; cursor: pointer;
  background: var(--alert); color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 10px 30px rgba(224, 72, 62, .28); transition: transform .08s, background .2s; -webkit-tap-highlight-color: transparent; user-select: none; }
.big:active { transform: scale(.96); }
.big.sent { background: #8c96a3; box-shadow: none; cursor: default; }
.big-label { font-size: 30px; font-weight: 800; }
.big-sub { font-size: 14px; opacity: .9; }
.ring { position: absolute; inset: -16px; width: calc(100% + 32px); height: calc(100% + 32px); transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke: var(--alert); stroke-width: 2.5; stroke-dasharray: 295.3; stroke-dashoffset: 295.3; opacity: 0; }
.big.sent .ring circle { opacity: 1; stroke: var(--accent); animation: cool linear forwards; animation-duration: var(--cool, 8s); }
@keyframes cool { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 295.3; } }

/* host */
.host { min-height: 100vh; display: flex; flex-direction: column; }
.host-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.room { display: flex; align-items: baseline; gap: 10px; }
.room strong { font-size: 30px; letter-spacing: 6px; }
.host-main { flex: 1; display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 24px; }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: background .25s, border-color .25s; }
.meter.flash { background: var(--alert-weak); border-color: var(--alert); transition: none; }
.meter-num { font-size: clamp(96px, 18vw, 220px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-label { font-size: 20px; color: var(--muted); margin-top: 6px; }
.meter-row { display: flex; gap: 24px; margin-top: 18px; color: var(--muted); }
.meter-row span { display: inline-flex; align-items: center; gap: 6px; }
.meter-row b { color: var(--text); font-size: 18px; }
.bars { width: 100%; max-width: 640px; height: 90px; display: flex; align-items: flex-end; gap: 3px; margin-top: 28px; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; background: var(--alert); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .8; }
.bars div.zero { background: var(--line); }
.bars-axis { width: 100%; max-width: 640px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.invite { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; align-self: start; }
.qr svg { width: 240px; height: 240px; display: block; }
.link { font-size: 13px; color: var(--accent); word-break: break-all; text-align: center; }

.unlock { position: fixed; inset: 0; background: rgba(246, 247, 249, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 5; }
.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) {
  .host-main { grid-template-columns: 1fr; padding: 16px; }
  .host-top { padding: 12px 16px; }
  .qr svg { width: 180px; height: 180px; }
}
