*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Outfit', sans-serif; color: #1a1a1a; background: #f7fafc; line-height: 1.5; }
button, input, select { font-family: inherit; font-size: 16px; }
.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.topbar, header.site-header { display: none !important; }
.header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(0,0,0,.06); }
.header-inner, header.header > .header-inner { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important; gap: 0.75rem !important; min-height: 72px; flex-wrap: wrap !important; padding: 0.5rem 0 !important; width: 100% !important; }
.logo-img { height: 46px; width: auto; display: block; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; flex: 1 1 18rem; }
#captainBtn { white-space: normal; text-align: center; line-height: 1.25; flex: 1 1 16rem; max-width: 28rem; min-height: 52px; padding: 0.55rem 0.85rem; }
.who { cursor: default; }
.intro { background: linear-gradient(135deg, #0c4a8a, #0c2460 55%, #071433); color: #fff; padding: 1.6rem 0 1.4rem; }
.intro h1 { font-family: 'Archivo Black', sans-serif; font-weight: 400; margin: 0 0 0.4rem; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.intro p { margin: 0; max-width: 40rem; }
.guide-wrap { padding-top: 0.2rem; padding-bottom: 2.5rem; }
.guide { background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.06); padding: 1rem 1.1rem 1.15rem; }
.guide h2, .guide h3 { font-family: 'Archivo Black', sans-serif; font-weight: 400; color: #0c2460; margin: 0 0 0.6rem; }
.guide h3 { font-size: 1.05rem; margin-top: 1rem; }
.guide ol, .guide ul { margin: 0.2rem 0 0; padding-left: 1.2rem; }
.guide li { margin: 0.35rem 0; }
.guide li ul { margin-top: 0.25rem; }
.guide p { margin: 0.7rem 0 0; }
.board { padding: 1.2rem 1rem 0.4rem; }
.toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar label { font-weight: 700; color: #0c2460; display: grid; gap: 0.3rem; }
.toolbar select { min-height: 44px; border: 1px solid #c9dced; border-radius: 8px; padding: 0.4rem 0.6rem; }
.clock { margin: 0; color: #0c4a8a; font-weight: 700; }
.banner { background: #fff3cd; color: #5c4a00; border-radius: 10px; padding: 0.7rem 0.9rem; font-weight: 600; }
.sim { background: #fff8e6; border: 1px solid #f0d78c; border-radius: 12px; padding: 0.85rem 0.9rem; margin-bottom: 1rem; }
.sim p { margin: 0 0 0.7rem; }
.sim-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sim-actions .is-on { background: #0c4a8a; color: #fff; border-color: #0c4a8a; }
.match { background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.06); padding: 1rem; margin-bottom: 1rem; }
.match h2 { margin: 0 0 0.2rem; color: #0c2460; font-size: 1.15rem; }
.when { margin: 0 0 0.8rem; color: #555; font-weight: 600; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.side { border-radius: 12px; padding: 0.75rem; background: #f7fafc; }
.side h3 { margin: 0 0 0.45rem; font-size: 1rem; }
.slot { display: flex; justify-content: space-between; gap: 0.4rem; padding: 0.28rem 0; border-bottom: 1px solid rgba(0,0,0,.05); font-size: 0.95rem; }
.slot span { color: #555; }
.hidden-note, .wait { margin: 0.2rem 0 0; font-weight: 700; color: #0c4a8a; }
.lineup-done { color: #1b4332; }
.closed { color: #9b2226; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.5rem 0.9rem; border-radius: 8px; font-weight: 700; border: 2px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: #0c4a8a; color: #fff; border-color: #0c4a8a; }
.btn-outline { background: #fff; color: #0c4a8a; border-color: #0c4a8a; }
.modal { position: fixed; inset: 0; background: rgba(7,20,51,.55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; width: min(560px, 100%); max-height: min(92dvh, 900px); overflow: auto; border-radius: 16px 16px 0 0; padding: 1.1rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); }
.modal-wide { width: min(720px, 100%); }
.modal-card h2 { font-family: 'Archivo Black', sans-serif; font-weight: 400; color: #0c2460; margin: 0 0 0.7rem; }
.modal-card label { display: block; font-weight: 700; color: #0c2460; margin: 0.55rem 0 0.25rem; }
.modal-card input, .modal-card select { width: 100%; min-height: 44px; border: 1px solid #c9dced; border-radius: 8px; padding: 0.4rem 0.6rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.form-error { color: #9b2226; font-weight: 700; }
.pass-row { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; align-items: center; margin-bottom: 0.55rem; }
.pass-row input { min-width: 0; }
.hint { color: #555; font-size: 0.92rem; }
.captain-help { margin: 0.9rem 0 0; padding: 0.9rem; background: #e7f8ef; border: 2px solid #128c7e; border-radius: 12px; color: #064e3b; font-size: 1.05rem; line-height: 1.45; }
.captain-help p { margin: 0; }
.captain-help strong { color: #065f46; }
.btn-whatsapp { background: #128c7e; border-color: #128c7e; color: #fff; font-size: 1.05rem; }
.btn-whatsapp:hover { background: #0f766e; color: #fff; }
.captain-help .btn-whatsapp { width: 100%; margin-top: 0.7rem; }
.modal-actions .btn-whatsapp { width: 100%; }
.modal-actions .hint { flex: 1 1 100%; margin: 0; }
.is-captain { color: #c1121f; font-weight: 800; }
.pass-current { color: #0c2460; font-weight: 700; }
.never { background: #fff4e8; border-radius: 10px; padding: 0.7rem 0.8rem; margin: 0.7rem 0; }
.never strong { color: #9b2226; }
.never ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.never-ok { background: #e7f6ee; border-radius: 10px; padding: 0.7rem 0.8rem; margin: 0.7rem 0; color: #1b4332; font-weight: 700; }
.modal-sheet { width: min(1100px, 100%); }
.sheet-pick { margin: 0 0 0.8rem; }
.sheet-pick p { margin: 0 0 0.4rem; font-weight: 700; color: #0c2460; }
.sheet-choice { display: block; width: 100%; text-align: left; margin: 0 0 0.4rem; background: #fff; border: 2px solid #c9dced; border-radius: 10px; padding: 0.55rem 0.7rem; font-weight: 700; color: #0c2460; cursor: pointer; }
.sheet-choice small { display: block; font-weight: 600; color: #355; }
.sheet-choice.is-on { border-color: #0c4a8a; background: #e7f4fb; }
.sheet-kicker { margin: 0 0 0.35rem; color: #355; font-weight: 700; }
.sheet-match { margin: 0; page-break-inside: avoid; }
.sheet-match h3 { margin: 0 0 0.35rem; color: #0c2460; font-size: 1rem; }
@page sheet { size: A4 landscape; margin: 5mm; }
.sheet-grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.92rem; table-layout: fixed; }
.sheet-grid .c-tag { width: 16%; }
.sheet-grid .c-num { width: 9%; }
.sheet-grid .c-name { width: 24%; }
.sheet-grid .c-set { width: 18%; }
.sheet-grid th, .sheet-grid td { border: 1px solid #c9dced; padding: 0.35rem 0.4rem; vertical-align: middle; overflow-wrap: anywhere; }
.sheet-grid .tag { text-align: left; color: #0c2460; }
.sheet-grid .tag span, .mini-rank { color: #0c4a8a; font-weight: 700; }
.sheet-grid .num { font-family: 'Archivo Black', sans-serif; font-weight: 400; text-align: center; font-size: 1.05rem; color: #0c2460; }
.sheet-grid .team { text-align: center; font-weight: 700; }
.sheet-grid .set-stack { padding: 0; background: #f4f8fb; text-align: center; font-weight: 700; color: #0c2460; }
.sheet-grid .set-stack.head { font-size: 0.72rem; letter-spacing: 0.04em; color: #0c4a8a; font-family: 'Outfit', sans-serif; }
.sheet-grid .set-stack span { display: flex; justify-content: space-between; gap: 0.35rem; padding: 0.18rem 0.35rem; border-top: 1px solid #c9dced; }
.sheet-grid .set-stack span:first-child { border-top: 0; }
.sheet-grid .set-stack i { font-style: normal; color: #0c4a8a; font-size: 0.7rem; }
.sheet-grid .set-stack .is-empty { color: #c5d0dc; font-weight: 600; }
.sheet-grid .away { text-align: right; }
@media print {
  body.printing-sheet { page: sheet; }
  body.printing-sheet * { visibility: hidden; }
  body.printing-sheet #sheetModal,
  body.printing-sheet #sheetModal * { visibility: visible; }
  body.printing-sheet #sheetModal { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: #fff; display: block; overflow: visible; }
  body.printing-sheet .modal-card { width: 100%; max-height: none; height: 100%; margin: 0; padding: 0; border-radius: 0; overflow: visible; }
  body.printing-sheet .sheet-page { width: 100%; }
  body.printing-sheet .sheet-kicker { font-size: 14pt; margin: 0 0 2mm; }
  body.printing-sheet .sheet-match { margin: 0; }
  body.printing-sheet .sheet-match h3 { font-size: 18pt; margin: 0 0 2mm; }
  body.printing-sheet .sheet-grid { width: 100%; height: 178mm; font-size: 18pt; }
  body.printing-sheet .sheet-grid tr:first-child { height: 22mm; }
  body.printing-sheet .sheet-grid tr { height: 52mm; }
  body.printing-sheet .sheet-grid th,
  body.printing-sheet .sheet-grid td { print-color-adjust: exact; -webkit-print-color-adjust: exact; padding: 1.5mm 2mm; }
  body.printing-sheet .sheet-grid .num { font-size: 20pt; }
  body.printing-sheet .sheet-grid .team { font-size: 16pt; }
  body.printing-sheet .sheet-grid .set-stack { display: flex; flex-direction: column; height: 100%; }
  body.printing-sheet .sheet-grid .set-stack span { flex: 1; align-items: center; font-size: 15pt; padding: 0 3mm; }
  body.printing-sheet .sheet-grid .set-stack i { font-size: 11pt; }
  body.printing-sheet .no-print { display: none !important; }
}
@media (min-width: 760px) {
  .modal { align-items: center; padding: 1rem; }
  .modal-card { border-radius: 16px; }
}
@media (max-width: 640px) { .sides { grid-template-columns: 1fr; } }
