/* 학생 화면 (게임형) — 선생님 화면은 style.css 를 씀 */
:root {
  --sky-1: #7ccfff;
  --sky-2: #c9ecff;
  --sky-3: #eef9ff;
  --ink: #1d2b3a;
  --muted: #5f6f80;
  --white: #ffffff;
  --orange: #ff8a3d;
  --orange-dark: #d9621a;
  --yellow: #ffc531;
  --green: #3fbf5f;
  --green-dark: #2a9446;
  --danger: #d64545;
  --card-shadow: 0 6px 0 rgba(29, 43, 58, .12), 0 12px 28px rgba(29, 43, 58, .12);
  --game-font: "Jua", "Pretendard Variable", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--sky-2);
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255, 138, 61, .55); outline-offset: 2px; }
[hidden] { display: none !important; }

#sky { position: fixed; inset: 0; background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%); }

/* ---------- 입장 ---------- */
.login-screen { position: fixed; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.login-card {
  width: min(420px, 100%); background: var(--white); border-radius: 30px; padding: 26px 22px 20px;
  box-shadow: var(--card-shadow); text-align: center;
}
.login-mascot {
  width: 108px; height: 108px; margin: -70px auto 6px; border-radius: 34px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #ffffff, #bfe5ff); box-shadow: var(--card-shadow);
}
.login-mascot svg { width: 88px; height: 88px; margin-top: 10px; animation: bob 2.4s ease-in-out infinite; }
.login-title { font-family: var(--game-font); font-weight: 400; font-size: 30px; margin: 8px 0 0; }
.login-sub { color: var(--muted); font-weight: 700; margin: 2px 0 18px; }
.login-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.login-field label { font-family: var(--game-font); font-size: 16px; }
.login-field input, .login-field select {
  font: inherit; font-size: 17px; color: var(--ink); background: #f6f8fa; border: 3px solid #e3e9ef;
  border-radius: 16px; padding: 10px 12px; min-height: 50px; width: 100%;
}
.login-field input:focus, .login-field select:focus { outline: none; border-color: var(--orange); background: #fff; }
.error { color: var(--danger); font-weight: 700; min-height: 1.4em; margin: 10px 0 0; }
.setup-warning { background: #fff4d6; border: 2px solid #f1d27a; border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; font-weight: 700; text-align: left; }

/* ---------- 3D 지도 ---------- */
#scene { position: fixed; inset: 0; }
#scene canvas { display: block; }
.labels { position: absolute; inset: 0; }
.map-label {
  font-family: var(--game-font); font-size: 14px; white-space: nowrap;
  background: rgba(255, 255, 255, .92); padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(29, 43, 58, .15); pointer-events: none; transform: translateY(-34px);
}
.map-label.goal { background: #ff5a5f; color: #fff; font-size: 16px; }
.map-label.start { background: var(--green); color: #fff; }
.no-webgl { position: absolute; top: 40%; left: 16px; right: 16px; text-align: center; font-family: var(--game-font); font-size: 20px; line-height: 1.5; }

/* ---------- HUD ---------- */
.hud-top {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.player {
  display: flex; align-items: center; gap: 10px; background: var(--white); border: 0; text-align: left; min-width: 0;
  padding: 6px 12px 6px 6px; border-radius: 999px; box-shadow: var(--card-shadow); transition: transform .08s;
}
.player:active { transform: translateY(3px); }
.player-text { min-width: 0; }
.player-more { font-family: var(--game-font); font-size: 13px; color: var(--orange-dark); background: #fff3e8; border-radius: 999px; padding: 2px 8px; margin-left: 4px; white-space: nowrap; }
.avatar-badge {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #ffffff, #c8e9ff); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}
.avatar-badge svg { width: 40px; height: 40px; margin-top: 6px; }
.player-name { display: block; font-family: var(--game-font); font-size: 16px; line-height: 1.2; }
.player-level { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.lv { background: var(--yellow); color: #6b4a00; border-radius: 6px; padding: 0 6px; margin-right: 4px; font-family: var(--game-font); }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hud-chips, .hud-actions { display: flex; gap: 8px; }
.chip-game {
  font-family: var(--game-font); font-size: 16px; background: var(--white);
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--card-shadow); white-space: nowrap;
}
.chip-game b { font-weight: 400; color: var(--orange-dark); }
.icon-btn { border: 0; background: var(--white); border-radius: 14px; padding: 8px 12px; font-family: var(--game-font); font-size: 14px; box-shadow: var(--card-shadow); white-space: nowrap; }

.progress-rail {
  position: fixed; left: 16px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.rail { position: relative; width: 16px; height: 42vh; background: rgba(255, 255, 255, .7); border-radius: 999px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); }
.rail-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 999px; background: linear-gradient(0deg, var(--orange), var(--yellow)); transition: height .8s cubic-bezier(.3, 1.4, .5, 1); }
.rail-dot { position: absolute; left: 50%; width: 22px; height: 22px; margin: 0 0 -11px -11px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.rail-dot.reached { background: var(--yellow); }
.rail-cap { font-family: var(--game-font); font-size: 13px; background: #fff; padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); white-space: nowrap; }

.next-goal {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  font-family: var(--game-font); font-size: 16px; background: rgba(255, 255, 255, .95);
  padding: 8px 18px; border-radius: 999px; box-shadow: var(--card-shadow); white-space: nowrap; pointer-events: none;
}
.next-goal b { font-weight: 400; color: var(--orange-dark); }

.hud-bottom {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 22px;
}
.side-btn {
  width: 72px; height: 72px; border: 0; border-radius: 22px; background: var(--white);
  box-shadow: 0 6px 0 #c9d6e3, 0 10px 20px rgba(29, 43, 58, .15);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 26px; transition: transform .08s;
}
.side-btn span { font-family: var(--game-font); font-size: 13px; }
.side-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c9d6e3; }
.go-btn {
  position: relative; width: 116px; height: 116px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffb36b, var(--orange) 60%);
  box-shadow: 0 9px 0 var(--orange-dark), 0 16px 30px rgba(217, 98, 26, .4);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--game-font); transition: transform .08s;
}
.go-btn::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 4px solid rgba(255, 138, 61, .55); animation: pulse 1.6s ease-out infinite; }
.go-btn:active { transform: translateY(6px); box-shadow: 0 3px 0 var(--orange-dark); }
.go-small { font-size: 16px; opacity: .95; }
.go-big { font-size: 40px; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.go-btn.done { background: radial-gradient(circle at 50% 35%, #7fe08f, var(--green) 60%); box-shadow: 0 9px 0 var(--green-dark), 0 16px 30px rgba(42, 148, 70, .35); }
.go-btn.done::before { display: none; }
.go-btn.done .go-small { font-size: 14px; }
.go-btn.done .go-big { font-size: 24px; white-space: nowrap; }
@keyframes pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.18); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-5px); } }

#tile-pop {
  position: fixed; z-index: 15; background: #fff; border-radius: 16px; padding: 12px 14px; min-width: 190px; max-width: 280px;
  box-shadow: var(--card-shadow); font-size: 14px; pointer-events: none; transform: translate(-50%, calc(-100% - 14px));
}
#tile-pop h4 { margin: 0 0 4px; font-family: var(--game-font); font-weight: 400; font-size: 17px; }

/* common.js 의 알림 */
.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: #fff; font-family: var(--game-font); font-size: 16px;
  padding: 10px 20px; border-radius: 999px; box-shadow: var(--card-shadow); max-width: calc(100% - 32px); text-align: center;
}
.toast.error { background: var(--danger); }

/* ---------- 기록 퀘스트 ---------- */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(20, 40, 60, .38); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(600px, 100%); max-height: 90dvh; overflow: auto; background: #fff;
  border-radius: 28px 28px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  animation: slide-up .35s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.close-btn { border: 0; background: #eef2f6; width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.pips { display: flex; gap: 6px; }
.pips span { width: 34px; height: 10px; border-radius: 999px; background: #e3e9ef; }
.pips span.on { background: var(--orange); }
.pips span.done { background: var(--green); }
.edit-note { background: #eef3ff; border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 14px; margin-bottom: 6px; }

.stage-banner { border-radius: 20px; padding: 14px 16px; color: #fff; margin: 6px 0 12px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12); }
.stage-no { font-family: var(--game-font); font-size: 14px; opacity: .9; }
.stage-name { font-family: var(--game-font); font-size: 26px; line-height: 1.2; }
.stage-sub { font-size: 14px; opacity: .95; }

.q-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 2px dashed #eef2f6; }
.q-row:last-child { border-bottom: 0; }
.q-text b { font-family: var(--game-font); font-weight: 400; font-size: 18px; display: block; }
.q-text small { display: block; color: #4d5d6e; font-size: 16px; line-height: 1.45; margin-top: 2px; }
.q-right { display: flex; flex-direction: column; align-items: center; }
.q-stars { display: flex; }
.q-star { border: 0; background: none; padding: 2px; font-size: 34px; line-height: 1; color: #dfe4ea; transition: color .1s; }
.q-star.on { color: var(--yellow); text-shadow: 0 2px 0 #e0a400; }
.q-star.pop { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-12deg); } 100% { transform: scale(1); } }
.q-cap { font-family: var(--game-font); font-size: 13px; color: var(--orange-dark); min-height: 18px; }
@media (max-width: 520px) {
  .q-row { flex-direction: column; align-items: flex-start; }
  .q-right { align-self: stretch; }
  .q-star { font-size: 40px; flex: 1; }
}

.write label { display: block; font-family: var(--game-font); font-size: 18px; margin: 10px 0 6px; }
.write textarea { width: 100%; min-height: 100px; font: inherit; border: 3px solid #e3e9ef; border-radius: 16px; padding: 12px; resize: vertical; }
.write textarea:focus { outline: none; border-color: var(--orange); }
.quest-error { color: var(--danger); font-weight: 700; min-height: 1.4em; margin: 8px 0 0; }

.sheet-foot { display: flex; gap: 10px; margin-top: 10px; }
.btn3d {
  flex: 1; border: 0; border-radius: 18px; padding: 14px; font-family: var(--game-font); font-size: 20px; color: #fff;
  background: var(--orange); box-shadow: 0 6px 0 var(--orange-dark); transition: transform .08s;
}
.btn3d:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-dark); }
.btn3d:disabled { background: #cfd8e1; box-shadow: 0 6px 0 #b2bfcb; cursor: not-allowed; }
.btn3d.ghost { flex: 0 0 auto; background: #eef2f6; color: var(--ink); box-shadow: 0 6px 0 #d3dce5; }
.btn3d.block { width: 100%; }

/* ---------- 보상 ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(20, 40, 60, .45); display: grid; place-items: center; padding: 16px; }
.reward-card { width: min(380px, 100%); background: #fff; border-radius: 28px; padding: 26px 22px 22px; text-align: center; box-shadow: var(--card-shadow); animation: bounce-in .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bounce-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reward-emoji { font-size: 64px; line-height: 1; }
.reward-title { font-family: var(--game-font); font-size: 30px; margin: 8px 0 4px; }
.reward-lines { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; }
.reward-line { background: #fff7e6; border-radius: 14px; padding: 10px; font-family: var(--game-font); font-size: 18px; }
.reward-line.is-badge { background: #eafbea; }
.reward-line.level { background: #eef3ff; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 35; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- 나의 성장 기록 (프로필 상세) ---------- */
.profile { position: fixed; inset: 0; z-index: 25; background: rgba(20, 40, 60, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.profile-card {
  position: relative; width: min(940px, 100%); height: min(94dvh, 980px); overflow: auto; border-radius: 30px;
  background: linear-gradient(180deg, #d6efff 0, #eef8ff 240px, #fbfdff 480px); box-shadow: var(--card-shadow);
  animation: bounce-in .45s cubic-bezier(.2, 1.4, .4, 1);
}
.profile-close { position: absolute; top: 14px; right: 14px; z-index: 3; }
.profile-top { padding: 22px 22px 0; }
.profile-hero { display: flex; gap: 18px; align-items: center; padding-right: 44px; }
.hero-avatar {
  width: 118px; height: 118px; flex: 0 0 auto; border-radius: 34px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #ffffff, #bfe5ff); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .06), var(--card-shadow);
}
.hero-avatar svg { width: 96px; height: 96px; margin-top: 10px; animation: bob 2.4s ease-in-out infinite; }
.hero-name { font-family: var(--game-font); font-size: 28px; line-height: 1.2; }
.hero-sub { color: var(--muted); font-weight: 700; font-size: 14px; }
.xp { height: 12px; background: #e3e9ef; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.tile-stat { background: #fff; border-radius: 20px; padding: 12px 8px; text-align: center; box-shadow: 0 5px 0 rgba(29, 43, 58, .08); }
.tile-stat .ic { font-size: 22px; }
.tile-stat .num { font-family: var(--game-font); font-size: 26px; line-height: 1.15; }
.tile-stat .cap { font-size: 13px; font-weight: 700; color: var(--muted); }
.ptabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; padding: 16px 22px 12px; overflow-x: auto; background: linear-gradient(180deg, #eef8ff 75%, rgba(238, 248, 255, 0)); }
.ptab { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 10px 18px; font-family: var(--game-font); font-size: 17px; background: #fff; box-shadow: 0 4px 0 #d3dce5; }
.ptab[aria-selected=true] { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-dark); }
.ppanel { padding: 0 22px 28px; }
.pcard { background: #fff; border: 3px solid #eaf0f5; border-radius: 24px; padding: 16px; margin-top: 14px; }
.pcard h3 { font-family: var(--game-font); font-weight: 400; font-size: 20px; margin: 0 0 10px; }
.hint { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.empty-card { text-align: center; padding: 34px 16px; font-family: var(--game-font); font-size: 19px; color: var(--muted); line-height: 1.6; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.chart-wrap { position: relative; height: 270px; }
.seg { display: inline-flex; background: #eef2f6; border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 6px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-family: var(--game-font); font-size: 15px; }
.seg button[aria-pressed=true] { background: #fff; color: var(--c); box-shadow: 0 2px 0 #d3dce5; }
.legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.stat { display: grid; grid-template-columns: 86px 1fr 48px 54px; align-items: center; gap: 10px; margin-top: 16px; }
.stat-name { font-family: var(--game-font); font-size: 19px; }
.stat-bar { height: 32px; background: #eef2f6; border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 3px rgba(29, 43, 58, .08); }
.stat-bar i { display: block; height: 100%; border-radius: 999px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), inset 0 4px 0 rgba(255, 255, 255, .25); }
.stat-val { font-family: var(--game-font); font-size: 22px; text-align: right; }
.stat-delta { font-size: 13px; font-weight: 800; color: var(--green-dark); }
.stat-delta.down { color: var(--danger); }
.hl-title { font-family: var(--game-font); font-size: 16px; margin: 4px 0 8px; }
.hl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #f7f9fb; margin-bottom: 6px; }
.hl-row .em { font-size: 20px; }
.hl-row .nm { font-family: var(--game-font); font-size: 17px; flex: 1; }
.hl-row .vl { font-family: var(--game-font); font-size: 17px; color: var(--c); }
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.heat thead th { font-weight: 800; color: var(--muted); font-size: 12px; white-space: nowrap; }
.heat th.vname { position: sticky; left: 0; z-index: 1; background: #fff; text-align: right; padding-right: 8px; font-family: var(--game-font); font-weight: 400; font-size: 15px; white-space: nowrap; }
.heat tr.cat-row th { position: sticky; left: 0; background: #fff; text-align: left; padding-top: 6px; font-family: var(--game-font); font-weight: 400; font-size: 15px; color: var(--c); }
.heat td { min-width: 34px; height: 30px; border-radius: 9px; text-align: center; font-weight: 800; }
.heat td.latest { outline: 3px solid var(--orange); outline-offset: -1px; }
.heat td.renamed { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .45) 0 3px, transparent 3px 7px); }
.heat-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.heat-legend span.sw { width: 18px; height: 14px; border-radius: 4px; display: inline-block; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-week { font-family: var(--game-font); font-size: 18px; }
.log-block { border-radius: 14px; padding: 10px 12px; margin-top: 8px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.log-block b { display: block; font-size: 12px; margin-bottom: 2px; white-space: normal; }
.log-block.reflect { background: #f3f6f9; }
.log-block.resolve { background: #eef3ff; }
.log-block.teacher { background: #eafbea; }
.log-block .empty-text { color: var(--muted); }
.mini { font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #f3f6f9; }
.pcard details summary { cursor: pointer; font-weight: 700; color: var(--muted); margin-top: 10px; font-size: 14px; }
.score-group { margin-top: 8px; }
.score-group .g-title { font-family: var(--game-font); font-size: 14px; color: var(--c); margin-bottom: 4px; }
.score-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.score-mini div { background: #f6f8fa; border-radius: 10px; padding: 6px 2px; text-align: center; font-size: 12px; font-weight: 700; }
.score-mini b { display: block; font-family: var(--game-font); font-weight: 400; font-size: 15px; color: var(--c); letter-spacing: -1px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge-card { background: #fff7e6; border-radius: 24px; padding: 18px 10px 14px; text-align: center; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .06); }
.badge-card .em { font-size: 46px; line-height: 1.1; }
.badge-card .nm { font-family: var(--game-font); font-size: 18px; margin-top: 6px; }
.badge-card .st { font-size: 13px; font-weight: 700; color: var(--muted); }
.badge-card.locked { background: #eef2f6; }
.badge-card.locked .em { filter: grayscale(1); opacity: .35; }

@media (max-width: 680px) {
  .profile { padding: 0; }
  .profile-card { height: 100dvh; border-radius: 0; }
  .profile-top { padding: 18px 16px 0; }
  .ptabs { padding: 14px 16px 10px; }
  .ppanel { padding: 0 16px 24px; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: 1fr; }
  .hero-avatar { width: 90px; height: 90px; border-radius: 28px; }
  .hero-avatar svg { width: 74px; height: 74px; }
  .hero-name { font-size: 23px; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .player-name { font-size: 14px; }
  .player-more { display: none; }
  .chip-game { font-size: 14px; padding: 6px 10px; }
  .progress-rail { left: 8px; }
  .rail { height: 32vh; width: 12px; }
  .hud-bottom { gap: 14px; }
  .go-btn { width: 100px; height: 100px; }
  .go-big { font-size: 34px; }
  .go-btn.done .go-big { font-size: 20px; }
  .side-btn { width: 64px; height: 64px; }
  .next-goal { bottom: calc(132px + env(safe-area-inset-bottom)); font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .go-btn::before, .confetti { display: none; }
  .sheet, .reward-card, .profile-card, .q-star.pop, .login-mascot svg, .hero-avatar svg { animation: none; }
}
