:root {
	--bg: #f6f7f9; --card: #fff; --text: #1f2328; --sub: #6b7280; --line: #e5e7eb; --accent: #00B2A9;
	/* 실제 로또 공 색 */
	--b1: #f5b800; --b2: #2f7fe0; --b3: #e5484d; --b4: #8b8f96; --b5: #2bb24c;
}
@media (prefers-color-scheme: dark) {
	:root { --bg: #15171a; --card: #1e2125; --text: #e6e8eb; --sub: #9aa0a6; --line: #2e3237; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
button { font: inherit; cursor: pointer; }

.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.logo { font-size: 17px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; color: var(--sub); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.basis { margin: 0 0 12px; color: var(--sub); font-size: 13px; }
.note { color: var(--sub); font-size: 12px; margin-top: 12px; }

/* 생성 결과 */
.sets { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.sets li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sets h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--sub); }
.sets h3 b { color: var(--text); margin-right: 6px; }
.balls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 36px; }
.plus { color: var(--sub); font-size: 13px; margin: 0 2px; }
.empty { color: var(--sub); font-size: 13px; }

.ball { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
	background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), var(--c);
	box-shadow: inset 0 -3px 6px rgba(0,0,0,.18); text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.ball.c1 { --c: var(--b1); } .ball.c2 { --c: var(--b2); } .ball.c3 { --c: var(--b3); } .ball.c4 { --c: var(--b4); } .ball.c5 { --c: var(--b5); }
.ball.roll { animation: roll .5s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes roll { from { transform: translateX(-24px) rotate(-200deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ball.roll { animation: none; } }

.primary { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; }
.primary:active { transform: translateY(1px); }

/* 통계 */
:root { --up: #e34948; --down: #2a78d6; --grid: #eceef1; }
@media (prefers-color-scheme: dark) { :root { --up: #e66767; --down: #3987e5; --grid: #2a2e33; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 14px; color: var(--sub); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--card); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile, .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile h4, .card h4 { margin: 0; font-size: 13px; font-weight: 700; }
.tile h4 small { font-weight: 400; color: var(--sub); margin-left: 4px; }
.tile-balls { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tile-balls figure { margin: 0; display: grid; justify-items: center; gap: 3px; }
.tile-balls .ball { width: 32px; height: 32px; font-size: 14px; }
.tile-balls figcaption { font-size: 11px; color: var(--sub); font-variant-numeric: tabular-nums; }

.card { margin-bottom: 12px; position: relative; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-sub { margin: 4px 0 10px; font-size: 12px; color: var(--sub); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--sub); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.up { background: var(--up); } .sw.down { background: var(--down); }

.chart-wrap { display: flex; gap: 6px; }
.yaxis { position: relative; width: 30px; flex: none; font-size: 10px; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.yaxis span { position: absolute; right: 0; transform: translateY(-50%); }
.chart { position: relative; flex: 1; min-width: 0; height: 220px; display: grid; grid-template-columns: repeat(45, minmax(0, 1fr)); gap: 2px; }
.chart .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); pointer-events: none; }
.chart .gl.zero { background: var(--sub); opacity: .5; }
.col { position: relative; height: 100%; cursor: default; }
.col i { position: absolute; left: 0; right: 0; }
.col i.up { background: var(--up); border-radius: 4px 4px 0 0; }
.col i.down { background: var(--down); border-radius: 0 0 4px 4px; }
.col:hover i, .col.on i { filter: brightness(1.15); }
.col:hover::before, .col.on::before { content: ""; position: absolute; inset: 0 -1px; background: var(--text); opacity: .06; border-radius: 3px; }
.xaxis { display: grid; grid-template-columns: repeat(45, minmax(0, 1fr)); gap: 2px; margin: 4px 0 0 36px; font-size: 10px; color: var(--sub); text-align: center; font-variant-numeric: tabular-nums; }
.xaxis span { overflow: visible; white-space: nowrap; display: flex; justify-content: center; }
.xaxis span:not(.tick) { visibility: hidden; }

.tip { position: absolute; z-index: 2; pointer-events: none; background: var(--text); color: var(--card); font-size: 12px; line-height: 1.45; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.tip b { font-size: 13px; }

.grid45 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 10px 4px; margin-top: 12px; }
.grid45 figure { margin: 0; display: grid; justify-items: center; gap: 4px; }
.grid45 .ball { width: 30px; height: 30px; font-size: 13px; }
.grid45 figcaption { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
	.grid45 { grid-template-columns: repeat(5, 1fr); }
	.chart { height: 180px; }
	.xaxis span:not(.tick):not(.t10) { visibility: hidden; }
	.xaxis span.tick:not(.t10) { visibility: hidden; }
}
.grid45 figcaption b { color: var(--text); font-weight: 600; }

/* 목록 */
.search { display: flex; gap: 6px; margin-bottom: 12px; }
.search input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.search button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.draws { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.draws li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.draws li:first-child { border-top: 0; }
.draws .seq { width: 76px; flex: none; font-weight: 700; }
.draws .seq small { display: block; font-weight: 400; font-size: 11px; color: var(--sub); }
.draws .ball { width: 30px; height: 30px; font-size: 13px; }
.more { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }

/* 고정·제외 번호판 */
.picker { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.picker summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.picker summary span { font-weight: 400; color: var(--sub); font-size: 13px; margin-left: 6px; }
.hint { color: var(--sub); font-size: 12px; margin: 8px 0; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; color: #fff; font-size: 11px; }
.tag.fix { background: var(--accent); } .tag.ex { background: #9ca3af; }
.board { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.board button { aspect-ratio: 1; max-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-weight: 600; font-size: 13px; padding: 0; }
.board button.fix { background: var(--accent); border-color: var(--accent); color: #fff; }
.board button.ex { background: none; color: var(--sub); text-decoration: line-through; opacity: .55; }
.link { border: 0; background: none; color: var(--sub); font-size: 12px; text-decoration: underline; margin-top: 6px; padding: 0; }
.meta { margin-top: 6px; font-size: 12px; color: var(--sub); }
.warn { margin-top: 6px; font-size: 12px; color: #d97706; }
