:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1d22; --muted: #646a75; --line: #e3e6eb;
  --accent: #3b5bdb; --accent-text: #fff; --good: #2b8a3e; --hit: #ffe066;
  --b1: #f5b800; --b2: #3b82f6; --b3: #ef4444; --b4: #6b7280; --b5: #22a35a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --card: #1a1d23; --text: #e9ebef; --muted: #9aa1ad; --line: #2b2f37; --accent: #748ffc; --accent-text: #0d0f13; --good: #69db7c; --hit: #8a6d00; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
header { border-bottom: 1px solid var(--line); background: var(--card); }
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
nav a { margin-left: 16px; color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a[aria-current] { color: var(--text); font-weight: 700; }
main { padding: 24px 0 48px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; line-height: 1.35; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.games { list-style: none; padding: 0; margin: 0; }
.games li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.games li:first-child { border-top: 0; }
.idx { width: 1.6em; color: var(--muted); font-size: .85rem; text-align: right; flex: none; }
.balls { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.ball { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem; flex: none; }
.ball.r1 { background: var(--b1); } .ball.r2 { background: var(--b2); } .ball.r3 { background: var(--b3); } .ball.r4 { background: var(--b4); } .ball.r5 { background: var(--b5); }
.ball.miss { opacity: .3; }
.plus { color: var(--muted); align-self: center; }
.copy { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; flex: none; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notice { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .9rem; color: var(--muted); margin-top: 12px; }
.badge { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--hit); color: var(--text); flex: none; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { white-space: nowrap; padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: .85rem; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.products a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); }
.products small { display: block; color: var(--muted); }
footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: .85rem; }
footer p { margin: 4px 0; }
@media (max-width: 400px) { .ball { width: 30px; height: 30px; font-size: .85rem; } .balls { gap: 4px; } }
