:root {
  --bg: #f4f5f7;
  --white: #ffffff;
  --ink: #111111;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --soft: #eef0f3;
  --link: #2f6bff;
  --card: #0f1115;
  --card-line: #1f232b;
  --card-muted: #9aa3b2;
  --blue: #2f6bff;
  --red: #f0445a;
  --good: #c6f36b;
  --warn: #f6b23c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; font-size: 15px; line-height: 1.5; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.sub { font-size: 13px; color: var(--muted); }

/* 머리 */
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-in { height: 56px; display: flex; align-items: center; gap: 28px; }
.brand { font-size: 18px; font-weight: 900; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
.top nav a.on { color: var(--ink); font-weight: 700; }

.grid { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-top: 28px; padding-bottom: 28px; }
.left { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.right { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.3; }

/* 붙여넣기 */
textarea, input[type=text], select { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
textarea { resize: vertical; line-height: 1.7; }
textarea:focus, input[type=text]:focus, select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
textarea::placeholder, input::placeholder { color: var(--faint); }
.filled { padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: #4b5563; }
.text-btn { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--link); }

/* 참가자 */
.players { list-style: none; margin: 0; padding: 6px 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.players:empty { display: none; }
.player > .row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px 16px; background: none; border: 0; text-align: left; }
.player > .row:hover { background: #f8f9fb; }
.player.open > .row { background: #f8f9fb; }
.face { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; background: var(--soft); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--faint); overflow: hidden; }
.face img { width: 100%; height: 100%; display: block; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 12px; color: var(--muted); }
.who small.unset { color: var(--warn); }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.main { background: var(--ink); color: var(--white); }
.pill.sub { background: var(--soft); color: var(--ink-2); }
.pill.none { border: 1px dashed var(--faint); color: var(--muted); }
.x { background: none; border: 0; color: var(--faint); font-size: 15px; padding: 2px 4px; }

.editor { padding: 6px 16px 14px 62px; display: grid; gap: 10px; background: #f8f9fb; }
.ed-line { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; }
.ed-line > span { font-size: 12px; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 4px; }
.opts button { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: var(--ink-2); }
.opts button.on { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 700; }
.opts button.on.no { background: var(--white); border-color: var(--red); color: var(--red); }

.add-one { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* 조건 */
.more { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.more summary { padding: 12px 16px; font-size: 14px; font-weight: 700; list-style: none; cursor: pointer; display: flex; justify-content: space-between; }
.more summary::after { content: "+"; color: var(--muted); }
.more[open] summary::after { content: "−"; }
.more-body { padding: 0 16px 16px; display: grid; gap: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; padding: 8px 0; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button[aria-checked=true] { background: var(--white); color: var(--ink); font-weight: 700; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.apart { display: grid; gap: 6px; }
.apart-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.apart-row select { padding: 8px 10px; border-radius: 10px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--soft); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.chips button { background: none; border: 0; color: var(--muted); }

/* 버튼 */
.btn { border: 0; border-radius: 12px; font-weight: 700; font-size: 14px; height: 44px; padding: 0 18px; white-space: nowrap; }
.btn.dark { background: var(--ink); color: var(--white); }
.btn.dark:disabled { background: #d1d5db; cursor: default; }
.btn.line { background: var(--white); border: 1px solid var(--line); }
.btn.big { height: 48px; padding: 0 28px; font-size: 15px; }
.btn.small { height: 38px; padding: 0 12px; font-size: 13px; }
.go-row, .act-row { display: flex; align-items: center; gap: 8px; }
.go-row .btn, .act-row .btn:first-of-type { margin-left: auto; }
.error { color: var(--red); font-size: 14px; }

/* 결과 */
.tabs-row { display: flex; align-items: center; }
.tabs { display: flex; gap: 6px; }
.tabs button { padding: 7px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: #4b5563; font-size: 13px; }
.tabs button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 700; }
.tabs-row .text-btn { margin-left: auto; color: var(--muted); font-weight: 400; }

.card { border-radius: 20px; overflow: hidden; background: var(--card); color: #fff; }
.card-head { padding: 20px 20px 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.card-head > div { display: flex; flex-direction: column; }
.date { font-size: 12px; color: var(--card-muted); }
.card-head strong { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; }
.verdict { font-size: 13px; font-weight: 700; color: var(--good); }
.verdict.l1 { color: var(--warn); }
.team-bar { display: grid; grid-template-columns: 1fr 1fr; font-size: 13px; font-weight: 700; }
.team-bar .b { background: var(--blue); padding: 7px 14px; }
.team-bar .r { background: var(--red); padding: 7px 14px; text-align: right; }
.mu { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--card-line); position: relative; }
.slot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-width: 0; background: none; border: 0; color: #fff; text-align: left; }
.slot.red { flex-direction: row-reverse; text-align: right; }
.slot:hover { background: #161a21; }
.slot.picked { background: #1d2430; box-shadow: inset 0 0 0 2px var(--good); }
.slot .face { width: 46px; height: 46px; background: #1f232b; color: #6b7280; font-size: 16px; }
.slot .who b { font-size: 15px; }
.slot .who small { color: var(--card-muted); }
.slot.red .who { align-items: flex-end; }
.slot .off { font-size: 11px; color: var(--warn); }
.lane-tag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--card); border: 1px solid #2a2f3a; border-radius: 6px; padding: 2px 8px; font-size: 12px; color: #c9ced8; pointer-events: none; }
.empty-mu .slot { color: #3a404c; cursor: default; }
.empty-mu .slot:hover { background: none; }
.card-foot { padding: 10px 20px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--card-line); }
.copy-text { align-self: flex-end; color: var(--muted); font-weight: 400; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 10px 18px; border-radius: 999px; font-size: 14px; }

.foot { padding-top: 8px; padding-bottom: 32px; font-size: 11px; color: var(--faint); line-height: 1.6; }
.foot nav { display: flex; gap: 14px; margin-bottom: 6px; }
.foot a { color: var(--muted); }
.doc { max-width: 720px; padding-top: 28px; padding-bottom: 28px; }
.doc h2 { font-size: 16px; margin: 24px 0 6px; }
.doc p { color: var(--ink-2); }

@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 24px; }
  .card-head strong { font-size: 22px; }
  .slot .face { width: 38px; height: 38px; }
  .slot { padding: 9px 10px; gap: 8px; }
  .slot .who b { font-size: 13px; }
  .act-row { flex-wrap: wrap; }
  .act-row .sub { width: 100%; }
  .editor { padding-left: 16px; }
}
