/* ============================================================
   마을버스 09번 — 페이지 + 게임 UI
   ============================================================ */
@font-face { font-family: 'BlackHanSans'; src: url('fonts/black-han-sans.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('fonts/pretendard-regular.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('fonts/pretendard-bold.woff2') format('woff2'); font-weight: 700 900; font-display: swap; }

:root {
  --green: #1d6b3e; --green2: #2b8a52; --green3: #58b879;
  --cream: #f6f0df; --paper: #fbf7ea; --paper2: #efe7d2;
  --ink: #1b1b18; --ink2: #4c4a42; --muted: #6f6b5e;
  --red: #c82820; --amber: #ffae1a; --line: #ded5be;
  --asphalt: #232624; --pbh: 54px;
  --shadow: 0 18px 40px rgba(27, 27, 24, .13);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: 'Pretendard', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px; line-height: 1.65; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -0.03em; }
p { margin: 0; }
.led {
  font-weight: 900; color: var(--amber);
  text-shadow: 0 0 7px rgba(255, 150, 20, .8), 0 0 1px #ffe3a8;
  letter-spacing: .04em;
}

/* ---------- 상단 바 ---------- */
.topbar { position: sticky; top: var(--pbh); z-index: 90; background: rgba(35, 38, 36, .97); color: #f3eddd; border-bottom: 2px solid #141514; }
.topbar__in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__led { display: grid; place-items: center; width: 42px; height: 34px; border-radius: 6px; background: #0d0d0c; border: 2px solid #3a3a34; font-size: 19px; }
.brand__txt { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand__txt b { color: var(--amber); margin-left: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 7px 11px; border-radius: 8px; text-decoration: none; font-size: 14.5px; font-weight: 700; color: #d8d2c2; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar__cta {
  border: 0; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 800; font-size: 14.5px;
  background: var(--green3); color: #0d2417; cursor: pointer;
}
.topbar__cta:hover { background: #7fd39a; }

/* ---------- 히어로 ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(43, 138, 82, .13), transparent 45%),
    repeating-linear-gradient(0deg, rgba(27, 27, 24, .035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(27, 27, 24, .035) 0 1px, transparent 1px 34px),
    var(--cream);
  border-bottom: 3px solid var(--ink);
}
.hero__grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.12fr .88fr; gap: 40px; padding: 42px 20px 56px; align-items: start; }
.kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .16em; color: var(--green); }
.hero__title { margin: 14px 0 16px; }
.hero__title-main { display: block; font-size: clamp(40px, 4.8vw, 62px); font-weight: 900; line-height: 1.02; color: var(--ink); }
.hero__title-top { display: block; font-size: 26px; font-weight: 800; color: var(--ink2); letter-spacing: -0.02em; }
.hero__title-top em { font-style: normal; color: var(--red); font-family: 'BlackHanSans', sans-serif; font-size: 32px; }
.hero__desc { margin: 0 0 24px; font-size: 16.5px; color: var(--ink2); }
.hero__desc b { color: var(--ink); background: linear-gradient(transparent 62%, rgba(255, 174, 26, .45) 62%); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; border-radius: 12px; padding: 14px 22px; }
.btn--main { background: var(--green); color: #fff; box-shadow: 0 6px 0 #12452a, 0 14px 24px rgba(29, 107, 62, .28); font-size: 18px; }
.btn--main:hover { transform: translateY(-1px); }
.btn--main:active { transform: translateY(3px); box-shadow: 0 3px 0 #12452a; }
.btn--main span { font-size: 12px; font-weight: 700; opacity: .82; }
.btn--ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink); padding: 12px 18px; }
.hero__chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 22px 0 0; }
.hero__chips li { font-size: 12.5px; font-weight: 700; color: var(--green); background: #fff; border: 1px solid #cfe0d3; border-radius: 999px; padding: 5px 11px; }
.hero__art { position: relative; }
.poster { margin: 0; background: #fff; padding: 10px 10px 0; border: 2px solid var(--ink); border-radius: 6px; transform: rotate(1.4deg); box-shadow: 10px 12px 0 rgba(27, 27, 24, .12); }
.poster img { aspect-ratio: 4 / 5; width: 100%; max-height: min(58vh, 520px); object-fit: cover; object-position: 50% 42%; border-radius: 3px; background: #d9d2be; }
.poster figcaption { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 10px 6px 12px; }
.poster figcaption span { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .16em; }
.poster figcaption b { font-size: 12px; color: var(--muted); }
.poster figcaption i { font-style: normal; font-family: 'BlackHanSans', sans-serif; font-size: 21px; color: var(--ink); }
.stamp {
  position: absolute; right: -16px; bottom: 46px; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; border: 6px solid var(--red); color: var(--red); font-family: 'BlackHanSans', sans-serif; font-size: 54px;
  transform: rotate(-14deg); background: rgba(246, 240, 223, .85); box-shadow: 0 0 0 3px rgba(200, 40, 32, .25) inset;
}
.led-sign {
  position: absolute; z-index: 2; left: -10px; top: -26px; display: grid; gap: 2px; padding: 10px 14px;
  background: #0c0c0b; border: 3px solid #34342e; border-radius: 8px; color: var(--amber);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transform: rotate(-2deg);
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .5) 0 1px, transparent 1px 3px);
}
.led-sign__no { font-size: 34px; font-weight: 900; line-height: 1; text-shadow: 0 0 8px rgba(255, 160, 30, .9); }
.led-sign__route { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.led-sign__small { font-size: 9px; letter-spacing: .3em; opacity: .8; }

/* ---------- 섹션 공통 ---------- */
.sec { padding: 64px 20px; }
.sec--alt { background: var(--paper2); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.sec__head { max-width: 1080px; margin: 0 auto 28px; }
.sec__kick { font-size: 12px; font-weight: 800; letter-spacing: .18em; color: var(--green); margin-bottom: 8px; }
.sec__title { font-family: 'BlackHanSans', sans-serif; font-size: clamp(24px, 3.4vw, 38px); font-weight: 400; }
.sec__sub { margin-top: 10px; color: var(--ink2); font-size: 15.5px; max-width: 760px; }

/* ---------- 왜 어려운가 ---------- */
.why { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.why__card { background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 20px; box-shadow: 6px 6px 0 rgba(27, 27, 24, .07); }
.why__ico { font-size: 26px; line-height: 1; margin-bottom: 10px; }
.why__card h3 { font-size: 17.5px; margin-bottom: 8px; }
.why__card p { font-size: 14px; color: var(--ink2); }
.why__card b { color: var(--ink); }
.why__svg { width: 100%; height: auto; margin-top: 12px; }

/* ---------- 코스 ---------- */
.courses { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.course {
  position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 20px; cursor: pointer;
  box-shadow: 7px 7px 0 rgba(27, 27, 24, .08); transition: transform .15s;
}
.course:hover { transform: translate(-2px, -2px); }
.course__no {
  display: inline-grid; place-items: center; min-width: 54px; height: 40px; padding: 0 10px; border-radius: 6px;
  background: #0d0d0c; color: var(--amber); font-weight: 900; font-size: 18px; letter-spacing: .06em;
}
.course__name { margin: 12px 0 4px; font-family: 'BlackHanSans', sans-serif; font-size: 23px; font-weight: 400; }
.course__desc { font-size: 13.5px; color: var(--ink2); min-height: 58px; }
.course__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.course__meta span { font-size: 11.5px; font-weight: 700; background: var(--cream); border-radius: 999px; padding: 4px 9px; color: var(--ink2); }
.course__diff { position: absolute; right: 16px; top: 20px; font-size: 11px; color: var(--muted); font-weight: 800; }
.course__diff i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d8d0bb; margin-left: 3px; }
.course__diff i.on { background: var(--red); }
.course__best { margin-top: 12px; font-size: 12.5px; font-weight: 800; color: var(--green); }
.course__lock { position: absolute; inset: 0; border-radius: 10px; background: rgba(246, 240, 223, .8); display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.best-line { max-width: 1080px; margin: 16px auto 0; font-size: 13.5px; color: var(--ink2); }

/* ---------- 조작법 ---------- */
.howto { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.howto__col { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 22px; }
.howto__col h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.howto__col h3 span { font-size: 11px; background: var(--green); color: #fff; padding: 4px 8px; border-radius: 5px; letter-spacing: .1em; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.keys li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.keys span { color: var(--ink2); margin-left: 4px; }
kbd {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px;
  background: #f4efe1; border: 1px solid #c9c0a9; border-bottom-width: 3px; border-radius: 6px;
  font: inherit; font-size: 12.5px; font-weight: 800; color: var(--ink);
}
.keys--touch b { min-width: 84px; font-size: 13px; color: var(--green); }
.howto__note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.tips3 { max-width: 1080px; margin: 18px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tips3 div { border-left: 4px solid var(--amber); padding: 2px 0 2px 12px; }
.tips3 b { font-size: 14px; }
.tips3 p { font-size: 13px; color: var(--ink2); margin-top: 3px; }

/* ---------- 등급 ---------- */
.ranks { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; align-items: start; }
.rank-table { width: 100%; border-collapse: collapse; background: #fff; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; font-size: 13.5px; }
.rank-table caption { caption-side: top; text-align: left; font-size: 12px; color: var(--muted); padding-bottom: 8px; }
.rank-table th, .rank-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.rank-table th { background: var(--green); color: #fff; font-size: 12.5px; letter-spacing: .06em; }
.rank-table tr:last-child td { border-bottom: 0; }
.rk { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--red); color: var(--red); font-family: 'BlackHanSans', sans-serif; font-size: 16px; }
.rk--f { border-color: #7a7a72; color: #7a7a72; }
.titles { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 20px; }
.titles h3 { font-size: 17px; margin-bottom: 12px; display: flex; justify-content: space-between; }
.titles h3 span { font-size: 12px; color: var(--muted); font-weight: 700; }
.titles ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.titles li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; font-size: 13.5px; }
.titles li b { font-weight: 800; }
.titles li i { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }

/* ---------- 골목 상식 ---------- */
.know { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.know article { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.know h3 { font-size: 16px; margin-bottom: 6px; color: var(--green); }
.know p { font-size: 13.5px; color: var(--ink2); }
.folds { max-width: 1080px; margin: 22px auto 0; display: grid; gap: 8px; }
.fold { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; }
.fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; font-weight: 800; font-size: 14.5px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary i { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; flex: none; }
.fold[open] summary i { transform: rotate(-135deg); }
.fold__body { padding: 0 0 14px; font-size: 13.5px; color: var(--ink2); }

/* ---------- 휴게소 ---------- */
.sec--rest { background: #fffdf5; border-top: 2px solid var(--ink); }
.rest-grid { max-width: 1080px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rest-item { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-decoration: none; transition: border-color .15s, transform .15s; }
.rest-item:hover { border-color: var(--green); transform: translateY(-2px); }
.rest-item span { font-size: 22px; }
.rest-item b { font-size: 14px; }
.rest-item i { font-style: normal; font-size: 12px; color: var(--muted); }
.rest-item em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--green); margin-top: auto; }
.coupang-dynamic-banner { max-width: 1080px; margin: 0 auto; min-height: 140px; }
.disc { max-width: 1080px; margin: 14px auto 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 형제 사이트 ---------- */
.sib-grid { max-width: 1080px; margin: 0 auto; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sib { display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.sib:hover { border-color: var(--green); transform: translateY(-2px); }
.sib span { font-size: 20px; }
.sib b { font-size: 14.5px; }
.sib i { font-style: normal; font-size: 12px; color: var(--muted); }

/* ---------- 최종 CTA ---------- */
.final-cta { padding: 70px 20px; background: var(--asphalt); color: #f3eddd; text-align: center; border-top: 3px solid #0d0e0d; }
.final-cta__in { max-width: 720px; margin: 0 auto; }
.final-cta .kicker { color: var(--green3); }
.final-cta h2 { font-family: 'BlackHanSans', sans-serif; font-size: clamp(28px, 4vw, 44px); font-weight: 400; margin: 10px 0; }
.final-cta p { color: #c9c3b3; margin-bottom: 22px; }

/* ---------- 푸터 ---------- */
.footer { background: #131411; color: #a9a496; padding: 34px 20px 44px; font-size: 12px; }
.footer__in { max-width: 1080px; margin: 0 auto; display: grid; gap: 8px; }
.footer__brand { font-weight: 800; color: #e9e3d2; letter-spacing: .08em; }
.footer__disc { color: #8f8a7c; }
.footer__fine { color: #7c786c; line-height: 1.7; }
.footer__links { display: flex; gap: 14px; margin-top: 6px; }
.footer__links a { color: #cfc9b8; text-decoration: none; }

/* ============================================================
   게임 오버레이
   ============================================================ */
.game { position: fixed; left: 0; right: 0; bottom: 0; top: var(--pbh); z-index: 8000; background: #0e100f; color: #fff; overflow: hidden; }
.game[hidden] { display: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.game ::selection { background: transparent; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.board {
  position: absolute; left: 50%; transform: translateX(-50%); top: 10px; width: min(94vw, 470px);
  background: linear-gradient(#0b0b0a, #151514); border: 2px solid #2c2c27; border-radius: 9px;
  padding: 7px 12px 6px; box-shadow: inset 0 0 0 1px #000, 0 6px 18px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.board::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .32) 0 1px, transparent 1px 3px); pointer-events: none; }
.board__top { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.board__next { font-size: 12px; opacity: .8; color: #ffce7a; }
.board__top b { flex: 1; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
.board__dist { font-size: 15px; }
.board__bot { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 12.5px; flex-wrap: wrap; white-space: nowrap; }
.board__bot b { color: #fff2c8; }
.board__bot #bSched { flex: 1; }
#bSched.late { color: #ff5a45; }
.lamps { display: inline-flex; gap: 3px; vertical-align: middle; }
.lamps i { width: 9px; height: 9px; border-radius: 50%; background: #3a1b14; box-shadow: inset 0 0 2px #000; }
.lamps i.on { background: #ff3b2a; box-shadow: 0 0 7px #ff3b2a; }
.banner {
  position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-family: 'BlackHanSans', sans-serif;
  font-size: clamp(26px, 6vw, 46px); color: #fff; text-shadow: 0 4px 0 #000, 0 0 22px rgba(0, 0, 0, .8);
  opacity: 0; transform: scale(.86); transition: opacity .2s, transform .2s;
}
.banner.on { opacity: 1; transform: scale(1); }
.banner small { display: block; font-family: 'Pretendard', sans-serif; font-size: 15px; font-weight: 800; margin-top: 4px; color: #ffe0a8; }
.cbadge {
  position: absolute; left: 50%; top: 92px; transform: translateX(-50%) scale(.6); opacity: 0;
  background: linear-gradient(#ffe27a, #f4c542); color: #2a1d00; border-radius: 12px; padding: 6px 18px 7px;
  font-weight: 900; font-size: 21px; text-align: center; box-shadow: 0 0 0 2px #5a3a06, 0 8px 20px rgba(0, 0, 0, .45);
  transition: opacity .15s, transform .25s cubic-bezier(.3, 1.7, .5, 1); white-space: nowrap;
}
.cbadge.on { opacity: 1; transform: translateX(-50%) scale(1); }
.cbadge.meh { background: #e9e2d2; color: #555; font-size: 16px; box-shadow: 0 0 0 2px #888; }
.cbadge small { display: block; font-size: 13px; font-weight: 800; }
.gaptag {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); opacity: 0; white-space: nowrap;
  background: rgba(18, 18, 18, .76); border: 2px solid #9fe2b6; color: #fff;
  font-weight: 900; font-size: 15px; border-radius: 999px; padding: 2px 9px;
}
.gaptag.on { opacity: 1; }
.gaptag.warn { border-color: #ffd54a; color: #ffe07a; }
.gaptag.hot { border-color: #ff5a3c; color: #ff9a86; font-size: 17px; }
.pops { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 20px; white-space: nowrap; color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0, 0, 0, .8); transform: translate(-50%, -50%); will-change: transform, opacity; }
.pop.good { color: #7dffa8; } .pop.bad { color: #ff6a4a; } .pop.gold { color: #ffd54a; } .pop.big { font-size: 32px; }
.flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0) 40%, rgba(255, 0, 0, .55)); opacity: 0; transition: opacity .25s; }
.tip {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 218px; width: min(92vw, 430px); text-align: center;
  font-weight: 800; font-size: 14px; color: #fff; text-shadow: 0 2px 6px #000, 0 0 2px #000; opacity: 0; transition: opacity .3s;
}
.tip.on { opacity: 1; }
.toast {
  position: absolute; left: 50%; bottom: 265px; transform: translateX(-50%) translateY(8px); opacity: 0;
  background: rgba(12, 12, 12, .86); border: 1px solid rgba(255, 255, 255, .18); color: #fff;
  padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 800; white-space: nowrap; transition: opacity .25s, transform .25s;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.speedo {
  position: absolute; right: 14px; bottom: 250px; text-align: right; background: rgba(10, 10, 10, .7);
  border: 1px solid #2b2b2b; border-radius: 10px; padding: 6px 10px; min-width: 96px;
}
.speedo > b { font-size: 24px; line-height: 1; }
.speedo > span { font-size: 10.5px; opacity: .8; margin-left: 2px; }
.speedo .pax { font-size: 11.5px; color: #ddd; margin-top: 4px; }
.speedo .comfort { width: 100%; height: 5px; background: #333; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.speedo .comfort i { display: block; height: 100%; width: 100%; background: #58d68d; transition: width .3s, background .3s; }
.stoplamp {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%); background: #5b2b8f; color: #fff;
  border-radius: 999px; padding: 5px 15px; font-weight: 800; font-size: 13.5px; box-shadow: 0 0 0 2px #2a1145, 0 0 16px rgba(170, 90, 255, .8);
  opacity: 0; transition: opacity .2s;
}
.stoplamp.on { opacity: 1; }

/* 조작 */
.ctl { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.ctl > * { pointer-events: auto; }
.wheel-wrap {
  position: absolute; left: 26px; bottom: 18px; width: min(30vh, 210px); height: min(30vh, 210px);
  touch-action: none; cursor: grab; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6));
}
.wheel-wrap.grab { cursor: grabbing; filter: drop-shadow(0 0 12px rgba(255, 190, 80, .55)) drop-shadow(0 8px 12px rgba(0, 0, 0, .6)); }
.wheel-wrap svg { width: 100%; height: 100%; }
.pedal {
  position: absolute; right: 22px; bottom: 22px; width: 84px; height: 200px; border-radius: 16px;
  background: linear-gradient(#2b2f2d, #1b1e1c); border: 2px solid #414642; overflow: hidden;
  touch-action: none; cursor: pointer; box-shadow: inset 0 0 14px rgba(0, 0, 0, .6);
}
.pedal i { position: absolute; left: 0; right: 0; bottom: 0; height: 8%; background: linear-gradient(#58d68d, #1f9a55); transition: height .06s; }
.pedal span { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11px; font-weight: 800; color: #e8e3d4; text-shadow: 0 1px 2px #000; }
.brake-btn {
  position: absolute; right: 118px; bottom: 22px; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(200, 40, 32, .88); border: 2px solid #7a1510; color: #fff; font: inherit; font-weight: 900; font-size: 12.5px;
  cursor: pointer; touch-action: none; box-shadow: 0 5px 0 #6c120e;
}
.brake-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #6c120e; }
.gear {
  position: absolute; right: 30px; bottom: 234px; width: 58px; height: 58px; border-radius: 14px;
  background: #101312; border: 2px solid #4a504c; color: #9fe2b6; font: inherit; font-weight: 900; font-size: 24px;
  cursor: pointer; touch-action: none;
}
.gear.rev { color: #ff9a86; border-color: #7a2b22; }
.view-btn {
  position: absolute; right: 14px; top: 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font: inherit; font-size: 13px; font-weight: 800; padding: 9px 13px; cursor: pointer;
}
.view-btn.cab { background: #2b8a52; border-color: #9fe2b6; }
.mini-btn {
  position: absolute; right: 14px; top: 58px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .5); color: #fff; font-size: 16px; cursor: pointer;
}
#muteBtn { top: 104px; } #exitBtn { top: 150px; } #helpBtn { top: 196px; }
.mini-btn--exit { background: rgba(160, 30, 24, .55); }

/* 화면 */
.screen { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: linear-gradient(180deg, rgba(8, 10, 9, .35), rgba(8, 10, 9, .78)); }
.screen[hidden] { display: none; }
.screen__card { width: min(94vw, 480px); max-height: 92%; overflow: auto; background: rgba(12, 14, 13, .93); border: 2px solid #333831; border-radius: 16px; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); color: #f2ecdb; }
.title-card .kicker { color: #9fe2b6; }
.game-logo { font-family: 'BlackHanSans', sans-serif; font-weight: 400; font-size: clamp(30px, 8vw, 44px); color: #f7f1e0; margin: 6px 0 2px; letter-spacing: -.02em; }
.game-logo em { font-style: normal; color: var(--amber); }
.game-sub { font-size: 17px; font-weight: 800; color: #cfc9b7; margin-bottom: 16px; }
.route-list { display: grid; gap: 8px; margin-bottom: 14px; }
.rcard {
  display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; text-align: left; cursor: pointer;
  background: #171b18; border: 1px solid #343a35; border-radius: 10px; padding: 10px 12px; color: #e8e2d2; font: inherit;
}
.rcard.sel { border-color: #9fe2b6; background: #1b2a20; box-shadow: 0 0 0 1px #9fe2b6 inset; }
.rcard.lock { opacity: .45; cursor: not-allowed; }
.rcard__no { display: grid; place-items: center; height: 36px; border-radius: 6px; background: #0b0c0b; color: var(--amber); font-weight: 900; font-size: 15px; }
.rcard b { display: block; font-size: 14.5px; }
.rcard i { font-style: normal; font-size: 11.5px; color: #a9a496; }
.rcard em { font-style: normal; font-size: 11px; color: #9fe2b6; }
.start-btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font: inherit; font-weight: 900; font-size: 18px;
  background: linear-gradient(#3aa564, #1d6b3e); color: #fff; cursor: pointer; box-shadow: 0 5px 0 #12452a;
}
.start-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #12452a; }
.title-hint { margin-top: 12px; font-size: 11.5px; color: #a9a496; line-height: 1.7; }
.title-foot { display: flex; gap: 8px; margin-top: 12px; }
.ghost-btn {
  background: transparent; border: 1px solid #4a504a; color: #d9d3c2; border-radius: 9px; padding: 8px 12px;
  font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.ghost-btn:hover { border-color: #9fe2b6; }
.modal { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 14px; background: rgba(6, 8, 7, .72); overflow: auto; }
.modal[hidden] { display: none; }
.modal__card { width: min(96vw, 560px); max-height: 94%; overflow: auto; background: #f8f3e4; color: var(--ink); border-radius: 16px; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.modal__card h2 { font-family: 'BlackHanSans', sans-serif; font-weight: 400; font-size: 26px; text-align: center; margin-bottom: 14px; }
.guide-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.guide-wheel, .guide-pedal { font-size: 40px; }
.guide-item b { display: block; margin: 6px 0 4px; font-size: 14px; }
.guide-item p { font-size: 12px; color: var(--ink2); line-height: 1.55; }
.guide-tip { margin: 14px 0; font-size: 12.5px; color: var(--ink2); text-align: center; }
.guide-card .start-btn { margin-top: 4px; }

/* 결과 */
.result-card { width: min(96vw, 540px); background: #fbf7e9; }
.result__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px double #bdb49c; padding-bottom: 8px; letter-spacing: .28em; font-weight: 900; font-size: 18px; }
.result__head em { font-style: normal; letter-spacing: 0; font-size: 11px; color: var(--muted); font-weight: 700; }
.result__top { display: flex; gap: 14px; align-items: center; margin: 14px 0 6px; }
.res-stamp {
  flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  border: 6px solid var(--red); color: var(--red); font-family: 'BlackHanSans', sans-serif; font-size: 40px; transform: rotate(-8deg);
}
.res-stamp.fail { border-color: #7a7a72; color: #7a7a72; }
.result__ttl span { font-size: 11.5px; color: var(--muted); font-weight: 800; }
.result__ttl b { display: block; font-family: 'BlackHanSans', sans-serif; font-weight: 400; font-size: 26px; line-height: 1.2; }
.result__ttl strong { font-size: 20px; color: var(--green); }
.result__course { font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.result__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.result__stats div { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 6px; text-align: center; }
.result__stats span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.result__stats b { font-size: 17px; }
.result__lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.result__lines li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.result__lines span { color: var(--muted); }
.dmg { background: #efe7d2; border-radius: 10px; margin: 12px 0; padding: 6px; }
.dmg canvas { width: 100%; height: auto; display: block; }
.result__share { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }
.result__actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 14px; align-items: stretch; }
.result__actions .start-btn { padding: 11px; font-size: 15px; }
.result__share-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.x-btn { display: inline-flex; align-items: center; gap: 6px; background: #111; color: #fff; text-decoration: none; border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 800; }
.result-coupang { margin-top: 14px; border-top: 2px dashed var(--line); padding-top: 12px; }
.result-coupang h3 { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.result-coupang .items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-coupang a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; text-decoration: none; font-size: 12px; }
.result-coupang a b { display: block; font-size: 12.5px; }
.result-coupang a i { font-style: normal; color: var(--muted); font-size: 11px; }
.result-coupang .disc { text-align: left; font-size: 10.5px; margin-top: 8px; }
.share-img-wrap { background: #1b1b18; border-radius: 10px; padding: 8px; max-height: 62vh; overflow: auto; }
.share-img-wrap img { width: 100%; height: auto; border-radius: 6px; }
.share-hint { font-size: 11.5px; color: var(--muted); margin: 8px 0 12px; }
.share-actions { display: flex; gap: 8px; }
.share-actions .start-btn { flex: 1; text-align: center; }

/* 반응형 */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 520px; }
  .why, .courses, .rest-grid { grid-template-columns: 1fr 1fr; }
  .howto, .know, .ranks { grid-template-columns: 1fr; }
  .sib-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .sec { padding: 44px 16px; }
  .hero__grid { padding: 34px 16px 44px; }
  .why, .courses, .rest-grid, .sib-grid, .tips3 { grid-template-columns: 1fr; }
  .hero__title-top { font-size: 21px; }
  .hero__title-main { font-size: clamp(34px, 11vw, 46px); }
  .stamp { width: 78px; height: 78px; font-size: 38px; right: -6px; bottom: -10px; }
  .led-sign { left: -4px; top: -18px; padding: 7px 10px; }
  .led-sign__no { font-size: 26px; }
  .result__lines { grid-template-columns: 1fr; }
  .result__actions { grid-template-columns: 1fr; }
  .result-coupang .items { grid-template-columns: 1fr; }
  .board { top: 6px; left: 8px; right: 8px; width: auto; transform: none; padding: 5px 9px 5px; }
  .board__top b { font-size: 16px; }
  .board__dist { font-size: 13px; }
  .board__bot { font-size: 10.5px; gap: 7px; margin-top: 2px; flex-wrap: wrap; white-space: normal; row-gap: 0; }
  .board__bot #bScore { margin-left: auto; }
  .speedo { bottom: 252px; right: 10px; padding: 5px 8px; min-width: 82px; }
  .speedo > b { font-size: 20px; }
  .wheel-wrap { left: 8px; bottom: 10px; width: 36vw; height: 36vw; max-width: 148px; max-height: 148px; }
  .pedal { right: 10px; bottom: 12px; width: 68px; height: 160px; }
  .brake-btn { right: 86px; bottom: 14px; width: 62px; height: 62px; font-size: 11px; }
  .gear { right: 16px; bottom: 182px; width: 48px; height: 48px; font-size: 19px; }
  .view-btn { right: 10px; top: 84px; font-size: 12px; padding: 6px 10px; background: rgba(0,0,0,.62); }
  .mini-btn { right: 10px; width: 34px; height: 34px; font-size: 14px; }
  #hornBtn { top: 124px; }
  #muteBtn { display: none; }
  #exitBtn { top: 162px; background: rgba(160,30,24,.5); }
  #helpBtn { display: none; }
  .tip { bottom: 190px; font-size: 12.5px; width: min(86vw, 360px); }
  .toast { bottom: 226px; font-size: 12px; }
  .cbadge { top: 76px; font-size: 17px; }
  .stoplamp { top: 76px; }
}
@media (min-width: 641px) and (pointer: coarse) {
  .wheel-wrap { width: min(34vh, 220px); height: min(34vh, 220px); }
}
