:root {
  color-scheme: light;
  --mint: #bfeedd;
  --mint-d: #3fbf96;
  --peach: #ffd9c7;
  --coral: #ff8a80;
  --lav: #e3dcff;
  --lav-d: #8b74e8;
  --butter: #fff1b8;
  --sky: #cdeaff;
  --ink: #3b3350;
  --ink-2: #7a7290;
  --card: #ffffffee;
  --line: #ece6f5;
  --ok: #34c38f;
  --bad: #ff6b6b;
  --gold: #ffc23d;
  --c-hyeji: #ff9fb8;
  --c-dahyun: #7fc8ff;
  --c-ahyun: #ffcf4d;
  --c-seungwoo: #b39dff;
  --radius: 22px;
  --shadow: 0 6px 0 #00000012, 0 10px 24px #6a5a9a1f;
  --display: "Jua", "Gowun Dodum", system-ui, sans-serif;
  --body: "Gowun Dodum", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: #f4f0ff;
  overscroll-behavior: none;
  /* 한글이 단어 중간에서 잘리지 않게 (띄어쓰기에서 줄바꿈) */
  word-break: keep-all;
  overflow-wrap: break-word;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: linear-gradient(180deg, #d9f3ff 0%, #f0eaff 55%, #ffe9e1 100%);
  background-size: cover;
  background-position: center;
  overflow-x: hidden;
}
#app.bg-game { background-image: linear-gradient(180deg, #fffaf0 0%, #f6f1ff 100%); }
#app.bg-result { background-image: linear-gradient(180deg, #fff3c9 0%, #ffe1ea 60%, #e8e0ff 100%); }
#app.bg-ranking { background-image: linear-gradient(180deg, #e8dcff 0%, #ffdccf 100%); }
#app.bg-home { background-image: linear-gradient(180deg, #d4f5e6 0%, #e9f6ff 50%, #fff5df 100%); }
#bg {
  position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 0;
  background-size: cover; background-position: center bottom;
}
#app { z-index: 1; }
#app.has-img { background: transparent; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  gap: 14px;
  animation: fadeUp .35s ease both;
}
.screen.with-nav { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

h1, h2, h3, .display { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -0.2px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(6px);
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display);
  font-size: 19px;
  padding: 15px 18px;
  border-radius: 18px;
  background: var(--mint-d);
  color: white;
  box-shadow: 0 5px 0 #2a9a77;
  transition: transform .08s, box-shadow .08s;
  width: 100%;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #2a9a77; }
a.btn { display: block; text-align: center; text-decoration: none; }
.btn.coral { background: var(--coral); box-shadow: 0 5px 0 #e0645a; }
.btn.coral:active { box-shadow: 0 1px 0 #e0645a; }
.btn.lav { background: var(--lav-d); box-shadow: 0 5px 0 #6a54c4; }
.btn.lav:active { box-shadow: 0 1px 0 #6a54c4; }
.btn.ghost { background: white; color: var(--ink); box-shadow: 0 5px 0 #e2dbef; }
.btn.ghost:active { box-shadow: 0 1px 0 #e2dbef; }
.btn:disabled { opacity: .5; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px;
  background: #ffffffcc; box-shadow: 0 3px 0 #00000010;
  display: grid; place-items: center; font-size: 20px;
}

/* ---------- start ---------- */
.start { justify-content: space-between; text-align: center; }
.logo { margin-top: 7vh; }
.logo .small-title { font-family: var(--display); font-size: 22px; color: var(--lav-d); }
.logo .big-title {
  font-family: var(--display); font-size: 58px; line-height: 1.05;
  color: white;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
}
.logo .sub-title {
  display: inline-block; margin-top: 10px;
  font-family: var(--display); font-size: 24px;
  background: var(--gold); color: var(--ink);
  padding: 6px 18px; border-radius: 99px; box-shadow: 0 4px 0 #d99d1a;
  transform: rotate(-3deg);
}
.ribbon {
  width: 92%; aspect-ratio: 3 / 1; margin: 0 auto;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  display: grid; place-items: center; padding-bottom: 4%;
  font-family: var(--display); font-size: 26px; color: var(--ink);
}
.logo .big-title, .big-title.mini {
  font-family: var(--display); line-height: 1.05; color: white;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.logo-main { display: block; width: 86%; max-width: 360px; margin: 4px auto 0; filter: drop-shadow(0 4px 0 #0001); }
.logo-main.mini { width: 150px; margin: 0; }
.big-title.mini { font-size: 30px; text-shadow: 0 3px 0 var(--ink); }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 -4px; }

/* 원클포클 동그란 배지 — 시작 화면 캐릭터 4마리 한가운데에 둥실 */
.logo-badge { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 4px 8px #0002); }
.logo-badge.text {
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9a8 60%, #ffd36b);
  border: 3px solid white; box-shadow: 0 4px 0 #e2a92a, 0 6px 14px #0002;
  font-family: var(--display); font-size: 20px; line-height: 1.05; color: var(--ink);
}
.logo-badge.small { width: 52px; height: 52px; font-size: 13px; }
.center-badge {
  position: absolute; left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  animation: floaty 3s ease-in-out infinite; z-index: 2; pointer-events: none;
}
@keyframes floaty {
  0%, 100% { transform: translate(-50%, -50%) rotate(-4deg); }
  50% { transform: translate(-50%, -60%) rotate(4deg); }
}
.hero.mascots { grid-template-columns: 1fr 1fr; gap: 6px 10px; align-content: center; position: relative; }
.mascot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mascot .bob { animation-delay: inherit; }
.hero { display: grid; place-items: center; flex: 1; }
.char { display: grid; place-items: center; isolation: isolate; }
/* 등·뒤 아이템(흰옷·기둥·보좌)은 캐릭터 그림 뒤로 */
.deco.back { z-index: -1; }
.char img { width: 100%; height: 100%; object-fit: contain; }
/* 세로로 긴 그림(기타·검 등)도 칸 안에 딱 맞게 */
.char > img:not(.deco) { position: absolute; inset: 0; }
.char .emo { line-height: 1; }
.bob { animation: bob 2.4s ease-in-out infinite; }

/* ---------- login ---------- */
.class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.class-btn {
  font-family: var(--display); font-size: 20px;
  padding: 16px 8px; border-radius: 18px;
  background: white; box-shadow: 0 4px 0 #00000014;
  border: 3px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.class-btn .flag { font-size: 26px; }
.class-btn.on { border-color: var(--ink); transform: translateY(2px); box-shadow: 0 2px 0 #00000014; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--display); font-size: 16px; }
.input {
  width: 100%; padding: 14px 16px; font-size: 18px;
  border-radius: 16px; border: 2px solid var(--line); background: white;
  outline: none;
}
.input:focus { border-color: var(--lav-d); }
.pin-input { letter-spacing: 12px; text-align: center; font-size: 26px; font-family: var(--display); }
.hint { background: var(--butter); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; min-height: 18px; text-align: center; }

/* ---------- home ---------- */
.topbar { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--display); font-size: 14px;
  padding: 4px 10px; border-radius: 99px; background: white; box-shadow: 0 2px 0 #0000000f;
}
.chip.cls-혜지반 { background: var(--c-hyeji); }
.chip.cls-다현반 { background: var(--c-dahyun); }
.chip.cls-아현반 { background: var(--c-ahyun); }
.chip.cls-승우반 { background: var(--c-seungwoo); }
.nick { font-family: var(--display); font-size: 22px; }

.stage-card { text-align: center; padding: 18px 16px 16px; position: relative; overflow: hidden; }
.stage-card .stage-name { font-family: var(--display); font-size: 18px; color: var(--mint-d); }
.stage-card .pedestal {
  width: 130px; height: 18px; margin: 0 auto 6px; border-radius: 50%;
  background: radial-gradient(#c9a27e, #a77d58); opacity: .55;
}
.lv-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.lv { font-family: var(--display); font-size: 26px; }
.xpbar { height: 16px; border-radius: 99px; background: #eee8f7; overflow: hidden; margin-top: 6px; }
.xpbar > div {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #7ee0b5, #3fbf96);
  transition: width .8s cubic-bezier(.2,.9,.3,1.2);
}
.streak { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  background: white; border-radius: 20px; padding: 14px 12px;
  box-shadow: 0 5px 0 #00000012;
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  transition: transform .08s;
  position: relative;
}
.mode:active { transform: translateY(3px); }
.mode .m-icon { width: 46px; height: 46px; font-size: 34px; }
.mode .m-name { font-family: var(--display); font-size: 18px; }
.mode .m-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.mode .m-xp { position: absolute; top: 10px; right: 10px; font-size: 11px; font-family: var(--display); background: var(--butter); padding: 2px 7px; border-radius: 99px; }
.mode.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; }
.badge-dot { background: var(--coral); color: white; font-family: var(--display); font-size: 12px; border-radius: 99px; padding: 1px 7px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; justify-content: space-around;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: #ffffffee; backdrop-filter: blur(10px);
  border-radius: 24px 24px 0 0; box-shadow: 0 -4px 20px #6a5a9a1a;
  z-index: 10;
}
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--display); font-size: 13px; color: var(--ink-2); padding: 4px 12px; border-radius: 14px; }
.nav button .ni { font-size: 24px; width: 30px; height: 30px; display: grid; place-items: center; }
.nav button.on { color: var(--ink); background: var(--mint); }

/* ---------- sheet (범위 선택) ---------- */
.sheet-bg { position: fixed; inset: 0; background: #2a204a66; z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: white; border-radius: 26px 26px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  animation: slideUp .28s cubic-bezier(.2,.9,.3,1.1) both;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: #ddd5ec; margin: 0 auto 4px; }
.quick { display: flex; gap: 8px; }
.quick button { flex: 1; padding: 10px 4px; border-radius: 14px; background: #f3effb; font-family: var(--display); font-size: 15px; }
.quick button.on { background: var(--lav-d); color: white; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.topic {
  padding: 9px 10px; border-radius: 12px; background: #f6f3fb; text-align: left;
  font-size: 13px; line-height: 1.25; border: 2px solid transparent;
}
.topic b { font-family: var(--display); font-weight: 400; font-size: 15px; margin-right: 4px; }
.topic.on { background: var(--mint); border-color: var(--mint-d); }

/* ---------- game ---------- */
.game-top { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 12px; border-radius: 99px; background: #ebe5f5; overflow: hidden; }
.progress > div { height: 100%; background: var(--lav-d); border-radius: 99px; transition: width .3s; }
.timebar > div { background: linear-gradient(90deg, #ff8a80, #ffc23d); transition: width 1s linear; }
.combo { font-family: var(--display); color: var(--coral); font-size: 16px; min-width: 64px; text-align: right; }
.hearts { font-size: 20px; letter-spacing: 2px; }
.score-pill { font-family: var(--display); background: white; border-radius: 99px; padding: 4px 12px; box-shadow: 0 2px 0 #0000000f; }

.q-card { padding: 20px 18px; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.q-label { align-self: flex-start; font-family: var(--display); font-size: 13px; background: var(--lav); color: var(--lav-d); padding: 3px 10px; border-radius: 99px; }
.q-text { font-family: var(--display); font-size: 23px; line-height: 1.4; word-break: keep-all; }
.q-text .term { color: var(--lav-d); }
.ox-claim {
  margin-top: 4px; padding: 14px; border-radius: 16px; background: var(--butter);
  font-size: 18px; font-family: var(--display); line-height: 1.4; word-break: keep-all;
}
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  text-align: left; padding: 14px 16px; border-radius: 18px; background: white;
  box-shadow: 0 4px 0 #00000012; font-size: 16.5px; line-height: 1.4; word-break: keep-all;
  display: flex; gap: 10px; align-items: flex-start; border: 2.5px solid transparent;
  transition: transform .08s;
}
.choice:active { transform: translateY(3px); }
.choice .n { font-family: var(--display); color: var(--lav-d); min-width: 18px; }
.choice.ok { border-color: var(--ok); background: #e3faf0; }
.choice.bad { border-color: var(--bad); background: #ffeaea; animation: shake .35s; }
.choice.dim { opacity: .45; }
.ox-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ox-btn {
  font-family: var(--display); font-size: 64px; padding: 18px 0; border-radius: 24px;
  background: white; box-shadow: 0 6px 0 #00000014; line-height: 1;
}
.ox-btn.o { color: #3a9df0; }
.ox-btn.x { color: var(--bad); }
.ox-btn.ok { background: #e3faf0; outline: 3px solid var(--ok); }
.ox-btn.bad { background: #ffeaea; outline: 3px solid var(--bad); animation: shake .35s; }

.feedback { border-radius: 18px; padding: 14px 16px; animation: pop .3s both; }
.feedback.ok { background: #e3faf0; }
.feedback.bad { background: #fff0ec; }
.feedback .fb-title { font-family: var(--display); font-size: 20px; }
.feedback .fb-ans { margin-top: 6px; font-size: 16px; line-height: 1.45; word-break: keep-all; }
.feedback .fb-ans b { font-family: var(--display); font-weight: 400; color: var(--mint-d); }

.blank-tools { display: flex; gap: 8px; }
.blank-tools button { flex: 1; padding: 10px; border-radius: 14px; background: white; box-shadow: 0 3px 0 #00000010; font-family: var(--display); font-size: 15px; }
.chosung { font-family: var(--display); font-size: 20px; letter-spacing: 3px; color: var(--lav-d); text-align: center; padding: 8px; background: var(--lav); border-radius: 14px; word-break: break-all; }

/* 공부하기 (암기 카드) */
.mode.study-mode { background: linear-gradient(135deg, #d9f5e8, #e3f1ff); border: 2.5px solid var(--mint-d); }
.mode.study-mode .m-name { font-size: 21px; }
.flash-card { display: flex; flex-direction: column; gap: 10px; min-height: 280px; cursor: pointer; }
.flash-answer { margin-top: auto; border-top: 2px dashed var(--line); padding-top: 12px; }
.fa-hidden { text-align: center; color: var(--ink-2); padding: 18px 0; line-height: 1.6; }
.fa-label { font-family: var(--display); font-size: 14px; color: var(--mint-d); }
.fa-text { font-family: var(--display); font-size: 22px; line-height: 1.45; word-break: keep-all; animation: pop .3s both; }
.flash-card.shown { background: #fbfffd; }
.big-q { font-family: var(--display); font-size: 18px; line-height: 1.5; word-break: keep-all; white-space: pre-line; background: #f6f3ff; border-radius: 14px; padding: 12px 14px; }
.big-q.compact { font-size: 15px; padding: 8px 10px; }
.sub-q { font-family: var(--display); font-size: 21px; color: var(--lav-d); margin-top: 4px; }
.big-q.compact + .sub-q { font-size: 16px; }
.sub-arrow { color: var(--coral); }
/* 공부하기 — 대문항 페이지 */
.study-page { display: flex; flex-direction: column; gap: 12px; }
.study-sub { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1.5px dashed var(--line); }
.ss-label { font-family: var(--display); font-size: 17px; color: var(--lav-d); }
.ss-known { font-family: var(--display); font-size: 13px; padding: 4px 10px; border-radius: 99px; background: #f3effb; color: var(--ink-2); flex: none; }
.study-sub.known .ss-known { background: var(--mint); color: var(--ink); }
.ss-answer {
  width: 100%; text-align: left; border-radius: 14px; padding: 12px 14px; min-height: 48px;
  background: repeating-linear-gradient(45deg, #ece6f7, #ece6f7 8px, #f4f0fb 8px, #f4f0fb 16px);
  border: 2px dashed #d6cdea;
}
.ss-answer.open { background: #e9fbf2; border: 2px solid var(--mint-d); animation: pop .25s both; }
.ss-hidden { color: var(--ink-2); font-size: 14px; }
.ss-text { font-family: var(--display); font-size: 18px; line-height: 1.5; word-break: keep-all; }
.study-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.study-grid button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px; text-align: left;
  border-radius: 12px; background: #f6f3fb; border: 2px solid transparent; min-height: 74px;
}
.study-grid button b { font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--lav-d); }
.study-grid button span { font-size: 11.5px; line-height: 1.3; word-break: keep-all; }
.study-grid button small { font-size: 11px; color: var(--ink-2); margin-top: auto; }
.study-grid button.part { background: var(--butter); }
.study-grid button.done { background: var(--mint); }
.study-grid button.cur { border-color: var(--lav-d); }
.key-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; align-items: center; }
.key-chips .fa-label { width: 100%; }
.key-chip { font-size: 13px; padding: 3px 9px; border-radius: 99px; background: #e3faf0; border: 1.5px solid var(--mint-d); }
.key-chip.miss { background: #ffeaea; border-color: var(--bad); }
.level-head { font-family: var(--display); font-size: 18px; text-align: center; }
.mock-title { white-space: pre-line; }

/* mock exam */
.mode.mock-mode { background: linear-gradient(135deg, #fff1b8, #ffd9c7); border: 2.5px solid var(--gold); }
.mode.mock-mode .m-name { font-size: 21px; }
.mock-input { resize: none; line-height: 1.45; min-height: 46px; padding: 10px 12px; font-size: 16px; overflow: hidden; }
.mock-page { display: flex; flex-direction: column; gap: 12px; }
.mock-title { font-family: var(--display); font-size: 19px; line-height: 1.45; word-break: keep-all; }
.mock-num { color: var(--lav-d); font-size: 22px; }
.mock-field { display: flex; flex-direction: column; gap: 4px; }
.mf-label { font-family: var(--display); font-size: 15px; color: var(--lav-d); }
.mock-grid button.part { background: var(--butter); }
.mock-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mock-grid button {
  padding: 8px 2px; border-radius: 10px; background: #f3effb; font-family: var(--display); font-size: 13px;
  border: 2px solid transparent;
}
.mock-grid button.on { background: var(--mint); }
.mock-grid button.cur { border-color: var(--lav-d); }

/* order */
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot {
  min-height: 48px; border-radius: 14px; border: 2.5px dashed #d6cdea; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; font-family: var(--display); font-size: 17px; background: #ffffff88; text-align: left;
}
.slot .sn { width: 26px; height: 26px; border-radius: 50%; background: var(--lav); color: var(--lav-d); display: grid; place-items: center; font-size: 14px; flex: none; }
.slot.filled { border-style: solid; border-color: var(--lav-d); background: white; }
.slot.ok { border-color: var(--ok); background: #e3faf0; }
.slot.bad { border-color: var(--bad); background: #ffeaea; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { padding: 10px 14px; border-radius: 14px; background: white; box-shadow: 0 4px 0 #00000014; font-family: var(--display); font-size: 16px; }
.tile.used { visibility: hidden; }
/* Lv.2·3 순서 맞추기 · 빈칸 */
.order-slots { display: flex; flex-direction: column; gap: 6px; }
.order-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.order-tiles .tile { font-size: 15px; line-height: 1.3; }
.cloze-card { font-size: 17px; line-height: 2.1; word-break: keep-all; }
/* 공부 모드 카드 (Lv.2·3) */
.mode.focus-mode { background: linear-gradient(135deg, #fff1de, #ffe3ef); border: 2.5px solid #ffb37a; }
.mode .m-xp.due { background: #ff6b6b; color: white; }

/* ---------- result ---------- */
.result { text-align: center; justify-content: center; }
.big-score { font-family: var(--display); font-size: 64px; line-height: 1; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stats .card { padding: 12px 6px; }
.result-stats .v { font-family: var(--display); font-size: 24px; }
.result-stats .k { font-size: 12px; color: var(--ink-2); }
.xp-gain { font-family: var(--display); font-size: 28px; color: var(--mint-d); animation: pop .5s .2s both; }
.levelup-banner {
  font-family: var(--display); font-size: 30px; color: white;
  background: linear-gradient(90deg, #ff9fb8, #b39dff, #7fc8ff);
  border-radius: 20px; padding: 10px; box-shadow: var(--shadow);
  animation: pop .6s .4s both;
}
.new-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- ranking ---------- */
.tabs { display: flex; background: #ffffffaa; border-radius: 16px; padding: 4px; gap: 4px; }
.tabs button { flex: 1; padding: 10px 4px; border-radius: 12px; font-family: var(--display); font-size: 15px; color: var(--ink-2); }
.tabs button.on { background: white; color: var(--ink); box-shadow: 0 2px 0 #0000000f; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; text-align: center; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.podium .block { width: 100%; border-radius: 14px 14px 6px 6px; font-family: var(--display); font-size: 26px; color: white; display: grid; place-items: center; }
.podium .p1 .block { height: 86px; background: var(--gold); }
.podium .p2 .block { height: 64px; background: #b9c3d6; }
.podium .p3 .block { height: 48px; background: #e0a37a; }
.podium .pn { font-family: var(--display); font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; background: white; border-radius: 16px; padding: 10px 12px; box-shadow: 0 3px 0 #0000000d; }
.rank-row.me { outline: 3px solid var(--mint-d); }
.rank-row .rk { font-family: var(--display); font-size: 18px; width: 28px; text-align: center; }
.rank-row .rc { width: 40px; height: 40px; font-size: 30px; }
.rank-row .rn { flex: 1; min-width: 0; }
.rank-row .rn .nm { font-family: var(--display); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .rx { font-family: var(--display); font-size: 16px; text-align: right; }
.class-bar { height: 12px; border-radius: 99px; background: #eee8f7; overflow: hidden; margin-top: 4px; }
.class-bar > div { height: 100%; border-radius: 99px; }

/* ---------- teacher ---------- */
.scope-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.scope-tabs button { flex: none; padding: 8px 14px; border-radius: 99px; background: #ffffffcc; font-family: var(--display); font-size: 15px; box-shadow: 0 2px 0 #0000000f; }
.scope-tabs button.on { background: var(--lav-d); color: white; }
.t-list { display: flex; flex-direction: column; gap: 6px; }
.t-row { display: flex; align-items: center; gap: 8px; background: white; border-radius: 14px; padding: 8px 10px; box-shadow: 0 2px 0 #0000000d; }
.t-row.off { background: #ffffff99; }
.t-row .rk { font-family: var(--display); width: 22px; text-align: center; }
.t-row .rn { flex: 1; min-width: 0; }
.t-row .nm { font-family: var(--display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-row .rx { font-family: var(--display); font-size: 15px; text-align: right; }
.t-row .seen { font-size: 11px; color: var(--ink-2); font-family: var(--body); }
.t-row .seen.today { color: var(--mint-d); font-weight: 700; }
.t-row .seen.old { color: var(--bad); }
.dim-char { filter: grayscale(1) opacity(.4); }
.pending-card { display: flex; flex-direction: column; gap: 8px; border: 3px solid var(--gold); }
.pending-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); }
.pending-row .rn { flex: 1; min-width: 0; }
.pending-row .nm { font-family: var(--display); font-size: 17px; }
.ok-btn, .no-btn { font-family: var(--display); font-size: 15px; padding: 8px 12px; border-radius: 12px; }
.ok-btn { background: var(--mint-d); color: white; box-shadow: 0 3px 0 #2a9a77; }
.no-btn { background: #ffeaea; color: var(--bad); }

/* ---------- room ---------- */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-align: center; }
.stage .char { width: 54px; height: 54px; font-size: 38px; background: white; border-radius: 16px; box-shadow: 0 3px 0 #0000000d; }
.stage.locked .char { filter: grayscale(1) brightness(1.6) opacity(.5); }
.stage.now .char { outline: 3px solid var(--mint-d); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; padding: 10px 4px; border-radius: 16px; background: white; }
.badge .bi { width: 52px; height: 52px; font-size: 38px; }
.badge.locked .bi { filter: grayscale(1) opacity(.35); }
.badge .bn { font-family: var(--display); font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid .card { padding: 12px; }
.stat-grid .v { font-family: var(--display); font-size: 22px; }
.stat-grid .k { font-size: 12px; color: var(--ink-2); }

/* ---------- fun: 칭호 · 꾸미기 · 보스 ---------- */
.char { position: relative; }
.deco { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); line-height: 1; max-width: none; pointer-events: none; filter: drop-shadow(0 2px 2px #0002); }
.char img.deco { width: auto; height: auto; object-fit: contain; }
/* 모자: 아랫단이 정수리에 살짝 걸치게 */
.deco.on-head { transform: translate(-50%, -85%) rotate(var(--rot, 0deg)); }
.deco.flip { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scaleX(-1); }
/* 손 아이템: 잡는 곳(--gx, --gy)이 손 위치에 오고, 그 점을 축으로 기울이고 뒤집음 */
.deco.grip { transform: translate(calc(-1 * var(--gx)), calc(-1 * var(--gy))) rotate(var(--rot, 0deg)); transform-origin: var(--gx) var(--gy); }
.deco.grip.flip { transform: translate(calc(-1 * var(--gx)), calc(-1 * var(--gy))) rotate(var(--rot, 0deg)) scaleX(-1); }
/* 실착 그림: 가이드 머리의 눈 높이(58.8%)를 캐릭터 눈에 맞추고 그 점을 축으로 기울임 */
.deco.wear { transform: translate(-50%, -58.8%) rotate(var(--rot, 0deg)); transform-origin: 50% 58.8%; }
.title-chip {
  display: inline-block; font-family: var(--display); font-size: 14px;
  background: linear-gradient(90deg, #fff1b8, #ffd9e5); border-radius: 99px; padding: 3px 10px;
  box-shadow: 0 2px 0 #00000012; margin: 2px 0;
}
.title-chip.sm { font-size: 11px; padding: 1px 7px; }

.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 3px 8px; /* 위쪽은 꼬리표(HOT·①손) 자리 */
  text-align: center; min-width: 0;
  background: white; border-radius: 14px; box-shadow: 0 3px 0 #0000000f; border: 2.5px solid transparent;
}
.shop-item .si-emo { font-size: 30px; line-height: 1.1; }
.shop-item .si-name { font-size: 11.5px; }
.shop-item .si-price { font-family: var(--display); font-size: 12px; color: var(--lav-d); }
.shop-item.worn { border-color: var(--mint-d); background: #e3faf0; }
.shop-item.worn .si-price { color: var(--mint-d); }
.shop-item.locked { opacity: .55; }
.shop-item { position: relative; }

/* 캐릭터 꾹 누르면 크게 */
.pc { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.pc img { -webkit-user-drag: none; pointer-events: none; }
.char-zoom {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: #2a1f4d33; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.char-zoom.on { opacity: 1; }
.cz-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #ffffffe8; border-radius: 28px; padding: 18px 22px 14px;
  box-shadow: 0 10px 30px #0003; transform: scale(.6); transition: transform .18s cubic-bezier(.3, 1.5, .6, 1);
}
.char-zoom.on .cz-card { transform: scale(1); }
.cz-pic { position: relative; }
.cz-pic > .char { position: absolute; left: 0; top: 0; }
.cz-name { font-family: var(--display); font-size: 18px; }
.shop-item .si-price { white-space: nowrap; }
/* 성경책 — 제일 비싼 보물 */
.shop-item.best { background: linear-gradient(160deg, #fff8dc, #ffe9a8); border-color: #f2c14e; }
.shop-item .si-best {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  font-family: var(--display); font-size: 10px; white-space: nowrap;
  background: #f2a900; color: white; border-radius: 99px; padding: 1px 7px; box-shadow: 0 2px 0 #c98700;
}

.title-list { display: flex; flex-direction: column; gap: 6px; }
.title-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: white; border-radius: 14px; box-shadow: 0 2px 0 #0000000d; border: 2.5px solid transparent; }
.title-item .ti-emo { font-size: 26px; }
.title-item.on { border-color: var(--gold); background: #fff8dc; }
.title-item.locked { opacity: .5; }

/* 단계 칭호 */
.tier-card { background: white; border-radius: 14px; box-shadow: 0 2px 0 #0000000d; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tier-bar { height: 7px; border-radius: 99px; background: #eee9fb; overflow: hidden; }
.tier-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mint-d), var(--gold)); }
.tier-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tier-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px 4px 7px; border-radius: 99px;
  font-size: 12.5px; background: #f3f1f8; color: #9a94ad; border: 2px solid transparent;
}
.tier-chip .tc-stars { font-size: 8px; color: #c9c3d8; letter-spacing: -1px; }
.tier-chip.got { background: #fff6d6; color: var(--ink); }
.tier-chip.got .tc-stars { color: #f2a900; }
.tier-chip.on { border-color: var(--gold); background: #ffeaa0; }

/* 히든 칭호 */
.hidden-title.locked { opacity: 1; background: linear-gradient(135deg, #f1edff, #fdf0ff); border-color: #e4d8ff; }
.hidden-title.locked b { color: #8a5cf6; letter-spacing: 2px; }
.hidden-title.locked .ti-emo { filter: grayscale(.3); }
.hidden-title.got { background: linear-gradient(135deg, #fff8dc, #f3e8ff); border-color: #d9c2ff; }

.raid-banner {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: linear-gradient(135deg, #2f2546, #4a3570); color: white;
  border-radius: 20px; padding: 12px 14px; box-shadow: 0 5px 0 #1c1530;
}
.raid-banner .muted { color: #d9cff5; }
.hpbar { position: relative; height: 12px; border-radius: 99px; background: #00000030; overflow: hidden; margin-top: 4px; }
.hpbar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff6b6b, #ffb347); transition: width .8s; }
.hpbar.big { height: 26px; background: #ece6f5; margin: 6px 0; width: 100%; }
.hpbar.big span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 14px; color: var(--ink); }
.boss-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(180deg, #ffffffee, #f3ecffee); }
.boss-pic { animation: wobble 2.2s ease-in-out infinite; }
.speech {
  position: relative; background: white; border-radius: 16px; padding: 10px 14px; font-family: var(--display);
  box-shadow: 0 3px 0 #0000000f; max-width: 92%; word-break: keep-all;
}
.speech::after { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top: 0; border-bottom-color: white; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.05); } }

/* ---------- 생활: 오늘 할 일 ---------- */
.chip.on { background: var(--lav-d); color: white; }
.center > .char { margin: 0 auto; }
#todayBody { display: flex; flex-direction: column; gap: 12px; }
.today-hero { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: white; border-radius: 18px; padding: 10px 12px; box-shadow: 0 4px 0 #00000010;
}
.todo:active { transform: translateY(2px); }
.todo.done { background: #effbf5; }
.todo.urgent { background: #fff4f4; box-shadow: 0 0 0 2px #ff9c9c inset, 0 3px 0 #00000010; }
.todo .need { font-size: 12px; color: #e5484d; background: #ffe1e1; border-radius: 99px; padding: 1px 7px; vertical-align: 2px; }
.todo-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.todo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-text b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.todo-status { font-family: var(--display); font-size: 15px; color: var(--lav-d); flex: none; }
/* 마감 안내는 한 줄로 따로 (폰에서 "D-" / "1"처럼 잘리지 않게) */
.todo-text .due { display: block; white-space: nowrap; font-size: 13px; color: #e5484d; font-weight: 600; margin-top: 1px; }
.steps { display: inline-flex; gap: 3px; }
.steps i { width: 9px; height: 9px; border-radius: 50%; background: #e2dbef; }
.steps i.on { background: var(--mint-d); }
.wk-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.wk-chip { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: #f1edf8; }
.wk-chip.am { background: #fff1b8; } .wk-chip.pm { background: #e3dcff; } .wk-chip.yes { background: #d9f5e8; } .wk-chip.no { background: #ffe1e1; }
.notice-banner, .makeup-banner {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 18px; font-size: 15px;
}
.notice-banner { background: linear-gradient(90deg, #fff1b8, #ffe1ea); box-shadow: 0 4px 0 #e9cf8a; }
.makeup-banner { background: #fff; border: 2.5px dashed var(--coral); }

/* 🔮 히든 칭호 공지 */
.hidden-news {
  position: relative; overflow: hidden; text-align: center; margin-bottom: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 14px 12px;
  border-radius: 18px; color: #3b2a6b; font-size: 15px; line-height: 1.45;
  background: linear-gradient(135deg, #f3e8ff, #fff4d6 55%, #e3f4ff);
  border: 2.5px solid #d9c2ff; box-shadow: 0 4px 14px #a77bff33;
  animation: hn-glow 2.4s ease-in-out infinite;
}
.hidden-news .hn-top { font-family: var(--display); font-size: 13px; color: #8a5cf6; letter-spacing: .5px; }
.hidden-news .hn-title { font-family: var(--display); font-size: 21px; color: #6d3fd8; }
.hidden-news .small-btn { width: auto; padding: 7px 22px; font-size: 15px; margin-top: 2px; }
.hidden-news.leader-news { background: linear-gradient(135deg, #fff4c2, #ffe6a3 55%, #ffd9e5); border-color: #f2c14e; color: #5a3b00; }
.leader-news .hn-top { color: #c98700; }
.leader-news .hn-title { color: #b8730a; }
.hidden-news.perfect-news { background: linear-gradient(135deg, #e3faf0, #fff8dc 55%, #e3f4ff); border-color: #7fdcb5; color: #1f5f45; }
.perfect-news .hn-top { color: #1aa36f; }
.perfect-news .hn-title { color: #148a5c; }

/* 상점: ✝️ 성경 아이템 · 🔥 인기 아이템 */
.shop-item.bible { background: linear-gradient(160deg, #ffffff, #f3ecff); border-color: #d9c2ff; }
.shop-item .si-ref { font-size: 10px; color: #8a5cf6; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.shop-item .si-gift { font-size: 9.5px; color: #c2417a; white-space: nowrap; }
.shop-item.hot { background: linear-gradient(160deg, #ffffff, #ffeef0); }
.shop-item .si-best.si-hot { background: #ff5a6e; box-shadow: 0 2px 0 #d63a50; }
.shop-item .si-best.si-bless { background: #8a5cf6; box-shadow: 0 2px 0 #6a3fd0; }
.bless-box { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 18px; background: linear-gradient(160deg, #fff8dc, #f3e8ff); border: 2.5px solid #e6d3ff; }
.bless-box .shop-grid { margin-top: 8px; row-gap: 12px; }

/* 🛟 오류가 나면 뜨는 홈으로 버튼 */
.rescue-btn {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  padding: 12px 20px; border-radius: 99px; background: #3b2a6b; color: white;
  font-family: var(--display); font-size: 16px; box-shadow: 0 6px 20px #0004; animation: pop .3s;
}

/* ✋ 암송성구 — 본문 선택·복사 막기 */
.no-copy, .no-copy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input, .no-copy textarea { -webkit-user-select: text; user-select: text; }

/* 📅 출결 보고 재촉 · ❗ 보강 요청 */
.nag-banner {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, #ffe4e4, #fff1de); border: 2.5px solid #ff8a8a; color: #8a1f1f;
  box-shadow: 0 4px 0 #ff8a8a44; animation: nagPulse 1.6s ease-in-out infinite; line-height: 1.4;
}
.nag-banner .nag-emo { font-size: 30px; }
.nag-banner .chip { flex: none; background: #ff6b6b; color: white; }
.nag-banner.makeup-need { background: linear-gradient(135deg, #fff6d6, #ffe9c2); border-color: #f2a900; color: #6b4a00; box-shadow: 0 4px 0 #f2a90044; }
@keyframes nagPulse { 50% { transform: scale(1.015); } }

/* 🔒 진화 퀘스트 */
.gate-banner {
  display: block; width: 100%; text-align: left; margin-top: 2px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, #fff0f0, #fff8dc); border: 2.5px solid #ffb3b3; box-shadow: 0 3px 0 #0000000f;
}
.gate-card { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gate-task { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 10px; border-radius: 10px; background: #fff; }
.gate-task.ok { background: #e3faf0; color: var(--mint-d); }
.gate-task b { font-family: var(--display); font-weight: 400; white-space: nowrap; }
.gate-mini { background: #fff0f0; border: 2px solid #ffb3b3; text-align: center; font-size: 14px; line-height: 1.5; }
.xpbar.locked > div { background: repeating-linear-gradient(45deg, #ffb3b3 0 8px, #ffd0d0 8px 16px); }
@keyframes hn-glow { 0%, 100% { box-shadow: 0 4px 14px #a77bff33; } 50% { box-shadow: 0 4px 22px #a77bff77; } }
.makeup-banner.seen { border-color: #e2dbef; opacity: .85; }
.notice.new { border: 2.5px solid var(--gold); }
.notice-body { white-space: pre-wrap; line-height: 1.55; font-size: 15px; margin-top: 6px; word-break: keep-all; }

/* 수업 계획 */
.wk-card { display: flex; flex-direction: column; gap: 6px; }
.wk-card.past { opacity: .6; }
.slot-row { display: flex; gap: 8px; }
.slot-btn { flex: 1; padding: 10px 6px; border-radius: 14px; background: #f6f3fb; font-family: var(--display); font-size: 16px; border: 2.5px solid transparent; line-height: 1.25; }
.slot-btn.on.am { background: #fff1b8; border-color: var(--gold); }
.slot-btn.on.pm { background: #e3dcff; border-color: var(--lav-d); }
.slot-btn.on.yes { background: #d9f5e8; border-color: var(--mint-d); }
.time-in { width: auto; padding: 8px 10px; font-size: 16px; }
.absent-lock { background: #fff0ef; border-radius: 14px; padding: 10px 12px; color: var(--bad); font-family: var(--display); }
.absent-lock .small { color: var(--ink-2); font-family: var(--body); }
.wk-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.wk-label { font-family: var(--display); font-size: 13px; min-width: 64px; }
.wk-name { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; padding: 3px 4px 3px 8px; border-radius: 99px; background: #f3effb; }
.wk-name.am { background: #fff6cf; } .wk-name.pm { background: #ece6ff; } .wk-name.yes { background: #e3faf0; } .wk-name.no { background: #ffe8e8; }
.wk-name.late { outline: 2px solid var(--coral); }
.wk-name small { color: var(--ink-2); font-size: 11px; }
.x-btn { font-size: 11px; padding: 2px 6px; border-radius: 99px; background: #ffffffcc; color: var(--bad); }
.x-btn.edit { font-size: 12px; padding: 2px 5px; color: var(--ink); }
.wk-name.none small { color: var(--ink-2); }
.mini-btn { font-family: var(--display); font-size: 13px; padding: 5px 9px; border-radius: 10px; background: #f3effb; margin-left: 6px; }
.mini-btn.no { color: var(--bad); background: #fff0ef; }

/* 암송성구 */
.stepper { display: flex; gap: 4px; }
.stepper span { flex: 1; text-align: center; font-size: 12px; font-family: var(--display); padding: 6px 2px; border-radius: 10px; background: #f1edf8; color: var(--ink-2); }
.stepper span.cur { background: var(--lav-d); color: white; }
.stepper span.done { background: var(--mint); color: var(--ink); }
.verse-card { display: flex; flex-direction: column; gap: 8px; }
.verse-ref { font-family: var(--display); color: var(--lav-d); font-size: 16px; }
.verse-text { font-size: 18px; line-height: 1.8; word-break: keep-all; }
.verse-text.blanks { line-height: 2.3; }
.blank-in { border: 0; border-bottom: 2.5px solid var(--lav-d); background: #f6f3ff; border-radius: 6px 6px 0 0; padding: 2px 4px; font-size: 16px; text-align: center; outline: none; }
.blank-in.bad { border-color: var(--bad); background: #ffeaea; }
.verse-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* 오늘, 하나님께 (밤하늘) */
#app.bg-night { background-image: linear-gradient(180deg, #2b2457 0%, #4b3c86 55%, #7a5fa8 100%); }
.screen.night { color: #f4efff; }
.screen.night .muted, .screen.night .small { color: #d8cff5; }
.night-intro { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.night-dots { display: flex; justify-content: center; gap: 6px; }
.night-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff40; }
.night-dots i.cur { background: #ffe58a; box-shadow: 0 0 10px #ffe58a; }
.night-dots i.done { background: #c9b8ff; }
.night-card { background: #ffffff1c; color: #f4efff; backdrop-filter: blur(8px); box-shadow: 0 6px 20px #0003; display: flex; flex-direction: column; gap: 10px; }
.night-card .input { background: #ffffffee; color: var(--ink); }
.night-card .chip { background: #ffffff30; color: white; }
.night-help { white-space: normal; line-height: 1.55; }
.share-toggle { display: flex; gap: 10px; align-items: flex-start; background: #ffffff1c; padding: 12px; border-radius: 16px; }
.share-toggle input { width: 22px; height: 22px; margin-top: 2px; accent-color: #ffe58a; }
.cal-head { font-family: var(--display); text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.cal b { font-weight: 400; opacity: .7; font-size: 11px; }
.cal span { padding: 6px 0; border-radius: 10px; }
.cal span.on { background: #ffffff26; }
.cal span.today { outline: 2px solid #ffe58a; }
.j-q { font-family: var(--display); font-size: 14px; margin-top: 10px; opacity: .85; }
.j-a { white-space: pre-wrap; line-height: 1.55; font-size: 15px; }
details summary { cursor: pointer; }

/* 모임 */
.rsvp { width: 100%; font-family: var(--display); font-size: 20px; padding: 16px; border-radius: 18px; background: white; box-shadow: 0 5px 0 #00000012; border: 3px solid transparent; }
.rsvp.on { background: #e3faf0; border-color: var(--mint-d); }
.eta-card { display: flex; flex-direction: column; gap: 6px; }
.goat-chip { display: inline-block; margin-left: 4px; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #eee6d8; color: #7a5a2e; white-space: nowrap; }
.eta-card .input { font-size: 20px; text-align: center; }

/* 선생님 */
.teacher-tabs button { font-size: 16px; }
.quick-make { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quick-make button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px;
  background: white; border-radius: 14px; box-shadow: 0 3px 0 #0000000f; font-size: 22px;
}
.quick-make button span { font-family: var(--display); font-size: 13px; }
.make-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.make-btn { display: flex; align-items: center; gap: 8px; padding: 12px; background: white; border-radius: 16px; box-shadow: 0 4px 0 #00000010; font-family: var(--display); font-size: 15px; }
.code-box { background: var(--butter); border-radius: 12px; padding: 10px; text-align: center; font-size: 15px; }
.code-box b { font-family: var(--display); font-size: 30px; letter-spacing: 6px; margin-left: 8px; }
.report-box { font-size: 13px; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; white-space: pre; overflow-x: auto; }
.t-row.tap { cursor: pointer; }
.t-row.tap:active { background: #f6f3fb; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mode-switch button { padding: 12px; border-radius: 16px; font-family: var(--display); font-size: 18px; background: #ffffffaa; color: var(--ink-2); }
.mode-switch button.on { background: white; color: var(--ink); box-shadow: 0 4px 0 #0000001a; }
.life-king { text-align: center; font-family: var(--display); font-size: 17px; background: linear-gradient(90deg, #fff1b8, #d9f5e8); border-radius: 16px; padding: 10px; }
.level-tabs { display: flex; gap: 6px; }
.level-tabs button { flex: 1; padding: 10px; border-radius: 14px; font-family: var(--display); font-size: 17px; background: white; box-shadow: 0 3px 0 #0000000f; }
.level-tabs button.on { background: var(--mint-d); color: white; }
.level-tabs button.locked { opacity: .55; }
select.input { appearance: auto; }

/* ---------- toast & fx ---------- */
#toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -150%);
  background: var(--ink); color: white; padding: 10px 18px; border-radius: 99px;
  font-family: var(--display); font-size: 15px; z-index: 50; transition: transform .3s; max-width: 90vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
.float-xp { position: absolute; font-family: var(--display); font-size: 22px; color: var(--mint-d); animation: floatUp .9s ease-out forwards; }

.loading { display: grid; place-items: center; min-height: 100dvh; font-family: var(--display); font-size: 20px; color: var(--ink-2); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-60px); } }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 0 #ffd76a); } 50% { filter: drop-shadow(0 0 18px #ffd76a); } }
.glow { animation: glow 1.6s ease-in-out infinite; }

/* ============================================================
   🎮 아케이드 (games.js)
   ============================================================ */
.arcade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.arcade-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 14px 8px 12px; border-radius: 20px; color: white; box-shadow: 0 4px 0 #00000022; overflow: hidden;
}
.arcade-card b { font-family: var(--display); font-weight: 400; font-size: 18px; text-shadow: 0 2px 0 #0002; }
.arcade-card .ac-desc { font-size: 11.5px; opacity: .95; line-height: 1.3; }
.arcade-card .ac-best { margin-top: 4px; font-family: var(--display); font-size: 12px; background: #ffffffdd; color: var(--ink); border-radius: 99px; padding: 1px 9px; }
.arcade-card .ac-icon { filter: drop-shadow(0 3px 0 #0002); }
.arcade-card:active { transform: translateY(2px); }
.ac-block { background: linear-gradient(150deg, #8fd3ff, #6a8dff); }
.ac-snake { background: linear-gradient(150deg, #7ee0b5, #2fb383); }
.ac-run { background: linear-gradient(150deg, #ffcf6b, #ff8f5a); }
.ac-duel { background: linear-gradient(150deg, #c3a6ff, #8a5cf6); }

.arcade { gap: 8px; touch-action: manipulation; }
.compact-q { min-height: 0; padding: 12px 14px; }
.compact-q .q-text { font-size: 16px; }
.tok-bar { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; min-height: 34px; }
.tok {
  font-family: var(--display); font-size: 15px; padding: 4px 10px; border-radius: 10px;
  background: #ffffffaa; color: #b7aed0; border: 2px dashed #d8cff0;
}
.tok.on { background: #fff; color: var(--ink); border: 2px solid var(--mint-d); animation: pop .3s; }
.tok.syl { min-width: 34px; text-align: center; padding: 4px 6px; }

/* 🧱 말씀 블록 */
.block-field {
  position: relative; height: min(52vh, 440px); border-radius: 18px; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, #1f2a5a, #3b3f8f 60%, #5a4fb0);
  box-shadow: inset 0 0 0 3px #ffffff33, 0 4px 0 #00000022;
  background-image: linear-gradient(90deg, #ffffff10 1px, transparent 1px), linear-gradient(180deg, #1f2a5a, #3b3f8f 60%, #5a4fb0);
  background-size: 25% 100%, 100% 100%;
}
.block-field.flash { animation: fieldFlash .35s; }
.block-field.gameover { filter: grayscale(.8) brightness(.8); }
@keyframes fieldFlash { 50% { box-shadow: inset 0 0 0 4px #ffe680, 0 0 24px #ffe680; } }
.danger-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #ff8a8a99; }
.fblock {
  position: absolute; top: 0; display: grid; place-items: center; padding: 0 2px;
  font-family: var(--display); color: white; line-height: 1.05; word-break: keep-all;
  border-radius: 10px; border: 2px solid #ffffff88; box-shadow: inset 0 -4px 0 #00000025, 0 2px 4px #0003;
  transition: transform .15s, opacity .25s;
}
.fblock.c0 { background: #ff8fab; } .fblock.c1 { background: #5cc8ff; } .fblock.c2 { background: #ffc23d; color: #5a3b00; }
.fblock.c3 { background: #9b7bff; } .fblock.c4 { background: #3fd19a; }
.fblock.caught { transform: scale(1.35); opacity: 0; }
.fblock.wrongtap { animation: shake .3s; filter: grayscale(.6); }
.fblock.old { opacity: .55; }
.fblock.landed { filter: saturate(.55) brightness(.9); transition: top .2s; }
.fblock.clear { transform: scaleY(0); opacity: 0; transition: transform .25s, opacity .25s; }

/* 🐍 말씀 뱀 */
.snake-cv { display: block; margin: 0 auto; border-radius: 16px; box-shadow: 0 0 0 3px #ffffffaa, 0 4px 0 #00000018; touch-action: none; }
.snake-cv.gameover { filter: grayscale(.7); }
.snake-go { text-align: center; font-size: 14px; background: #fff; border-radius: 12px; padding: 6px 10px; box-shadow: 0 2px 0 #0000000f; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.dpad { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dpad > div { display: flex; gap: 58px; }
.dpad button {
  width: 58px; height: 44px; border-radius: 14px; background: white; font-size: 20px; color: var(--lav-d);
  box-shadow: 0 3px 0 #0000001a; touch-action: none;
}
.dpad button:active { transform: translateY(2px); background: #f1ecff; }

/* 🏃 무한 달리기 */
.run-q .run-opts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.run-opts .ro { font-size: 14px; padding: 5px 9px; border-radius: 10px; line-height: 1.35; }
.run-opts .ro.a { background: #e6f4ff; } .run-opts .ro.b { background: #fff1de; }
.run-opts .ro b { font-family: var(--display); font-weight: 400; margin-right: 4px; }
.run-field {
  --scroll: 0px; position: relative; height: min(44vh, 340px); border-radius: 18px; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, #bfe6ff 0%, #e3f6ff 42%, #9fdc8f 42%, #7fcb6f 100%);
  box-shadow: 0 4px 0 #00000018;
}
.run-field.gameover { filter: grayscale(.7); }
/* 배경 그림이 있을 때: 그림을 옆으로 흘리고, 길은 반투명하게 위에 */
.run-field.has-img { background-size: auto 100%; background-repeat: repeat-x; image-rendering: pixelated; }
.run-field.has-img .run-sky { display: none; }
.run-field.has-img .run-lane { background-color: #f3d9a880; box-shadow: inset 0 2px 0 #ffffff66, inset 0 -2px 0 #0000001f; height: 15%; }
/* 그림의 땅(아래쪽 절반)에 두 길을 놓기 — 위쪽은 하늘·풍경이 보이게 */
.run-field.has-img .run-lane.top { top: 57%; }
.run-field.has-img .run-lane.bot { top: 79%; }
.run-field.has-img .runner.lane0 { top: 66%; }
.run-field.has-img .runner.lane1 { top: 88%; }
.run-field.has-img .run-obj.gate { top: 50%; height: 50%; }
.run-field.has-img .gate-half:first-child { margin-top: 10%; }
.run-field.theme-in { animation: themeIn .6s ease-out; }
@keyframes themeIn { from { filter: brightness(1.8) saturate(.4); } }
.speed-pill { background: #fff1de; color: #c2410c; }
/* 달리기 그림 (길·장애물·코인·표지판) */
.run-field.has-path .run-lane { background-color: transparent; background-size: auto 100%; background-repeat: repeat-x; box-shadow: none; image-rendering: pixelated; }
.run-field.has-path.has-img .run-lane { height: 17%; }
.run-art { display: block; height: 40px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 3px 2px #0003); }
.run-art.coin { height: 28px; }
.run-obj { transform-origin: center; }
.run-obj.gate:has(.sign) { width: 60px; }
.gate-half.sign { position: relative; background: none !important; display: grid; place-items: center; }
.gate-half.sign .sign-wrap { position: relative; display: inline-block; height: 100%; max-height: 66px; }
.gate-half.sign .run-art { height: 100%; max-height: 66px; }
/* A·B 글자는 표지판 동그라미 한가운데에 */
.gate-half.sign b { position: absolute; left: 48%; top: 40%; transform: translate(-50%, -50%); font-size: 17px; color: white; text-shadow: 0 2px 0 #0006, 0 0 4px #0008; }
.run-obj.gate.ok .gate-half.sign { filter: drop-shadow(0 0 8px #3fd19a); }
.run-obj.gate.bad .gate-half.sign { filter: drop-shadow(0 0 8px #ff6b6b) grayscale(.4); }
.run-sky { position: absolute; inset: 0 0 58% 0; background-image: radial-gradient(circle at 20px 20px, #fff 12px, transparent 13px), radial-gradient(circle at 40px 26px, #fff 15px, transparent 16px); background-size: 200px 70px; background-position: calc(var(--scroll) * .3) 8px; opacity: .9; }
.run-lane { position: absolute; left: 0; right: 0; height: 22%; background-image: repeating-linear-gradient(90deg, #ffffff55 0 40px, transparent 40px 100px); background-position: var(--scroll) 0; }
.run-lane.top { top: 25%; background-color: #e9c99a; }
.run-lane.bot { top: 65%; background-color: #e2bb86; }
.runner { position: absolute; left: 16%; transform: translate(-50%, -78%); transition: top .16s ease-out; z-index: 3; }
.runner.lane0 { top: 36%; } .runner.lane1 { top: 76%; }
.runner .char { animation: runBob .32s ease-in-out infinite; }
.runner.ouch .char { animation: shake .3s, runBob .32s ease-in-out infinite; filter: drop-shadow(0 0 6px #ff6b6b); }
@keyframes runBob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.run-obj { position: absolute; left: 0; top: 0; font-size: 30px; z-index: 2; will-change: transform; }
.run-obj.coin { font-size: 24px; }
.run-obj.got { opacity: 0; transform: scale(1.5); transition: opacity .2s; }
.run-obj.smash { opacity: .3; }
.run-obj.gate { top: 0; height: 100%; width: 34px; display: flex; flex-direction: column; }
.gate-half {
  flex: 1; display: grid; place-items: center; font-family: var(--display); font-size: 20px; color: white;
  border-radius: 10px; margin: 6% 0; text-shadow: 0 2px 0 #0003;
}
.gate-half:first-child { background: linear-gradient(180deg, #5cc8ff, #3a8dff); margin-top: 20%; }
.gate-half:last-child { background: linear-gradient(180deg, #ffb35c, #ff7f3a); margin-bottom: 4%; }
.run-obj.gate.ok .gate-half { background: #3fd19a; }
.run-obj.gate.bad .gate-half { background: #ff6b6b; }
.run-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.run-ctl button { padding: 14px 6px; border-radius: 16px; font-family: var(--display); font-size: 17px; color: white; box-shadow: 0 4px 0 #0000001f; touch-action: none; }
.run-ctl button:first-child { background: #3a8dff; } .run-ctl button:last-child { background: #ff7f3a; }
.run-ctl button:active { transform: translateY(2px); }

/* 🃏 1:1 카드 대결 */
.duel .duel-side { display: flex; align-items: center; gap: 10px; background: #ffffffd9; border-radius: 18px; padding: 8px 12px; box-shadow: 0 3px 0 #00000012; }
.duel .duel-side.foe { flex-direction: row-reverse; text-align: right; }
.duel .hpbar { height: 14px; background: #ece6f5; }
.duel .hpbar.mine > div { background: linear-gradient(90deg, #3fd19a, #9be15d); }
.duel-pic.shake { animation: shake .35s 2; }
.duel-log { text-align: center; font-family: var(--display); font-size: 16px; min-height: 26px; color: var(--ink); }
.duel-hand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.duel-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: 16px;
  background: white; border: 3px solid #e6defa; box-shadow: 0 4px 0 #0000001a; animation: pop .3s backwards;
}
.duel-card:nth-child(2) { animation-delay: .07s; } .duel-card:nth-child(3) { animation-delay: .14s; }
.duel-card .dc-emo { font-size: 32px; }
.duel-card b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.duel-card span { font-size: 11px; color: var(--ink-2); line-height: 1.25; }
.duel-card.c-atk { border-color: #ffb3b3; } .duel-card.c-ult { border-color: #ffb35c; background: #fff7ea; }
.duel-card.c-heal { border-color: #9be6c4; } .duel-card.c-shield { border-color: #a9cfff; }
.duel-card:active { transform: translateY(3px); }
