:root {
  --ink: #eaf2ff; --muted: #8b9bb6; --navy: #07111f;
  --line: #21314a; --cyan: #42dcff; --cyan2: #04a6d8;
  --lime: #a9ff68; --danger: #ff7592;
}
* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink);
  background: radial-gradient(circle at 48% -15%, #123b59, transparent 35%), linear-gradient(#07111f, #030914);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, select, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
.app-shell { width: min(100%, 760px); min-height: 100dvh; margin: auto; padding: 18px clamp(16px,4vw,28px) 12px; }
.brandbar { display: flex; align-items: center; gap: 11px; min-height: 54px; }
.brandmark { display: grid; grid-template-columns: 1fr 1fr; width: 43px; height: 43px; border: 1px solid #2a4561; border-radius: 12px; overflow: hidden; box-shadow: 0 0 22px #24c9f522; }
.brandmark span { display: grid; place-items: center; font-weight: 900; color: #03111b; background: var(--cyan); }
.brandmark span:last-child { color: #7890a8; background: #102037; }
.eyebrow { margin: 0 0 2px; color: var(--cyan); font-size: .68rem; font-weight: 900; letter-spacing: .15em; }
h1 { margin: 0; font-size: 1.18rem; letter-spacing: .08em; }
.quiet-button { margin-left: auto; border: 0; color: var(--muted); background: transparent; padding: 12px; }
.start-screen { padding-top: 28px; }
.hero-copy { position: relative; z-index: 2; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #24405a; border-radius: 99px; color: #a7b8ce; background: #0c1b2dbb; font-size: .78rem; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.hero-copy h2 { margin: 20px 0 12px; font-size: clamp(2.35rem,10vw,4rem); line-height: 1.04; letter-spacing: -.055em; }
.hero-copy h2 em { color: var(--cyan); font-style: normal; text-shadow: 0 0 30px #32cbff33; }
.hero-copy p { width: 85%; margin: 0; color: var(--muted); line-height: 1.65; }
.city { height: 105px; display: flex; justify-content: flex-end; align-items: flex-end; gap: 7px; margin: -25px 0 10px; opacity: .65; mask-image: linear-gradient(to right,transparent,#000 40%); }
.city b { width: 12%; border: 1px solid #247ca0; background: repeating-linear-gradient(90deg,transparent 0 8px,#29cfff22 8px 11px),linear-gradient(#123551,#0a1525); }
.city b:nth-child(1){height:45px}.city b:nth-child(2){height:85px}.city b:nth-child(3){height:64px}.city b:nth-child(4){height:100px}.city b:nth-child(5){height:72px}.city b:nth-child(6){height:54px}
.setup-card, .mission-card, .result-screen { border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg,#101f34ee,#0a1527f5); box-shadow: 0 25px 60px #0005; }
.setup-card { padding: 21px; }
.setup-card h3 { margin: 0 0 16px; font-size: 1rem; }
.segmented { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.segmented button { min-height: 62px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: #091626; }
.segmented button strong, .segmented button small { display: block; }
.segmented button small { margin-top: 3px; font-size: .68rem; opacity: .75; }
.segmented button.selected { color: #04121c; border-color: var(--cyan); background: linear-gradient(145deg,#80ebff,var(--cyan)); box-shadow: 0 8px 22px #20cdf52e; }
label { display: grid; gap: 7px; margin-top: 15px; color: #aebbd0; font-size: .78rem; font-weight: 700; }
select, .answer-input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #081522; outline: none; }
.setting-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary, .secondary { width: 100%; min-height: 54px; border-radius: 14px; font-weight: 900; }
.primary { margin-top: 20px; border: 0; color: #03131c; background: linear-gradient(145deg,#72eaff,var(--cyan2)); box-shadow: 0 12px 28px #09b9e32e; }
.primary span { float: right; margin-right: 5px; font-size: 1.3rem; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { margin-top: 10px; border: 1px solid var(--line); color: var(--ink); background: #0b192a; }
.play-screen { padding-top: 18px; }
.hud { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.hud div { padding: 10px 4px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: #0b1829cc; }
.hud span, .hud small { display: block; color: var(--muted); font-size: .68rem; font-weight: 600; }
.hud strong { font-size: 1.03rem; }
.hud strong small { display: inline; }
.progress { height: 6px; margin: 12px 2px 16px; border-radius: 99px; overflow: hidden; background: #142238; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--cyan2),var(--cyan)); transition: width .3s; }
.mission-card { padding: clamp(20px,5vw,34px); text-align: center; }
.mission-kicker { margin: 0 0 10px; color: var(--cyan); font-size: .75rem; font-weight: 900; letter-spacing: .12em; }
.mission-card h2 { margin: 0; font-size: clamp(1.4rem,6vw,2.2rem); line-height: 1.3; }
.mission-card h2 strong { color: var(--cyan); font-size: 1.35em; }
.guide { margin: 8px 0 22px; color: var(--muted); font-size: .88rem; }
.bit-grid { display: grid; gap: clamp(4px,1.6vw,9px); }
.bit-grid button { min-width: 0; aspect-ratio: .74; padding: 7px 2px; border: 1px solid var(--line); border-radius: 12px; color: #71849d; background: #091523; transition: .16s ease; }
.bit-grid button small, .bit-grid button b, .bit-grid button i { display: block; }
.bit-grid button small { font-size: clamp(.58rem,2.6vw,.78rem); }
.bit-grid button b { margin: 7px 0; font-size: clamp(1.25rem,5vw,2rem); }
.bit-grid button i { width: 7px; height: 7px; margin: auto; border-radius: 50%; background: #27364a; }
.bit-grid button.on { transform: translateY(-3px); color: #03131b; border-color: var(--cyan); background: linear-gradient(#7decff,#24cbed); box-shadow: 0 7px 22px #25c9ed40; }
.bit-grid button.on i { background: white; box-shadow: 0 0 10px white; }
.sum-card { display: grid; place-items: center; min-height: 110px; margin-top: 18px; border: 1px solid #20324b; border-radius: 15px; background: #07111dcc; }
.sum-card span { color: var(--muted); font-size: .72rem; }
.sum-card strong { color: var(--cyan); font-size: 2rem; }
.sum-card small { min-height: 1.2em; color: #7690aa; font-size: .75rem; }
.answer-input { max-width: 330px; height: 68px; margin: 18px auto; text-align: center; font-size: 1.4rem; font-weight: 900; }
.answer-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #35d4fa22; }
.feedback { min-height: 24px; margin: 16px 0 0; color: var(--muted); font-size: .82rem; font-weight: 800; }
.feedback.ok { color: var(--lime); }
.feedback.bad { color: var(--danger); }
.check { margin-top: 12px; }
.result-screen { margin-top: 28px; padding: 28px 22px; text-align: center; }
.result-screen h2 { margin: 5px 0 18px; font-size: 2rem; }
.grade { display: grid; place-items: center; width: 100px; height: 100px; margin: auto; border-radius: 50%; color: #03131c; background: linear-gradient(145deg,#8cf0ff,var(--cyan2)); font-size: 3rem; font-weight: 950; box-shadow: 0 0 45px #23c9f53b; }
.result-lead { color: var(--muted); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0 5px; }
.result-grid div { padding: 13px 5px; border: 1px solid var(--line); border-radius: 12px; background: #091626; }
.result-grid span { display: block; color: var(--muted); font-size: .7rem; }
.result-grid strong { font-size: 1.15rem; }
footer { padding: 20px 0 8px; text-align: center; color: #52647b; font-size: .66rem; }

@media (max-width:560px) {
  .segmented { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .segmented button:nth-child(4), .segmented button:nth-child(5) { grid-column: auto; }
}
@media (min-width:700px) {
  .start-screen { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:26px; }
  .city { grid-column:1; margin-top:-90px; }
  .setup-card { grid-column:2; grid-row:1 / span 2; }
  .mission-card { padding-inline:50px; }
}
@media (max-width:380px) {
  .app-shell { padding-inline:11px; }
  .setup-card, .mission-card { border-radius:19px; padding-inline:14px; }
  .hero-copy h2 { font-size:2.25rem; }
  .bit-grid { gap:3px; }
  .bit-grid button { border-radius:9px; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important; } }

/* BIT CITY v2 */
.version-badge { display:inline-block; margin-left:7px; padding:3px 7px; border:1px solid #2d5872; border-radius:999px; color:var(--cyan); background:#0a1a2c; font-size:.58rem; letter-spacing:.05em; vertical-align:middle; }
.city-progress { margin:0 0 16px; padding:13px 14px 11px; border:1px solid var(--line); border-radius:16px; background:#081523cc; }
.city-progress-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; color:var(--muted); font-size:.72rem; font-weight:800; }
.city-progress-head strong { color:var(--cyan); font-size:.85rem; }
.city-blocks { display:flex; align-items:flex-end; gap:5px; height:57px; }
.city-blocks b { position:relative; flex:1; height:34px; border:1px solid #233750; border-radius:4px 4px 1px 1px; background:repeating-linear-gradient(90deg,transparent 0 7px,#1c3047 7px 9px),linear-gradient(#10223a,#091421); opacity:.45; transition:.28s ease; }
.city-blocks b:nth-child(2){height:43px}.city-blocks b:nth-child(3){height:49px}.city-blocks b:nth-child(4){height:40px}.city-blocks b:nth-child(5){height:53px}.city-blocks b:nth-child(6){height:57px}
.city-blocks b.on { opacity:1; border-color:var(--cyan); background:repeating-linear-gradient(90deg,transparent 0 7px,#d8ff9a 7px 9px),linear-gradient(#237597,#0d3148); box-shadow:0 0 22px #42dcff88, inset 0 0 12px #a9ff6833; transform:translateY(-2px); }
.city-blocks b.on::after { content:''; position:absolute; inset:7px 18%; background:repeating-linear-gradient(#efffcf 0 4px,transparent 4px 9px); opacity:1; filter:drop-shadow(0 0 4px #a9ff68); }
.city-message { min-height:1.2em; margin:8px 0 0; color:#7f95ad; font-size:.72rem; text-align:center; }
.review-area { margin:22px 0 5px; text-align:left; }
.review-area h3 { margin:0 0 10px; font-size:.95rem; }
.review-list { display:grid; gap:8px; }
.review-item { padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:#081522; }
.review-item strong { display:block; margin-bottom:5px; color:var(--ink); font-size:.8rem; }
.review-item span { display:block; color:var(--muted); font-size:.72rem; line-height:1.55; }
.review-item em { color:var(--danger); font-style:normal; }
@media (max-width:380px) { .city-progress { padding-inline:10px; } .city-blocks { gap:3px; } }

.answer-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; max-width:430px; margin:20px auto 4px; }
.answer-card { min-height:72px; border:1px solid var(--line); border-radius:15px; color:var(--ink); background:#091626; font-size:1.35rem; font-weight:900; transition:.16s ease; }
.answer-card:hover { border-color:#39718f; }
.answer-card.selected { transform:translateY(-2px); color:#03131c; border-color:var(--cyan); background:linear-gradient(145deg,#80ebff,var(--cyan)); box-shadow:0 8px 22px #20cdf52e; }
@media (max-width:380px) { .answer-card { min-height:62px; } }

/* BIT CITY v2.3 difficulty */
.setting-label { display:block; margin-top:15px; color:#aebbd0; font-size:.78rem; font-weight:700; }
.difficulty-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:7px; }
.difficulty-options button { min-height:66px; padding:8px 5px; border:1px solid var(--line); border-radius:13px; color:var(--muted); background:#091626; }
.difficulty-options button strong, .difficulty-options button small { display:block; }
.difficulty-options button small { margin-top:4px; font-size:.62rem; line-height:1.25; }
.difficulty-options button.selected { color:#04121c; border-color:var(--cyan); background:linear-gradient(145deg,#80ebff,var(--cyan)); box-shadow:0 8px 22px #20cdf52e; }
.bit-grid.hide-place-values button small { visibility:hidden; }
.result-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width:560px) { .difficulty-options { grid-template-columns:repeat(2,minmax(0,1fr)); } }
