/* 엔진 화면 모양: 장면 화면 · 처음 화면 · 도감 · 폰 */
:root { --ink: #3d2c3a; --paper: #fbf6ea; --accent: #e8734a; --ok: #4f9a7a; }
* { box-sizing: border-box; }
body { margin: 0; background: #efe6d2; color: var(--ink); font-family: "Pretendard", "Malgun Gothic", sans-serif; }
.wrap { max-width: 1030px; margin: 0 auto; padding: 12px; }
header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
h1 { font-size: 17px; margin: 0 6px 0 0; }
/* 장면 탭은 늘 둘째 줄 한 줄 — 비유/용어로 글 길이가 바뀌어도 머리 틀은 그대로. 넘치면 옆으로 넘김 */
.scenes { order: 3; width: 100%; display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.scenes::-webkit-scrollbar { display: none; }
.scenes button { flex: none; font: inherit; font-size: 12px; padding: 3px 8px; border: 2px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); }
.scenes button.on { background: var(--ink); color: #fff; }
.scenes button:disabled { opacity: .35; }
.mode { display: flex; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.mode button { border: 0; background: #fff; color: var(--ink); padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.mode button.on { background: var(--ink); color: #fff; }
.stage { position: relative; width: 100%; border: 3px solid var(--ink); border-radius: 4px; line-height: 0; }
canvas { display: block; width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.tag, .bub { position: absolute; transform: translate(-50%, -100%); line-height: 1.25; white-space: nowrap; pointer-events: none; }
.tag { font-size: 11px; padding: 1px 4px; background: rgba(255, 255, 255, .88); border: 1px solid var(--ink); border-radius: 3px; }
.tag.room { font-weight: bold; background: rgba(255, 248, 230, .9); transform: translate(0, -100%); }
.tag.pod { font-size: 10px; padding: 0 3px; border-color: #8a7a6a; }
.bub { font-size: 12px; padding: 2px 6px; background: #fff3d6; border: 2px solid var(--accent); border-radius: 6px; font-weight: bold; animation: pop .25s ease-out; }
.bub.ok { border-color: var(--ok); background: #e9f6ee; }
.bub.no { border-color: #b8b0a8; background: #f2eeea; color: #8a7f78; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }
.panel { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.say { flex: 1 1 440px; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 8px 12px; min-height: 92px; }
.say p { margin: 3px 0; font-size: 15px; }
.meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 12px; color: #7a6a6a; flex-wrap: wrap; }
.meta details { font-size: 12px; }
.meta summary { cursor: pointer; }
.meta details p { margin: 4px 0; max-width: 560px; color: var(--ink); }
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices:not(:empty) { margin: 8px 0 2px; }
.choices button { font: inherit; font-size: 13px; padding: 4px 10px; border: 2px solid var(--accent); border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; }
.choices button:hover { background: #fff3d6; }
.ledger { flex: 0 1 330px; background: #fffdf5; border: 2px solid var(--ink); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.ledger .lh { font-weight: bold; margin-bottom: 2px; }
.ledger .lrs { font-size: 12px; color: #7a6a6a; margin-bottom: 4px; }
.ledger { overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; }
.ledger td { white-space: nowrap; }
.ledger th, .ledger td { text-align: left; padding: 2px 4px; border-bottom: 1px dashed #d9cdb4; font-size: 12px; }
.ledger tr.flash td { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: #ffe27a; } }
.ledger tr.flash-loop td { animation: flash 1.4s ease-out infinite; }
.ctrl { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ctrl button { font: inherit; font-size: 14px; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.ctrl button.main { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }
.ctrl button:disabled { opacity: .35; cursor: default; }
.ctrl label { font-size: 13px; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ctrl .count { margin-left: auto; font-size: 12px; color: #7a6a6a; }
[hidden] { display: none !important; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav button { font: inherit; font-size: 12px; padding: 3px 8px; border: 2px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; }
.tag .short { display: none; }

/* 처음 화면 · 도감 — 장면 화면과 같은 색 */
.screen { max-width: 520px; margin: 0 auto; min-height: 100vh; }
#home { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px; text-align: center; }
#home .ttl { font-size: 27px; letter-spacing: -1px; margin: 0 0 6px; color: var(--ink); text-shadow: 3px 3px 0 #e2cfa6; }
#home .tagline { font-size: 12.5px; color: #7a6a6a; margin-bottom: 20px; }
#titleCv { width: 100%; max-width: 360px; border: 3px solid var(--ink); border-radius: 4px; margin-bottom: 22px; image-rendering: pixelated; image-rendering: crisp-edges; }
#home .menu { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; }
#home .menu button { border: 2px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); padding: 13px; font: inherit; font-size: 15px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
#home .menu button.main { background: var(--accent); color: #fff; }
#home .menu button .s { display: block; font-size: 11px; font-weight: normal; color: #7a6a6a; margin-top: 3px; }
#home .menu button.main .s { color: #fff3d6; }
@media (hover: hover) { #home .menu button:hover { background: #fff3d6; } #home .menu button.main:hover { background: #ef8a62; } }
#home .menu button:active { transform: translateY(4px); box-shadow: none; }
#dex { max-width: 760px; padding: 0 14px 30px; }
.dexhead { position: sticky; top: 0; background: #efe6d2; padding: 10px 0 8px; border-bottom: 2px solid var(--ink); z-index: 2; }
.dexhead .row { display: flex; align-items: center; gap: 10px; }
.dexhead h2 { font-size: 18px; margin: 0; color: var(--ink); }
.dexhead .cnt { margin-left: auto; font-size: 12px; color: #7a6a6a; }
.dexhead button { font: inherit; border: 2px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; }
.dexhead .row button { font-size: 13px; padding: 4px 10px; white-space: nowrap; }
.dexhead h2 { white-space: nowrap; }
.dexhead .mode { flex: none; }
.dexhead .mode button { border: 0; border-radius: 0; }
.dexhead .mode button.on { background: var(--ink); color: #fff; }
.dexnav { display: flex; gap: 4px; margin-top: 8px; }
.dexnav button { font-size: 13px; padding: 3px 12px; }
.dexnav button.on { background: var(--ink); color: #fff; }
#dex h3 { font-size: 14px; color: #7a6a6a; margin: 18px 0 8px; }
.dexlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.dexit { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); padding: 7px 8px; }
.dexit .art { flex: none; width: 72px; height: 60px; background: #f3e6c8; border: 2px solid var(--ink); border-radius: 3px; image-rendering: pixelated; image-rendering: crisp-edges; }
.dexit .nm { font-weight: bold; font-size: 15px; color: var(--ink); }
.dexit .tm { font-size: 12px; color: var(--accent); font-weight: bold; }
.dexit .ds { font-size: 13px; line-height: 1.45; margin-top: 3px; }
@media (hover: hover) { .dexhead button:not(.on):hover { background: #fff3d6; } }
.dexit { cursor: pointer; }
@media (hover: hover) { .dexit:hover { background: #fff3d6; } }
/* 도감 카드: 목록 위에 덮어 하나를 크게 */
body.noscroll { overflow: hidden; }
.cardwrap { position: fixed; inset: 0; z-index: 10; background: rgba(61, 44, 58, .55); display: flex; align-items: center; justify-content: center; padding: 14px; }
.dcard { width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 12px 14px 14px; box-shadow: 0 6px 0 var(--ink); animation: pop2 .18s ease-out; }
.dcard button { font: inherit; border: 2px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; }
.dcard .ch { display: flex; align-items: center; }
.dcard .kick { font-size: 12px; font-weight: bold; color: var(--accent); }
.dcard .ch button { margin-left: auto; font-size: 12px; padding: 1px 8px; }
#cardArt { display: block; width: 100%; max-width: 288px; margin: 10px auto 12px; background: #f3e6c8; border: 2px solid var(--ink); border-radius: 4px; image-rendering: pixelated; image-rendering: crisp-edges; }
.dcard .cname { font-size: 21px; font-weight: bold; text-align: center; }
.dcard .cterm { font-size: 14px; font-weight: bold; color: var(--accent); text-align: center; margin-top: 2px; }
.dcard .cmode { display: flex; justify-content: flex-end; margin-top: 8px; }
.dcard .mode button { border: 0; border-radius: 0; padding: 4px 12px; font-size: 13px; box-shadow: none; }
.dcard .mode button.on { background: var(--ink); color: #fff; }
.dcard .ctext { font-size: 15px; line-height: 1.75; margin: 8px 0 0; white-space: pre-line; word-break: keep-all; }
.dcard .cnav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.dcard .cnav button { font-size: 13px; padding: 5px 10px; box-shadow: 0 3px 0 var(--ink); }
.dcard .cnav button:disabled { opacity: .3; cursor: default; box-shadow: none; }
@media (hover: hover) { .dcard button:not(:disabled):not(.on):hover { background: #fff3d6; } }

/* 살펴보기: 번호 · 질문 제목 · 멈춘 무대(그 장 요소만 밝게) · 설명 · 「~란?」 패널 · 넘기기 */
#tour { max-width: 680px; padding: 0 14px 30px; }
.tourhead { display: flex; align-items: center; gap: 10px; padding: 10px 0 8px; border-bottom: 2px solid var(--ink); }
.tourhead h2 { font-size: 18px; margin: 0; }
#tour button { font: inherit; border: 2px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; }
.tourhead button { font-size: 13px; padding: 4px 10px; }
.tcard { margin-top: 12px; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 12px 14px 14px; }
.tag.big { font-size: 13px; font-weight: bold; padding: 1px 6px; border: 2px solid var(--accent); }
.tcard .kick { font-size: 12px; font-weight: bold; color: var(--accent); }
.tcard h3 { font-size: 19px; margin: 2px 0 10px; letter-spacing: -.5px; }
.trow { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.terms { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
#tour .terms button { font-size: 13px; padding: 3px 10px; border-color: var(--accent); border-radius: 14px; }
#tour .terms button.on { background: var(--accent); color: #fff; }
#tour .mode button { border: 0; border-radius: 0; padding: 4px 12px; font-size: 13px; }
#tour .mode button.on { background: var(--ink); color: #fff; }
.tbody { font-size: 15.5px; line-height: 1.75; margin: 12px 0 0; word-break: keep-all; white-space: pre-line; }
.tterm { margin-top: 12px; background: #fffdf5; border: 2px solid var(--accent); border-radius: 6px; padding: 8px 12px 10px; animation: pop2 .2s ease-out; }
@keyframes pop2 { from { opacity: 0; transform: translateY(-4px); } }
.tterm .tph { display: flex; align-items: center; gap: 8px; }
.tterm .tph b { font-size: 15px; }
#tour .tterm .tph button { margin-left: auto; font-size: 12px; padding: 1px 8px; }
.tterm p { margin: 6px 0 0; font-size: 14px; line-height: 1.65; word-break: keep-all; }
.tterm .def { font-weight: bold; }
.tterm .ana span { display: inline-block; font-size: 11px; font-weight: bold; color: #fff; background: var(--accent); border-radius: 3px; padding: 0 5px; margin-right: 6px; }
.tterm .more { color: #5a4a56; white-space: pre-line; }
.tscenes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; font-size: 12px; color: #7a6a6a; }
.tscenes { margin-top: 14px; gap: 6px; }
#tour .tscenes button { font-size: 13px; padding: 5px 10px; }
.tnav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
#tour .tnav > button { font-size: 15px; padding: 6px 16px; box-shadow: 0 3px 0 var(--ink); }
#tour .tnav > button:active { transform: translateY(3px); box-shadow: none; }
#tour .tnav > button:disabled { opacity: .3; cursor: default; box-shadow: none; transform: none; }
.dots { display: flex; gap: 6px; }
#tour .dots button { width: 11px; height: 11px; padding: 0; border-radius: 50%; background: #fff; }
#tour .dots button.on { background: var(--ink); }
@media (hover: hover) { #tour button:not(.on):not(:disabled):hover { background: #fff3d6; } }

/* 폰: 장면 탭은 옆으로 넘기는 한 줄, 이름표는 작고 짧게 */
@media (max-width: 700px) {
  .wrap { padding: 8px; }
  h1 { font-size: 15px; }
  .dexhead .cnt { display: none; }   /* 폰은 머리 한 줄에 스위치까지 — 개수는 처음 화면 버튼에 있음 */
  .dexhead .mode { margin-left: auto; }
  .tag { font-size: 8px; padding: 0 2px; }
  .tag.pod { font-size: 7px; padding: 0 2px; }
  .tag .full { display: none; }
  .tag .short { display: inline; }
  .bub { font-size: 10px; padding: 1px 4px; border-width: 1.5px; }
  .say p { font-size: 14px; }
  .ctrl button { padding: 6px 10px; }
  .dexlist { grid-template-columns: 1fr; }
  #tour { padding: 0 8px 24px; }
  .tcard { padding: 10px 10px 12px; }
  .tcard h3 { font-size: 17px; }
  .tbody { font-size: 14.5px; }
  .tag.big { font-size: 10px; padding: 0 3px; border-width: 1.5px; }
}

/* 민랩노트 허브·개인정보처리방침 링크 */
.mln-links{text-align:center;font-size:12px;line-height:1.6;margin-top:14px;opacity:.75}
.mln-links a{color:inherit;text-decoration:underline;text-underline-offset:3px}
