/* 에너지 타운 3D — 부드럽고 귀여운 화면 */
:root {
  --cream: #fff8ea; --cream-d: #f1dfc2; --ink: #5a3e2b; --soft: #a07a5c;
  --pink: #ff8fa3; --pink-d: #e2687f; --gold: #ffcf4a; --gold-d: #d99a17;
  --green: #5cc76a; --green-d: #3f9e4c; --orange: #ffa94d; --orange-d: #d9772a; --blue: #63c3f0; --blue-d: #3fa3d4; --grey: #d8cfc2;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; color: var(--ink);
  background: #9ed870; user-select: none; -webkit-user-select: none; touch-action: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; touch-action: manipulation; }
button:disabled { cursor: default; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#loading { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; text-align: center; gap: 8px; font-size: 22px; background: linear-gradient(180deg, #c8efa6, #9ed870); }
#loading div { font-size: 60px; animation: bob 1.2s ease-in-out infinite; }
#loading small { font-size: 15px; color: var(--soft); }
@keyframes bob { 50% { transform: translateY(-6px); } }

.panel { background: var(--cream); border: 4px solid #fff; border-radius: 22px; box-shadow: 0 5px 0 var(--cream-d), 0 10px 22px rgba(90, 62, 43, .18); }

/* 위쪽 */
.profile { position: fixed; left: 12px; top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 26px; z-index: 5; }
.avatar { width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffd99a); border: 3px solid #fff; box-shadow: 0 3px 0 var(--cream-d); display: grid; place-items: center; font-size: 30px; }
.profile b { display: block; font-size: 19px; font-weight: normal; }
.lv { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--soft); }
.lv i { display: block; width: 96px; height: 12px; border-radius: 99px; background: #f0e2cb; overflow: hidden; }
.lv u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9be07d, #5cc76a); border-radius: 99px; transition: width .4s; }
.resbar { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; padding: 4px 8px; border-radius: 99px; z-index: 5; }
.res { display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 18px; border-right: 2px dashed #f0e2cb; white-space: nowrap; }
.res:last-child { border-right: none; }
.res span { font-size: 20px; }
.res b { font-weight: normal; }
.res.dirty { color: #8a6a3a; }
.res.trash.warn { color: #e2687f; animation: wob 1s ease-in-out infinite; }
@keyframes wob { 50% { transform: scale(1.08); } }
.dirty-ico { filter: sepia(1) saturate(4) hue-rotate(-25deg) brightness(.75); }
.bump { animation: bump .45s; }
@keyframes bump { 30% { transform: scale(1.2); } }
.coinbar { position: fixed; right: 12px; top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 99px; font-size: 24px; z-index: 5; }
.coinbar b { font-weight: normal; min-width: 44px; text-align: right; }
.coinbar .c { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a8, var(--gold) 60%, var(--gold-d)); border: 3px solid #fff; display: grid; place-items: center; font-size: 15px; color: #b0740a; }
.plus { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(180deg, #8be27a, #4fbf5c); border: 3px solid #fff; color: #fff; display: grid; place-items: center; font-size: 30px; line-height: 1; box-shadow: 0 3px 0 #3a9a48; }
.plus:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a9a48; }

.gear { position: fixed; right: 14px; top: calc(max(12px, env(safe-area-inset-top)) + 80px); width: 52px; height: 52px; border-radius: 18px; font-size: 28px; line-height: 1; z-index: 6; }
.gear:active { transform: rotate(40deg); }
.gearmenu { position: fixed; right: 14px; top: calc(max(12px, env(safe-area-inset-top)) + 140px); padding: 8px; z-index: 7; display: flex; flex-direction: column; gap: 6px; min-width: 230px; }
.gearmenu button { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; font-size: 17px; padding: 10px 12px; border-radius: 16px; background: #fff; border: 3px solid #f0e3c8; box-shadow: 0 3px 0 #f0e3c8; }
.gearmenu button span { font-size: 24px; }
.gearmenu button small { flex-basis: 100%; padding-left: 34px; margin-top: -4px; font-size: 13px; color: var(--soft); }
.gearmenu button:active { transform: translateY(2px); box-shadow: 0 1px 0 #f0e3c8; }
.zoom { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.zoom button { width: 52px; height: 52px; border-radius: 18px; font-size: 28px; line-height: 1; }
.zoom button:disabled { opacity: .45; }

/* 퀘스트 */
.quest { position: fixed; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); width: 300px; padding: 10px 12px; z-index: 5; }
.quest .t { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.quest .t em { font-style: normal; background: var(--green); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 14px; }
.quest .t .fold { margin-left: auto; font-size: 14px; color: var(--soft); }
.quest .lesson { font-size: 13px; color: var(--soft); margin: 2px 0 4px; }
.quest .q { padding: 6px 0 4px; border-top: 2px dashed #f0e2cb; }
.quest .q:first-of-type { border-top: none; }
.quest .q h4 { margin: 0; font-weight: normal; font-size: 16px; display: flex; gap: 6px; align-items: baseline; }
.quest .q.done h4 { color: #5cb35f; text-decoration: line-through; }
.quest .q p { margin: 2px 0 0 24px; font-size: 13px; color: var(--soft); line-height: 1.3; }
.quest .q .prog { margin: 3px 0 0 24px; font-size: 13px; background: #fff; border-radius: 10px; padding: 2px 8px; display: inline-block; }
.quest .q .hint { margin: 3px 0 0 24px; font-size: 12px; color: var(--blue-d); }
.quest.min .q, .quest.min .lesson, .quest.min .reward { display: none; }
.quest.min .q.now { display: block; border-top: none; }
.quest .reward { font-size: 13px; text-align: center; color: var(--soft); margin-top: 4px; }
.quest .xprow { margin-top: 6px; padding-top: 6px; border-top: 2px dashed #f0e2cb; font-size: 14px; }
.quest .xprow .gauge { height: 10px; margin-top: 3px; }
.quest .xprow .gauge > div { background: linear-gradient(90deg, #ffd36e, #ffb547); }
.quest .xprow.ok { color: var(--green-d); }
.quest .xprow.ok .gauge > div { background: linear-gradient(90deg, #8be27a, #4fbf5c); }
.lv i { width: 120px; }
.lv u { background: linear-gradient(90deg, #ffd36e, #ffb547); }

/* 상점·저장소 */
.dock { position: fixed; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: flex-end; z-index: 5; }
.big { width: 104px; height: 104px; border-radius: 32px; display: grid; place-items: center; position: relative; border: 5px solid #fff; box-shadow: 0 6px 0 var(--sh), 0 12px 24px rgba(90, 62, 43, .25); }
.big:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--sh); }
.big svg { width: 70px; height: 70px; margin-top: -10px; }
.big b { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: normal; white-space: nowrap; font-size: 18px; padding: 3px 14px; border-radius: 99px; border: 3px solid #fff; }
.shop { background: linear-gradient(180deg, #ffe4a3, #ffc35c); --sh: #d99a3a; }
.shop b { background: var(--pink); box-shadow: 0 3px 0 var(--pink-d); }
.store { background: linear-gradient(180deg, #d9f2c4, #a9dc84); --sh: #7fb75a; width: 88px; height: 88px; border-radius: 28px; }
.store svg { width: 58px; height: 58px; }
.store b { background: #8a5a3b; box-shadow: 0 3px 0 #6b4329; font-size: 16px; }

/* 건설 모드 */
.buildbar { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 26px; text-align: center; z-index: 6; max-width: calc(100vw - 24px); }
.buildbar h3 { margin: 0; font-weight: normal; font-size: 20px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.buildbar .legend { display: flex; gap: 14px; justify-content: center; font-size: 14px; margin-top: 4px; color: var(--soft); flex-wrap: wrap; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; margin-right: 4px; }
.confirm { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 14px; z-index: 6; }
.cbtn { font-size: 20px; color: #fff; padding: 12px 24px; border-radius: 99px; border: 4px solid #fff; white-space: nowrap; }
.cbtn.ok { background: linear-gradient(180deg, #8be27a, #4fbf5c); box-shadow: 0 5px 0 #3a9a48; }
.cbtn.no { background: linear-gradient(180deg, #ffb0be, #ff8fa3); box-shadow: 0 5px 0 var(--pink-d); }
.cbtn.turn { background: linear-gradient(180deg, #ffd98a, #ffb84d); box-shadow: 0 5px 0 #d99528; }
.cbtn:disabled { background: var(--grey); box-shadow: 0 5px 0 #c2b7a7; }
.costs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cost { background: #fff; border-radius: 99px; padding: 1px 9px; font-size: 15px; }
.cost.lack { background: #ffe6ea; color: var(--pink-d); }

/* 말풍선 메뉴 */
.pop { position: fixed; left: 0; top: 0; z-index: 8; width: 240px; padding: 10px 12px 12px; text-align: center; transform: translate(-50%, -100%); }
.pop::after { content: ''; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 0; border-top-color: #fff; }
.pop h4 { margin: 0 0 4px; font-weight: normal; font-size: 19px; }
.pop .info { font-size: 14px; color: var(--soft); line-height: 1.4; }
.pop .gauge { margin: 4px auto 0; width: 170px; }
.pop .acts { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.pop .a { flex: 1; border-radius: 16px; padding: 7px 4px; font-size: 15px; color: #fff; border: 3px solid #fff; line-height: 1.2; }
.pop .a span { display: block; font-size: 22px; }
.pop .a:disabled { background: var(--grey) !important; box-shadow: 0 3px 0 #c2b7a7 !important; }
.a.go { background: linear-gradient(180deg, #8be27a, #4fbf5c); box-shadow: 0 3px 0 #3a9a48; }
.a.fuel { background: linear-gradient(180deg, #ffbf6b, #ff9a3d); box-shadow: 0 3px 0 var(--orange-d); }
.a.info2 { background: linear-gradient(180deg, #8fd4f5, #5bb8e8); box-shadow: 0 3px 0 var(--blue-d); }
.a.dem { background: linear-gradient(180deg, #ff9fb0, #ff7a8f); box-shadow: 0 3px 0 var(--pink-d); }
.a.paint { background: linear-gradient(180deg, #c3a6ff, #9b7be8); box-shadow: 0 3px 0 #7458c4; }   /* 🎨 색 바꾸기 */

/* 지도 위 표시 */
.lab { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none; }
.lab.bubble {
  pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 26px;
  box-shadow: 0 3px 0 #f0d77d, 0 6px 12px rgba(0, 0, 0, .12); animation: floaty 1.4s ease-in-out infinite; cursor: pointer;
}
.lab.bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
@keyframes floaty { 50% { margin-top: -5px; } }
/* 채굴 중: 세금 말풍선과 같은 말풍선 안에서 시계 바늘이 빙그르르 돈다 */
.lab.bubble .clk { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 4px solid #7fc4f0; background: #f2fbff; display: block; box-sizing: border-box; }
.lab.bubble .clk::before { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #5a3e2b; }
.lab.bubble .clk::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: #ff8fa3;
  transform-origin: 50% 0; transform: rotate(180deg); animation: tick 1s linear infinite; }
@keyframes tick { from { transform: rotate(180deg); } to { transform: rotate(540deg); } }
.lab.tag { background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 2px 8px; font-size: 14px; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.lab.tag.red { background: var(--pink); color: #fff; }
.lab.tag.grow { color: var(--green-d); }
.lab.tag.lock { background: rgba(90, 62, 43, .8); color: #fff; font-size: 16px; }
.lab.float { font-size: 24px; color: #fff; text-shadow: 0 2px 0 var(--orange-d), 0 0 6px rgba(0, 0, 0, .3); animation: rise 1.4s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; margin-top: 6px; } 15% { opacity: 1; margin-top: 0; } 100% { opacity: 0; margin-top: -50px; } }

/* 게이지 */
.gauge { height: 14px; background: #efe6d6; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.gauge > div { height: 100%; background: linear-gradient(90deg, var(--orange), #ffd36e); border-radius: 999px; transition: width .4s; }
.gauge.green > div { background: linear-gradient(90deg, var(--green), #a8e48c); }

/* 버튼 */
.btn { border-radius: 999px; padding: 11px 20px; font-size: 18px; background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-d); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-d); }
.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.btn.pink { background: var(--pink); box-shadow: 0 4px 0 var(--pink-d); }
.btn.ghost { background: #fff; color: var(--ink); border: 3px solid var(--line, #f0e3c8); box-shadow: 0 4px 0 #f0e3c8; }
.btn.small { padding: 7px 14px; font-size: 15px; }
.btn:disabled { background: var(--grey); box-shadow: 0 4px 0 #c2b7a7; color: #fff; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* 모달 */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(90, 62, 43, .35); }
.modal-card { position: relative; width: min(560px, 100%); max-height: 88dvh; overflow: auto; background: var(--cream); border: 5px solid #fff; border-radius: 30px; padding: 22px 20px 20px; box-shadow: 0 8px 0 var(--cream-d), 0 20px 40px rgba(0, 0, 0, .2); animation: modal-in .32s cubic-bezier(.3, 1.5, .5, 1); }
.modal-card.wide { width: min(780px, 100%); }
@keyframes modal-in { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card .x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #f0e3c8; background: #fff; font-size: 18px; }
.m-title { font-size: 26px; text-align: center; margin: 0 40px 4px; }
.m-sub { font-size: 16px; text-align: center; color: var(--soft); margin-bottom: 14px; line-height: 1.4; }
.m-big { font-size: 64px; text-align: center; line-height: 1.1; margin: 4px 0; }
.m-text { font-size: 17px; line-height: 1.55; text-align: center; }
.note { font-size: 14px; color: var(--soft); background: #fff; border-radius: 14px; padding: 8px 12px; line-height: 1.45; margin-top: 8px; }
.sec-title { font-size: 19px; margin: 14px 4px 6px; }
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.tabs button { padding: 8px 18px; border-radius: 99px; background: #fff; border: 3px solid #f0e3c8; font-size: 17px; }
.tabs button.on { background: var(--pink); color: #fff; border-color: #fff; box-shadow: 0 3px 0 var(--pink-d); }

/* 문제 */
.question { background: #fff; border-radius: 20px; padding: 16px; font-size: 21px; line-height: 1.45; border: 3px solid #f0e3c8; text-align: center; margin-bottom: 12px; }
.choices { display: grid; gap: 9px; }
.choices.ox { grid-template-columns: 1fr 1fr; }
.choice { border: 3px solid #f0e3c8; background: #fff; border-radius: 18px; padding: 13px 14px; font-size: 18px; text-align: left; box-shadow: 0 4px 0 #f0e3c8; line-height: 1.35; }
.choices.ox .choice { text-align: center; font-size: 40px; padding: 10px; }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #f0e3c8; }
.choice.right { background: #e5f8d9; border-color: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.choice.wrong { background: #ffe6ea; border-color: var(--pink); box-shadow: 0 4px 0 var(--pink-d); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { text-align: center; margin-top: 12px; font-size: 19px; line-height: 1.45; }
.feedback .explain { font-size: 16px; color: var(--soft); margin-top: 6px; background: #fff; border-radius: 14px; padding: 8px 12px; }
.feedback .good { color: var(--green-d); font-size: 24px; }
.feedback .bad { color: var(--pink-d); font-size: 22px; }
.countdown { font-size: 44px; text-align: center; color: var(--pink-d); margin: 10px 0; }
.loading, .error { text-align: center; font-size: 18px; padding: 24px 0; }

/* 상점 목록 */
.menu-sec { margin-bottom: 14px; }
.menu-sec h4 { margin: 0 0 6px 4px; font-size: 18px; font-weight: normal; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.item { background: #fff; border: 3px solid #f0e3c8; border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.item .top { display: flex; gap: 10px; align-items: center; }
.item .ic { font-size: 38px; }
.item .nm { font-size: 19px; }
.item p { margin: 0; font-size: 13px; color: var(--soft); line-height: 1.35; flex: 1; }
.locked-menu { display: flex; align-items: center; gap: 10px; background: #f1ebe2; border: 3px dashed #dccfbd; border-radius: 18px; padding: 10px 12px; color: #9c8b78; font-size: 16px; margin-bottom: 8px; }
.locked-menu .ic { font-size: 26px; filter: grayscale(1); opacity: .6; }
.locked-menu small { display: block; font-size: 13px; }

/* 저장소 */
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { background: #fff; border: 3px solid #f0e3c8; border-radius: 18px; padding: 8px; text-align: center; }
.slot span { display: block; font-size: 32px; }
.slot b { font-weight: normal; font-size: 20px; }
.slot small { display: block; font-size: 13px; color: var(--soft); }
.slot.locked { background: #f1ebe2; border-style: dashed; color: #9c8b78; }
.slot.locked span { filter: grayscale(1); opacity: .5; }
.list-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid #f0e3c8; border-radius: 18px; padding: 8px 12px; margin-bottom: 8px; }
.list-row .ic { font-size: 28px; }
.list-row .nm { flex: 1; font-size: 17px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: #fff; border: 3px solid #f0e3c8; border-radius: 16px; padding: 8px 12px; font-size: 16px; }
.stat b { font-size: 22px; font-weight: normal; }

/* 학생 선택 */
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.picker-grid.four { grid-template-columns: repeat(4, 1fr); }
.pick { border: 3px solid #f0e3c8; background: #fff; border-radius: 16px; padding: 12px 6px; font-size: 19px; box-shadow: 0 4px 0 #f0e3c8; }
.pick.on { background: var(--green); color: #fff; border-color: #fff; box-shadow: 0 4px 0 var(--green-d); }

#toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #fff; border-radius: 999px; padding: 9px 18px; font-size: 17px; box-shadow: 0 4px 0 #f0e3c8, 0 8px 18px rgba(0, 0, 0, .12); animation: toast-in .3s cubic-bezier(.3, 1.6, .5, 1); text-align: center; max-width: 90vw; }
.toast.good { background: #effae6; color: var(--green-d); }
.toast.bad { background: #ffeef1; color: var(--pink-d); }
@keyframes toast-in { from { transform: translateY(-10px) scale(.9); opacity: 0; } }
#saveState { position: fixed; left: 50%; transform: translateX(-50%); bottom: 4px; font-size: 12px; color: rgba(90, 62, 43, .6); z-index: 4; }
.confetti { position: fixed; top: -40px; z-index: 70; font-size: 26px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* 좁은 화면 (세로 태블릿) */
@media (max-width: 900px) {
  .res { font-size: 15px; padding: 2px 5px; }
  .res span { font-size: 16px; }
  .resbar { top: 76px; }
  .quest { width: 250px; }
  .buildbar { top: 128px; }
  #toasts { top: 130px; }
}

/* 주택 개조 버튼 */
.pop .retro { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 2px; max-width: 290px; }
.pop .retro .chip { font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: 99px; border: 2px solid #ffd27a; background: #fff8e6; color: #5a3e2b; cursor: pointer; }
.pop .retro .chip:disabled { opacity: .45; cursor: default; }
.pop .retro .chip.on { border-color: #8be27a; background: #effbe9; }

/* Lv.6 */
.quest .q .qgo { margin: 6px 0 2px 24px; }
.sim-year { font-size: 34px; text-align: center; color: var(--orange-d); margin: 8px 0; }
.sim-bar { height: 14px; margin-bottom: 8px; }
.sim-row { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 7px 10px; border-radius: 12px; margin: 5px 0; font-size: 14px; background: #f6f1e8; }
.sim-row b { white-space: nowrap; min-width: 72px; }
.sim-row.good { background: #effbe9; }
.sim-row.bad { background: #ffe8ec; color: #b4384f; }
.sim-row.mid { background: #fff6dc; }
.cert { text-align: center; border: 6px double #e8b582; border-radius: 18px; padding: 14px 10px 6px; background: linear-gradient(180deg, #fffaf0, #fff3dc); }
.cert-ribbon { font-size: 54px; line-height: 1; }
.cert-title { font-size: 28px; color: var(--orange-d); margin: 6px 0 2px; }
.cert-name { font-size: 22px; margin: 4px 0 8px; }
.cert-score { font-size: 24px; color: #3a9a48; margin: 10px 0; }
.cert-date { font-size: 13px; color: var(--soft); margin: 8px 0; }

/* 선생님이 게임을 끝낼 때: 10초 카운트다운 */
.cd { position: fixed; inset: 0; z-index: 9999; background: rgba(60, 40, 25, .55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.cd-box { background: #fff9ec; border: 6px double #e8b582; border-radius: 28px; padding: 26px 40px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.cd-t { font-size: 30px; }
.cd-s { font-size: 18px; color: var(--soft); margin-top: 6px; }
.cd-num { font-size: 120px; line-height: 1.1; color: #e8952a; margin-top: 8px; }
.cd-num.tick { animation: cdpop .5s ease-out; }
@keyframes cdpop { from { transform: scale(1.5); opacity: .4; } to { transform: scale(1); opacity: 1; } }

/* 내 이름 고르기 */
.picker-grid.names { grid-template-columns: repeat(2, 1fr); }
.pick small { display: block; font-size: 12px; color: var(--soft); margin-top: 2px; }
.pick.taken { opacity: .5; box-shadow: none; }

/* 입장 화면 · 프로필 · 동물 캐릭터 */
.avatar { overflow: hidden; padding: 2px; }
.avatar svg { display: block; }
.profile { cursor: pointer; }
.login { text-align: center; }
.fld { display: flex; align-items: center; gap: 10px; margin: 8px auto; max-width: 420px; }
.fld > span { width: 92px; text-align: right; font-size: 18px; color: var(--soft); flex: none; }
.fld-in { flex: 1; display: flex; align-items: center; gap: 6px; }
.fld-in b { font-weight: normal; font-size: 19px; }
.fld input { flex: 1; min-width: 0; font-family: inherit; font-size: 20px; padding: 9px 12px; border: 3px solid #f0e3c8; border-radius: 14px; background: #fff; color: var(--ink); outline: none; }
.fld input:focus { border-color: var(--green); }
.ava-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 440px; margin: 6px auto 10px; }
.ava { border: 3px solid #f0e3c8; background: #fff; border-radius: 18px; padding: 6px 4px 4px; box-shadow: 0 4px 0 #f0e3c8; font-family: inherit; color: var(--ink); }
.ava .ava-face { display: block; width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffd99a); }
.ava small { font-size: 13px; color: var(--soft); }
.ava.on { border-color: var(--green); background: #effae6; box-shadow: 0 4px 0 var(--green-d); }
.code-box { background: #fff4dc; border: 3px dashed #f3c97e; border-radius: 18px; padding: 6px 10px; max-width: 440px; margin: 10px auto 4px; }
.code-in { letter-spacing: 4px; text-transform: uppercase; text-align: center; }
.login-err { color: #e66b82; min-height: 22px; margin: 4px 0; }
.big-go { font-size: 21px; padding: 12px 34px; }
.cert-avatar { width: 64px; height: 64px; margin: 2px auto 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffd99a); border: 3px solid #fff; }
.cert-avatar:empty { display: none; }
.fld > span { white-space: nowrap; }
.code-box .fld > span { width: auto; }
.login .m-big { font-size: 34px; margin: 0; }
.login .m-title { margin: 2px 0 4px; }
.login .fld { margin: 6px auto; }
.ava { padding: 4px 4px 2px; }
.ava .ava-face { width: 46px; height: 46px; }
.code-in::placeholder { letter-spacing: 0; }
.res.warn { color: #e2687f; animation: wob 1s ease-in-out infinite; }

/* 정보: 점수 한 줄, 해설은 아래 줄에 작은 글씨 */
.list-row.sc { padding: 10px 14px; }
.list-row.sc .nm b { display: block; font-weight: normal; font-size: 18px; }
.list-row.sc .nm small { display: block; margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--soft); }
.list-row.sc .gauge { margin-top: 6px; }

/* 🎨 색 바꾸기 */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 10px 0 12px; }
.swc { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 4px; border-radius: 16px; }
.swc i { width: 52px; height: 52px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12), 0 0 0 2px #f0e3c8; }
.swc small { font-size: 14px; }
.swc.on i { box-shadow: 0 0 0 4px #8a5a3b; }
.swc:active i { transform: scale(.94); }

/* 입장 코드 칸: 위 칸들보다 크지 않게 */
.code-box { max-width: 340px; padding: 4px 10px; margin: 8px auto 2px; border-width: 2px; }
.code-box .fld { margin: 4px auto; gap: 8px; }
.code-box .fld > span { font-size: 16px; }
.code-box .code-in { font-size: 17px; padding: 6px 10px; letter-spacing: 3px; }
