:root {
  --bg: #0a0e1a;
  --surface: rgba(17, 23, 40, .94);
  --surface-2: rgba(255, 255, 255, .045);
  --surface-3: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .08);
  --panel: rgba(14, 20, 36, .66);
  --panel-border: rgba(255, 255, 255, .08);
  --text: #eef2ff;
  --muted: #8f9bbb;
  --faint: #5f6a88;
  --accent: #06d6a0;
  --accent2: #7b61ff;
  --gold: #ffd23f;
  --danger: #ff5d7a;
  --display: "Fredoka", "Jua", "Pretendard Variable", system-ui, sans-serif;
  --body: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
html { scrollbar-color: rgba(255, 255, 255, .18) transparent; scrollbar-width: thin; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); font-family: var(--body); color: var(--text); -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.hidden { display: none !important; }
b, strong { font-weight: 700; }

/* =============================== HUD =============================== */
#hud { position: fixed; inset: 0; pointer-events: none; }
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--r-md); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }

#stats { position: absolute; left: 16px; top: 16px; display: flex; padding: 6px 4px; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 66px; padding: 2px 10px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat span { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat b { font-family: var(--display); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
#sMass { color: var(--accent); }
#sRank { color: var(--gold); }
#sKills { color: #ff7d97; }

#buffs { position: absolute; left: 16px; top: 86px; display: flex; flex-direction: column; gap: 6px; }
.buff { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px; padding: 4px 12px 4px 6px; font-size: 13px; font-weight: 600; animation: pop .25s ease-out; backdrop-filter: blur(8px); }
.buff i { font-style: normal; font-size: 18px; }
.buff .bar { width: 70px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.buff .bar div { height: 100%; border-radius: 3px; transition: width .1s linear; }

#killfeed { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kf { background: rgba(10, 14, 26, .6); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; animation: kfIn .3s ease-out; transition: opacity .6s; white-space: nowrap; }
.kf .x { color: var(--muted); margin: 0 6px; font-weight: 500; }

#announce { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; }
.ann { display: inline-block; font-family: var(--display); font-size: 48px; font-weight: 700; letter-spacing: .5px; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 30px var(--c, #ff4d6d); animation: annIn 1.6s ease-out forwards; }
.ann small { display: block; font-family: var(--body); font-size: 17px; font-weight: 600; color: var(--muted); text-shadow: none; margin-top: 2px; }

#leaderboard { position: absolute; right: 16px; top: 16px; width: 214px; padding: 12px 12px 10px; }
#leaderboard h3 { margin: 0 0 8px; font-family: var(--display); font-size: 16px; font-weight: 600; text-align: center; }
#leaderboard ol { list-style: none; margin: 0; padding: 0; font-size: 14px; counter-reset: r; }
#leaderboard li { counter-increment: r; display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 7px; }
#leaderboard li::before { content: counter(r); width: 18px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
#leaderboard li:nth-child(1)::before { content: "🥇"; }
#leaderboard li:nth-child(2)::before { content: "🥈"; }
#leaderboard li:nth-child(3)::before { content: "🥉"; }
#leaderboard li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard li .m { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
#leaderboard li.me { background: rgba(255, 210, 63, .14); color: var(--gold); font-weight: 700; }

#minimap { position: absolute; right: 16px; bottom: 16px; width: 180px; height: 180px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--panel-border); }

#mobileBtns { display: none; position: absolute; right: 24px; bottom: 210px; flex-direction: column; gap: 14px; pointer-events: auto; }
#mobileBtns button { width: 66px; height: 66px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); background: rgba(16, 22, 38, .6); font-size: 26px; }
#mobileBtns button:active { transform: scale(.92); }
@media (pointer: coarse) { #mobileBtns { display: flex; } }

.iconBtn { position: fixed; left: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--panel-border); background: var(--panel); color: #fff; font-size: 18px; cursor: pointer; z-index: 5; backdrop-filter: blur(8px); }
.iconBtn:hover { background: rgba(40, 50, 80, .7); }

/* Achievement toasts */
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 20; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 260px; padding: 10px 18px 10px 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(48, 40, 12, .96), rgba(22, 26, 44, .96)); border: 1px solid rgba(255, 210, 63, .45); box-shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 0 30px rgba(255, 210, 63, .18); animation: toastIn .45s cubic-bezier(.2, .9, .3, 1.3); transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateY(12px); }
.toast > i { font-style: normal; font-size: 30px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 210, 63, .14); }
.toast b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--gold); }
.toast small { font-size: 13px; color: var(--text); opacity: .85; }

/* =============================== Menu =============================== */
.overlay { position: fixed; inset: 0; display: flex; padding: 28px 16px; overflow-y: auto; background: radial-gradient(1100px 520px at 50% -10%, rgba(123, 97, 255, .2), transparent 65%), rgba(6, 9, 17, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .4s; z-index: 10; }
.shell { width: 100%; max-width: 940px; margin: auto; animation: rise .5s cubic-bezier(.2, .9, .3, 1.1); }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 4px 18px; }
.logo { font-family: var(--display); font-size: 56px; font-weight: 700; letter-spacing: -1px; line-height: .95; }
.logo span { display: inline-block; animation: bob 3s ease-in-out infinite; }
.logo .b1 { color: var(--accent); text-shadow: 0 0 28px rgba(6, 214, 160, .45); }
.logo .b2 { color: #9a86ff; text-shadow: 0 0 28px rgba(123, 97, 255, .5); animation-delay: -1.5s; margin-left: 8px; }
.sub { margin: 8px 0 0 2px; color: var(--muted); font-size: 15px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #39e75f; box-shadow: 0 0 8px #39e75f; animation: blink 2s infinite; }

.cols { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05); }
.label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 2px 7px; letter-spacing: .2px; }
.label.between { display: flex; justify-content: space-between; align-items: baseline; }
.label.between span { font-weight: 600; color: var(--faint); }

/* --- identity --- */
.identity { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
#preview { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015) 70%); border: 1px solid var(--line); display: grid; place-items: center; }
#previewCanvas { width: 92px; height: 92px; }
#nameInput { width: 100%; font-family: var(--display); font-size: 19px; font-weight: 500; padding: 11px 14px; color: var(--text); background: var(--surface-2); border: 2px solid var(--line); border-radius: var(--r-md); outline: none; transition: border-color .15s, background .15s; -webkit-user-select: text; user-select: text; }
#nameInput::placeholder { color: var(--faint); }
#nameInput:focus { border-color: var(--accent2); background: var(--surface-3); }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip.gold { color: var(--gold); background: rgba(255, 210, 63, .08); border-color: rgba(255, 210, 63, .2); }
button.chip { cursor: pointer; transition: background .15s, color .15s; }
button.chip:hover { background: var(--surface-3); color: var(--text); }

/* --- segmented controls --- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modes { margin-top: 18px; }
.modes button { text-align: left; padding: 11px 14px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; }
.modes button:hover { background: var(--surface-3); }
.modes button:active { transform: scale(.98); }
.modes button b { display: block; font-family: var(--display); font-size: 17px; font-weight: 600; }
.modes button small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.modes button.sel { border-color: var(--accent); background: rgba(6, 214, 160, .1); box-shadow: 0 0 24px rgba(6, 214, 160, .14); }
.modes button[data-mode="ai"].sel { border-color: var(--accent2); background: rgba(123, 97, 255, .13); box-shadow: 0 0 24px rgba(123, 97, 255, .18); }

.seg.small { display: inline-grid; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg.small button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg.small button.sel { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }

/* --- play --- */
#playBtn { margin-top: 14px; width: 100%; font-family: var(--display); font-size: 24px; font-weight: 700; padding: 13px; border: 0; border-radius: 16px; color: #04281e; background: linear-gradient(180deg, #3cf7c6, #06d6a0); box-shadow: 0 6px 0 #049a74, 0 14px 34px rgba(6, 214, 160, .32); cursor: pointer; transition: transform .08s, box-shadow .08s, filter .15s; letter-spacing: .5px; }
#playBtn::after { content: " ▶"; font-size: .8em; }
#playBtn:hover { filter: brightness(1.06); }
#playBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #049a74, 0 6px 16px rgba(6, 214, 160, .3); }
#playBtn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }

.custom { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.swatches { display: grid; grid-template-columns: repeat(12, 1fr); gap: 7px; margin-bottom: 16px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0; transition: transform .12s; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .2); }
.swatches button:hover { transform: scale(1.12); }
.swatches button.sel { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.08); }

.skins { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.skins button { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); border: 1.5px solid transparent; background: var(--surface-2); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; display: grid; place-items: center; transition: background .12s, transform .12s, border-color .12s; font-family: inherit; }
.skins button:hover { background: var(--surface-3); transform: translateY(-1px); }
.skins button.sel { border-color: var(--accent2); background: rgba(123, 97, 255, .2); box-shadow: 0 0 14px rgba(123, 97, 255, .25); }
.skins button .none { width: 46%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--faint); }
.skins button.locked > span { filter: grayscale(1) brightness(.8); opacity: .3; }
.skins button.locked em { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; }
.skins button.locked:hover { background: rgba(255, 210, 63, .07); }
.skins button.locked.peek { border-color: rgba(255, 210, 63, .55); }
.hint { min-height: 18px; margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hint b { color: var(--gold); }
.status { font-size: 12.5px; color: #ff8fa3; margin: 8px 0 0; min-height: 1em; text-align: center; }
.status:empty { display: none; }

/* --- death banner --- */
#deathInfo { position: relative; overflow: hidden; background: linear-gradient(160deg, rgba(255, 93, 122, .2), rgba(255, 93, 122, .05) 60%); border: 1px solid rgba(255, 93, 122, .3); border-radius: 18px; padding: 14px; margin-bottom: 18px; animation: pop .35s; text-align: center; }
#deathInfo .t { font-family: var(--display); font-size: 22px; font-weight: 600; color: #ffb3c1; }
#deathInfo .by { font-size: 13px; color: var(--muted); margin-top: 2px; }
#deathInfo .by b { color: var(--text); }
#deathInfo .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
#deathInfo .grid div { background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 7px 2px 6px; }
#deathInfo .grid b { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
#deathInfo .grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
#deathInfo .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
#deathInfo .tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(0, 0, 0, .25); }
#deathInfo .tag.rank { color: var(--gold); }
#deathInfo .tag.ach { color: #fff; background: linear-gradient(135deg, rgba(255, 210, 63, .28), rgba(255, 210, 63, .1)); border: 1px solid rgba(255, 210, 63, .35); }
#deathInfo .tag.best { color: var(--gold); animation: blink 1.2s infinite; }

/* --- side card --- */
.side { display: flex; flex-direction: column; padding: 14px; contain: size; min-height: 520px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.tabs button { border: 0; background: none; padding: 9px 4px; border-radius: 12px; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.sel { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .06); }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 4px 2px; animation: fade .25s; }
.paneHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex: none; }
.reset { font-size: 12px; color: var(--faint); font-weight: 600; text-align: right; }

/* ranking */
.rankList { list-style: none; margin: 0; padding: 0 2px 0 0; flex: 1; min-height: 0; overflow-y: auto; }
.rankList li { display: grid; grid-template-columns: 30px 30px minmax(0, 1fr) auto 64px; align-items: center; gap: 8px; height: 42px; padding: 0 8px; border-radius: 12px; font-size: 14px; }
.rankList li:nth-child(odd) { background: rgba(255, 255, 255, .022); }
.rankList li.me { background: rgba(6, 214, 160, .13); box-shadow: inset 0 0 0 1px rgba(6, 214, 160, .35); }
.rankList .no { text-align: center; font-family: var(--display); font-weight: 600; color: var(--muted); font-size: 14px; }
.rankList li:nth-child(-n+3) .no { font-size: 19px; }
.rankList .av { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000)); display: grid; place-items: center; font-size: 15px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.rankList .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rankList .kl { font-size: 12px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.rankList .sc { text-align: right; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.rankList li:nth-child(1) .sc { color: var(--gold); }
.rankList .empty { display: block; height: auto; text-align: center; padding: 48px 12px; color: var(--muted); background: none !important; line-height: 1.6; }
.rankList .empty i { display: block; font-style: normal; font-size: 40px; margin-bottom: 8px; opacity: .8; }
.rankMe { flex: none; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rankMe b { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--accent); }
.rankMe .sc { font-family: var(--display); font-size: 16px; color: var(--text); }

/* achievements */
.achSum > div:first-child { font-family: var(--display); white-space: nowrap; }
.achSum b { font-size: 26px; font-weight: 600; color: var(--gold); }
.achSum span { font-size: 15px; color: var(--muted); margin-left: 2px; }
.prog { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.prog > div { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffb703, var(--gold)); transition: width .5s; }
.achList { list-style: none; margin: 0; padding: 0 2px 0 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.achList li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
.achList li.done { background: linear-gradient(135deg, rgba(255, 210, 63, .1), rgba(255, 210, 63, .02)); border-color: rgba(255, 210, 63, .2); }
.achList .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, .05); }
.achList li:not(.done) .ic { filter: grayscale(1); opacity: .5; }
.achList li.done .ic { background: rgba(255, 210, 63, .16); }
.achList .nm { font-family: var(--display); font-size: 15px; font-weight: 600; }
.achList .ds { font-size: 12px; color: var(--muted); margin-top: 1px; }
.achList .pg { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.achList .pg .prog { height: 5px; }
.achList .pg small { font-size: 11px; color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.achList li.done .pg { display: none; }
.achList .rw { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(0, 0, 0, .2); }
.achList li:not(.done) .rw span { filter: grayscale(1); opacity: .35; }
.achList .rw em { position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: 12px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #1b2238; }
.achList li.done .rw em { background: var(--accent); color: #04281e; font-size: 11px; font-weight: 800; }

/* help */
.keys { display: grid; gap: 6px; }
.keys div { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
kbd { display: inline-block; text-align: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-bottom-width: 3px; border-radius: 8px; padding: 4px 8px; font-family: var(--body); font-size: 12.5px; font-weight: 700; color: var(--text); }
.tips { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.tips li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.tips i { font-style: normal; font-size: 18px; text-align: center; }
.tips b { color: var(--text); font-weight: 600; }

/* =============================== Motion =============================== */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes blink { 50% { opacity: .45; } }
@keyframes kfIn { from { transform: translateY(-10px); opacity: 0; } }
@keyframes toastIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@keyframes annIn {
  0% { transform: scale(2.2); opacity: 0; }
  15% { transform: scale(.95); opacity: 1; }
  22% { transform: scale(1.05); }
  30% { transform: scale(1); }
  80% { opacity: 1; }
  100% { transform: translateY(-30px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =============================== Responsive =============================== */
@media (max-width: 900px) {
  .shell { max-width: 460px; }
  .top { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .sub { margin-left: 0; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side { contain: none; min-height: 0; }
  .rankList, .achList { flex: none; max-height: 420px; }
}
@media (max-width: 560px) {
  .overlay { padding: 18px 12px; }
  .card { padding: 16px; border-radius: 20px; }
  .logo { font-size: 44px; }
  .identity { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  #preview { width: 76px; height: 76px; }
  #previewCanvas { width: 72px; height: 72px; }
  .swatches { gap: 5px; }
  .skins { grid-template-columns: repeat(9, 1fr); gap: 5px; }
  .skins button { font-size: 18px; border-radius: 8px; }
  .rankList li { grid-template-columns: 26px 28px minmax(0, 1fr) 58px; }
  .rankList .kl { display: none; }

  #leaderboard { width: 150px; padding: 8px 10px; }
  #leaderboard h3 { font-size: 13px; }
  #leaderboard ol { font-size: 12px; }
  #minimap { width: 120px; height: 120px; }
  .stat { min-width: 48px; padding: 2px 6px; }
  .stat b { font-size: 17px; }
  #killfeed { top: auto; bottom: 16px; }
  #toasts { bottom: auto; top: 76px; }
  .ann { font-size: 32px; }
}
