/* 크게보는 마킹출력 — 차분하고 정돈된 스타일
   흰 종이 / 용지 회색 / 로또 주황 / 프로토 청록 / 먹색 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --fs: 20px;
  --paper: #ffffff;
  --surface: #f4f4f1;
  --line: #e3e2dd;
  --ink: #1c1c1e;
  --ink-soft: #5b5b60;
  --red: #d4442a;
  --red-tint: #fbefeb;
  --blue: #0d8291;
  --blue-tint: #e8f4f5;
  --c: var(--red);
  --t: var(--red-tint);
  --font: 'Pretendard Variable', Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
}
html[data-size="2"] { --fs: 24px; }
html[data-size="3"] { --fs: 30px; }
html[data-contrast="high"] {
  --paper: #000; --surface: #121212; --line: #8a8a8a;
  --ink: #fff; --ink-soft: #e6e6e6;
  --red: #ff9a80; --red-tint: #2a120c;
  --blue: #6fd8e6; --blue-tint: #0a2226;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.65;
  word-break: keep-all; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.025em; font-weight: 700; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.4rem; }
.skip { position: absolute; left: -9999px; top: .5rem; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px; z-index: 99; }
.skip:focus { left: .5rem; }
.timing, .bracket-none { }

/* ── 머리글 ───────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding-block: .75rem; }
.logo { font-size: 1.1rem; font-weight: 800; letter-spacing: -.03em; }
.logo a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.logo-mark { width: .9em; height: .9em; border-radius: 4px; background: var(--red); position: relative; }
.logo-mark::after { content: ''; position: absolute; inset: 22% 36%; background: var(--paper); border-radius: 2px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .2rem; background: var(--surface); border-radius: 12px; }
.tools-label { font-size: .75rem; color: var(--ink-soft); padding: 0 .5rem 0 .6rem; }
.tools button {
  min-height: 44px; padding: 0 .8rem; font-size: .78rem; font-weight: 600;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--ink-soft);
}
.tools button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }

/* ── 광고 한 줄 ───────────────────────── */
.ad-strip { border-bottom: 1px solid var(--line); }
.ad-strip .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; padding-block: .8rem; font-size: .9rem; }
.ad-tag { font-size: .68rem; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--line); padding: .05rem .4rem; border-radius: 6px; }
.ad-name { font-weight: 700; }
.ad-info { color: var(--ink-soft); }

/* ── 첫 화면 ───────────────────────────── */
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; padding-block: 3.6rem 3.2rem; }
.hero h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.18; letter-spacing: -.04em; }
.hero p { font-size: 1.05rem; color: var(--ink-soft); max-width: 24em; margin: 1.2rem 0 0; }

/* 용지 그림 — 사이트의 유일한 장식 */
.slip {
  display: flex; gap: 1rem; padding: 1.3rem 1.2rem 1.3rem 1rem;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: 0 30px 60px -30px rgb(60 40 20 / .25), 0 0 0 1px var(--line);
  transform: rotate(-2deg);
}
.slip .timing { width: .38rem; flex: none; background: repeating-linear-gradient(180deg, var(--ink) 0 .22rem, transparent .22rem .6rem); opacity: .85; }
.slip-body { flex: 1; min-width: 0; }
.slip-head { margin-bottom: .8rem; }
.slip-logo { color: var(--red); font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; }
.slip-row { display: flex; gap: .7rem; }
.slip-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem .3rem; }
.slip-cell {
  position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center;
  font-size: .72rem; font-weight: 600; color: var(--red);
  border: 1.5px solid color-mix(in srgb, var(--red) 55%, transparent); border-radius: 6px;
}
.slip-cell.on::after {
  content: ''; position: absolute; inset: 14% 24%; background: var(--ink); border-radius: 3px;
  transform-origin: top; animation: mark .4s cubic-bezier(.3,.7,.2,1) both; animation-delay: calc(.4s + var(--i) * .22s);
}
@keyframes mark { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .slip-cell.on::after { animation: none; } }
.game-tab {
  writing-mode: vertical-rl; background: var(--red); color: #fff; border-radius: 8px;
  display: flex; align-items: center; gap: .6rem; padding: .6rem .35rem; font-size: .72rem; font-weight: 700;
}
.game-tab b { writing-mode: horizontal-tb; font-size: 1rem; }

/* ── 섹션 공통 ───────────────────────────── */
.choose, .stores, .guide { padding-block: 3rem; }
.choose h2, .stores h2, .guide h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.lead { color: var(--ink-soft); margin: -.6rem 0 1.4rem; max-width: 32em; }

/* 종목 선택 */
.choose { background: var(--surface); }
.tickets { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ticket {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  min-height: 14rem; padding: 1.6rem; text-decoration: none;
  background: var(--paper); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .2s, transform .2s;
}
.ticket:hover { box-shadow: 0 0 0 2px var(--c); transform: translateY(-2px); }
.ticket.lotto { --c: var(--red); }
.ticket.proto { --c: var(--blue); }
.ticket > span:first-child { display: block; }
.brand-pill { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--blue); background: var(--blue-tint); padding: .15rem .55rem; border-radius: 99px; margin-bottom: .2rem; }
.ticket-name { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.035em; color: var(--c); }
.ticket-desc { display: block; color: var(--ink-soft); margin-top: .25rem; }
.ticket-go {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 56px; padding: 0 1.3rem;
  background: var(--c); color: #fff; font-weight: 700; border-radius: var(--r-md);
}
html[data-contrast="high"] .ticket-go { color: #000; }

/* 판매처 */
.store-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.store { display: flex; flex-direction: column; gap: .2rem; padding: 1.3rem; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.store h3 { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.store p { margin: 0; color: var(--ink-soft); }
.tel {
  margin-top: .9rem; align-self: flex-start; display: inline-flex; align-items: center; min-height: 52px; padding: 0 1rem;
  font-weight: 700; text-decoration: none; background: var(--surface); border-radius: var(--r-md);
}
.tel:hover { background: var(--line); }
.ad-inquiry { margin-top: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem; background: var(--surface); border-radius: var(--r-lg); }
.ad-inquiry h3 { font-size: 1.1rem; }
.ad-inquiry p { margin: .15rem 0 0; color: var(--ink-soft); }

/* 이용 순서 */
.guide { border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: s; }
.steps li { counter-increment: s; font-weight: 600; font-size: 1.05rem; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: .7rem;
  border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .9rem; font-weight: 700;
}
.notice { margin-top: 2rem; font-size: .8rem; color: var(--ink-soft); max-width: 46em; }

.foot { border-top: 1px solid var(--line); padding-block: 1.4rem; font-size: .8rem; color: var(--ink-soft); }
.foot p { margin: .1rem 0; }

/* ── 버튼 ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 1.3rem;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 0; border-radius: var(--r-md); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn:hover { background: var(--surface); }
.btn:disabled, .btn:disabled:hover { opacity: .4; cursor: not-allowed; background: var(--paper); }
.btn-add { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn-add:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.btn-add:disabled, .btn-add:disabled:hover { background: var(--ink); }
.btn-print {
  width: 100%; min-height: 76px; margin-top: 1.6rem; font-size: 1.2rem;
  background: var(--c); color: #fff; box-shadow: none; border-radius: var(--r-lg);
}
.btn-print:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 85%, #000); }
.btn-print:disabled, .btn-print:disabled:hover { background: var(--c); }
html[data-contrast="high"] .btn-print { color: #000; }

/* ── 마킹 페이지 ─────────────────────────── */
.mark-page.lotto { --c: var(--red); --t: var(--red-tint); }
.mark-page.proto { --c: var(--blue); --t: var(--blue-tint); }
.page-head { background: var(--t); }
.page-head .timing { display: none; }
.page-head .wrap { padding-block: 1rem 2rem; }
.back { display: inline-flex; align-items: center; min-height: 48px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.back::before { content: '‹'; font-size: 1.4em; line-height: 1; margin-right: .35rem; }
.back:hover { color: var(--ink); }
.page-head h2 { font-size: clamp(2rem, 4.4vw, 2.8rem); font-weight: 800; letter-spacing: -.04em; color: var(--c); margin-top: .2rem; }
.page-head p { margin: .35rem 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.work { padding-block: 1.8rem 3rem; max-width: 820px; }

.picked {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem;
  padding: 1rem 1.3rem; margin-bottom: 1rem; background: var(--surface); border-radius: var(--r-lg);
}
.picked-label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
#pickedNums { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
#pickedCount { margin-left: auto; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }

/* 번호판 */
.grid45 { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; margin-bottom: 1.1rem; }
@media (max-width: 560px) { .grid45 { grid-template-columns: repeat(5, 1fr); } }
.num {
  aspect-ratio: 1; min-height: 56px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, var(--line));
  color: var(--c); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color .15s, color .15s, transform .15s;
}
.num:hover { background: var(--t); }
.num[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; transform: scale(.96); }
@media (prefers-reduced-motion: reduce) { .num, .ticket { transition: none; } }

.row-btns { display: flex; flex-wrap: wrap; gap: .5rem; }

.sub-title { display: flex; align-items: baseline; gap: .5rem; margin: 2.4rem 0 .8rem; font-size: 1.2rem; }
.sub-title > span { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.game-list:empty::before { content: '아직 담은 게임이 없습니다. 번호 6개를 고르고 게임에 담으세요.'; display: block; padding: 1.2rem 1.3rem; color: var(--ink-soft); border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.game-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem .8rem .7rem .8rem; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.game-list li > span { display: flex; align-items: center; flex-wrap: wrap; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.game-list li b { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; margin-right: .8rem; border-radius: var(--r-sm); background: var(--c); color: #fff; font-size: 1rem; }
html[data-contrast="high"] .game-list li b { color: #000; }
.game-list li .won { font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-left: .7rem; }
.game-list li button { min-height: 48px; padding: 0 1rem; border: 0; border-radius: var(--r-sm); background: var(--surface); font-weight: 600; cursor: pointer; }
.game-list li button:hover { background: var(--line); }

/* 프로토 경기 */
.proto-list { display: grid; gap: .8rem; }
.match { padding: 1.2rem 1.3rem 1.3rem; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.match-head { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .85rem; color: var(--ink-soft); }
.match-head .no { font-weight: 700; color: var(--c); }
.match-teams { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: .2rem 0 .9rem; }
.match-teams small { font-size: .8rem; font-weight: 500; color: var(--ink-soft); margin: 0 .5rem; }
.wdl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.wdl button {
  min-height: 64px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, var(--line));
  color: var(--c); font-size: 1.25rem; font-weight: 700; transition: background-color .15s, color .15s;
}
.wdl button:hover { background: var(--t); }
.wdl button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }

.amount { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.6rem; font-weight: 600; }
.amount select {
  font: inherit; font-weight: 700; min-height: 56px; padding: 0 1rem; border: 0; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
}

.msg { font-weight: 600; min-height: 1.7em; margin-top: .8rem; }

/* ── 좁은 화면 ───────────────────────────── */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.2rem; padding-block: 2.4rem; }
  .slip { max-width: 400px; }
  .tickets, .steps { grid-template-columns: 1fr; }
}

/* 홈으로 가기 버튼 */
.btn-home {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 56px; padding: 0 1.2rem 0 1rem;
  font-weight: 700; font-size: 1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-home:hover { background: var(--surface); }
.btn-home-wide { width: 100%; justify-content: center; min-height: 64px; margin-top: .6rem; border-radius: var(--r-lg); }
.page-head .btn-home { margin-bottom: .6rem; }

/* 순서 변경: 종목 선택 → 첫 화면 */
.choose + .hero { border-bottom: 1px solid var(--line); }

/* ═══ 로또 마킹: 실제 용지 모양 ═══════════════════════════ */
:root { --slip-paper: #fbfaf6; }
html[data-contrast="high"] { --slip-paper: #0d0d0d; }
.stripe { background: repeating-linear-gradient(180deg, var(--ink) 0 .22rem, transparent .22rem .58rem); }

/* 대괄호 칸 [ ] */
.slip-num, .mm-grid i, .side-check .box {
  --bc: var(--red);
  border: 0; border-left: 2.5px solid var(--bc); border-right: 2.5px solid var(--bc); border-radius: 0;
  background-image:
    linear-gradient(var(--bc), var(--bc)), linear-gradient(var(--bc), var(--bc)),
    linear-gradient(var(--bc), var(--bc)), linear-gradient(var(--bc), var(--bc));
  background-size: 26% 2.5px; background-repeat: no-repeat;
  background-position: left top, right top, left bottom, right bottom;
}

/* 미니맵 */
.minimap {
  display: grid; grid-template-columns: auto 1fr; gap: .4rem .8rem;
  padding: .9rem 1rem .9rem .7rem; margin-bottom: 1.2rem;
  background: var(--slip-paper); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line);
}
.minimap .timing { grid-row: 1 / 3; width: .3rem; background: repeating-linear-gradient(180deg, var(--ink) 0 .18rem, transparent .18rem .45rem); }
.minimap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.mm-logo { color: var(--red); font-weight: 800; letter-spacing: -.03em; }
.mm-hint { font-size: .72rem; color: var(--ink-soft); }
.minimap-games { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.mm-game {
  display: flex; gap: 4px; padding: .4rem; border: 0; cursor: pointer;
  background: transparent; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line);
}
.mm-game:hover { background: var(--red-tint); }
.mm-game.is-current { background: var(--red-tint); box-shadow: inset 0 0 0 2.5px var(--red); }
.mm-grid { flex: 1; display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; direction: rtl; gap: 2px 1px; }
.mm-grid i { --bc: color-mix(in srgb, var(--red) 70%, transparent); aspect-ratio: 3 / 4; border-left-width: 1px; border-right-width: 1px; background-size: 40% 1px; }
.mm-grid i.on { background-color: var(--ink); --bc: var(--ink); }
.mm-tab { flex: none; width: 1.05rem; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 3px; font-size: .7rem; font-weight: 800; }
html[data-contrast="high"] .mm-tab { color: #000; }

.picked-label b { color: var(--red); font-size: 1.2em; }

/* 용지 한 게임 (크게) */
.slip-game {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: .9rem;
  padding: 1.1rem 1.1rem 1.1rem .8rem;
  background: var(--slip-paper); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line);
}
.slip-game .timing { width: .42rem; background: repeating-linear-gradient(180deg, var(--ink) 0 .28rem, transparent .28rem .72rem); }
.slip-side { display: flex; flex-direction: column; justify-content: flex-end; gap: .6rem; }
.side-check {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 4.4rem; min-height: 64px; padding: .5rem .4rem;
  border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  color: var(--red); font-size: .8rem; font-weight: 700;
}
.side-check:hover { background: var(--red-tint); }
.side-check .box { display: block; width: 1.5rem; height: 1.7rem; }
.side-check:active .box { background-color: var(--ink); }

.slip-numbers { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; direction: rtl; gap: .45rem .4rem; }
.slip-num {
  direction: ltr; aspect-ratio: 1 / 1.05; min-height: 46px; cursor: pointer;
  background-color: transparent; color: var(--red); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color .12s, color .12s;
}
.slip-num:hover { background-color: var(--red-tint); }
.slip-num[aria-pressed="true"] { background-color: var(--ink); color: var(--paper); --bc: var(--ink); }
@media (prefers-reduced-motion: reduce) { .slip-num { transition: none; } }

.slip-tab {
  display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: .8rem .45rem;
  background: var(--red); color: #fff; border-radius: var(--r-sm);
}
.slip-tab b { font-size: 1.5rem; line-height: 1; }
.slip-tab span { writing-mode: vertical-rl; font-size: .8rem; font-weight: 700; letter-spacing: .05em; }
html[data-contrast="high"] .slip-tab { color: #000; }

/* 게임 A~E 전환 */
.game-switch { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: 1rem; }
.gs-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 68px;
  border: 0; border-radius: var(--r-md); background: var(--surface); cursor: pointer;
}
.gs-btn b { font-size: 1.25rem; }
.gs-btn span { font-size: .75rem; color: var(--ink-soft); font-weight: 600; }
.gs-btn[aria-pressed="true"] { background: var(--red); color: #fff; }
.gs-btn[aria-pressed="true"] span { color: #fff; }
html[data-contrast="high"] .gs-btn[aria-pressed="true"], html[data-contrast="high"] .gs-btn[aria-pressed="true"] span { color: #000; }

@media (max-width: 640px) {
  .slip-game { grid-template-columns: auto 1fr auto; padding: .9rem .8rem .9rem .6rem; gap: .6rem; }
  .slip-side { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: flex-start; }
  .side-check { flex-direction: row; min-width: 0; padding: .4rem .8rem; background: var(--surface); }
  .side-check .box { width: 1.1rem; height: 1.3rem; }
  .slip-num { font-size: 1.05rem; min-height: 40px; }
  .minimap-games { gap: .3rem; }
  .mm-game { padding: .25rem; gap: 2px; }
  .mm-hint { display: none; }
}

/* 번호 순서: 가로로 1, 2, 3 … (왼쪽 위부터) */
.slip-numbers { grid-template-rows: none; grid-template-columns: repeat(7, 1fr); grid-auto-flow: row; direction: ltr; }
.mm-grid { grid-template-rows: none; grid-template-columns: repeat(7, 1fr); grid-auto-flow: row; direction: ltr; align-content: start; }

/* 고른 번호: 고정된 6칸 — 개수와 상관없이 크기 변화 없음 */
.picked { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; flex-wrap: nowrap; }
.picked-label { white-space: nowrap; }
.slots { display: grid; grid-template-columns: repeat(6, minmax(0, 2.6rem)); gap: .4rem; justify-content: start; }
.slots i {
  font-style: normal; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink);
  transition: background-color .15s, box-shadow .15s;
}
.slots i.on { background: var(--ink); color: var(--paper); box-shadow: none; }
#pickedCount { margin-left: 0; white-space: nowrap; min-width: 3.2em; text-align: right; }
@media (max-width: 520px) {
  .picked { gap: .6rem; padding: .8rem .9rem; }
  .slots { gap: .25rem; }
  .slots i { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .slots i { transition: none; } }

/* 자동 선택 칸 마킹 */
.side-check.is-on .box { background-color: var(--ink); --bc: var(--ink); }
.side-check.is-on { background: var(--red-tint); }
.slots i.auto { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); }
.slots i.auto::after { content: '자동'; font-size: .55rem; font-weight: 700; }
.mm-grid { position: relative; }
.mm-auto { grid-column: 7; grid-row: 7; display: block; aspect-ratio: 3 / 4; border-radius: 1px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 70%, transparent); }
.mm-auto.on { background: var(--ink); box-shadow: none; }

/* ═══ 용지 미니맵 (최대 20장) ═══════════════════════════ */
.sheets { margin-bottom: 1rem; }
.sheets-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .6rem; }
.sheets-title { font-weight: 700; font-size: 1.05rem; }
.sheets-title b { color: var(--red); }
.sheets-total { font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-left: .5rem; font-variant-numeric: tabular-nums; }
.sheets-actions { display: flex; gap: .4rem; }
.sheet-btn {
  min-height: 48px; min-width: 7.5rem; padding: 0 .9rem; border: 0; border-radius: var(--r-sm);
  background: var(--surface); font-weight: 700; font-size: .82rem; cursor: pointer;
}
.sheet-btn:hover { background: var(--line); }
.sheet-add { background: var(--ink); color: var(--paper); }
.sheet-add:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.sheet-btn:disabled { opacity: .4; cursor: not-allowed; }

.sheet-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .4rem; }
@media (max-width: 700px) { .sheet-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sheet-thumb {
  display: flex; flex-direction: column; gap: .25rem; padding: .35rem .35rem .4rem;
  border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--slip-paper); box-shadow: inset 0 0 0 1px var(--line);
}
.sheet-thumb:hover { box-shadow: inset 0 0 0 1.5px var(--red); }
.sheet-thumb.is-current { box-shadow: inset 0 0 0 2.5px var(--red); background: var(--red-tint); }
.st-no { font-size: .72rem; font-weight: 800; color: var(--red); line-height: 1; text-align: left; font-variant-numeric: tabular-nums; }
.st-games { display: grid; gap: 2px; }
.st-games i { display: block; height: 5px; border-radius: 2px; background: var(--line); }
.st-games i.done { background: var(--ink); }
.st-games i.auto { background: var(--red); }
.st-games i.partial { background: transparent; box-shadow: inset 0 0 0 1px var(--red); }

/* ═══ 게임 미니맵 안 용지 번호 아이콘 ══════════════════════ */
.minimap-head { flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .5rem .8rem; }
.sheet-icons { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; min-width: 0; }
.sheet-icon {
  position: relative; width: 2.05rem; height: 2.5rem; padding: 0; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: .28rem 0 .26rem; border-radius: 4px 9px 4px 4px;   /* 접힌 귀퉁이 느낌 */
  background: var(--paper); color: var(--red); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, var(--line));
}
.sheet-icon::before { content: ''; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 2px;
  background: repeating-linear-gradient(180deg, currentColor 0 2px, transparent 2px 4px); opacity: .55; }
.sheet-icon:hover { background: var(--red-tint); }
.si-no { font-size: .72rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; padding-left: 3px; }
.si-dots { display: flex; gap: 1.5px; padding-left: 3px; }
.si-dots i { width: 3px; height: 3px; border-radius: 50%; background: color-mix(in srgb, currentColor 25%, transparent); }
.si-dots i.done { background: currentColor; }
.si-dots i.partial { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.sheet-icon.is-current { background: var(--red); color: #fff; box-shadow: none; }
html[data-contrast="high"] .sheet-icon.is-current { color: #000; }

.sheet-tools { display: flex; gap: .3rem; margin-left: auto; }
.icon-btn {
  width: 2.5rem; height: 2.5rem; min-width: 44px; min-height: 44px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn.armed { background: var(--red); color: #fff; }
.minimap-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo tools" "icons icons"; align-items: center; gap: .5rem .8rem; }
.minimap-head .mm-logo { grid-area: logo; }
.minimap-head .sheet-tools { grid-area: tools; margin-left: 0; }
.minimap-head .sheet-icons { grid-area: icons; }
.minimap-games { margin-top: .2rem; }

/* 미니맵 순서: 로고·버튼 → A~E 게임 → 용지 번호 아이콘 */
.minimap {
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "timing logo tools" "timing games games" "timing icons icons";
}
.minimap .timing { grid-area: timing; }
.minimap-head { display: contents; }
.minimap-head .mm-logo { grid-area: logo; align-self: center; }
.minimap-head .sheet-tools { grid-area: tools; }
.minimap-head .sheet-icons { grid-area: icons; margin-top: .15rem; }
.minimap-games { grid-area: games; margin-top: 0; }

/* 용지 번호 아이콘: 더 작게 */
.sheet-icons { gap: .22rem; }
.sheet-icon { width: 1.45rem; height: 1.8rem; padding: .18rem 0 .2rem; border-radius: 3px 6px 3px 3px; }
.sheet-icon::before { left: 2px; top: 3px; bottom: 3px; width: 1.5px; }
.si-no { font-size: .56rem; padding-left: 2px; }
.si-dots { gap: 1px; padding-left: 2px; }
.si-dots i { width: 2px; height: 2px; }
.icon-btn { width: 2.2rem; height: 2.2rem; min-width: 40px; min-height: 40px; }

/* 용지 번호 아이콘: 가로형 OMR 카드 */
.sheet-icon {
  width: 2.3rem; height: 1.4rem; padding: 0 .38rem 0 .3rem;
  flex-direction: row; align-items: center; justify-content: space-between;
  border-radius: 3px; overflow: hidden;
}
/* 아래쪽 타이밍 마크 (OMR 눈금) */
.sheet-icon::before {
  left: 3px; right: 7px; top: auto; bottom: 2px; width: auto; height: 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px); opacity: .6;
}
/* 오른쪽 게임 탭 띠 */
.sheet-icon::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: currentColor; opacity: .85;
}
.si-no { padding: 0 0 2px; font-size: .58rem; }
.si-dots { flex-direction: column; gap: 1px; padding: 0 0 2px; }
.si-dots i { width: 3px; height: 2px; border-radius: 1px; }

/* OMR 카드 아이콘: 더 작게 */
.sheet-icons { gap: .18rem; }
.sheet-icon { width: 1.7rem; height: 1.05rem; padding: 0 .3rem 0 .22rem; border-radius: 2px; }
.sheet-icon::before { left: 2px; right: 5px; bottom: 1.5px; height: 1.5px;
  background: repeating-linear-gradient(90deg, currentColor 0 1.5px, transparent 1.5px 3px); }
.sheet-icon::after { width: 3px; }
.si-no { font-size: .48rem; padding-bottom: 1.5px; }
.si-dots { gap: .5px; padding-bottom: 1.5px; }
.si-dots i { width: 2px; height: 1.5px; }

/* 사용 용지 / 미사용 용지 구분 */
.sheet-icon.is-unused {
  color: var(--ink-soft); background: transparent;
  box-shadow: inset 0 0 0 1px var(--line); opacity: .7;
}
.sheet-icon.is-unused::before, .sheet-icon.is-unused::after { opacity: .3; }
.sheet-icon.is-unused .si-dots { visibility: hidden; }
.sheet-icon.is-used:not(.is-current) {
  color: var(--red); background: var(--red-tint);
  box-shadow: inset 0 0 0 1.5px var(--red);
}
.sheet-icon.is-unused:hover { opacity: 1; background: var(--surface); }
/* 지금 용지는 사용 여부와 상관없이 주황 채움 */
.sheet-icon.is-current { opacity: 1; background: var(--red); color: #fff; box-shadow: none; }
.sheet-icon.is-current.is-unused::before, .sheet-icon.is-current.is-unused::after { opacity: .6; }

/* 자동 선택·취소: 화면 폭과 상관없이 항상 번호판 아래 한 줄 (위치 고정) */
.slip-game { grid-template-columns: auto 1fr auto; }
.slip-side { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: flex-start; gap: .5rem; }
.side-check {
  flex-direction: row; gap: .5rem; min-width: 0; min-height: 52px; padding: .4rem 1rem;
  background: var(--surface); font-size: .85rem;
}
.side-check .box { width: 1.1rem; height: 1.3rem; }

/* 고른 번호: 칸 너비 완전 고정 (상태 글자 길이와 무관) */
.picked { grid-template-columns: 4.6em auto 5.6em; justify-content: space-between; }
.slots { grid-template-columns: repeat(6, 2.2rem); }
.slots i { width: 2.2rem; height: 2.2rem; aspect-ratio: auto; }
#pickedCount { width: 5.6em; min-width: 0; text-align: right; overflow: hidden; white-space: nowrap; font-size: .9rem; }
@media (max-width: 520px) {
  .picked { grid-template-columns: 4em auto 5em; }
  .slots { grid-template-columns: repeat(6, 1.75rem); }
  .slots i { width: 1.75rem; height: 1.75rem; }
  #pickedCount { width: 5em; font-size: .8rem; }
}

/* 고른 번호: 크기는 화면 폭에만 따라감 (상태 글자와 무관) */
.picked { grid-template-columns: 4.6em minmax(0, 1fr) 5.6em; }
.slots { grid-template-columns: repeat(6, minmax(0, 2.2rem)); }
.slots i { width: auto; height: auto; aspect-ratio: 1; }
@media (max-width: 520px) {
  .picked { grid-template-columns: 3.8em minmax(0, 1fr) 4.6em; padding: .7rem .8rem; gap: .5rem; }
  .slots { grid-template-columns: repeat(6, minmax(0, 1.9rem)); gap: .2rem; }
  .slots i { width: auto; height: auto; font-size: .75rem; }
  #pickedCount { width: 4.6em; font-size: .72rem; }
  .slots i.auto::after { font-size: .45rem; }
}

/* 좁은 화면에서 번호판이 넘치지 않게 */
.slip-game { min-width: 0; }
.slip-numbers { grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 0; }
.slip-num { min-height: 0; min-width: 0; }
@media (max-width: 520px) {
  .slip-game { gap: .45rem; padding: .8rem .6rem .8rem .5rem; }
  .slip-numbers { gap: .3rem .22rem; }
  .slip-num { font-size: .85rem; }
  .slip-tab { padding: .6rem .3rem; }
  .slip-tab b { font-size: 1.1rem; }
  .slip-tab span { font-size: .65rem; }
}

/* 게임 전환 버튼: 상태 글자가 길어도 한 줄, 높이 고정 */
.gs-btn { height: 68px; min-width: 0; overflow: hidden; }
.gs-btn span { white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; padding: 0 .2rem; }
@media (max-width: 520px) { .gs-btn span { font-size: .62rem; } .gs-btn { height: 60px; min-height: 0; } }

/* 고른 번호 동그라미: 빈 칸 / 고른 번호 / 자동 — 확실히 다르게 */
.slots i {
  box-shadow: none; border: 2px dashed color-mix(in srgb, var(--ink) 28%, transparent);
  background: transparent; color: var(--ink);
}
.slots i.on {
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  animation: slot-pop .2s ease-out;
}
.slots i.auto {
  border: 2px solid var(--red); background: var(--red); color: #fff;
  animation: slot-pop .2s ease-out;
}
html[data-contrast="high"] .slots i.auto { color: #000; }
.slots i.auto::after { content: '자동'; font-size: .55rem; font-weight: 800; letter-spacing: -.02em; }
@keyframes slot-pop { 0% { transform: scale(.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .slots i.on, .slots i.auto { animation: none; } }
@media (max-width: 520px) { .slots i.auto::after { font-size: .42rem; } }

/* 좁은 화면: 윗줄 게임 이름·상태, 아랫줄 동그라미 6칸 (항상 두 줄로 고정) */
@media (max-width: 620px) {
  .picked { grid-template-columns: 1fr auto; grid-template-areas: "label count" "slots slots"; row-gap: .6rem; }
  .picked-label { grid-area: label; }
  #pickedCount { grid-area: count; width: auto; font-size: .85rem; }
  .slots { grid-area: slots; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .45rem; max-width: 22rem; }
  .slots i { font-size: 1rem; }
  .slots i.auto::after { font-size: .6rem; }
}

/* 고른 번호: 페이지 폭과 무관하게 동그라미 크기 고정 (글자 크기 설정만 따름) */
.picked, .picked { grid-template-columns: 1fr auto; grid-template-areas: "label count" "slots slots"; row-gap: .6rem; padding: .9rem 1.1rem; }
.picked-label { grid-area: label; }
#pickedCount { grid-area: count; width: auto; font-size: .85rem; }
.slots { grid-area: slots; grid-template-columns: repeat(6, 2.2rem); gap: .4rem; max-width: none; justify-content: start; }
.slots i, .slots i.on, .slots i.auto { width: 2.2rem; height: 2.2rem; aspect-ratio: auto; font-size: .95rem; }
.slots i.auto::after { font-size: .55rem; }
@media (max-width: 620px) {
  .picked { grid-template-columns: 1fr auto; }
  .slots { grid-template-columns: repeat(6, 2.2rem); gap: .4rem; }
  .slots i, .slots i.on, .slots i.auto { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
  .slots i.auto::after { font-size: .55rem; }
  #pickedCount { font-size: .85rem; }
}
@media (max-width: 520px) {
  .slots { grid-template-columns: repeat(6, 2.2rem); gap: .4rem; }
  .slots i, .slots i.on, .slots i.auto { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
  .slots i.auto::after { font-size: .55rem; }
  #pickedCount { font-size: .85rem; }
}

/* ═══════════════════════════════════════════════════════════
   반응형 정리 — 모든 화면 폭 × 글자 크기 3단계 점검 후 일괄 수정
   ═══════════════════════════════════════════════════════════ */

/* 1) 글자 크기 설정: 넓은 화면에서는 설정 그대로, 좁은 화면에서만 상한을 둠 */
html { --fs: clamp(17px, 4.6vw, 20px); }
html[data-size="2"] { --fs: clamp(19px, 5.3vw, 24px); }
html[data-size="3"] { --fs: clamp(21px, 6vw, 30px); }

/* 2) 기본 안전장치: 격자·플렉스 안의 칸이 내용 때문에 밖으로 밀리지 않게 */
.wrap, .work, .hero .wrap > *, .tickets > *, .ticket, .store, .minimap, .minimap-games, .mm-game,
.slip-game, .slip-numbers, .picked, .slots, .game-switch, .proto-list, .match, .slip, .slip-body, .slip-grid { min-width: 0; }
@media (max-width: 560px) { .wrap { padding: 0 .8rem; } }

/* 3) 한 줄로 유지할 글자 */
.mm-logo, .side-check, .btn-home, .ticket-go, .picked-label, #pickedCount, .tel, .sheet-btn, .slip-tab b { white-space: nowrap; }

/* 4) 고른 번호 동그라미: 평소엔 고정 크기, 화면이 아주 좁을 때만 들어갈 만큼 줄어듦 */
.slots { grid-template-columns: repeat(6, minmax(0, 2.2rem)); gap: .4rem; }
.slots i, .slots i.on, .slots i.auto { width: auto; height: auto; aspect-ratio: 1; }

/* 5) 게임 미니맵 */
.minimap { grid-template-columns: auto minmax(0, 1fr) auto; }
.minimap-games { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.mm-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .minimap { padding: .7rem .7rem .7rem .55rem; gap: .4rem .5rem; }
  .mm-game { padding: .22rem; gap: 2px; }
  .mm-tab { width: .85rem; font-size: .55rem; }
}

/* 6) 용지 게임: 좁은 화면에서는 탭·눈금을 날씬하게, 숫자는 칸에 맞게 */
@media (max-width: 560px) {
  .slip-game { gap: .4rem; padding: .75rem .55rem .75rem .45rem; }
  .slip-game .timing { width: .3rem; }
  .slip-numbers { gap: .32rem .2rem; }
  .slip-num { font-size: .82rem; }
  .slip-tab { padding: .55rem .25rem; gap: .5rem; }
  .slip-tab b { font-size: 1rem; }
  .slip-tab span { font-size: .6rem; }
  .side-check { padding: .4rem .8rem; font-size: .8rem; }
}

/* 7) 홈: 첫 화면 용지 그림과 종목 카드 */
.hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.slip { max-width: 100%; }
.slip-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.slip-cell { min-width: 0; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .slip { padding: .9rem .8rem .9rem .7rem; gap: .6rem; }
  .slip-row { gap: .45rem; }
  .game-tab { padding: .5rem .25rem; }
  .ticket { padding: 1.2rem 1.1rem 1.2rem 1.4rem; min-height: 0; }
  .ticket-name { font-size: 1.6rem; }
}

/* 8) 판매점 카드: 전화번호가 한 줄에 들어갈 폭 확보 */
.store-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }

/* 9) 머리글: 좁은 화면에서는 '글자 크기' 라벨 숨겨 한 줄 유지 */
@media (max-width: 560px) {
  .tools-label { display: none; }
  .tools button { padding: 0 .55rem; font-size: .72rem; }
}

/* 10) 게임 전환 버튼: 글자 크기에 맞춰 높이 확보 (상태 글자 잘림 방지) */
.gs-btn, .gs-btn[aria-pressed] { height: auto; min-height: 3.3rem; padding: .45rem .2rem; gap: .15rem; }
.gs-btn b { line-height: 1.1; }
.gs-btn span { line-height: 1.2; }
@media (max-width: 520px) { .gs-btn, .gs-btn[aria-pressed] { height: auto; min-height: 3.1rem; } }

/* 11) 인쇄 버튼: 항상 두 줄(제목 + 장·게임·금액) — 높이 고정 */
.btn-print { flex-direction: column; gap: .15rem; min-height: 0; height: auto; padding: .8rem 1rem; line-height: 1.25; }
.btn-print b { font-size: 1.15rem; white-space: nowrap; }
.btn-print small { font-size: .78rem; font-weight: 600; opacity: .9; white-space: nowrap; }

/* 12) 용지 아이콘 줄: 처음부터 두 줄 자리 확보 → 용지를 추가해도 미니맵 높이 그대로 */
.minimap-head .sheet-icons { min-height: calc(2 * 1.05rem + .18rem); align-content: flex-start; }

/* 13) 고른 번호: 한 줄 — 게임 이름 | 동그라미 6칸 | 상태(고정 폭) */
.picked { grid-template-columns: max-content minmax(0, 1fr) 4.4rem; grid-template-areas: "label slots count"; column-gap: .8rem; row-gap: 0; }
.slots { justify-content: start; }
#pickedCount { width: 4.4rem; text-align: right; font-size: .78rem; }
@media (max-width: 560px) {
  .picked { column-gap: .5rem; padding: .8rem .8rem; grid-template-columns: max-content minmax(0, 1fr) 3.8rem; }
  #pickedCount { width: 3.8rem; font-size: .68rem; }
  .slots { gap: .25rem; }
  .picked-label { font-size: .85rem; }
}

/* 14) 좁은 화면(820px 미만)에서는 두 줄: 윗줄 게임 이름·상태, 아랫줄 동그라미 — 동그라미가 너무 작아지지 않게 */
@media (max-width: 819px) {
  .picked { grid-template-columns: 1fr auto; grid-template-areas: "label count" "slots slots"; row-gap: .6rem; column-gap: .5rem; padding: .85rem 1rem; }
  #pickedCount { width: auto; font-size: .8rem; }
  .picked-label { font-size: inherit; }
  .slots { gap: .4rem; }
}
/* 동그라미 안 글자 높이 고정 (숫자 유무로 높이가 1px씩 흔들리지 않게) */
.slots i { line-height: 1; overflow: hidden; }
.work { max-width: 900px; }

/* 15) 고른 번호: 화면 크기와 상관없이 항상 한 줄 — 게임 이름 바로 옆에 동그라미 6칸 */
.picked, .picked { grid-template-columns: max-content minmax(0, 1fr) auto; grid-template-areas: "label slots count"; row-gap: 0; column-gap: .8rem; }
@media (max-width: 819px) {
  .picked { grid-template-columns: max-content minmax(0, 1fr) auto; grid-template-areas: "label slots count"; row-gap: 0; column-gap: .6rem; }
  .slots { gap: .3rem; }
}
/* 좁은 화면: '게임' 글자와 상태 글자를 덜어내 동그라미 자리 확보 (상태는 아래 A~E 버튼에 표시됨) */
@media (max-width: 600px) {
  .picked { column-gap: .55rem; padding: .75rem .8rem; }
  .pl-word, #pickedCount { display: none; }
  .picked-label b { font-size: 1.5rem; line-height: 1; }
  .slots { gap: .25rem; }
}

/* 16) 미니맵 번호칸 숫자: 칸이 읽을 만큼 클 때만 표시 (미니 게임 폭 기준) */
.mm-game { container-type: inline-size; }
.mm-grid i { position: relative; display: grid; place-items: center; overflow: hidden; }
@container (min-width: 118px) {
  .mm-grid i::before {
    content: attr(data-n); font-style: normal; font-weight: 700; line-height: 1;
    font-size: 6.4cqw; color: var(--red); letter-spacing: -.04em;
  }
  .mm-grid i.on::before { color: var(--paper); }
  .mm-grid { gap: 2px 1px; }
}

/* ── 프로토 인쇄 안내 · 보조 링크 (proto.html) ─────────────── */
.print-tip { font-size: .9rem; color: var(--ink-soft); margin: .4rem 0 0; }
.print-tip a { color: var(--c); font-weight: 700; }
.page-links { margin-top: 1.2rem; }
.page-links .btn { flex: 1 1 14rem; }

/* ── 용지 위치 맞추기 (proto-calibrate.html) ───────────────── */
.calib-page { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.calib-page > header, .calib-page > footer, .calib-page > .skip { grid-column: 1 / -1; }
.calib-page > .omr-print.preview { position: sticky; top: 1rem; margin: 1.5rem 1.5rem 1.5rem 0; zoom: 1.8; }
@media (max-width: 1100px) {
  .calib-page { grid-template-columns: 1fr; }
  .calib-page > .omr-print.preview { position: static; justify-self: center; margin: 0 0 2rem; zoom: 1.5; }
}
@media print { .calib-page { display: block; } .calib-page > .omr-print.preview { zoom: 1; margin: 0; } }
.calib-box { padding: 1.2rem 1.3rem; margin-bottom: 1rem; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.calib-box h3 { margin: 0 0 .8rem; font-size: 1.2rem; }
.calib-box h3 small { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.calib-box .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.calib-hint { font-size: .85rem; color: var(--ink-soft); margin: .7rem 0 0; }
.calib-group { border: 0; padding: 0; margin: 0 0 1.2rem; }
.calib-group legend { font-weight: 800; color: var(--c); margin-bottom: .4rem; }
.calib-row { display: grid; grid-template-columns: minmax(8em, 1fr) auto minmax(6em, 2fr) auto 5.5em; align-items: center; gap: .4rem .6rem; padding: .3rem 0; }
.calib-row label { font-weight: 600; font-size: .95rem; }
.calib-row input[type=range] { width: 100%; accent-color: var(--c); min-height: 44px; }
.calib-row .icon-btn { min-width: 44px; min-height: 44px; font-size: 1.3rem; font-weight: 800; }
.calib-num { font: inherit; font-weight: 700; width: 100%; min-height: 44px; padding: 0 .4rem; border: 0; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); text-align: right; }
@media (max-width: 560px) { .calib-row { grid-template-columns: auto 1fr auto 5em; } .calib-row label { grid-column: 1 / -1; } }
.calib-more summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.calib-more .row-btns { margin-top: .5rem; }

/* ── 내 인쇄 기록 (history.html) ──────────────────────────── */
#summary b { font-size: 1.2rem; color: var(--c); }
.slip-history { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .9rem; }
.slip-history .empty { padding: 1.2rem 1.3rem; color: var(--ink-soft); border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.slip-card { padding: 1.1rem 1.2rem; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.slip-card-head, .slip-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.slip-card-head { font-weight: 600; color: var(--ink-soft); }
.slip-card-foot { margin-top: .8rem; font-weight: 700; }
.slip-items { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .4rem; }
.slip-items li { display: grid; grid-template-columns: 5.5em 1fr auto auto; align-items: center; gap: .6rem; padding: .5rem .7rem; background: var(--surface); border-radius: var(--r-md); }
.slip-items .no { font-weight: 700; color: var(--c); }
.slip-items .teams { font-weight: 700; }
.slip-items .teams small { font-weight: 500; color: var(--ink-soft); margin: 0 .3rem; }
.slip-items .pick { font-size: 1.3rem; }
@media (max-width: 560px) { .slip-items li { grid-template-columns: 1fr auto auto; } .slip-items .no { grid-column: 1 / -1; } }
.tag { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--line); color: var(--ink); }
.tag.big { font-size: 1rem; padding: .25rem .9rem; }
.tag.hit, .tag.won { background: var(--blue); color: #fff; }
.tag.miss, .tag.lost { background: var(--red); color: #fff; }
html[data-contrast="high"] .tag.hit, html[data-contrast="high"] .tag.won,
html[data-contrast="high"] .tag.miss, html[data-contrast="high"] .tag.lost { color: #000; }

/* 브랜드: 탭프린트 + 도메인 */
.logo-domain { margin-left: .45rem; font-size: .62em; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
@media (max-width: 380px) { .logo-domain { display: none; } }

/* ═══ 프로토: 같은 경기 묶음 + 게임 유형 태그 ═══════════════ */
.proto-count { font-weight: 700; margin: 0 0 .8rem; color: var(--c); font-variant-numeric: tabular-nums; }
.proto-hidden { color: var(--ink-soft); font-size: .85rem; margin-top: .6rem; }
.match-group .match-head { align-items: baseline; }
.match-group .mg-count { margin-left: auto; font-size: .78rem; }

.bet-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .1rem 0 .8rem; }
.bet-tag {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .85rem;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.bet-tag:hover { box-shadow: inset 0 0 0 1.5px var(--c); }
.bet-tag[aria-pressed="true"] { background: var(--c); color: #fff; box-shadow: none; }
html[data-contrast="high"] .bet-tag[aria-pressed="true"] { color: #000; }
.bet-tag.is-picked::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ink); flex: none; }
.bet-tag[aria-pressed="true"].is-picked::before { background: #fff; }
.bet-tag.is-closed { opacity: .5; }
.bet-tag small { font-size: .7rem; font-weight: 600; }

.bet-meta { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .78rem; color: var(--ink-soft); margin-bottom: .45rem; }
.bet-closed { color: var(--red); font-weight: 700; }
.bet-btns { display: grid; gap: .5rem; }
.bet-btns.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bet-btns.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bet-btns button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 68px; }
.bet-btns .bb-label { font-size: 1.1rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.bet-btns .bb-odds { font-size: .78rem; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.bet-btns button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 560px) {
  .bet-tag { padding: 0 .65rem; font-size: .78rem; min-height: 40px; }
  .bet-btns .bb-label { font-size: .95rem; }
}

/* ═══ 프로토 경기 카드: 종목별 경기장 배경 ═══════════════════ */
.match-group { position: relative; overflow: hidden; isolation: isolate; --sport: var(--ink-soft); --sport-tint: var(--surface); }
.match-group::before {
  content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: min(78%, 34rem);
  background-image: var(--sport-art, none); background-repeat: no-repeat; background-position: right -1.2rem center; background-size: auto 112%;
  opacity: .16; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
}
.match-group { background: linear-gradient(100deg, var(--paper) 35%, var(--sport-tint) 100%); box-shadow: 0 0 0 1px var(--line), inset 5px 0 0 var(--sport); }
.sport-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: var(--sport); }
.sport-chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: #fff; opacity: .85; }
.match-group .match-head .no { color: var(--sport); }
html[data-contrast="high"] .match-group { background: var(--paper); }
html[data-contrast="high"] .match-group::before { display: none; }
html[data-contrast="high"] .sport-chip { color: #000; }
.match-group.sport-SC { --sport: #1f8a4c; --sport-tint: #eef7f0; --sport-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMTgwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxZjhhNGMiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxyZWN0IHg9IjYiIHk9IjYiIHdpZHRoPSIyODgiIGhlaWdodD0iMTY4IiByeD0iMyIvPjxsaW5lIHgxPSIxNTAiIHkxPSI2IiB4Mj0iMTUwIiB5Mj0iMTc0Ii8+PGNpcmNsZSBjeD0iMTUwIiBjeT0iOTAiIHI9IjI4Ii8+PGNpcmNsZSBjeD0iMTUwIiBjeT0iOTAiIHI9IjIuNSIgZmlsbD0iIzFmOGE0YyIvPjxyZWN0IHg9IjYiIHk9IjQ2IiB3aWR0aD0iNDYiIGhlaWdodD0iODgiLz48cmVjdCB4PSI2IiB5PSI3MCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjQwIi8+PHBhdGggZD0iTTUyIDcyYTIyIDIyIDAgMCAxIDAgMzYiLz48cmVjdCB4PSIyNDgiIHk9IjQ2IiB3aWR0aD0iNDYiIGhlaWdodD0iODgiLz48cmVjdCB4PSIyNzgiIHk9IjcwIiB3aWR0aD0iMTYiIGhlaWdodD0iNDAiLz48cGF0aCBkPSJNMjQ4IDcyYTIyIDIyIDAgMCAwIDAgMzYiLz48cGF0aCBkPSJNNiAxNGE4IDggMCAwIDAgOC04TTI4NiA2YTggOCAwIDAgMCA4IDhNNiAxNjZhOCA4IDAgMCAxIDggOE0yODYgMTc0YTggOCAwIDAgMSA4LTgiLz48L3N2Zz4="); }
.match-group.sport-BK { --sport: #d9721b; --sport-tint: #fdf3e9; --sport-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMTgwIiBmaWxsPSJub25lIiBzdHJva2U9IiNkOTcyMWIiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxyZWN0IHg9IjYiIHk9IjYiIHdpZHRoPSIyODgiIGhlaWdodD0iMTY4IiByeD0iMyIvPjxwYXRoIGQ9Ik02IDYyYTI4IDI4IDAgMCAxIDAgNTYiLz48cGF0aCBkPSJNMjk0IDIyaC00MmE3MiA3MiAwIDAgMCAwIDEzNmg0MiIvPjxyZWN0IHg9IjIyNiIgeT0iNjIiIHdpZHRoPSI2OCIgaGVpZ2h0PSI1NiIvPjxjaXJjbGUgY3g9IjIyNiIgY3k9IjkwIiByPSIyOCIvPjxsaW5lIHgxPSIyODQiIHkxPSI3NiIgeDI9IjI4NCIgeTI9IjEwNCIgc3Ryb2tlLXdpZHRoPSIzIi8+PGNpcmNsZSBjeD0iMjc2IiBjeT0iOTAiIHI9IjYiLz48L3N2Zz4="); }
.match-group.sport-VL { --sport: #2f5fd0; --sport-tint: #eef2fd; --sport-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMTgwIiBmaWxsPSJub25lIiBzdHJva2U9IiMyZjVmZDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxyZWN0IHg9IjIwIiB5PSIzMCIgd2lkdGg9IjI2MCIgaGVpZ2h0PSIxMzAiIHJ4PSIyIi8+PGxpbmUgeDE9IjE1MCIgeTE9IjIyIiB4Mj0iMTUwIiB5Mj0iMTY4IiBzdHJva2Utd2lkdGg9IjMuNSIvPjxsaW5lIHgxPSIxMDgiIHkxPSIzMCIgeDI9IjEwOCIgeTI9IjE2MCIgc3Ryb2tlLWRhc2hhcnJheT0iNiA1Ii8+PGxpbmUgeDE9IjE5MiIgeTE9IjMwIiB4Mj0iMTkyIiB5Mj0iMTYwIiBzdHJva2UtZGFzaGFycmF5PSI2IDUiLz48cGF0aCBkPSJNMTQ2IDI2aDhNMTQ2IDQwaDhNMTQ2IDU0aDhNMTQ2IDY4aDhNMTQ2IDgyaDhNMTQ2IDk2aDhNMTQ2IDExMGg4TTE0NiAxMjRoOE0xNDYgMTM4aDhNMTQ2IDE1Mmg4IiBzdHJva2Utd2lkdGg9IjEuMiIvPjxjaXJjbGUgY3g9IjI0NiIgY3k9IjY0IiByPSIxNiIvPjxwYXRoIGQ9Ik0yMzIgNThjOCAyIDE4IDEwIDIyIDIwTTIzOCA1MGM2IDYgOCAxNiA2IDI4TTI1NiA1MmMtMTAgMi0xOCA4LTIyIDE4IiBzdHJva2Utd2lkdGg9IjEuNiIvPjwvc3ZnPg=="); }
.match-group.sport-BS { --sport: #8a5a2b; --sport-tint: #f8f1ea; --sport-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMTgwIiBmaWxsPSJub25lIiBzdHJva2U9IiM4YTVhMmIiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxwYXRoIGQ9Ik0xNTAgMTcwTDQwIDYwTTE1MCAxNzBMMjYwIDYwIi8+PHBhdGggZD0iTTYwIDgwYTEzMCAxMzAgMCAwIDEgMTgwIDAiLz48cGF0aCBkPSJNMTUwIDE1MGwtNDQtNDQgNDQtNDQgNDQgNDR6Ii8+PHJlY3QgeD0iMTQ2IiB5PSIxNDYiIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIHRyYW5zZm9ybT0icm90YXRlKDQ1IDE1MCAxNTApIiBmaWxsPSIjOGE1YTJiIi8+PHJlY3QgeD0iMTAyIiB5PSIxMDIiIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIHRyYW5zZm9ybT0icm90YXRlKDQ1IDEwNiAxMDYpIi8+PHJlY3QgeD0iMTQ2IiB5PSI1OCIgd2lkdGg9IjgiIGhlaWdodD0iOCIgdHJhbnNmb3JtPSJyb3RhdGUoNDUgMTUwIDYyKSIvPjxyZWN0IHg9IjE5MCIgeT0iMTAyIiB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSAxOTQgMTA2KSIvPjxjaXJjbGUgY3g9IjE1MCIgY3k9IjEwNiIgcj0iNyIvPjwvc3ZnPg=="); }
.match-group.sport-HK { --sport: #2a7a9b; --sport-tint: #ecf5f8; --sport-art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMTgwIiBmaWxsPSJub25lIiBzdHJva2U9IiMyYTdhOWIiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxyZWN0IHg9IjYiIHk9IjYiIHdpZHRoPSIyODgiIGhlaWdodD0iMTY4IiByeD0iNDAiLz48bGluZSB4MT0iMTUwIiB5MT0iNiIgeDI9IjE1MCIgeTI9IjE3NCIgc3Ryb2tlLXdpZHRoPSIzIi8+PGxpbmUgeDE9IjEwNCIgeTE9IjYiIHgyPSIxMDQiIHkyPSIxNzQiLz48bGluZSB4MT0iMTk2IiB5MT0iNiIgeDI9IjE5NiIgeTI9IjE3NCIvPjxjaXJjbGUgY3g9IjE1MCIgY3k9IjkwIiByPSIyNiIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNTAiIHI9IjE4Ii8+PGNpcmNsZSBjeD0iNjAiIGN5PSIxMzAiIHI9IjE4Ii8+PGNpcmNsZSBjeD0iMjQwIiBjeT0iNTAiIHI9IjE4Ii8+PGNpcmNsZSBjeD0iMjQwIiBjeT0iMTMwIiByPSIxOCIvPjxwYXRoIGQ9Ik0yMiA3NmgxMHYyOEgyMiIvPjxwYXRoIGQ9Ik0yNzggNzZoLTEwdjI4aDEwIi8+PC9zdmc+"); }

/* ═══ 프로토 선택 미니맵 (로또 미니맵과 같은 모양, 청록) ═══════════ */
.proto-minimap { --red: var(--blue); --red-tint: var(--blue-tint); }
.proto-minimap .pm-count { min-height: 0; align-items: center; font-weight: 700; color: var(--blue); font-size: .9rem; font-variant-numeric: tabular-nums; }
.pm-slots { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .3rem; }
@media (max-width: 700px) { .pm-slots { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pm-slot { padding: .28rem; gap: 3px; }
.pm-slot:disabled { cursor: default; opacity: .55; }
.pm-slot:disabled:hover { background: transparent; }
.pm-slot.is-used { box-shadow: inset 0 0 0 1.5px var(--blue); background: var(--paper); }
.pm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pm-digits { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px 1px; }
.pm-digits i { aspect-ratio: 4 / 3; }
.pm-wdl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.pm-wdl i {
  font-style: normal; display: grid; place-items: center; aspect-ratio: 4 / 3; line-height: 1;
  font-size: .5rem; font-weight: 800; color: var(--blue); border-radius: 2px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 60%, transparent);
}
.pm-wdl i.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.pm-slot .mm-tab { width: 1rem; font-size: .6rem; }
@media (max-width: 560px) { .pm-wdl i { font-size: .42rem; } .pm-slot .mm-tab { width: .8rem; font-size: .5rem; } }

/* 미니맵에서 눌러 이동한 카드 잠깐 강조 */
@keyframes card-flash { 0%, 60% { box-shadow: 0 0 0 3px var(--blue), inset 5px 0 0 var(--sport); } 100% { box-shadow: 0 0 0 1px var(--line), inset 5px 0 0 var(--sport); } }
.match-group.is-flash { animation: card-flash 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .match-group.is-flash { animation: none; box-shadow: 0 0 0 3px var(--blue), inset 5px 0 0 var(--sport); } }

/* ═══ 프로토 선택 미니맵: 스크롤을 따라 머리글 바로 아래에 붙음 ═══════ */
.proto-minimap {
  position: sticky; top: calc(var(--top-h, 72px) + .4rem); z-index: 15;
  background: var(--slip-paper);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgb(0 0 0 / .35);
}
.match-group { scroll-margin-top: calc(var(--top-h, 72px) + var(--mm-h, 160px) + 1.2rem); }
/* 휴대폰: 처음부터 10칸 한 줄 (붙어 있을 때 화면을 덜 가리도록, 크기 변화 없음) */
@media (max-width: 700px) {
  .proto-minimap { gap: .3rem .5rem; padding: .55rem .6rem .55rem .5rem; }
  .proto-minimap .pm-slots { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .18rem; }
  .proto-minimap .pm-slot { padding: .14rem; gap: 1px; }
  .proto-minimap .pm-slot .mm-tab { width: .7rem; font-size: .45rem; }
  .proto-minimap .pm-body { gap: 2px; }
  .proto-minimap .pm-wdl i { font-size: 0; }
  .proto-minimap .mm-logo { font-size: .85rem; }
  .proto-minimap .icon-btn { width: 2rem; height: 2rem; min-width: 36px; min-height: 36px; }
  .proto-minimap .pm-count { font-size: .78rem; }
}

/* ═══ 프로토 선택 미니맵: 경기 카드형 (종목 공 배경 · 홈/상대 · 유형 · 예측) ═══════ */
.pm-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.pick-slot {
  position: relative; overflow: hidden; isolation: isolate; min-width: 0; height: 5.4rem;
  display: flex; align-items: stretch; gap: .35rem; padding: .45rem .5rem; text-align: left; cursor: pointer;
  border: 0; border-radius: var(--r-sm); color: var(--ink); font: inherit;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line);
  --sport: var(--blue); --sport-tint: var(--blue-tint);
}
.pick-slot:disabled { cursor: default; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); border: 0; }
.pick-slot:disabled::after { content: ""; position: absolute; inset: 6px; border: 1.5px dashed var(--line); border-radius: 6px; z-index: -1; }
.pick-slot.is-used { background: linear-gradient(120deg, var(--paper) 30%, var(--sport-tint)); box-shadow: inset 0 0 0 1.5px var(--sport), inset 4px 0 0 var(--sport); }
.pick-slot.is-used:hover { box-shadow: inset 0 0 0 2.5px var(--sport), inset 4px 0 0 var(--sport); }
.pick-slot.is-used::before {
  content: ""; position: absolute; z-index: -1; right: -.9rem; bottom: -1rem; width: 4.6rem; height: 4.6rem;
  background: var(--ball) no-repeat center / contain; opacity: .2; transform: rotate(-12deg);
}
.ps-no { flex: none; align-self: flex-start; min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem; display: grid; place-items: center; border-radius: 4px; font-size: .62rem; font-weight: 800; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.pick-slot.is-used .ps-no { background: var(--sport); color: #fff; box-shadow: none; }
.ps-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ps-home, .ps-away { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.ps-home { font-size: .8rem; font-weight: 800; }
.ps-away { font-size: .72rem; font-weight: 600; color: var(--ink-soft); }
.ps-away small { font-size: .6rem; margin-right: .1rem; }
.ps-foot { display: flex; align-items: center; justify-content: space-between; gap: .3rem; min-width: 0; }
.ps-type { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .62rem; font-weight: 700; color: var(--sport); }
.ps-pick { flex: none; padding: .05rem .5rem; border-radius: 999px; background: var(--sport); color: #fff; font-size: .78rem; font-weight: 800; white-space: nowrap; }
html[data-contrast="high"] .pick-slot.is-used { background: var(--paper); }
html[data-contrast="high"] .pick-slot.is-used::before { display: none; }
html[data-contrast="high"] .ps-pick, html[data-contrast="high"] .pick-slot.is-used .ps-no { color: #000; }
/* 휴대폰: 한 줄로 옆으로 밀어서 보기 (따라다닐 때 화면을 덜 가리도록) */
@media (max-width: 700px) {
  .proto-minimap .pm-slots { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 8.2rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .2rem; gap: .35rem; scrollbar-width: thin; }
  .pick-slot { height: 4.9rem; scroll-snap-align: start; }
}
.pick-slot.sport-SC { --sport: #1f8a4c; --sport-tint: #eef7f0; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxZjhhNGMiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQ1Ii8+PHBhdGggZD0iTTUwIDM0bDE1IDExLTYgMThINDFsLTYtMTh6IiBmaWxsPSIjMWY4YTRjIi8+PHBhdGggZD0iTTUwIDM0VjhNNjUgNDVsMjQtOE01OSA2M2wxNSAyME00MSA2M0wyNiA4M00zNSA0NUwxMSAzNyIvPjxwYXRoIGQ9Ik0zOCA5bDEyIDUgMTItNU04NSAyN2w0IDE0LTQgMTJNNzggODBsLTE0IDctMTAtNE0yMiA4MGwxNCA3IDEwLTRNMTUgMjdsLTQgMTQgNCAxMiIvPjwvc3ZnPg=="); }
.pick-slot.sport-BK { --sport: #d9721b; --sport-tint: #fdf3e9; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiNkOTcyMWIiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQ1Ii8+PHBhdGggZD0iTTUwIDV2OTBNNSA1MGg5MCIvPjxwYXRoIGQ9Ik0yMCAxNGMxNCAxMiAyMCAyNCAyMCAzNnMtNiAyNC0yMCAzNk04MCAxNEM2NiAyNiA2MCAzOCA2MCA1MHM2IDI0IDIwIDM2Ii8+PC9zdmc+"); }
.pick-slot.sport-VL { --sport: #2f5fd0; --sport-tint: #eef2fd; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiMyZjVmZDAiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQ1Ii8+PHBhdGggZD0iTTUwIDVjLTYgMTgtNCAzNCA2IDQ1czI4IDE2IDM4IDEwIi8+PHBhdGggZD0iTTU2IDUwQzQwIDU0IDI0IDY2IDE4IDg0Ii8+PHBhdGggZD0iTTYgNDJjMTgtNiAzNi0yIDUwIDgiLz48cGF0aCBkPSJNMzAgMTJjNCAxNCAxNCAyNiAyNiAzOCIvPjwvc3ZnPg=="); }
.pick-slot.sport-BS { --sport: #8a5a2b; --sport-tint: #f8f1ea; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiM4YTVhMmIiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQ1Ii8+PHBhdGggZD0iTTIyIDE0YzEyIDEwIDE4IDIyIDE4IDM2UzM0IDc2IDIyIDg2TTc4IDE0QzY2IDI0IDYwIDM2IDYwIDUwczYgMjYgMTggMzYiLz48cGF0aCBkPSJNMzAgMjJsNi0zTTM0IDMybDYtMk0zNiA0M2g2TTM2IDU1bDYgMU0zNCA2Nmw2IDJNMzAgNzdsNiAzTTcwIDIybC02LTNNNjYgMzJsLTYtMk02NCA0M2gtNk02NCA1NWwtNiAxTTY2IDY2bC02IDJNNzAgNzdsLTYgMyIgc3Ryb2tlLXdpZHRoPSIyLjQiLz48L3N2Zz4="); }
.pick-slot.sport-HK { --sport: #2a7a9b; --sport-tint: #ecf5f8; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiMyYTdhOWIiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxlbGxpcHNlIGN4PSI1MCIgY3k9IjM4IiByeD0iNDIiIHJ5PSIxNiIvPjxwYXRoIGQ9Ik04IDM4djIyYzAgOSAxOSAxNiA0MiAxNnM0Mi03IDQyLTE2VjM4Ii8+PGVsbGlwc2UgY3g9IjUwIiBjeT0iMzgiIHJ4PSIyNiIgcnk9IjgiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg=="); }
.pick-slot.sport-ETC { --sport: #5b5b60; --sport-tint: #f4f4f1; --ball: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiBzdHJva2U9IiM1YjViNjAiIHN0cm9rZS13aWR0aD0iMy4yIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQ1Ii8+PGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iMjAiLz48L3N2Zz4="); }
/* 배당 표시 · 총 예측 배당 */
.ps-pick { display: inline-flex; align-items: baseline; gap: .3rem; }
.ps-pick b { font-size: .66rem; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }
.pm-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.pm-total { display: inline-flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pm-total b { font-size: 1.05rem; font-weight: 800; color: var(--blue); }
@media (max-width: 700px) { .pm-total { font-size: .7rem; } .pm-total b { font-size: .9rem; } }
/* 선택 미니맵 칸: 번호+홈팀 / vs 상대팀 / 유형 + 예측(배당) — 유형이 잘리지 않게 한 줄 전체 사용 */
.pick-slot { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: .35rem; row-gap: .12rem; align-items: center; }
.ps-body { display: contents; }
.ps-no { grid-column: 1; grid-row: 1; align-self: center; }
.ps-home { grid-column: 2; grid-row: 1; }
.ps-away { grid-column: 1 / -1; grid-row: 2; }
.ps-foot { grid-column: 1 / -1; grid-row: 3; align-self: end; }
.ps-type { flex: 1 1 auto; min-width: 2.6em; font-size: .64rem; }
.ps-pick { padding: .05rem .42rem; font-size: .72rem; }
.ps-pick b { font-size: .62rem; }
.ps-foot { flex-direction: column; align-items: stretch; gap: .15rem; }
.ps-type { flex: none; }
.ps-pick { align-self: flex-end; }
.pick-slot { height: 6.3rem; padding: .42rem .5rem .45rem; }
@media (max-width: 700px) { .pick-slot { height: 6rem; } }
/* 구매 금액 직접 입력 (지금은 hidden) */
.amount input { font: inherit; font-weight: 700; width: 9em; min-height: 56px; padding: 0 .8rem; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); text-align: right; }
.amount small { display: block; width: 100%; font-weight: 500; font-size: .75rem; color: var(--ink-soft); }
.amount[hidden] { display: none; }

/* ═══ 프로토: 게임 유형 표 (모든 유형을 한눈에) ═══════════════ */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bet-table { width: 100%; border-collapse: separate; border-spacing: 0 .35rem; table-layout: fixed; margin-top: .2rem; }
.bet-table thead th { font-size: .7rem; font-weight: 700; color: var(--ink-soft); text-align: center; padding: 0 .2rem .1rem; }
.bet-table thead th:first-child { text-align: left; width: 34%; }
.bet-table tbody th { text-align: left; padding: .35rem .5rem .35rem .2rem; vertical-align: middle; }
.bet-table td { padding: 0 .2rem; vertical-align: middle; }
.bt-name { display: block; font-size: .9rem; font-weight: 800; line-height: 1.2; word-break: keep-all; }
.bt-no { display: block; font-size: .66rem; font-weight: 600; color: var(--ink-soft); margin-top: .1rem; }
.bt-no b { color: var(--red); font-weight: 700; }
.bet-table tbody tr { background: color-mix(in srgb, var(--paper) 78%, transparent); }
.bet-table tbody tr.is-picked th { box-shadow: inset 4px 0 0 var(--sport); padding-left: .55rem; }
.bet-table tbody tr.is-closed { opacity: .45; }
.bt-none { display: grid; place-items: center; height: 3.2rem; color: var(--line); font-weight: 700; }
.bt-btn {
  width: 100%; min-height: 3.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
  border: 0; border-radius: var(--r-sm); cursor: pointer; font: inherit; color: var(--blue);
  background: var(--paper); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blue) 45%, var(--line));
}
.bt-btn:hover:not(:disabled) { background: var(--blue-tint); }
.bt-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.bt-btn:disabled { cursor: not-allowed; }
.bt-btn .bb-label { font-size: .92rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.bt-btn .bb-odds { font-size: .7rem; font-weight: 600; opacity: .85; font-variant-numeric: tabular-nums; }
html[data-contrast="high"] .bt-btn[aria-pressed="true"] { background: #fff; color: #000; }
@media (max-width: 560px) {
  .bet-table thead th:first-child { width: 31%; }
  .bt-name { font-size: .78rem; }
  .bt-btn { min-height: 2.9rem; }
  .bt-btn .bb-label { font-size: .8rem; }
  .bt-btn .bb-odds { font-size: .62rem; }
  .bet-table td { padding: 0 .12rem; }
}
/* 게임 유형 표: 제목 줄(종목·리그·팀)보다 안쪽으로 들여서 붙임 */
.bet-table { margin-left: 1.2rem; width: calc(100% - 1.2rem); }
.bet-table thead th:first-child { padding-left: .6rem; }
.bet-table tbody th { padding-left: .6rem; border-left: 2px solid var(--line); }
.bet-table tbody tr.is-picked th { box-shadow: none; border-left-color: var(--sport); padding-left: .6rem; }
@media (max-width: 560px) {
  .bet-table { margin-left: .7rem; width: calc(100% - .7rem); }
  .bet-table thead th:first-child, .bet-table tbody th, .bet-table tbody tr.is-picked th { padding-left: .45rem; }
}
/* 게임 유형 표 머리 줄: 음영으로 한 줄 강조 (게임 유형 | 승 | 가운데 | 패) */
.bet-table thead th {
  padding: .45rem .2rem; font-size: .78rem; font-weight: 800; color: var(--sport);
  background: color-mix(in srgb, var(--sport) 14%, var(--paper));
  border-top: 1.5px solid color-mix(in srgb, var(--sport) 35%, transparent);
  border-bottom: 1.5px solid color-mix(in srgb, var(--sport) 35%, transparent);
}
.bet-table thead th:first-child { padding-left: .6rem; border-left: 1.5px solid color-mix(in srgb, var(--sport) 35%, transparent); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.bet-table thead th:last-child { border-right: 1.5px solid color-mix(in srgb, var(--sport) 35%, transparent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
html[data-contrast="high"] .bet-table thead th { background: #1a1a1a; color: #fff; }
@media (max-width: 560px) { .bet-table thead th { font-size: .7rem; } .bet-table thead th:first-child { padding-left: .45rem; } }
/* 게임 유형 표: 선택 줄을 홀수/짝수로 번갈아 음영 (줄 구분) */
.bet-table { border-spacing: 0 .2rem; }
.bet-table tbody tr { background: none; }
.bet-table tbody tr > * { padding-top: .32rem; padding-bottom: .32rem; }
.bet-table tbody tr:nth-child(odd) > * { background: color-mix(in srgb, var(--paper) 85%, transparent); }
.bet-table tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--sport) 9%, var(--paper)); }
.bet-table tbody tr > *:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding-right: .3rem; }
.bet-table tbody tr > th { border-radius: 0; }
html[data-contrast="high"] .bet-table tbody tr:nth-child(odd) > * { background: #000; }
html[data-contrast="high"] .bet-table tbody tr:nth-child(even) > * { background: #1a1a1a; }
.bet-table tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--sport) 4.5%, var(--paper)); }
/* 프로토 미니맵: 로고·버튼 / 용지 번호 아이콘 / 고른 경기 칸 / 고른 수·총 배당 */
.proto-minimap { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "timing logo tools" "timing sheets sheets" "timing games games" "timing count count"; }
.proto-minimap .pm-sheets { grid-area: sheets; }
.proto-minimap .pm-count { grid-area: count; min-height: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; font-weight: 700; color: var(--blue); font-size: .9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .proto-minimap .pm-count { font-size: .78rem; } }
/* 프로토 미니맵 순서: 로고·버튼 → 고른 경기 칸 → 용지 번호 → 고른 수·총 배당 */
.proto-minimap { grid-template-areas: "timing logo tools" "timing games games" "timing sheets sheets" "timing count count"; }
.proto-minimap .pm-sheets { margin-top: .15rem; }
/* 프로토 용지 번호 아이콘: 번호 + 총 배당 */
.pm-sheets { min-height: 0; gap: .3rem; }
.pm-sheets .sheet-icon { width: auto; min-width: 3.9rem; height: 1.6rem; padding: 0 .6rem 2px .4rem; justify-content: flex-start; gap: .4rem; }
.pm-sheets .sheet-icon::before { bottom: 2px; }
.pm-sheets .si-no { font-size: .7rem; padding: 0; }
.pm-sheets .si-odds { font-size: .66rem; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .9; }
@media (max-width: 560px) { .pm-sheets .sheet-icon { min-width: 3.3rem; height: 1.45rem; gap: .3rem; padding: 0 .5rem 2px .32rem; } .pm-sheets .si-odds { font-size: .58rem; } }

/* ═══ 프로토 미니맵 세로 줄이기 ═══════════════════════════ */
.proto-minimap {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "timing logo count tools" "timing games games games" "timing sheets sheets sheets";
  gap: .35rem .7rem; padding: .55rem .75rem .55rem .55rem;
}
.proto-minimap .pm-count { grid-area: count; align-self: center; justify-self: start; font-size: .78rem; gap: .1rem .8rem; }
.proto-minimap .pm-total { font-size: .74rem; }
.proto-minimap .pm-total b { font-size: .9rem; }
.proto-minimap .mm-logo { font-size: .95rem; align-self: center; }
.proto-minimap .icon-btn { width: 2rem; height: 2rem; min-width: 38px; min-height: 38px; }
.proto-minimap .pm-sheets { margin-top: 0; }
.pm-slots { gap: .3rem; }
/* 칸: 번호+홈팀 / vs 상대팀 / 유형 … 예측·배당 (3줄) */
.pick-slot { height: 3.7rem; padding: .3rem .45rem; row-gap: .04rem; grid-template-rows: auto auto auto; }
.ps-home { font-size: .74rem; }
.ps-away { font-size: .64rem; }
.ps-no { min-width: 1rem; height: 1rem; font-size: .56rem; }
.ps-foot { flex-direction: row; align-items: center; justify-content: space-between; gap: .25rem; }
.ps-type { flex: 1 1 auto; min-width: 0; font-size: .58rem; }
.ps-pick { align-self: auto; padding: .02rem .38rem; font-size: .64rem; gap: .22rem; }
.ps-pick b { font-size: .56rem; }
.pick-slot.is-used::before { width: 3.4rem; height: 3.4rem; right: -.7rem; bottom: -.8rem; }
@media (max-width: 700px) {
  .proto-minimap { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "timing logo tools" "timing count count" "timing games games" "timing sheets sheets"; gap: .25rem .5rem; }
  .pick-slot { height: 3.6rem; }
}
@media (max-width: 700px) {
  .proto-minimap .pm-sheets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: .15rem; }
  .proto-minimap .pm-sheets .sheet-icon { flex: none; }
}

/* 게임 유형 표 줄 높이 줄이기: 버튼은 예상·배당 한 줄, 유형 이름·경기번호도 한 줄 */
.bet-table { border-spacing: 0 .15rem; }
.bet-table tbody tr > * { padding-top: .12rem; padding-bottom: .12rem; }
.bt-btn { flex-direction: row; gap: .35rem; min-height: 2.3rem; padding: 0 .3rem; }
.bt-btn .bb-label { font-size: .88rem; }
.bt-btn .bb-odds { font-size: .74rem; }
.bt-none { height: 2.3rem; }
.bet-table tbody th { line-height: 1.15; }
.bt-name { display: inline; font-size: .86rem; }
.bt-no { display: inline; margin: 0 0 0 .35rem; font-size: .62rem; white-space: nowrap; }
.bet-table thead th { padding-top: .32rem; padding-bottom: .32rem; }
@media (max-width: 560px) {
  .bt-btn { gap: .2rem; min-height: 2.25rem; padding: 0 .15rem; }
  .bt-btn .bb-label { font-size: .76rem; }
  .bt-btn .bb-odds { font-size: .64rem; }
  .bt-name { display: block; font-size: .74rem; }
  .bt-no { display: block; margin: .05rem 0 0; font-size: .58rem; }
}

/* ── 프로토 이동 내비게이션 (미니맵 아래, 함께 따라옴) ───────────── */
.proto-nav {
  position: sticky; top: calc(var(--top-h, 72px) + var(--mm-h, 160px) + .7rem); z-index: 14;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem;
  margin: .5rem 0 .9rem; padding: .45rem .55rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px);
  border-radius: var(--r-md, 10px); box-shadow: 0 0 0 1px var(--line), 0 4px 10px -6px rgb(0 0 0 / .18);
}
.pn-sports, .pn-group { display: flex; gap: .3rem; flex-wrap: nowrap; }
.pn-sports { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pn-sports::-webkit-scrollbar { display: none; }
.pn-group { padding-left: .5rem; border-left: 1px solid var(--line); }
.pn-chip {
  --c: var(--ink-soft);
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem;
  min-height: 2.2rem; padding: 0 .7rem; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 600; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
}
.pn-chip b { font-size: .74rem; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.pn-chip:hover { box-shadow: inset 0 0 0 1.5px var(--c); }
.pn-chip[aria-pressed="true"] { background: var(--c); color: #fff; box-shadow: none; }
.pn-chip[aria-pressed="true"] b { color: rgb(255 255 255 / .85); }
.pn-chip:focus-visible, .pn-arrow:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pn-chip.sport-ALL { --c: var(--ink); }
.pn-chip.sport-SC { --c: #1f8a4c; } .pn-chip.sport-BK { --c: #d9721b; } .pn-chip.sport-VL { --c: #2f5fd0; }
.pn-chip.sport-BS { --c: #8a5a2b; } .pn-chip.sport-HK { --c: #2a7a9b; }
.pn-chip[data-sort] { --c: var(--ink); }
.pn-open { --c: var(--blue); }
.pn-move { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.pn-arrow {
  display: inline-flex; align-items: center; gap: .15rem; min-height: 2.2rem; padding: 0 .65rem;
  border: 0; border-radius: var(--r-sm, 8px); background: var(--ink); color: var(--paper);
  font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.pn-arrow:hover { background: var(--blue); }
.pn-pos { min-width: 4.4rem; text-align: center; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.proto-list.only-open tr.is-closed { display: none; }
.match-group { scroll-margin-top: calc(var(--top-h, 72px) + var(--mm-h, 160px) + var(--nav-h, 52px) + 1.4rem); }
.match-group[hidden] { display: none !important; }
@media (max-width: 720px) {
  .proto-nav { gap: .3rem; padding: .35rem .4rem; }
  .pn-sports { flex: 1 1 100%; }
  .pn-group { padding-left: 0; border-left: 0; }
  .pn-chip { min-height: 2rem; padding: 0 .55rem; font-size: .78rem; }
  .pn-arrow { min-height: 2rem; padding: 0 .5rem; font-size: .78rem; }
  .pn-pos { min-width: 3.4rem; font-size: .78rem; }
}
@media (max-width: 720px) {
  .proto-nav { row-gap: .3rem; column-gap: .25rem; }
  .proto-nav .pn-chip { min-height: 1.95rem; padding: 0 .5rem; font-size: .76rem; gap: .2rem; }
  .pn-move { gap: .1rem; }
  .pn-arrow { min-height: 1.95rem; padding: 0 .4rem; }
  .pn-arrow .pn-txt { display: none; }
  .pn-pos { min-width: 2.9rem; font-size: .74rem; }
}
@media (max-width: 720px) {
  .pn-open .pn-txt { display: none; }
  .proto-nav .pn-group .pn-chip { padding: 0 .45rem; }
  .pn-move { margin-left: auto; }
}
@media (max-width: 720px) {
  .proto-nav .pn-chip, .proto-nav .pn-group .pn-chip { padding: 0 .4rem; font-size: .72rem; }
  .pn-group { gap: .2rem; }
  .pn-arrow { padding: 0 .3rem; }
  .pn-pos { min-width: 2.5rem; font-size: .72rem; }
  .pn-move { gap: 0; }
}

/* ═══ 프로토 미니맵: +·삭제 버튼을 용지 번호(1,2,3…) 아래로 ═══ */
.proto-minimap {
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: "timing logo count" "timing games games" "timing sheets sheets" "timing tools tools";
}
.proto-minimap .minimap-head .sheet-tools { grid-area: tools; justify-self: start; margin: 0; gap: .35rem; }
@media (max-width: 700px) {
  .proto-minimap { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "timing logo" "timing count" "timing games" "timing sheets" "timing tools"; }
}

/* 미니맵 '이 용지 인쇄' 버튼 */
.mm-print {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: 0 .85rem;
  border: 0; border-radius: var(--r-sm, 8px); background: var(--blue); color: #fff;
  font: inherit; font-size: .82rem; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.mm-print:hover:not(:disabled) { filter: brightness(1.1); }
.mm-print:disabled { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }
.mm-print:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* 미니맵: '이 용지 인쇄'를 Proto 승부식 로고 옆으로 */
.proto-minimap {
  grid-template-columns: auto auto auto minmax(0, 1fr);
  grid-template-areas: "timing logo print count" "timing games games games" "timing sheets sheets sheets" "timing tools tools tools";
}
.proto-minimap .mm-print { grid-area: print; align-self: center; justify-self: start; min-height: 34px; padding: 0 .7rem; }
@media (max-width: 700px) {
  .proto-minimap { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "timing logo print" "timing count count" "timing games games" "timing sheets sheets" "timing tools tools"; }
}

/* 미니맵: 'n번 용지 고른 경기 · 총 배당'을 로고 줄 아래로 */
.proto-minimap {
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: "timing logo print" "timing count count" "timing games games" "timing sheets sheets" "timing tools tools";
}
.proto-minimap .pm-count { margin-top: -.1rem; }
@media (max-width: 720px) { .pn-group .pn-txt { display: none; } }
/* 폰: 1줄 = 종목 + 이전/다음, 2줄 = 정렬 + 발매 가능 */
@media (max-width: 720px) {
  .proto-nav { flex-wrap: wrap; }
  .pn-sports { flex: 1 1 0; order: 1; }
  .pn-move { order: 2; flex: none; }
  .pn-group { order: 3; }
  .pn-open { order: 4; }
}
@media (max-width: 720px) { .pn-sports { flex: 1 1 calc(100% - 150px); } }

/* 국가 필터 (정렬은 항상 시간순) */
.pn-countries { display: flex; gap: .3rem; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-left: .5rem; border-left: 1px solid var(--line); }
.pn-countries::-webkit-scrollbar { display: none; }
.pn-chip.pn-country { --c: #4a4f8c; }
.pn-chip[hidden] { display: none; }
@media (max-width: 720px) {
  .pn-countries { order: 3; flex: 1 1 calc(100% - 110px); padding-left: 0; border-left: 0; }
  .pn-open { order: 4; flex: none; }
}

/* 전체 용지 인쇄 */
.mm-print-all { background: var(--ink); }
.mm-print-all b { font-variant-numeric: tabular-nums; }
.proto-minimap .mm-print-all { grid-area: printall; align-self: center; justify-self: start; min-height: 34px; padding: 0 .7rem; }
.proto-minimap {
  grid-template-columns: auto auto auto minmax(0, 1fr);
  grid-template-areas: "timing logo print printall" "timing count count count" "timing games games games" "timing sheets sheets sheets" "timing tools tools tools";
}
@media (max-width: 700px) {
  .proto-minimap { grid-template-columns: auto auto auto minmax(0, 1fr); grid-template-areas: "timing logo logo logo" "timing print printall printall" "timing count count count" "timing games games games" "timing sheets sheets sheets" "timing tools tools tools"; }
}
#omrPrintArea .omr-page { display: none; }
@media print {
  #omrPrintArea.multi > .omr-sheet-wrapper:not(.omr-page) { display: none !important; }
  #omrPrintArea.multi > .omr-page { display: flex !important; break-after: page; page-break-after: always; }
  #omrPrintArea.multi > .omr-page:last-child { break-after: auto; page-break-after: auto; }
}

/* 인쇄 전 안내 팝업 */
.print-notice {
  width: min(26rem, calc(100vw - 2rem)); padding: 1.5rem 1.4rem 1.2rem; border: 0; border-radius: var(--r-lg, 16px);
  background: var(--paper); color: var(--ink); text-align: center;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -12px rgb(0 0 0 / .35);
}
.print-notice::backdrop { background: rgb(0 0 0 / .45); }
.print-notice .pn-icon { color: var(--blue); margin-bottom: .4rem; }
.print-notice h2 { margin: 0 0 .5rem; font-size: 1.2rem; line-height: 1.35; word-break: keep-all; }
.print-notice p { margin: 0 0 1.2rem; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); word-break: keep-all; }
.print-notice p b { color: var(--ink); }
.pn-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: .5rem; }
.pn-actions button { min-height: 3rem; border: 0; border-radius: var(--r-md, 10px); font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; }
.pn-cancel { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.pn-ok { background: var(--blue); color: #fff; }
.pn-actions button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media print { .print-notice { display: none !important; } }

/* 마감 임박 표시 */
.mg-deadline {
  display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .55rem; border-radius: 999px;
  background: #fff4e0; color: #9a5a00; box-shadow: inset 0 0 0 1.5px #f0b44c; font-size: .78rem; font-weight: 800; white-space: nowrap;
}
.mg-deadline::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.mg-deadline[hidden] { display: none; }
.match-group.is-soon { box-shadow: 0 0 0 2px #f0b44c, 0 6px 16px -10px rgb(0 0 0 / .3); }
.match-group.is-urgent { box-shadow: 0 0 0 2.5px #d6302b, 0 6px 16px -10px rgb(0 0 0 / .3); }
.match-group.is-urgent .mg-deadline { background: #d6302b; color: #fff; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .match-group.is-urgent .mg-deadline::before { animation: dl-blink 1.2s ease-in-out infinite; }
}
@keyframes dl-blink { 50% { opacity: .25; } }
.pick-slot.is-soon { box-shadow: inset 0 0 0 2px #f0b44c; }
.pick-slot.is-urgent { box-shadow: inset 0 0 0 2.5px #d6302b; }
.pick-slot.is-soon .ps-no { background: #f0b44c; color: #3a2300; }
.pick-slot.is-urgent .ps-no { background: #d6302b; color: #fff; }
html[data-contrast="high"] .mg-deadline, [data-theme="dark"] .mg-deadline { background: #ffcf4d; color: #000; }

/* 미니맵: .pm-count를 용지 번호(sheets) 아래로 */
.proto-minimap {
  grid-template-columns: auto auto auto minmax(0, 1fr);
  grid-template-areas: "timing logo print printall" "timing games games games" "timing sheets sheets sheets" "timing count count count" "timing tools tools tools";
}
.proto-minimap .pm-count { margin-top: 0; }
@media (max-width: 700px) {
  .proto-minimap { grid-template-areas: "timing logo logo logo" "timing print printall printall" "timing games games games" "timing sheets sheets sheets" "timing count count count" "timing tools tools tools"; }
}

.mm-print-all[hidden] { display: none; }

/* 고른 번호 동그라미: 실제 로또 공 색 */
.slots i.on[data-ball] { box-shadow: none; text-shadow: 0 1px 1px rgb(0 0 0 / .25); }
.slots i.on[data-ball="1"] { background: #fbc400; color: #fff; }
.slots i.on[data-ball="2"] { background: #69c8f2; color: #fff; }
.slots i.on[data-ball="3"] { background: #ff7272; color: #fff; }
.slots i.on[data-ball="4"] { background: #aaaaaa; color: #fff; }
.slots i.on[data-ball="5"] { background: #b0d840; color: #fff; }
html[data-contrast="high"] .slots i.on[data-ball] { color: #000; text-shadow: none; }

/* 로또: 게임 고르기(A~E 버튼 줄)는 가림 — 위 미니맵의 A~E 게임을 눌러 고름 */
.lotto #gameSwitch { display: none !important; }

/* 로또 번호칸 1~45: 폭을 줄여 실제 용지처럼 세로로 긴 직사각형 */
.slip-numbers { grid-template-columns: repeat(7, minmax(0, 2.7rem)); justify-content: center; column-gap: .55rem; }
.slip-num { aspect-ratio: 3 / 4.2; min-height: 0; }
@media (max-width: 560px) { .slip-numbers { column-gap: .3rem; } }

/* 용지 한 게임: 배경(용지)을 번호칸 크기에 맞게 줄이고 가운데 */
.lotto .slip-game { width: fit-content; max-width: 100%; margin-inline: auto; }

/* 고른 번호 줄: 0 / 6 옆 지우기 버튼 */
.picked { grid-template-columns: max-content minmax(0, 1fr) auto auto; grid-template-areas: "label slots count clear"; }
.picked-clear {
  grid-area: clear; display: inline-flex; align-items: center; gap: .25rem; min-height: 2.2rem; padding: 0 .65rem;
  border: 0; border-radius: 999px; background: var(--paper); color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red);
  font: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.picked-clear:hover:not(:disabled) { background: var(--red); color: #fff; }
.picked-clear:disabled { color: var(--ink-soft); box-shadow: inset 0 0 0 1.5px var(--line); cursor: default; opacity: .6; }
.picked-clear:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
/* 좁은 화면: 윗줄 게임·0/6·지우기, 아랫줄 동그라미 6칸 (게임 고르기 줄을 가려서 상태를 여기서 보여 줌) */
@media (max-width: 600px) {
  .picked { grid-template-columns: max-content 1fr auto; grid-template-areas: "label count clear" "slots slots slots"; row-gap: .55rem; }
  .pl-word { display: inline; }
  #pickedCount { display: block; width: auto; text-align: right; font-size: .8rem; }
  .picked-label b { font-size: 1.2em; }
  .picked-clear { min-height: 2rem; padding: 0 .55rem; font-size: .75rem; }
  .slots { gap: .4rem; }
}

/* 로또 미니맵: 로고 옆 '이 용지 인쇄' · '전체 용지 인쇄' (프로토와 같은 모양) */
.lotto .minimap { grid-template-columns: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "timing logo lprint lprintall tools" "timing games games games games" "timing icons icons icons icons"; }
.lotto .minimap #lmPrint { grid-area: lprint; align-self: center; justify-self: start; min-height: 34px; padding: 0 .7rem; }
.lotto .minimap #lmPrintAll { grid-area: lprintall; align-self: center; justify-self: start; min-height: 34px; padding: 0 .7rem; }
.lotto .minimap .mm-print { background: var(--red); }
.lotto .minimap .mm-print-all { background: var(--ink); }
.lotto .minimap .mm-print:disabled { background: var(--line); color: var(--ink-soft); }
@media (max-width: 700px) {
  .lotto .minimap { grid-template-columns: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "timing logo logo logo tools" "timing lprint lprintall lprintall lprintall" "timing games games games games" "timing icons icons icons icons"; }
}
@media (max-width: 700px) { .lotto .minimap #lmPrint, .lotto .minimap #lmPrintAll { padding: 0 .5rem; font-size: .76rem; gap: .25rem; } }

/* 고른 번호 줄: 폭을 줄여 아래 용지와 같은 폭으로 가운데 */
.lotto .picked { width: fit-content; max-width: 100%; margin-inline: auto; grid-template-columns: max-content auto auto auto; column-gap: 1rem; }
@media (max-width: 600px) { .lotto .picked { width: auto; grid-template-columns: max-content 1fr auto; } }
.lotto .picked { column-gap: .6rem; padding-left: 1rem; padding-right: .8rem; }

/* 로또: 아래 '로또 용지 인쇄하기' 버튼 삭제 — 인쇄는 미니맵 버튼으로 (안내 문구 #lottoMsg는 그대로 표시) */
.lotto #printLottoBtn { display: none !important; }

/* 경기 목록: 지금 고를 수 없는(고르면 바뀌는) 유형은 살짝 색을 빼서 구분 */
.match-group tbody tr { transition: opacity .15s, filter .15s; }
.match-group.has-pick tbody tr:not(.is-picked):not(.is-closed),
.proto-list.is-full .match-group:not(.has-pick) tbody tr:not(.is-closed) { opacity: .5; filter: saturate(.25); }
.match-group.has-pick tbody tr:not(.is-picked):not(.is-closed):hover,
.proto-list.is-full .match-group:not(.has-pick) tbody tr:not(.is-closed):hover { opacity: .8; filter: saturate(.6); }
@media (prefers-reduced-motion: reduce) { .match-group tbody tr { transition: none; } }

/* 미니맵: 경기를 고르면 '총 배당' 글자 때문에 높이·폭이 바뀌던 것 고정 */
.proto-minimap .pm-count { height: 1.9rem; min-height: 1.9rem; align-items: center; white-space: nowrap; overflow: hidden; line-height: 1.2; }
.proto-minimap .pm-count > *, .proto-minimap .pm-total, .proto-minimap .pm-total b { line-height: 1.2; }
.proto-minimap .pm-total { display: inline-block; min-width: 9.5em; font-variant-numeric: tabular-nums; }
#protoCount { font-variant-numeric: tabular-nums; }

/* ═══ 프로토: 선택 미니맵을 오른쪽 세로형 사이드바로 (화면 폭 750px 이상) ═══
   작은 화면에서 위쪽 미니맵이 경기 목록을 가리던 문제 → 경기 목록은 왼쪽, 미니맵은 오른쪽에 따라옴 */
@media (min-width: 750px) {
  .proto .work { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 27vw, 330px); column-gap: 1.2rem; align-items: start; }
  .proto .work > * { grid-column: 1; }
  .proto .work > .proto-minimap {
    grid-column: 2; grid-row: 1 / span 12;
    position: sticky; top: calc(var(--top-h, 72px) + .6rem);
    max-height: calc(100vh - var(--top-h, 72px) - 1.2rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    margin: 0;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "timing logo logo" "timing print printall" "timing games games" "timing sheets sheets" "timing count count" "timing tools tools";
    align-content: start;
  }
  .proto .proto-minimap .mm-print, .proto .proto-minimap .mm-print-all { justify-self: stretch; justify-content: center; padding: 0 .4rem; font-size: .74rem; }
  .proto .proto-minimap .mm-print-all[hidden] { display: none; }
  .proto .proto-minimap:has(#mmPrintAll[hidden]) #mmPrint { grid-area: print / print / print / printall; }
  .proto .proto-minimap .pm-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; overflow: visible; gap: .3rem; }
  .proto .proto-minimap .pick-slot { height: 3.6rem; }
  .proto .proto-minimap .pm-count { flex-wrap: wrap; height: auto; min-height: 2.6rem; white-space: normal; row-gap: .1rem; }
  .proto .proto-minimap .pm-total { min-width: 0; }
  .proto .proto-minimap .pm-sheets { flex-wrap: wrap; }
  /* 이동 내비·경기 카드는 미니맵 높이와 상관없이 머리글 바로 아래에 붙음 */
  .proto .proto-nav { top: calc(var(--top-h, 72px) + .6rem); }
  .proto .match-group { scroll-margin-top: calc(var(--top-h, 72px) + var(--nav-h, 52px) + 1.4rem); }
}
@media (min-width: 750px) {
  /* 사이드바 모드: 이동 내비를 2줄로 (1줄 종목+국가, 2줄 발매 가능+이전/다음) */
  .proto .proto-nav { flex-wrap: wrap; row-gap: .35rem; }
  .proto .pn-sports { flex: 0 0 auto; overflow: visible; }
  .proto .pn-countries { flex: 1 1 0; min-width: 0; overflow-x: auto; }
  .proto .pn-open { flex: none; }
  .proto .pn-move { margin-left: auto; }
}
@media (min-width: 750px) {
  /* 세로형 미니맵: 고른 경기 칸 1칸 × 10줄 (번호 | 홈·상대 | 유형·예측) */
  .proto .proto-minimap .pm-slots { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .proto .proto-minimap .pick-slot {
    height: 2.75rem; padding: .25rem .4rem;
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr; column-gap: .4rem; row-gap: 0;
  }
  .proto .proto-minimap .ps-no { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .proto .proto-minimap .ps-home { grid-column: 2; grid-row: 1; align-self: end; font-size: .72rem; }
  .proto .proto-minimap .ps-away { grid-column: 2; grid-row: 2; align-self: start; font-size: .62rem; }
  .proto .proto-minimap .ps-foot { grid-column: 3; grid-row: 1 / 3; flex-direction: column; align-items: flex-end; justify-content: center; gap: .1rem; align-self: center; }
  .proto .proto-minimap .ps-type { flex: none; max-width: 5.5em; text-align: right; font-size: .56rem; }
  .proto .proto-minimap .pick-slot:disabled .ps-no { grid-row: 1 / 3; }
  .proto .proto-minimap .pick-slot.is-used::before { width: 2.6rem; height: 2.6rem; right: 4.2rem; bottom: -.6rem; opacity: .5; }
}
@media (min-width: 750px) { .proto .proto-minimap .pick-slot:disabled { display: flex; align-items: center; } }
/* 750~899px: 세로형은 유지하되 사이드바를 좁히고 내비·버튼을 작게 */
@media (min-width: 750px) and (max-width: 899px) {
  .proto .work { grid-template-columns: minmax(0, 1fr) 210px; column-gap: .8rem; padding-inline: .8rem; }
  .proto .proto-minimap .ps-type { display: none; }
  .proto .proto-nav { padding: .35rem .45rem; gap: .3rem; }
  .proto .proto-nav .pn-chip { min-height: 2rem; padding: 0 .5rem; font-size: .76rem; }
  .proto .pn-arrow { min-height: 2rem; padding: 0 .45rem; font-size: .76rem; }
  .proto .pn-arrow .pn-txt { display: none; }
  .proto .pn-pos { min-width: 3rem; font-size: .76rem; }
  .proto .bet-table .bt-btn { padding-inline: .25rem; gap: .2rem; }
}

/* ── 관리자 · 인쇄 용지 편집 ── */
.admin-tabs { display: flex; gap: .5rem; margin: 1rem 0; }
.admin-tabs [role=tab] { flex: 1; min-height: 3.2rem; font: inherit; font-size: 1.15rem; font-weight: 800; border: 2px solid var(--ink, #222); background: #fff; color: inherit; border-radius: 12px; cursor: pointer; }
.admin-tabs [role=tab][aria-selected=true] { background: var(--ink, #222); color: #fff; }
.admin-tabs [role=tab]:focus-visible { outline: 3px solid var(--blue, #1f5fd6); outline-offset: 2px; }
.admin-key-input { flex: 1; min-width: 12rem; min-height: 2.8rem; font: inherit; font-size: 1.1rem; padding: 0 .8rem; border: 2px solid #999; border-radius: 10px; }
.admin-page .work { max-width: 760px; }
.admin-page.tab-lotto { grid-template-columns: 1fr; }
.admin-page.tab-lotto > .lt-print.preview { justify-self: center; margin: 0 1rem 2rem; zoom: 1.25; max-width: calc(100vw - 2rem); }
@media (max-width: 1100px) { .admin-page.tab-lotto > .lt-print.preview { zoom: 1; } }
@media (max-width: 800px) { .admin-page.tab-lotto > .lt-print.preview { zoom: .5; } }
.admin-page.tab-lotto > .omr-print { display: none; }
.admin-page.tab-proto > .lt-print { display: none; }
@media print { .admin-page > .lt-print.preview { zoom: 1 !important; margin: 0 !important; } }

/* 홈 · 관리자 링크 */
.admin-link { display: inline-block; margin-top: 1rem; padding: .55rem 1rem; border: 2px solid currentColor; border-radius: 10px; color: inherit; font-weight: 700; text-decoration: none; opacity: .75; }
.admin-link:hover, .admin-link:focus-visible { opacity: 1; }

/* 관리자 · 프로토 탭도 로또처럼 위아래 배치 (조정칸 아래에 용지) */
.admin-page.tab-proto { grid-template-columns: 1fr; }
.admin-page.tab-proto > .omr-print.preview { position: static; justify-self: center; margin: 0 1rem 2rem; zoom: 1.5; }
@media (max-width: 800px) { .admin-page.tab-proto > .omr-print.preview { zoom: 1.1; } }
@media print { .admin-page > .omr-print.preview { zoom: 1 !important; margin: 0 !important; } }

/* 관리자 · 로또 미리보기도 프로토처럼 세로 */
.admin-page.tab-lotto > .lt-print.preview { zoom: 1.5; max-width: none; }
@media (max-width: 1100px) { .admin-page.tab-lotto > .lt-print.preview { zoom: 1.5; } }
@media (max-width: 800px) { .admin-page.tab-lotto > .lt-print.preview { zoom: 1.1; } }

/* 관리자 · 미리보기 용지를 페이지 오른쪽에 (스크롤해도 따라옴) */
.admin-page.tab-proto, .admin-page.tab-lotto { grid-template-columns: minmax(0, 1fr) auto; }
.admin-page.admin-page > .omr-print.preview, .admin-page.admin-page > .lt-print.preview { grid-column: 2; position: sticky; top: calc(var(--top-h, 82px) + .8rem); align-self: start; justify-self: end; margin: 1.5rem 1.5rem 1.5rem 0; zoom: 1.1; max-width: none; }
@media (max-width: 1000px) {
  .admin-page.tab-proto, .admin-page.tab-lotto { grid-template-columns: 1fr; }
  .admin-page.admin-page > .omr-print.preview, .admin-page.admin-page > .lt-print.preview { grid-column: 1; position: static; justify-self: center; margin: 0 1rem 2rem; zoom: 1; }
}
@media print { .admin-page.admin-page > .omr-print.preview, .admin-page.admin-page > .lt-print.preview { position: absolute !important; top: 0 !important; left: 0 !important; zoom: 1 !important; margin: 0 !important; } }

/* 관리자 · 위치 조정 줄: 입력값 옆 초기값(흐리게) + 잠금 버튼 */
.admin-page .calib-row { grid-template-columns: minmax(6.5em, 1fr) auto minmax(4.5em, 2fr) auto 5em 3.2em auto; }
.admin-page .calib-default { font-weight: 700; text-align: right; opacity: .4; font-variant-numeric: tabular-nums; }
.admin-page .lock-btn { min-height: 44px; padding: 0 .7rem; font: inherit; font-size: .9rem; font-weight: 800; border-radius: var(--r-sm, 8px); border: 1.5px solid var(--line, #ccc); background: var(--surface, #fff); color: var(--ink, #222); cursor: pointer; }
.admin-page .lock-btn[aria-pressed=true] { background: var(--ink, #222); color: #fff; border-color: var(--ink, #222); }
.admin-page .calib-row.locked label, .admin-page .calib-row.locked input, .admin-page .calib-row.locked .icon-btn { opacity: .45; }
@media (max-width: 560px) { .admin-page .calib-row { grid-template-columns: auto 1fr auto 4.5em; } .admin-page .calib-default { grid-column: 3; } .admin-page .lock-btn { grid-column: 4; } }
.admin-page.admin-page .work { display: block; max-width: 820px; }
.admin-page .bg-toggle-row { margin-top: .6rem; align-items: center; }
.admin-page .bg-toggle-row[hidden] { display: none; }
.admin-page #bgToggle[aria-pressed=true] { background: var(--ink, #222); color: #fff; }
.admin-page .line-row .line-label { font-weight: 700; margin-left: .4rem; }
.admin-page .line-row input[type=range] { width: 9rem; accent-color: var(--c, #0b7a75); min-height: 44px; }
.admin-page .line-row .icon-btn { min-width: 44px; min-height: 44px; font-size: 1.3rem; font-weight: 800; }
.admin-page .line-row output { min-width: 4.5em; font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-page #lineToggle[aria-pressed=true] { background: var(--ink, #222); color: #fff; }
.admin-page .line-row :disabled { opacity: .4; }
.admin-page .line-row { flex-wrap: wrap; row-gap: .4rem; }

/* ── 회원: 상단 메뉴 ── */
.acct { display: flex; align-items: center; gap: .3rem; margin-left: auto; margin-right: .6rem; flex-wrap: wrap; }
.acct a, .acct button { font: inherit; font-size: .85rem; font-weight: 700; color: var(--ink); text-decoration: none; padding: .45rem .75rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; }
.acct a:hover, .acct button:hover { background: var(--surface); }
.acct .acct-join { background: var(--ink); color: var(--paper); }
.acct .acct-join:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.acct-name { font-size: .85rem; font-weight: 700; padding: 0 .3rem; }
.acct-badge { font-size: .7rem; font-weight: 800; padding: .15rem .5rem; border-radius: 99px; background: var(--blue-tint); color: var(--blue); }
.acct-badge.wait { background: var(--red-tint); color: var(--red); }
@media (max-width: 640px) { .top-in { flex-wrap: wrap; } .acct { order: 3; width: 100%; margin: .2rem 0 .4rem; } }

/* ── 회원: 로그인·가입 화면 ── */
.auth-wrap { max-width: 34rem; padding-top: 1.6rem; padding-bottom: 3rem; }
.auth-form { display: grid; gap: 1.1rem; }
.auth-form .field { display: grid; gap: .4rem; margin: 0; border: 0; padding: 0; }
.auth-form label, .auth-form legend { font-weight: 800; font-size: 1rem; }
.auth-form label small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; margin-left: .3rem; }
.auth-form input:not([type=radio]):not([type=checkbox]) { font: inherit; font-size: 1.15rem; min-height: 3.2rem; padding: 0 .9rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); width: 100%; }
.auth-form input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.auth-form .field.bad input { border-color: var(--red); }
.auth-form .type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.auth-form .type-pick legend { grid-column: 1 / -1; margin-bottom: .4rem; }
.auth-form .pick { display: block; cursor: pointer; }
.auth-form .pick input { position: absolute; opacity: 0; }
.auth-form .pick span { display: grid; gap: .2rem; height: 100%; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: var(--r-md); font-weight: 500; font-size: .85rem; color: var(--ink-soft); }
.auth-form .pick span b { font-size: 1.1rem; color: var(--ink); }
.auth-form .pick input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
.auth-form .pick input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.auth-form .store-fields { display: grid; gap: 1.1rem; padding: 1.1rem; border-radius: var(--r-md); background: var(--surface); }
.auth-form .store-fields[hidden] { display: none; }
.auth-form .store-fields h3 { margin: 0; font-size: 1.05rem; }
.auth-form .check { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.auth-form .check input { width: 1.6rem; height: 1.6rem; accent-color: var(--ink); }
.auth-form .hint { margin: 0; font-size: .8rem; color: var(--ink-soft); }
.auth-form .form-msg { margin: 0; min-height: 1.4em; font-weight: 700; color: var(--red); }
.btn-big { min-height: 3.4rem; font-size: 1.15rem; width: 100%; justify-content: center; }
.auth-alt { margin: 0; text-align: center; color: var(--ink-soft); }
.auth-alt a { color: var(--ink); font-weight: 800; }
.auth-off { padding: .9rem 1rem; border-radius: var(--r-sm); background: var(--red-tint); color: var(--ink); font-weight: 700; }
.auth-done { display: grid; gap: .8rem; padding: 1.4rem; border-radius: var(--r-md); background: var(--surface); }
.auth-done h3, .auth-done p { margin: 0; }

/* ── 관리자 · 회원 관리 ── */
.admin-page.tab-members { grid-template-columns: 1fr; }
.admin-page.tab-members > .omr-print, .admin-page.tab-members > .lt-print { display: none !important; }
.admin-page.tab-members .work { max-width: 1100px; }
.mem-table-wrap { overflow-x: auto; }
.mem-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .6rem; }
.mem-table th, .mem-table td { text-align: left; vertical-align: top; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.mem-table th { font-size: .78rem; color: var(--ink-soft); }
.mem-st { font-weight: 800; }
.mem-st.pending { color: var(--red); }
.mem-st.active { color: var(--blue); }
.mem-st.rejected { color: var(--ink-soft); text-decoration: line-through; }
.mem-acts { white-space: nowrap; }
.mem-acts .btn { min-height: 40px; padding: 0 .8rem; margin: 0 .2rem .2rem 0; }

/* 보기 설정(글자 크기·검은 화면) 가림 — 기본 '보통'으로 고정 (common.js VIEW_TOOLS) */
.top .tools { display: none; }
.top .acct { margin-right: 0; }
@media (max-width: 640px) { .top .top-in { flex-wrap: nowrap; } .top .acct { order: 0; width: auto; margin: 0 0 0 auto; } .top .acct a, .top .acct button { padding: .4rem .6rem; } }

/* ── 홈 용지 카드: 로또 당첨번호 · 프로토 회차 ── */
.ticket-info { display: grid; gap: .35rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.ticket-info[hidden] { display: none; }
.ticket-info .ti-head { font-weight: 800; font-size: .95rem; color: var(--ink); }
.ticket-info .ti-head small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; margin-left: .2rem; }
.ticket-info .ti-line { font-size: .85rem; color: var(--ink-soft); }
.ticket-info .ti-line b { color: var(--ink); }
.ti-balls { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.ti-balls .ball { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-weight: 800; font-size: .95rem; color: #fff; text-shadow: 0 1px 1px rgb(0 0 0 / .25); }
.ti-balls .ball[data-ball="1"] { background: #fbc400; }
.ti-balls .ball[data-ball="2"] { background: #69c8f2; }
.ti-balls .ball[data-ball="3"] { background: #ff7272; }
.ti-balls .ball[data-ball="4"] { background: #aaaaaa; }
.ti-balls .ball[data-ball="5"] { background: #b0d840; }
.ti-plus { color: var(--ink-soft); font-weight: 800; margin: 0 .1rem; }
.ti-state { font-size: .72rem; font-weight: 800; padding: .1rem .5rem; border-radius: 99px; background: var(--surface); color: var(--ink-soft); vertical-align: 1px; }
.ti-state.on { background: var(--blue-tint); color: var(--blue); }
@media (max-width: 420px) { .ti-balls { gap: .22rem; } .ti-balls .ball { width: 1.75rem; height: 1.75rem; font-size: .8rem; } .ti-plus { margin: 0; } }

/* ── 홈: 판매점 지도 ── */
.store-map { padding: 2.4rem 0 0; }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.map-head h2 { margin: 0; }
.map-legend { list-style: none; display: flex; gap: 1.1rem; flex-wrap: wrap; margin: .8rem 0; padding: 0; font-size: .85rem; color: var(--ink-soft); }
.map-legend li { display: flex; align-items: center; gap: .4rem; }
.map-legend small { font-size: .75rem; }
.near-dot { width: .95rem; height: .95rem; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; display: inline-block; }
.near-dot.nd-me { background: #d4442a; }
.near-dot.nd-store { background: #0d8291; }
.near-dot.nd-shop { background: #b07c00; }
.map-box { height: 420px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); overflow: hidden; background: var(--surface); z-index: 0; }
.map-box .leaflet-popup-content { font-family: var(--font); font-size: 15px; line-height: 1.5; }
.map-box .leaflet-popup-content a { font-weight: 800; }
.near-list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .4rem; }
.near-item { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; min-height: 3rem; font: inherit; color: var(--ink); text-align: left; background: var(--paper); border: 0; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.near-item:hover { background: var(--surface); }
.near-name { flex: 1; font-weight: 700; }
.near-name small { font-weight: 700; font-size: .72rem; color: var(--blue); margin-left: .3rem; }
.near-d { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.near-none { color: var(--ink-soft); }
@media (max-width: 640px) { .map-box { height: 320px; } }
/* 가입: 판매점 위치 고르기 */
.auth-form .pick-label { font-weight: 800; }
.auth-form .pick-label small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; display: block; }
.auth-form .pick-map { height: 260px; border-radius: var(--r-md); }
.auth-form .row-btns { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.store-map[hidden] { display: none; }

/* ── 경기 찾기: 잘리는 버튼 없이 모두 보이게 (가로 스크롤 대신 줄바꿈) ──
   1줄: 종목 · 발매 가능만 · 이전/다음   2줄~: 국가 */
#protoNav.proto-nav { flex-wrap: wrap; row-gap: .35rem; }
#protoNav .pn-sports { order: 1; flex: 0 1 auto; flex-wrap: wrap; overflow: visible; min-width: 0; }
#protoNav .pn-open { order: 2; }
#protoNav .pn-move { order: 3; margin-left: auto; }
#protoNav .pn-countries { order: 4; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; min-width: 0; padding: .35rem 0 0; border-left: 0; border-top: 1px solid var(--line); }

/* ── 경기 목록: 고른 경기는 카드 배경을 종목 색으로 칠해 확실히 표시 ── */
.match-group.has-pick {
  background: color-mix(in srgb, var(--sport) 16%, var(--paper));
  box-shadow: 0 0 0 3px var(--sport), inset 8px 0 0 var(--sport);
}
.match-group.has-pick .bet-table tbody tr.is-picked > * { background: color-mix(in srgb, var(--sport) 30%, var(--paper)); }
.match-group.has-pick .match-head::after {
  content: '✓ 고른 경기'; order: 9; margin-left: .5rem; padding: .12rem .6rem; border-radius: 99px;
  background: var(--sport); color: #fff; font-size: .78rem; font-weight: 800; white-space: nowrap;
}
html[data-contrast="high"] .match-group.has-pick { background: #1d1d1d; box-shadow: 0 0 0 3px #fff, inset 8px 0 0 #fff; }

/* ── 곧 마감: 경기 카드 맨 위에 넓은 띠로 크게 ── */
.match-group .match-head .mg-deadline {
  order: -1; flex: 1 1 100%; justify-content: center; gap: .45rem;
  font-size: 1rem; font-weight: 800; padding: .5rem .9rem; margin: 0 0 .35rem; border-radius: var(--r-sm);
  background: #ffe7b3; color: #6b4300; box-shadow: inset 0 0 0 1.5px #f0b44c;
}
.match-group.is-urgent .match-head .mg-deadline { background: #d6302b; color: #fff; box-shadow: none; font-size: 1.05rem; }
.match-group .match-head .mg-deadline::before { width: .6rem; height: .6rem; }

/* ── 로또: 미니맵을 한 줄로 작게 줄여 위에 붙여 둠 → 번호 고르는 용지와 한 화면에 ──
   [로고 / 인쇄]  [A B C D E 작은 게임]  [+ 삭제 / 용지 번호] */
.lotto .minimap {
  position: sticky; top: calc(var(--top-h, 72px) + .4rem); z-index: 15;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "timing logo games tools" "timing lprint games icons" "timing lprintall games icons";
  align-items: center; gap: .25rem .7rem; padding: .45rem .7rem .45rem .55rem;
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -18px rgb(0 0 0 / .45);
}
.lotto .minimap .timing { grid-row: 1 / 4; }
.lotto .minimap-games { grid-template-columns: repeat(5, minmax(0, 64px)); justify-content: center; gap: .3rem; }
.lotto .minimap .mm-game { padding: .12rem; gap: 1px; }
.lotto .minimap .mm-logo { font-size: .95rem; white-space: nowrap; }
.lotto .minimap #lmPrint, .lotto .minimap #lmPrintAll { min-height: 30px; padding: 0 .55rem; font-size: .78rem; white-space: nowrap; }
.lotto .minimap .sheet-tools { justify-self: end; }
.lotto .minimap .sheet-tools .icon-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
.lotto .minimap-head .sheet-icons { min-height: 0; justify-self: end; max-width: 9rem; }
/* 번호 칸을 조금 낮게 → 용지 전체 높이 줄임 */
.lotto .slip-numbers { grid-template-columns: repeat(7, minmax(0, 2.6rem)); row-gap: .32rem; }
.lotto .slip-num { aspect-ratio: 3 / 3.4; }
.lotto .page-head .wrap { padding-block: .7rem 1rem; }
.lotto .page-head h2 { font-size: 2rem; }
@media (max-width: 640px) {
  .lotto .minimap { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "timing logo tools" "timing games games" "timing lprint icons"; }
  .lotto .minimap #lmPrintAll { display: none; }
  .lotto .minimap-games { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lotto .page-head p { display: none; }
}
/* 상단 회원 메뉴가 두 줄로 쌓이지 않게 */
.acct { flex-wrap: nowrap; }
@media (max-width: 420px) { .top .logo-domain { display: none; } }
@media (min-width: 641px) and (max-height: 760px) { .lotto .slip-num { aspect-ratio: 3 / 3; } .lotto .slip-numbers { row-gap: .25rem; } }

/* ── 로또 미니맵: 다 칠한 게임(번호 6개 또는 자동)은 초록으로 구분 ── */
.mm-game.is-done { background: #bfe6cb; box-shadow: inset 0 0 0 2.5px #1f8a4c; }
.mm-game.is-done .mm-tab { background: #1f8a4c; }
.mm-game.is-done .mm-grid i.on { background-color: #1f8a4c; --bc: #1f8a4c; }
.mm-game.is-done.is-current { background: #bfe6cb; box-shadow: inset 0 0 0 2.5px var(--red), 0 0 0 2px #1f8a4c; }
html[data-contrast="high"] .mm-game.is-done { background: #0f2a17; }

/* 로또 미니맵: 용지 번호를 게임 A~E 바로 아래로 */
.lotto .minimap { grid-template-areas: "timing logo games tools" "timing lprint games tools" "timing lprintall icons tools"; }
.lotto .minimap-head .sheet-icons { justify-self: center; max-width: none; justify-content: center; }
.lotto .minimap .sheet-tools { align-self: start; }
@media (max-width: 640px) {
  .lotto .minimap { grid-template-areas: "timing logo tools" "timing games games" "timing icons icons" "timing lprint lprint"; }
  .lotto .minimap .minimap-head .sheet-icons { justify-self: center; }
  .lotto .minimap #lmPrint { justify-self: start; }
}

/* 로또: 지금 게임을 다 칠하면 용지·고른 번호 줄도 초록 배경 */
.lotto .slip-game.is-done { background: #dff2e5; box-shadow: 0 0 0 3px #1f8a4c; }
.lotto .slip-game.is-done .slip-tab { background: #1f8a4c; }
.lotto .picked.is-done { background: #dff2e5; box-shadow: inset 0 0 0 2px #1f8a4c; }
.lotto .picked.is-done .picked-label, .lotto .picked.is-done #pickedCount { color: #1f8a4c; }
.lotto .picked.is-done #pickedCount::after { content: ' 완성'; font-weight: 800; }
html[data-contrast="high"] .lotto .slip-game.is-done, html[data-contrast="high"] .lotto .picked.is-done { background: #0f2a17; }

/* ── 저장 용지 · 가맹점 출력 ─────────────────────── */
.btn-save {
  width: 100%; margin-top: .7rem; min-height: 64px; flex-direction: column; gap: .15rem; padding: .7rem 1rem;
  border-radius: var(--r-lg); background: var(--t); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); line-height: 1.25;
}
.btn-save b { font-size: 1.05rem; }
.btn-save small { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.btn-save:hover:not(:disabled) { background: color-mix(in srgb, var(--t) 70%, var(--c) 12%); }
.btn-save:disabled, .btn-save:disabled:hover { background: var(--t); }

.save-dlg { border: 0; border-radius: var(--r-lg); padding: 1.6rem 1.4rem 1.3rem; width: min(26rem, calc(100vw - 2rem)); text-align: center; background: var(--paper); color: var(--ink); }
.save-dlg::backdrop { background: rgb(0 0 0 / 55%); }
.save-dlg h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.save-what { margin: 0 0 1rem; color: var(--ink-soft); font-size: .9rem; }
.save-label { margin: 0; font-weight: 700; font-size: .9rem; }
.save-code { margin: .3rem 0 .4rem; font-size: 3rem; font-weight: 900; letter-spacing: .08em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.save-until { margin: 0 0 1.2rem; font-size: .85rem; color: var(--ink-soft); }
.save-btns { display: flex; gap: .5rem; }
.save-btns .btn { flex: 1; min-height: 52px; }
.save-btns .save-close { background: var(--ink); color: var(--paper); box-shadow: none; }

.saved-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .7rem; }
.saved-item {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "kind code" "title title" "meta meta" "btns btns";
  gap: .2rem .7rem; align-items: center; padding: 1rem 1.1rem; border-radius: var(--r-md); background: var(--surface);
  border-left: 6px solid var(--red);
}
.saved-item.proto { border-left-color: var(--blue); }
.si-kind { grid-area: kind; font-size: .8rem; font-weight: 800; padding: .15rem .6rem; border-radius: 99px; background: var(--red-tint); color: var(--red); }
.saved-item.proto .si-kind { background: var(--blue-tint); color: var(--blue); }
.si-code { grid-area: code; font-size: 1.9rem; font-weight: 900; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.si-title { grid-area: title; font-weight: 700; }
.si-meta { grid-area: meta; font-size: .82rem; color: var(--ink-soft); }
.si-btns { grid-area: btns; display: flex; gap: .4rem; margin-top: .4rem; }
.si-btns .btn { min-height: 46px; font-size: .85rem; flex: 1; }
.saved-go { display: flex; gap: .5rem; flex-wrap: wrap; }
.saved-go .btn { flex: 1; }

.code-form { margin-top: .5rem; }
.code-form label { display: block; font-weight: 800; margin-bottom: .4rem; }
.code-row { display: flex; gap: .5rem; }
.code-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 2.2rem; font-weight: 900; letter-spacing: .1em; text-align: center;
  padding: .4rem .6rem; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums;
}
.code-row input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.code-row .btn { min-width: 7rem; }
.saved-result { margin-top: 1rem; padding: 1.1rem; border-radius: var(--r-lg); background: var(--surface); --c: var(--red); --t: var(--red-tint); }
.saved-result.proto { --c: var(--blue); --t: var(--blue-tint); }
.sr-head h3 { margin: 0; font-size: 1.15rem; color: var(--c); }
.sr-head p { margin: .2rem 0 .6rem; font-size: .88rem; color: var(--ink-soft); }
.sr-printed { color: var(--red); }
.sr-warn { margin: 0 0 .6rem; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--red-tint); color: var(--red); font-weight: 700; font-size: .88rem; }
.sr-sheets { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sr-sheets > li { background: var(--paper); border-radius: var(--r-md); padding: .6rem .8rem; }
.sr-no { font-weight: 800; font-size: .85rem; color: var(--c); }
.sr-sheets ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .25rem; }
.sr-sheets ul li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .9rem; }
.sr-sheets ul li > b { min-width: 2.2rem; }
.sr-sheets .ball { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--t); color: var(--c); font-weight: 800; font-size: .85rem; }
.sr-sheets .tag { font-size: .75rem; font-weight: 800; padding: .1rem .5rem; border-radius: 99px; background: var(--c); color: #fff; }
.sr-amt { display: block; margin-top: .3rem; font-size: .82rem; color: var(--ink-soft); }
.saved-result .btn-print { margin-top: 1rem; }

@media (max-width: 560px) {
  .acct a, .acct button { padding: .4rem .45rem; font-size: .78rem; }
  .acct .acct-name { display: none; }
  .save-code { font-size: 2.5rem; }
}

/* ── 미니맵 줄이기: 위에 붙은 미니맵이 화면 높이의 40%를 넘으면(갤럭시 Z 접는 폰 등) 20% 안으로 ──
   html.mm-compact 는 common.js 가 화면 크기를 재서 붙입니다.
   한 줄: 인쇄 · 전체 인쇄 · 용지 번호 · (프로토) 고른 수 · 추가/삭제
   둘째 줄: 게임/경기 칸 (프로토는 10칸 한 줄, 번호 칸은 숨기고 승무패만) */
html.mm-compact .minimap {
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto !important;
  grid-template-areas: "timing print printall sheets count tools" "timing games games games games games" !important;
  gap: .25rem .4rem !important; padding: .35rem .5rem .4rem .4rem !important;
}
html.mm-compact .minimap .timing { grid-row: 1 / 3 !important; }
html.mm-compact .minimap .mm-logo { display: none !important; }
html.mm-compact .minimap .mm-print, html.mm-compact .minimap #lmPrint, html.mm-compact .minimap #mmPrint { grid-area: print !important; }
html.mm-compact .minimap .mm-print-all, html.mm-compact .minimap #lmPrintAll, html.mm-compact .minimap #mmPrintAll { grid-area: printall !important; }
html.mm-compact .minimap .mm-print { min-height: 34px !important; padding: 0 .45rem !important; font-size: 0 !important; gap: .2rem; }
html.mm-compact .minimap .mm-print-all span { font-size: .7rem; }
html.mm-compact .minimap .sheet-icons, html.mm-compact .minimap .pm-sheets {
  grid-area: sheets !important; margin: 0 !important; align-self: center;
  flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; min-width: 0;
}
html.mm-compact .minimap .sheet-icons > * { flex: none; }
html.mm-compact .minimap .pm-count { display: none !important; }   /* 고른 수는 칸이 채워진 것으로 보임 */
html.mm-compact .minimap .sheet-tools { grid-area: tools !important; align-self: center; gap: .2rem !important; }
html.mm-compact .minimap .icon-btn { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; }
html.mm-compact .minimap .minimap-games { grid-area: games !important; gap: .25rem !important; }
html.mm-compact .minimap .mm-game { padding: .15rem !important; }
html.mm-compact .minimap .pm-slots {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important; grid-auto-flow: row !important; grid-auto-columns: auto !important;
  overflow: visible !important; gap: .15rem !important; padding-bottom: 0 !important;
}
html.mm-compact .minimap .pick-slot {
  height: 2.3rem !important; min-height: 0 !important; padding: .15rem .1rem !important;
  grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto auto !important; row-gap: 2px !important; justify-items: center;
}
html.mm-compact .minimap .pick-slot:disabled::after { inset: 3px; }
html.mm-compact .minimap .ps-no { align-self: center; min-width: .95rem; height: .95rem; font-size: .55rem; }
html.mm-compact .minimap .ps-home, html.mm-compact .minimap .ps-away, html.mm-compact .minimap .ps-type, html.mm-compact .minimap .ps-pick b { display: none !important; }
html.mm-compact .minimap .ps-foot { justify-content: center; }
html.mm-compact .minimap .ps-pick { padding: 0 .25rem; font-size: .62rem; }
/* 그래도 20%를 넘으면 게임 칸 줄도 숨김 (용지 번호·인쇄 줄만) */
html.mm-compact.mm-compact-2 .minimap { grid-template-areas: "timing print printall sheets count tools" !important; }
html.mm-compact.mm-compact-2 .minimap .minimap-games { display: none !important; }
html.mm-compact.mm-compact-2 .minimap .timing { grid-row: 1 / 2 !important; }

/* ── 프로토 필터(종목·국가·발매 가능) 접기/펴기 버튼: 모든 화면에서 ── */
.proto-nav .pn-toggle {
  order: 0; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; min-height: 2.4rem; min-width: 0; max-width: calc(100% - 7.6rem);
  padding: 0 .8rem; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 800;
  background: var(--ink); color: var(--paper);
}
.proto-nav .pn-toggle .pn-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; opacity: .85; }
.proto-nav .pn-toggle .pn-caret { flex: none; transition: transform .15s; transform: rotate(180deg); }
.proto-nav.is-folded .pn-toggle .pn-caret { transform: none; }
.proto-nav .pn-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.proto-nav.is-folded .pn-sports, .proto-nav.is-folded .pn-countries, .proto-nav.is-folded .pn-open { display: none !important; }
.proto-nav .pn-move { order: 0 !important; margin-left: auto; }
.proto-nav.is-folded { row-gap: 0; }
/* 펼쳤을 때: 필터 버튼·이동 버튼 줄 아래에 종목 → 국가 → 발매 가능 */
.proto-nav:not(.is-folded) .pn-sports { order: 1 !important; flex: 1 1 100% !important; flex-wrap: wrap; overflow: visible; }
.proto-nav:not(.is-folded) .pn-countries { order: 2 !important; flex: 1 1 100% !important; flex-wrap: wrap; overflow: visible; padding-left: 0; border-left: 0; }
.proto-nav:not(.is-folded) .pn-open { order: 3 !important; }
@media (prefers-reduced-motion: reduce) { .proto-nav .pn-toggle .pn-caret { transition: none; } }

/* 개발 단계 안내 띠 (account.js, 서버 DEV_NOTICE) */
.dev-notice { background: var(--blue-tint); border-bottom: 1px solid var(--line); color: var(--ink); }
.dev-notice .wrap { display: flex; align-items: flex-start; gap: .6rem; padding-top: .7rem; padding-bottom: .7rem; font-size: .85rem; line-height: 1.5; font-weight: 600; }
.dev-tag { flex: none; font-size: .7rem; font-weight: 800; color: var(--paper); background: var(--blue); padding: .15rem .5rem; border-radius: 6px; margin-top: .1rem; }
.link-btn { background: none; border: 0; padding: .3rem 0; color: var(--ink-soft); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; }
.auth-form[hidden], .link-btn[hidden] { display: none !important; }
#signupMsg { white-space: pre-line; }

/* 문의 게시판 (inquiry.html) */
.inq-wrap { padding-bottom: 2rem; }
.inq-top { margin-bottom: .8rem; }
.inq-filter { margin-bottom: .8rem; }
.inq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.inq-item { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "st title" "meta meta"; gap: .25rem .7rem; align-items: center;
  padding: .9rem 1.1rem; border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-decoration: none; border-left: 6px solid var(--red); }
.inq-item.answered { border-left-color: var(--blue); }
.inq-item.closed { border-left-color: var(--line); opacity: .8; }
.inq-item:hover .inq-title { text-decoration: underline; }
.inq-st { grid-area: st; font-size: .75rem; font-weight: 800; padding: .15rem .6rem; border-radius: 99px; background: var(--red-tint); color: var(--red); white-space: nowrap; }
.inq-st.answered { background: var(--blue-tint); color: var(--blue); }
.inq-st.closed { background: var(--line); color: var(--ink-soft); }
.inq-title { grid-area: title; font-weight: 700; overflow-wrap: anywhere; }
.inq-meta { grid-area: meta; font-size: .8rem; color: var(--ink-soft); }
.inq-form textarea, .inq-reply textarea { font: inherit; font-size: 1.05rem; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); width: 100%; resize: vertical; }
.inq-form textarea:focus-visible, .inq-reply textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.inq-detail { display: grid; gap: .9rem; }
.inq-detail > .btn { justify-self: start; }
.inq-head h3 { margin: .4rem 0 .2rem; font-size: 1.3rem; overflow-wrap: anywhere; }
.inq-head .inq-meta { margin: 0; }
.inq-body { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem 1.1rem; border-radius: var(--r-md); background: var(--surface); line-height: 1.6; }
.inq-sub { margin: .6rem 0 0; font-size: 1rem; }
.inq-replies { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.inq-reply-item { padding: .8rem 1rem; border-radius: var(--r-md); border: 1.5px solid var(--line); }
.inq-reply-item.by-admin { background: var(--blue-tint); border-color: transparent; }
.inq-who { font-weight: 800; margin-right: .5rem; }
.inq-reply-item.by-admin .inq-who { color: var(--blue); }
.inq-when { font-size: .78rem; color: var(--ink-soft); }
.inq-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .3rem; line-height: 1.6; }
.inq-none { color: var(--ink-soft); font-size: .9rem; }
.inq-form[hidden], .inq-detail[hidden], #inqListView[hidden], .inq-reply[hidden], .inq-filter[hidden], .inq-admin[hidden] { display: none !important; }
/* 좁은 화면: 로그인 메뉴가 많을 때(관리자·가맹점) 줄바꿈 */
@media (max-width: 640px) {
  .top .acct { flex-wrap: wrap; justify-content: flex-end; row-gap: .15rem; min-width: 0; flex: 1 1 auto; }
  .top .acct a, .top .acct button, .top .acct .acct-name { white-space: nowrap; }
  .top .acct a, .top .acct button { padding: .35rem .45rem; font-size: .8rem; }
}

/* 관리자: 기기 전용 용지 위치 */
.device-box { padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: var(--r-md); background: var(--blue-tint); }
.device-box h4, .calib-box h4 { margin: 0 0 .3rem; font-size: 1rem; }
.device-box h4 small, .calib-box h4 small { font-weight: 500; color: var(--ink-soft); font-size: .78rem; margin-left: .3rem; }
.device-box .calib-hint { margin-top: 0; }
.device-box .row-btns { margin-top: .5rem; }
.mem-table tr.dev-this td { background: var(--blue-tint); }

/* 로또: 번호 목록 붙여넣기 */
.text-import { margin: 1rem 0; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); background: var(--paper); }
.text-import > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 800; list-style: none; }
.text-import > summary::-webkit-details-marker { display: none; }
.text-import > summary::before { content: '＋'; display: inline-block; width: 1.3em; color: var(--red); }
.text-import[open] > summary::before { content: '－'; }
.text-import > summary small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; margin-left: .3rem; }
.text-import[open] { padding-bottom: 1rem; }
.text-import .ti-label, .text-import textarea, .text-import .ti-mode, .text-import .row-btns, .text-import .ti-msg { margin-left: 1.1rem; margin-right: 1.1rem; }
.text-import .ti-label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: .4rem; }
.text-import textarea { display: block; width: calc(100% - 2.2rem); font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: 1rem; line-height: 1.6; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); resize: vertical; }
.text-import textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.text-import .ti-mode { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: .6rem; font-size: .9rem; }
.text-import .row-btns { margin-top: .6rem; }
.text-import .ti-msg { font-weight: 600; margin-top: .6rem; min-height: 1.2em; }
