:root {
  --bg: #0c0a09;
  --card: #1c1917;
  --card2: #292524;
  --line: #3a3532;
  --text: #fafaf9;
  --muted: #a8a29e;
  --accent: #f97316;
  --a: #f59e0b;
  --b: #22c55e;
  --o: #38bdf8;
  --bad: #f43f5e;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--accent); }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 18px 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.brand b { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 10px; }
p { line-height: 1.55; margin: 0 0 12px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card.tight { padding: 14px; }
input[type=text], textarea { width: 100%; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 17px; font-family: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
button { font-family: inherit; cursor: pointer; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 18px; font-weight: 700; background: var(--accent); color: #111; margin-top: 12px; transition: transform .05s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.small { padding: 10px 12px; font-size: 15px; width: auto; display: inline-block; margin-top: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.scale button { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px 0; font-size: 20px; font-weight: 700; }
.scale button.on { background: var(--accent); color: #111; border-color: var(--accent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opts button { text-align: left; background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px; }
.opts button.on { border-color: var(--accent); background: #3b1f0b; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; letter-spacing: .03em; }
.role-A { background: var(--a); color: #111; }
.role-B { background: var(--b); color: #111; }
.role-O { background: var(--o); color: #111; }
.big-role { font-size: 40px; font-weight: 900; margin: 6px 0 2px; }
.side { font-size: 18px; font-weight: 700; padding: 14px; border-radius: 12px; background: var(--card2); border: 1px dashed var(--line); text-align: center; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; letter-spacing: -.02em; }
.timer.huge { font-size: 76px; text-align: center; line-height: 1; margin: 8px 0; }
.timer.warn { color: var(--a); }
.timer.over { color: var(--bad); }
.role-text p { font-size: 16.5px; }
.role-text p:last-child { font-weight: 700; }
details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 10px; }
.partner { font-size: 34px; font-weight: 900; margin: 4px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--bad); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: 90vw; }
.toast.ok { background: #16a34a; }
.conn { position: fixed; top: 8px; right: 10px; font-size: 12px; color: var(--muted); }
.conn.off { color: var(--bad); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.done-mark { font-size: 54px; text-align: center; }
