:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif;color:#17211f;background:#f4f7f6;line-height:1.5}*{box-sizing:border-box}body{margin:0}.container{max-width:1100px;margin:auto;padding:32px 18px 70px}.hero{padding:20px 4px 28px}.hero h1{font-size:clamp(28px,5vw,44px);margin:4px 0 8px;letter-spacing:-1px}.eyebrow{font-size:12px;font-weight:800;letter-spacing:2px;color:#0f766e;margin:0 0 5px}.subtitle{color:#687571;margin:0}.card{background:#fff;border:1px solid #e3e9e7;border-radius:18px;box-shadow:0 6px 24px #17352a0b}.setup-card{padding:24px}.setup-card h2{margin-bottom:20px}.grid{display:grid;gap:14px}.inputs{grid-template-columns:repeat(3,1fr)}label{font-weight:700;font-size:14px;color:#42504d}input,textarea{display:block;width:100%;margin-top:7px;border:1px solid #d5dfdc;border-radius:10px;padding:11px 12px;font:inherit;background:#fbfcfc}input:focus,textarea:focus{outline:2px solid #99d8ce;border-color:#0f766e}textarea{resize:vertical;min-height:170px}.player-header{display:flex;align-items:end;justify-content:space-between;margin:24px 0 10px}.player-header h3{margin:0}.player-header p{margin:2px 0 0;color:#77827f;font-size:13px}.player-actions,.result-actions{display:flex;gap:8px;flex-wrap:wrap}.small{padding:7px 10px;font-size:12px}.primary,.secondary{border:0;border-radius:10px;padding:11px 15px;font-weight:800;cursor:pointer}.primary{background:#0f766e;color:white}.primary:hover{background:#0b625c}.secondary{background:#edf3f1;color:#28514a}.secondary:hover{background:#e0ebe8}.generate{width:100%;margin-top:16px;font-size:15px}.hint{font-size:13px;color:#687571;margin-top:8px}.hidden{display:none!important}.result{margin-top:36px}.result-top{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:18px}.result-top h2{font-size:30px;margin:0 0 4px}.result-top p:last-child{color:#687571;margin:0}.round{margin-bottom:18px}.round-title{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:9px}.round-title h3{margin:0;font-size:19px}.round-title span{font-size:13px;color:#77827f}.court-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:12px}.court{background:#fff;border:1px solid #e0e7e5;border-radius:15px;padding:15px}.court-head{display:flex;justify-content:space-between;color:#71807b;font-size:12px;font-weight:800;margin-bottom:12px}.teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px}.team{display:flex;flex-direction:column;gap:7px}.player{border:1px solid #d8e3df;background:#f7faf9;border-radius:8px;padding:8px 6px;text-align:center;cursor:pointer;font-weight:700;font-size:14px}.player:hover{border-color:#0f766e;background:#edf8f6}.vs{font-size:11px;color:#8b9692;font-weight:800}.stats-card{padding:20px;margin-top:24px}.section-title h3{margin:0}.section-title p{color:#77827f;font-size:13px;margin:3px 0 15px}.stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}.stat{border:1px solid #e2e9e7;border-radius:10px;padding:10px 12px;display:flex;justify-content:space-between;gap:10px;background:#fbfcfc}.stat .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stat .count{font-weight:900;color:#0f766e}.edit-note{text-align:center;color:#74817e;font-size:12px;margin-top:13px}.message{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:#20312d;color:#fff;padding:11px 16px;border-radius:10px;box-shadow:0 8px 25px #0003;font-size:13px;z-index:10}@media(max-width:700px){.container{padding:18px 12px 50px}.inputs{grid-template-columns:1fr 1fr}.inputs label:last-child{grid-column:1/-1}.player-header,.result-top{align-items:flex-start;flex-direction:column}.result-actions{width:100%}.result-actions button{flex:1}.setup-card{padding:18px}.court-grid{grid-template-columns:1fr}.teams{gap:5px}.player{font-size:13px}.stats-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:420px){.inputs{grid-template-columns:1fr}.inputs label:last-child{grid-column:auto}.player-actions button{font-size:11px}}
.player-input-row{display:flex;gap:8px}.player-input-row input{margin-top:0;flex:1}.add-player{margin-top:0;white-space:nowrap}.player-list{display:flex;flex-direction:column;gap:7px;margin-top:10px;max-height:280px;overflow:auto}.member{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f7faf9;border:1px solid #e0e7e5;border-radius:10px;padding:9px 12px;font-weight:700}.remove-player{width:28px;height:28px;border:0;border-radius:7px;background:#edf3f1;color:#66736f;font-size:20px;line-height:1;cursor:pointer}.remove-player:hover{background:#e2ebe8;color:#c0392b}
@media(max-width:420px){.player-input-row{align-items:stretch}.add-player{padding-left:12px;padding-right:12px}}

.first-round-header{display:flex;justify-content:space-between;align-items:center;margin:14px 0 8px;font-size:13px}.first-round-header span{color:#0f766e;font-weight:800}.member-check{display:flex;align-items:center;gap:9px;margin:0;font-size:14px;font-weight:700;cursor:pointer;color:#17211f}.member-check input{width:18px;height:18px;margin:0;accent-color:#0f766e}.member-check span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.result-top h2 #matchDate{font-size:.52em;font-weight:700;color:#687571;white-space:nowrap;margin-left:6px}

.stat-detail{border:1px solid #e2e9e7;border-radius:10px;background:#fbfcfc;overflow:hidden}
.stat-detail summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;font-weight:700}
.stat-detail summary::-webkit-details-marker{display:none}
.stat-detail summary:before{content:"＋";color:#0f766e;font-weight:900;width:18px}
.stat-detail[open] summary:before{content:"−"}
.stat-detail .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.detail-body{border-top:1px solid #e2e9e7;padding:10px 12px;display:flex;flex-direction:column;gap:10px}
.detail-row{display:flex;flex-direction:column;gap:6px}
.detail-row>strong{font-size:12px;color:#5d6b67}
.detail-chips{display:flex;flex-wrap:wrap;gap:5px}
.detail-chip,.attendance{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:4px 8px;font-size:11px;background:#edf3f1;color:#36534c}
.detail-chip b{color:#0f766e}
.attendance.played{background:#e6f5f2;color:#0b625c}
.attendance.rest{background:#f1f3f2;color:#7a8581}
.empty-detail{font-size:11px;color:#89938f}


.attendance-card{padding:20px;margin-top:24px}
.attendance-matrix{border:1px solid #e4ebe8;border-radius:16px;overflow:hidden;background:#fff}
.attendance-head,.attendance-row{display:grid;grid-template-columns:minmax(110px,1.4fr) repeat(var(--round-count, 6),minmax(58px,1fr)) minmax(55px,.7fr);align-items:stretch}
.attendance-head{min-width:520px;background:#f5f8f7;border-bottom:1px solid #e4ebe8}
.attendance-head>div{padding:10px 8px;text-align:center;color:#65736f;font-size:11px;font-weight:800;background:#f5f8f7}
.attendance-player-title{text-align:left!important;padding-left:14px!important}
.attendance-round-title{display:flex;flex-direction:column;gap:1px}
.attendance-round-title small,.attendance-total-title small{font-size:9px;font-weight:700;color:#8a9692}
.attendance-row{min-width:520px;border-bottom:1px solid #eef2f0}
.attendance-row:last-child{border-bottom:0}
.attendance-player{display:flex;align-items:center;padding:10px 14px;font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attendance-cell{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:52px;border-left:1px solid #f0f3f2}
.attendance-cell span{font-size:18px;font-weight:900;line-height:1}
.attendance-cell small{font-size:9px;font-weight:700;margin-top:3px}
.attendance-cell.is-played{background:#effaf7;color:#08766e}
.attendance-cell.is-rest{background:#fafbfb;color:#a1aaa7}
.attendance-total{display:flex;align-items:center;justify-content:center;gap:1px;border-left:1px solid #e8eeeb;background:#f7faf9;color:#0f766e;font-size:17px;font-weight:900}
.attendance-total small{font-size:10px;color:#71807b}
.attendance-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:10px;color:#6f7c78;font-size:11px}
.attendance-legend span{display:flex;align-items:center;gap:5px}
.legend-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.legend-dot.played{background:#0f766e}
.legend-dot.rest{background:#c7cfcc}

.stats-card .stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.player-detail-card{border:1px solid #e2e9e7;border-radius:14px;background:#fff;padding:14px;box-shadow:0 2px 10px #17352a08}
.player-detail-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:11px;margin-bottom:11px;border-bottom:1px solid #edf1f0}
.player-detail-head>div{display:flex;align-items:baseline;gap:8px}
.player-detail-head strong{font-size:15px}
.player-detail-head span{font-size:11px;color:#0f766e;font-weight:900;background:#edf8f6;border-radius:999px;padding:3px 7px}
.detail-section+.detail-section{margin-top:12px}
.detail-label{font-size:11px;color:#66746f;font-weight:800;margin-bottom:6px}
.detail-chips{display:flex;flex-wrap:wrap;gap:5px}
.detail-chip{display:inline-flex;align-items:center;gap:6px;border-radius:8px;padding:6px 8px;font-size:11px;background:#f4f7f6;color:#36534c;border:1px solid #e5ebe9}
.detail-chip b{color:#0f766e;font-size:10px}
.empty-detail{font-size:11px;color:#89938f}
@media(max-width:700px){
  .attendance-card,.stats-card{padding:16px}
  .attendance-matrix{overflow-x:auto}
  .attendance-head,.attendance-row{grid-template-columns:100px repeat(var(--round-count, 6),58px) 55px}.attendance-head{min-width:503px}
  .stats-card .stats-grid{grid-template-columns:1fr}
}

.algorithm-card{margin-top:24px;overflow:hidden}
.algorithm-card summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;cursor:pointer;background:#fff}
.algorithm-card summary::-webkit-details-marker{display:none}
.algorithm-card summary>span{display:flex;flex-direction:column;gap:2px}
.algorithm-card summary strong{font-size:15px;color:#1d302c}
.algorithm-card summary small{font-size:11px;color:#77827f;font-weight:600}
.algorithm-card summary>b{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:#edf3f1;color:#0f766e;font-size:18px}
.algorithm-card[open] summary{border-bottom:1px solid #e5ebe9;background:#f9fbfa}
.algorithm-card[open] summary>b{transform:rotate(45deg)}
.algorithm-info{padding:16px 20px 18px}
.algorithm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.algorithm-grid>div{display:flex;flex-direction:column;gap:3px;padding:12px;border:1px solid #e3eae8;border-radius:12px;background:#fbfcfc}
.algorithm-grid strong{font-size:12px;color:#28514a}
.algorithm-grid span{font-size:11px;color:#687571;line-height:1.55}
.algorithm-note{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:#f3f7f5;color:#6d7975;font-size:11px;line-height:1.55}
@media(max-width:700px){
  .algorithm-card summary{padding:14px 16px}
  .algorithm-info{padding:14px 16px 16px}
  .algorithm-grid{grid-template-columns:1fr}
}

.swap-modal{position:fixed;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;padding:18px}
.swap-backdrop{position:absolute;inset:0;background:#17211f99;backdrop-filter:blur(2px)}
.swap-dialog{position:relative;width:min(420px,100%);max-height:min(80vh,620px);overflow:auto;background:#fff;border-radius:18px;box-shadow:0 18px 55px #0004;padding:20px}
.swap-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.swap-header>div{display:flex;flex-direction:column;gap:2px}
.swap-header strong{font-size:17px}
.swap-header span{font-size:11px;color:#77827f}
.swap-close{width:32px;height:32px;border:0;border-radius:9px;background:#edf3f1;color:#66736f;font-size:22px;line-height:1;cursor:pointer}
.swap-help{margin:0 0 13px;color:#687571;font-size:12px}
.swap-options{display:flex;flex-direction:column;gap:8px}
.swap-option{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:11px 12px;border:1px solid #dce6e2;border-radius:11px;background:#f7faf9;color:#20312d;text-align:left;font:inherit;font-weight:800;cursor:pointer}
.swap-option:hover{border-color:#0f766e;background:#edf8f6}
.swap-option b{font-size:11px;color:#0f766e;background:#e2f3ef;border-radius:999px;padding:4px 8px}
.swap-cancel{width:100%;margin-top:12px}
@media(max-width:420px){.swap-dialog{padding:16px;border-radius:15px}.swap-modal{padding:10px}}

.match-count{margin-top:12px;padding:12px 14px;border:1px solid #dfe9e6;border-radius:12px;background:#f7faf9;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.match-count strong{font-size:15px;color:#0f766e}.match-count span{font-size:12px;color:#52615d}.match-count small{font-size:11px;color:#8a9692}
.site-footer{text-align:center;color:#8a9692;font-size:11px;padding:28px 0 4px}