/* 방향: 저녁 동네 풋살장. 화면은 중립 톤으로 조용하게, 색은 코트와 가입 버튼에만. 숫자는 등번호처럼. */
:root {
  --bg: #fafafa; --card: #fff; --raised: #f4f4f5;
  --text: #171717; --text-2: #525252; --text-3: #737373;
  --line: rgb(23 23 23 / .1); --line-strong: rgb(23 23 23 / .22);
  --accent: #17663f; --primary-bg: #17663f; --primary-fg: #fff;
  --positive: #16a34a; --danger: #dc2626;
  --turf: #2c7a4d; --turf-ink: #0f3d25;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --num: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141415; --card: #19191b; --raised: #232325;
    --text: #ededed; --text-2: #a1a1a6; --text-3: #85858b;
    --line: rgb(237 237 237 / .09); --line-strong: rgb(237 237 237 / .24);
    --accent: #4cc38a; --primary-bg: #ededed; --primary-fg: #141415;
    --positive: #4cc38a; --danger: #e5484d;
    --turf: #1f6a41;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; word-break: keep-all; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--num); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1056px; margin: 0 auto; padding: 12px 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; }
.logo svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
main { max-width: 1056px; margin: 0 auto; padding: 8px 16px 64px; min-height: 72vh; }
.bottom { max-width: 1056px; margin: 0 auto; padding: 24px 16px 40px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease); }
.btn:hover { border-color: var(--line-strong); }
.btn:active, .chip:active { transform: scale(.98); }
.btn.primary { background: var(--primary-bg); border-color: transparent; color: var(--primary-fg); }
.btn.primary:hover { opacity: .9; }
.link { background: none; border: 0; padding: 4px 0; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; font-size: 14px; cursor: pointer; transition: color 150ms var(--ease); }
.link:hover { color: var(--text); }
.link.danger { color: var(--danger); }

/* 질문: 모바일은 코트가 위(가로), 넓은 화면은 오른쪽(세로) */
.quiz { display: grid; gap: 24px; max-width: 928px; margin: 0 auto; padding-top: 8px; }
.court { display: block; width: 100%; max-width: 560px; height: auto; }
.court.v { display: none; }
.turf { fill: var(--turf); }
.mow rect { fill: #fff; opacity: .05; }
.lines { fill: none; stroke: #fff; stroke-width: 1.5; opacity: .85; }
.spots { fill: #fff; opacity: .85; }
.passes { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .7; }
.player { fill: #fff; }
.no { font-family: var(--num); font-weight: 600; font-size: 10px; fill: var(--turf-ink); }
.pick { font-size: 13px; font-weight: 500; fill: #fff; stroke: var(--turf); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; } /* 선 위에 겹쳐도 읽히게 잔디색 테두리 */
.court.v .pick { font-size: 10.5px; }
.ball { fill: #fff; stroke: var(--turf-ink); stroke-width: 2; transition: transform 480ms var(--ease); }
.lead { color: var(--text-2); margin-bottom: 20px; }
.step { display: flex; align-items: baseline; gap: 8px; line-height: 1; margin-bottom: 12px; }
.step .num { font-size: 40px; }
.step .of { font-family: var(--num); font-size: 16px; color: var(--text-3); }
.quiz h1 { font-size: 28px; line-height: 1.3; margin-bottom: 24px; }
.chips { display: grid; gap: 8px; }
.chips.many { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.chip { display: flex; flex-direction: column; gap: 4px; text-align: left; min-height: 44px; justify-content: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 500; cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease); }
.chips.many .chip { align-items: center; padding: 8px; }
.chip:hover { background: var(--raised); border-color: var(--line-strong); }
.chip small { font-weight: 400; color: var(--text-2); font-size: 13px; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.finishing .chip { pointer-events: none; }
@media (min-width: 860px) {
  .quiz { grid-template-columns: minmax(0, 1fr) 256px; gap: 64px; align-items: center; padding-top: 40px; }
  .pitch { order: 2; }
  .court.h { display: none; }
  .court.v { display: block; }
  .quiz h1 { font-size: 36px; line-height: 1.2; letter-spacing: -.01em; }
  .step .num { font-size: 48px; }
}

/* 결과 */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--text-3); }
.filters .check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); min-height: 36px; }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
select, input:not([type=checkbox]), textarea { min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); width: 100%; transition: border-color 150ms var(--ease); }
select:hover, input:not([type=checkbox]):hover, textarea:hover { border-color: var(--line-strong); }
.filters select { width: auto; min-width: 104px; }
.filters .search input { width: 176px; }
.count { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin: 24px 0 16px; }
.total { font-size: 16px; }
.total .num { font-size: 32px; margin-right: 2px; }
.count-note { color: var(--text-2); font-size: 14px; margin-right: auto; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 304px), 1fr)); }
.card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h2 { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.loc { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--text-2); }
.facts > span + span::before { content: "·"; margin: 0 8px; color: var(--text-3); }
.facts .num { font-size: 15px; color: var(--text); }
.status.on::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--positive); vertical-align: 2px; }
.note { font-size: 14px; overflow-wrap: anywhere; }
.meta { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.card-foot .link { margin-left: auto; font-size: 13px; }
.empty { padding: 64px 0; text-align: center; color: var(--text-2); }
@media (max-width: 520px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters select, .filters .search input { width: 100%; }
  .filters .search { grid-column: 1 / -1; }
}

/* 다이얼로그 폼 */
dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog form { display: grid; gap: 12px; padding: 24px; }
dialog h2 { font-size: 18px; }
dialog label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.hint { font-size: 14px; color: var(--text-2); }
.hp { position: absolute; left: -9999px; }
.status[role=status] { min-height: 24px; font-size: 14px; color: var(--danger); }
.actions { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--card); padding: 8px 0 0; }

/* 관리자 */
.admin h1 { font-size: 20px; margin: 32px 0 12px; }
.admin #requests { display: grid; gap: 16px; }
.admin #q { max-width: 320px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child > * { border-bottom: 0; }
thead th { color: var(--text-3); font-weight: 500; font-size: 12px; }
.row-actions { white-space: nowrap; display: flex; gap: 12px; }
.diff th { width: 34%; color: var(--text-2); font-weight: 400; }
.diff td { overflow-wrap: anywhere; }
.diff .old { color: var(--text-3); text-decoration: line-through; }
.diff tr:first-child .old { text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 지역 링크(푸터)와 검색엔진용 지역별 목록 페이지 */
.regions { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin-bottom: 16px; }
.regions h2 { width: 100%; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.bottom a, .crumbs a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.bottom a:hover, .crumbs a:hover { color: var(--text); }
.top a.btn { flex: none; }
.listing h1 { font-size: 28px; line-height: 1.3; margin: 8px 0 12px; }
.listing h1 .num { font-size: 32px; }
.listing .lead { max-width: 640px; margin-bottom: 24px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.districts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.districts a { display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; line-height: 26px; transition: border-color 150ms var(--ease); }
.districts a:hover { border-color: var(--line-strong); }
.districts .num { color: var(--text-3); }

/* 타일 지도: 칸 색의 진하기 = 팀 수 */
.filters .map-toggle { margin-left: auto; }
.map { display: flex; flex-wrap: wrap; gap: 24px 48px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.map h2 { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.tiles { display: grid; gap: 4px; }
.tiles.kr { grid-template-columns: repeat(4, minmax(0, 80px)); }
.tiles.seoul { grid-template-columns: repeat(6, minmax(0, 64px)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 12px; line-height: 1.3; cursor: pointer; transition: border-color 150ms var(--ease); }
.tile .num { font-size: 15px; line-height: 1.1; min-height: 16px; }
.tile[data-l="1"] { background: color-mix(in srgb, var(--turf) 12%, var(--card)); }
.tile[data-l="2"] { background: color-mix(in srgb, var(--turf) 24%, var(--card)); }
.tile[data-l="3"] { background: color-mix(in srgb, var(--turf) 38%, var(--card)); }
.tile[data-l="4"] { background: color-mix(in srgb, var(--turf) 52%, var(--card)); }
.tile:hover:not(:disabled) { border-color: var(--line-strong); }
.tile:disabled { background: transparent; color: var(--text-3); cursor: default; }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 520px) { .filters .map-toggle { grid-column: 1 / -1; margin-left: 0; } }
