/* 成就頁的版面：碼舍內嵌視窗大約 480–720px 寬，窄版也要排得下 */
:root {
  --bg: #f4f2ee; --card: #fff; --ink: #1f1d1a; --mute: #6b665e; --line: #e2ddd4;
  --accent: #c2581f; --gold: #d9a227; --hl: #fff3d6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1b19; --card: #262421; --ink: #eeeae3; --mute: #a39d93; --line: #3a3732; --hl: #3a2f1c; }
}
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "Microsoft JhengHei UI", "Noto Sans TC", system-ui, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
header h1 { font-size: 22px; margin: 0; }
header p { color: var(--mute); margin: 4px 0 16px; font-size: 13px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; font: inherit; text-align: center; }
.cell b { font-size: 13px; }
.note { font-size: 12px; color: var(--mute); }
.medal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 22px; font-weight: 700; color: #5a3b00; background: linear-gradient(145deg, #f3cf5f, var(--gold)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.limited .medal { color: #fff; background: linear-gradient(145deg, #f08a5d, var(--accent)); }
.locked .medal, .progress .medal { color: #999; background: #ddd; box-shadow: none; }
/* 有徽章圖時：去掉圓底，圖本身就是圓章；未得與有進度的圖用灰階淡化 */
.cell .medal.art { width: 64px; height: 64px; border-radius: 0; background: none; box-shadow: none; }
.medal.art img { display: block; width: 100%; height: 100%; user-select: none; }
.locked .medal.art img, .progress .medal.art img { filter: grayscale(1); opacity: .35; }
.earned .medal { animation: pop .4s ease-out; }
.bar { width: 70%; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.waiting { color: var(--mute); text-align: center; margin-top: 80px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .earned .medal { animation: none; } }
