:root { --elite: #fff3c4; --muted: #999; --line: #ddd; --running: #dce9f6; --running-ink: #1f4e79;
  --reward-sure: #d8f0dd; --reward-draw: #ffe4c4; --reward-lost: #f2f2f2; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 14px; color: #222; background: #fafafa; }
header { padding: 12px 16px; background: #2b2d42; color: #fff; }
header .bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
header h1 { margin: 0; font-size: 18px; }
header .updated { text-align: right; font-size: 12px; line-height: 1.3; white-space: nowrap; opacity: .9; }
header .updated time { font-weight: bold; }
header .updated small { opacity: .8; }
header a { color: #fff; text-decoration: none; }
nav a { display: inline-block; margin-right: 12px; opacity: .9; }
main { padding: 12px 16px; max-width: 1200px; margin: 0 auto; }
section { margin-bottom: 28px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.rules { background: #fff; border: 1px solid var(--line); padding: 8px 12px; }
.rules ol { margin: 0; padding-left: 20px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; background: #fff; white-space: nowrap; }
th, td { border: 1px solid var(--line); padding: 4px 8px; text-align: center; }
th { background: #f0f0f0; position: sticky; top: 0; }
tr.elite { background: var(--elite); }
tr.below { color: var(--muted); }
tr.excluded td { text-decoration: line-through; }
table.grid th .date { font-weight: bold; }
table.grid th .day { font-weight: bold; color: #2b2d42; }
table.cwl th .date { font-weight: normal; font-size: 12px; color: #555; }
table.grid th .type, table.grid th .opp { font-weight: normal; font-size: 12px; color: #555; }
.cell { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }
footer { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }
table.cwl th { background: #ececec; color: #555; }
.hint { margin: 0 0 6px; color: #666; font-size: 12px; }
.scores-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; }
.scores-head h2 { margin: 0; }
.month-select { font-size: 13px; }
.month-select select { font-size: 14px; padding: 4px 6px; margin-left: 4px; border-radius: 4px; border: 1px solid #999; }
.tabs > input { display: none; }
.tab-bar { display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.tab-bar label { padding: 8px 12px; cursor: pointer; white-space: nowrap; color: #555; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs .panel { display: none; }
#tab-members:checked ~ #panel-members, #tab-scores:checked ~ #panel-scores, #tab-roster:checked ~ #panel-roster,
#tab-regular:checked ~ #panel-regular, #tab-cwl:checked ~ #panel-cwl { display: block; }
#tab-members:checked ~ .tab-bar label[for="tab-members"], #tab-scores:checked ~ .tab-bar label[for="tab-scores"],
#tab-roster:checked ~ .tab-bar label[for="tab-roster"], #tab-regular:checked ~ .tab-bar label[for="tab-regular"],
#tab-cwl:checked ~ .tab-bar label[for="tab-cwl"] { color: #2b2d42; border-bottom-color: #2b2d42; font-weight: bold; }
table.grid th.running { background: var(--running); }
table.grid th .status { font-weight: bold; color: var(--running-ink); font-size: 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.subtabs > input { display: none; }
.subtab-bar { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.subtab-bar label { padding: 6px 12px; cursor: pointer; white-space: nowrap; font-size: 13px;
  color: #444; background: #ececec; border-radius: 999px; }
.subtabs .subpanel { display: none; }
#cwltab-roster:checked ~ #subpanel-roster, #cwltab-record:checked ~ #subpanel-record,
#cwltab-scores:checked ~ #subpanel-scores, #cwltab-reward:checked ~ #subpanel-reward { display: block; }
#cwltab-roster:checked ~ .subtab-bar label[for="cwltab-roster"],
#cwltab-record:checked ~ .subtab-bar label[for="cwltab-record"],
#cwltab-scores:checked ~ .subtab-bar label[for="cwltab-scores"],
#cwltab-reward:checked ~ .subtab-bar label[for="cwltab-reward"] { background: #2b2d42; color: #fff; }
h4 { font-size: 14px; margin: 18px 0 6px; }
tr.reward-sure { background: var(--reward-sure); }
tr.reward-draw { background: var(--reward-draw); }
.legend { font-size: 12px; color: #555; margin: 0 0 8px; }
.swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid #bbb; vertical-align: -1px; }
.swatch.reward-sure { background: var(--reward-sure); }
.swatch.reward-draw { background: var(--reward-draw); }
.summary { margin: 0 0 8px; }
tr.reward-lost { color: var(--muted); }
.swatch.reward-lost { background: var(--reward-lost); }
.draw-box { background: #fff; border: 1px solid var(--line); padding: 14px; margin: 10px 0 16px; }
.draw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .draw-grid { grid-template-columns: 1fr; } }
.draw-box h5 { font-size: 13px; margin: 0 0 8px; color: #333; }
.pool-label { font-size: 12px; color: #666; margin: 10px 0 4px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; }
.chips li { padding: 4px 9px; border-radius: 999px; background: #eee; font-size: 13px;
  transition: background .15s, color .15s; }
.chips li.flash { background: #2b2d42; color: #fff; }
.chips li.won { background: var(--reward-sure); font-weight: bold; }
.chips li.lost { background: var(--reward-lost); color: #aaa; }
.slots { list-style: none; counter-reset: slot; padding: 0; margin: 0; display: grid; gap: 4px; }
.slots li { counter-increment: slot; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; }
.slots li::before { content: counter(slot); min-width: 18px; text-align: right;
  color: var(--muted); font-size: 12px; }
.slots li.empty .who { color: #ccc; }
.slots li.filled { background: var(--reward-sure); }
.slots li .note { margin-left: auto; font-size: 11px; color: #567; }
.slots li.just-filled { animation: slot-pop .3s ease-out; }
@keyframes slot-pop { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .slots li.just-filled { animation: none; } }
.draw-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.draw-actions .hint { margin: 0; }
#draw-play { padding: 8px 18px; font-size: 14px; border: 0; border-radius: 6px;
  background: #2b2d42; color: #fff; cursor: pointer; }
#draw-play:disabled { opacity: .5; cursor: default; }
#draw-reset.ghost { padding: 8px 14px; font-size: 13px; border: 1px solid #bbb;
  border-radius: 6px; background: #fff; color: #444; cursor: pointer; }
.badge-draw { display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--reward-draw); color: #8a4b00; font-size: 12px; font-weight: bold; }
footer .ver { color: var(--muted); text-decoration: none; }
footer .ver:hover { text-decoration: underline; }
