/* 문주의 한국사 탐험 — 위에 시간의 길, 아래에 카드와 문제 */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #12131b; color: #eef1f8;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  -webkit-text-size-adjust: 100%;
}
#road { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hudBtns { position: fixed; top: 10px; right: 12px; z-index: 6; display: flex; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; }
body.playing #hudBtns { opacity: 1; pointer-events: auto; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 11px; font-size: 16px; cursor: pointer;
  background: rgba(12,16,28,.75); border: 1px solid rgba(255,255,255,.15); color: #eef1f8;
}
.iconbtn:hover { background: rgba(40,50,80,.9); }

/* 정거장 판 — 시간의 길(캔버스) 아래에 놓인다 */
#stage {
  position: fixed; left: 50%; transform: translateX(-50%); top: 108px; bottom: 14px; z-index: 5;
  width: min(860px, calc(100vw - 20px)); display: none; overflow-y: auto;
  background: rgba(18,20,30,.94); border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 16px 18px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
#sName { font-size: 20px; font-weight: 800; }
#sSpan { font-size: 12px; color: #8ea0c8; margin-left: 8px; font-weight: 600; }
#sIntro { color: #a9b6d4; font-size: 13.5px; line-height: 1.65; margin: 7px 0 12px; }
#sStep { font-size: 13px; font-weight: 700; color: #e8c766; margin-bottom: 11px; }

#cardBox { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 10px; }
.card {
  display: grid; gap: 3px; text-align: left; padding: 12px 14px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px; color: #eef1f8; min-height: 96px;
}
.card:hover { background: rgba(232,199,102,.14); border-color: rgba(232,199,102,.5); }
.card.done { border-color: rgba(111,214,168,.55); background: rgba(111,214,168,.10); cursor: default; }
.card .ord {
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); color: #cfe1ff;
}
.card.done .ord { background: #6fd6a8; color: #0d1b16; }
.card .ct { font-weight: 700; font-size: 15px; }
.card .cd { font-size: 12.5px; color: #a9b6d4; line-height: 1.55; }
.card .cy { font-size: 12px; color: #6fd6a8; font-weight: 700; }

.qtext { font-size: 18px; font-weight: 700; line-height: 1.6; margin-bottom: 13px; }
.choices { display: grid; gap: 9px; }
.choice {
  text-align: left; padding: 13px 16px; font-size: 15.5px; cursor: pointer; min-height: 46px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px; color: #eef1f8;
}
.choice:hover { background: rgba(110,168,255,.18); border-color: rgba(140,180,255,.5); }

#sMsg { margin-top: 12px; font-size: 13.5px; line-height: 1.6; min-height: 20px; }
#sMsg .ok { color: #6fd6a8; }
#sMsg .no { color: #ffc7a6; }

/* 화면(메뉴·통과) */
.screen {
  position: fixed; inset: 0; z-index: 10; display: none;
  flex-direction: column; align-items: center; justify-content: flex-start;
  background: radial-gradient(120% 90% at 50% 0%, #221f2e 0%, #12131b 70%);
  background-color: #12131b; padding: 24px 18px; overflow-y: auto; text-align: center;
}
/* ⚠️가운데 정렬만 하면 내용이 길어질 때 제목이 잘리고 스크롤도 안 된다 */
.screen::before, .screen::after { content: ''; display: block; flex: 1 0 8px; }
.screen h1 { font-size: clamp(1.5rem, 4.4vw, 2.4rem); margin: 0 0 4px; font-weight: 800; letter-spacing: -.02em; }
.screen h1 span { display: block; font-size: 12px; letter-spacing: .26em; color: #9a8ec8; font-weight: 600; margin-top: 6px; }
.screen h2 { font-size: 1.45rem; margin: 0 0 6px; }
.lead { color: #a9b6d4; font-size: 14px; margin: 8px 0 18px; max-width: 640px; line-height: 1.65; }

.eralist { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 9px; width: min(800px, 96vw); margin-bottom: 16px; }
.erabtn {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 11px; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.11); color: #eef1f8;
}
.erabtn:hover { background: rgba(232,199,102,.14); border-color: rgba(232,199,102,.45); }
.erabtn.done { border-color: rgba(111,214,168,.45); }
.erabtn .no { grid-row: 1 / 4; align-self: center; font-size: 20px; font-weight: 800; color: #e8c766; width: 22px; }
.erabtn .nm { font-weight: 700; font-size: 15.5px; }
.erabtn .sp { grid-column: 2; font-size: 12px; color: #93a4c8; }
.erabtn .st { grid-column: 2; font-size: 11.5px; color: #6f81a6; margin-top: 3px; }
.erabtn.done .st { color: #6fd6a8; }

.row { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.bigbtn, .graybtn { border: 0; border-radius: 11px; padding: 11px 20px; font-size: 15px; font-weight: 700; cursor: pointer; }
.bigbtn { background: linear-gradient(180deg, #e8c766, #cfa63e); color: #1a1406; }
.graybtn { background: rgba(255,255,255,.09); color: #dce4f5; border: 1px solid rgba(255,255,255,.15); }
.graybtn:hover { background: rgba(255,255,255,.16); }

#cLine { width: min(640px, 94vw); margin: 12px 0 6px; text-align: left; }
.tl {
  display: grid; grid-template-columns: 64px 1fr; gap: 2px 12px; padding: 9px 12px;
  border-left: 3px solid #e8c766; background: rgba(255,255,255,.04);
  border-radius: 0 10px 10px 0; margin-bottom: 7px;
}
.tl b { grid-row: 1 / 3; align-self: center; color: #e8c766; font-size: 15px; }
.tl span { font-weight: 700; font-size: 15px; }
.tl i { font-style: normal; font-size: 12.5px; color: #a9b6d4; line-height: 1.5; }
#cWhy { color: #b7c4de; font-size: 13.5px; max-width: 620px; line-height: 1.6; }
#cStats { color: #7f8db0; font-size: 12.5px; margin: 8px 0 6px; }

.help { color: #8ea0c8; font-size: 12.5px; line-height: 1.9; margin-top: 12px; max-width: 640px; }
.help b { color: #f0dda0; }
.credit { color: #5d6c8e; font-size: 11px; margin-top: 14px; }

@media (max-width: 560px) {
  .eralist { grid-template-columns: 1fr; }
  .lead { display: none; }
  #stage { top: 96px; }
  .qtext { font-size: 16.5px; }
}
