/* 딴짓 · 팀 나누기 — 체육관 마룻바닥, 팀마다 색 조끼(빕), 흰 이름표 */
:root {
  --wood: #c98b4f; --wood-2: #b97a40; --ink: #22201c; --paper: #fffdf7; --dim: #6a4f33; --line: #f4e9d8;
  --head: 'Black Han Sans', 'Pretendard Variable', sans-serif;
  --ui: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100svh; color: var(--ink); font: 500 16px/1.55 var(--ui); overflow-x: clip;
  background-color: var(--wood);
  background-image:
    linear-gradient(90deg, transparent 0 calc(50% - 2px), rgba(255,255,255,.55) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    repeating-linear-gradient(0deg, rgba(0,0,0,.09) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 120px, rgba(0,0,0,.05) 120px 240px);
  background-attachment: fixed; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; max-width: 1080px; margin: 0 auto; }
.logo { font: 400 21px/1 var(--head); color: var(--paper); background: var(--ink); padding: 9px 12px 7px; border-radius: 6px; text-decoration: none; }
.chip { appearance: none; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,.25); font-weight: 800; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="false"] { opacity: .5; text-decoration: line-through; }
.stage { max-width: 1080px; margin: 0 auto; padding: 0 16px 28px; min-height: calc(100svh - 64px); }

.setup { max-width: 540px; margin: 6px auto 0; background: var(--paper); border-radius: 14px; padding: 18px 16px; box-shadow: 0 10px 24px rgba(60,30,5,.25); border-top: 10px solid #e2463a; }
h1 { margin: 0; font: 400 clamp(38px, 11vw, 52px)/1 var(--head); }
.lede { margin: 6px 0 10px; color: var(--dim); font-size: 15px; word-break: keep-all; }
.fld { display: grid; gap: 4px; margin-top: 10px; font-weight: 800; font-size: 14px; }
.fld small { font-weight: 600; color: var(--dim); margin-left: 4px; }
.fld textarea, .fld input, .fld select { width: 100%; border: 2px solid var(--ink); border-radius: 8px; background: #fff; padding: 8px 10px; font-size: 16px; }
.fld textarea { min-height: 76px; resize: vertical; }
.fld input, .fld select { min-height: 46px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.mode button { appearance: none; min-height: 46px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 800; cursor: pointer; }
.mode [aria-checked="true"] { background: var(--ink); color: var(--paper); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
.stepper button { appearance: none; width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font: 700 28px/1 var(--ui); cursor: pointer; }
.stepper output { font: 400 48px/1 var(--head); min-width: 2ch; text-align: center; }
.stepper span { font-weight: 800; margin-left: -8px; }
.plan { margin: 6px 0 0; text-align: center; color: var(--dim); font-size: 14px; min-height: 1.4em; }
.more-opt { margin-top: 10px; font-size: 14px; }
.more-opt summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; }
.chk input { width: 20px; height: 20px; accent-color: var(--ink); }
.err { margin: 8px 0 0; color: #c2271b; font-weight: 700; font-size: 14px; }
.err:empty { display: none; }
.go { appearance: none; display: block; width: 100%; margin-top: 14px; min-height: 60px; border: 0; border-radius: 12px; background: #e2463a; color: #fff; font: 400 28px/1 var(--head); cursor: pointer; box-shadow: 0 5px 0 #8f1d14; }
.go:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f1d14; }

/* 결과: 조끼 */
.result[hidden] { display: none; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 18px 14px; padding-top: 22px; }
.bib { position: relative; background: var(--c); color: var(--on, #fff); border-radius: 26px 26px 14px 14px; padding: 44px 14px 16px; min-height: 180px; box-shadow: inset 0 -10px 0 rgba(0,0,0,.12), 0 8px 16px rgba(60,30,5,.3);
  background-image: radial-gradient(rgba(255,255,255,.18) 1.2px, transparent 1.6px); background-size: 6px 6px;
  -webkit-mask: radial-gradient(circle 40px at 50% -12px, transparent 39px, #000 40px); mask: radial-gradient(circle 40px at 50% -12px, transparent 39px, #000 40px); }
.bib::before, .bib::after { content: ''; position: absolute; top: 0; width: 28px; height: 100%; background: rgba(0,0,0,.06); }
.bib::before { left: 0; border-radius: 26px 0 0 14px; } .bib::after { right: 0; border-radius: 0 26px 14px 0; }
.bib h2 { margin: 0 0 10px; text-align: center; font: 400 30px/1 var(--head); letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.bib h2 small { display: block; font: 700 13px/1.4 var(--ui); opacity: .85; letter-spacing: 0; text-shadow: none; }
.bib ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; position: relative; z-index: 1; }
.tag { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 6px 10px; font-weight: 800; font-size: 16px; box-shadow: 0 2px 0 rgba(0,0,0,.2); max-width: 100%; overflow-wrap: anywhere; }
.tag.cap::before { content: '★ '; color: #d99a00; }
.tag.fly { animation: fly .42s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes fly { from { transform: translateY(-60px) rotate(-12deg) scale(.6); opacity: 0; } }
.acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.btn { appearance: none; min-height: 46px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.btn.main { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; margin: 0; padding: 12px 16px; background: var(--ink); color: var(--paper); border-radius: 10px; font-weight: 700; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.toast[hidden] { display: none; }

.guide { background: var(--paper); border-top: 8px solid var(--ink); }
.guide-in { max-width: 760px; margin: 0 auto; padding: 30px 20px 44px; content-visibility: auto; contain-intrinsic-size: auto 1600px; }
.guide h2 { font: 400 25px/1.3 var(--head); margin: 30px 0 10px; word-break: keep-all; }
.guide section:first-of-type h2 { margin-top: 6px; }
.guide p, .guide li, .guide dd, .guide td { word-break: keep-all; }
.steps { padding-left: 1.3em; } .steps li { margin: 6px 0; } .steps b { margin-right: 4px; }
.guide table { width: 100%; border-collapse: collapse; font-size: 15px; }
.guide th, .guide td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eadfcd; vertical-align: top; }
.faq dl { margin: 0; } .faq dt { font-weight: 800; margin-top: 16px; } .faq dd { margin: 4px 0 0; color: #4a3d33; }
.more ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.more a { display: block; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 8px; color: var(--ink); text-decoration: none; }
.more a b { margin-right: 6px; }
.site-foot { margin-top: 30px; font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.site-foot a { color: var(--dim); display: inline-block; padding: 10px 0; }
@media (prefers-reduced-motion: reduce) { .tag.fly { animation: none; } }
