* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #181b26; --panel: #232838; --panel2: #2d3347; --line: #0e1017; --hi: #3c445e;
  --text: #eef1f7; --sub: #8f9bb8; --acc: #f5c249; --acc-d: #a87616;
  --good: #5cd68d; --bad: #f25f5c; --sky: #4ea8de;
  --fire: #ff6b35; --water: #3a86ff; --leaf: #52b043; --volt: #ffd60a; --light: #e9e4ff; --dark: #b392e0;
}
html, body { height: 100%; background: #10121a; color: var(--text); font-family: 'Galmuri11', 'Galmuri9', 'Malgun Gothic', 'Apple SD Gothic Neo', monospace, sans-serif; font-size: 13px; user-select: none; -webkit-user-select: none; overflow: hidden; }
#app { max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; box-shadow: 0 0 0 2px var(--line), 0 18px 40px #000a; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; pointer-events: none; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.px-ico { display: inline-block; vertical-align: -2px; flex-shrink: 0; }

/* 상단바 */
#topbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 2px solid var(--line); box-shadow: inset 0 -2px 0 var(--hi); }
.logo { font-family: 'Galmuri14', 'Galmuri11', monospace; font-weight: bold; color: var(--acc); letter-spacing: 2px; font-size: 16px; text-shadow: 2px 2px 0 #7a3418; }
.res { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; background: #131620; padding: 3px 9px; border-radius: 3px; border: 2px solid var(--line); box-shadow: inset 0 1px 0 #000; font-size: 12px; font-weight: bold; color: var(--acc); }
.icon-btn { background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--line); }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }

#screen { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
#screen::-webkit-scrollbar { width: 6px; }
#screen::-webkit-scrollbar-thumb { background: var(--hi); border-radius: 2px; }

/* 하단 탭 (레트로 콘솔 키) */
#tabs { display: flex; background: #141722; border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; background: none; border: none; border-top: 3px solid transparent; color: var(--sub); padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; position: relative; }
#tabs button.badge::after { content: ''; position: absolute; top: 5px; right: 24%; width: 7px; height: 7px; background: var(--bad); border: 1px solid var(--line); }
#tabs button i { display: inline-flex; opacity: .55; transition: transform .1s; }
#tabs button.active { color: var(--acc); border-top-color: var(--acc); background: var(--panel); }
#tabs button.active i { opacity: 1; transform: translateY(-1px); }

/* 데스크톱 미니 위젯 모드 */
body.mini-mode { background: #10121a; }
body.mini-mode #app { max-width: 300px; max-height: 360px; margin: auto; border: 2px solid var(--acc); border-radius: 6px; overflow: hidden; position: fixed; right: 16px; bottom: 16px; height: auto; }
@media (max-width: 340px) {
  body.mini-mode #app { max-width: 100%; max-height: 100%; right: 0; bottom: 0; border-radius: 0; border: none; height: 100vh; }
}
body.mini-mode #tabs { display: none; }
body.mini-mode #screen { padding: 6px; overflow: hidden; }
body.mini-mode .hide-mini { display: none !important; }
body.mini-mode .device { margin: 4px 0; padding: 6px; }
body.mini-mode .device-top { display: none; }
body.mini-mode .actions { grid-template-columns: repeat(4, 1fr); margin: 6px 0 0; gap: 4px; }
body.mini-mode .actions button { padding: 5px 2px; }
body.mini-mode .actions button span { font-size: 10px; }

/* 공통 픽셀 베벨 버튼 & 패널 */
.primary { background: var(--acc); color: #261800; border: 2px solid var(--line); padding: 9px 14px; border-radius: 3px; font-weight: bold; box-shadow: inset 0 2px 0 #ffe38f, 0 3px 0 var(--acc-d); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.primary:active { transform: translateY(2px); box-shadow: inset 0 2px 0 #ffe38f, 0 1px 0 var(--acc-d); }
.btn { background: var(--panel2); border: 2px solid var(--line); padding: 7px 11px; border-radius: 3px; font-size: 12px; box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.on { background: var(--acc); color: #261800; box-shadow: inset 0 2px 0 #ffe38f, 0 2px 0 var(--line); }
.btn.sm { padding: 4px 8px; font-size: 11px; }
.btn.red { border-color: var(--bad); color: var(--bad); }

.card { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 10px; margin-bottom: 10px; box-shadow: inset 0 2px 0 var(--hi), 0 3px 0 #0a0c12; }
.center { text-align: center; }
.sec { font-size: 13px; font-weight: bold; margin: 14px 0 7px; color: var(--acc); display: flex; align-items: center; gap: 6px; letter-spacing: .5px; }
.sub { color: var(--sub); font-size: 11px; }
.red { color: var(--bad); }
.row { display: flex; gap: 6px; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 6px; border-radius: 2px; background: #161924; border: 1px solid var(--hi); vertical-align: middle; }
.t-fire { --tc: var(--fire); } .t-water { --tc: var(--water); } .t-leaf { --tc: var(--leaf); }
.t-volt { --tc: var(--volt); } .t-light { --tc: var(--light); } .t-dark { --tc: var(--dark); } .t-normal { --tc: #bbb; }
.tag[class*="t-"] { border-color: var(--tc); color: var(--tc); }
.tag.boss { border-color: var(--bad); color: var(--bad); }
.tag.shiny { border-color: var(--acc); color: var(--acc); background: #2d2410; }
.tag.fusion { border-color: #ff8fab; color: #ff8fab; background: #2d1828; }
.big-num { font-size: 26px; color: var(--acc); font-weight: bold; }

.progress { height: 10px; background: #10121a; border-radius: 2px; overflow: hidden; margin-top: 6px; border: 2px solid var(--line); }
.progress div { height: 100%; background: repeating-linear-gradient(90deg, var(--acc) 0 6px, #d89f26 6px 8px); transition: width .4s; }

textarea, input[type=text], select { width: 100%; background: #12151e; border: 2px solid var(--line); box-shadow: inset 0 2px 0 #0006; border-radius: 3px; color: var(--text); padding: 7px 8px; font-family: inherit; font-size: 12px; resize: none; margin: 5px 0; user-select: text; -webkit-user-select: text; }
@keyframes blink { 0%, 100% { border-color: var(--acc); } 50% { border-color: var(--hi); } }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-4px); } }

/* 홈: 핸드헬드 콘솔 쉘 */
.pet-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.pet-name { font-size: 16px; margin-right: 4px; }
.lv { font-size: 13px; color: var(--acc); background: #131620; padding: 2px 7px; border: 1px solid var(--hi); border-radius: 2px; }
.trait-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.device { background: #3b4259; padding: 10px 10px 12px; border-radius: 6px 6px 18px 6px; border: 2px solid var(--line); box-shadow: inset 0 2px 0 #535d7d, inset 0 -4px 0 #262b3b, 0 4px 0 #0b0d14; margin: 8px 0; }
.device-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; padding: 0 2px; font-size: 9px; color: #9ea8c7; letter-spacing: 1.5px; }
.led { display: inline-block; width: 6px; height: 6px; background: #5cd68d; border: 1px solid #0e1017; margin-right: 4px; vertical-align: 0px; }
.led.sleep { background: #4ea8de; }
.led.warn { background: #f25f5c; }
.grille { letter-spacing: 2px; color: #1b2030; }
.device-bezel { background: #141720; padding: 6px; border-radius: 3px; border: 2px solid #0b0d14; }
.device canvas { width: 100%; display: block; border-radius: 2px; background: #cfe8a9; cursor: pointer; }

.expbar { height: 6px; background: #12151e; border: 1px solid var(--line); overflow: hidden; margin: 4px 0 8px; }
.expbar div { height: 100%; background: var(--good); transition: width .3s; }
.bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.bar label { width: 32px; font-size: 11px; color: var(--sub); }
.track { flex: 1; height: 10px; background: #12151e; border: 2px solid var(--line); position: relative; overflow: hidden; }
.track div { height: 100%; transition: width .3s; }
.track::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 8px, #00000044 8px 10px); pointer-events: none; }
.bar span { width: 26px; text-align: right; font-size: 11px; }
.meta { font-size: 11px; color: var(--sub); margin-top: 6px; line-height: 1.55; }
.hint { font-size: 11px; color: var(--sub); margin-top: 8px; padding: 7px 8px; background: #161924; border: 1px solid var(--hi); border-radius: 3px; line-height: 1.65; }
.hint .ok { color: var(--good); } .hint .ng { color: var(--sub); }
.evo-btn { width: 100%; margin-top: 8px; animation: blink 1s steps(2, end) infinite; }
.fusion-btn { width: 100%; margin-top: 8px; background: #ff8fab; color: #260a1c; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 10px; }
.actions button { background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: inset 0 2px 0 var(--hi), 0 3px 0 var(--line); }
.actions button span { font-size: 11px; }
.actions button:active { transform: translateY(2px); box-shadow: none; }
.actions button.alert { border-color: var(--bad); animation: blink .8s steps(2, end) infinite; }

.quest { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--hi); font-size: 12px; }
.quest:last-child { border-bottom: none; }
.quest .q-n { flex: 1; }

/* 파티 / 보관함 */
.party-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.pslot { background: #161924; border: 2px solid var(--line); border-radius: 3px; padding: 6px 4px; text-align: center; font-size: 11px; }
.pslot.active { border-color: var(--acc); }
.pslot canvas { display: block; margin: 0 auto 2px; }
.box-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.box-row { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; padding: 7px; }
.box-row.in-party { border-color: var(--acc); }
.box-row .info { flex: 1; font-size: 12px; line-height: 1.45; }

/* 알 선택 */
.hero { text-align: center; padding: 12px 0 6px; }
.hero h1 { color: var(--acc); font-size: 24px; letter-spacing: 3px; text-shadow: 3px 3px 0 #7a3418; }
.eggs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.egg { background: #161924; border: 2px solid var(--tc); border-radius: 4px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 3px 0 var(--line); }
.egg canvas { animation: float 2s infinite ease-in-out; }
.egg.locked { filter: grayscale(1) brightness(.6); }
.egg.locked canvas { animation: none; }
.egg small { font-size: 10px; color: var(--sub); }

/* 모달 */
#modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; }
.hidden { display: none !important; }
.modal-box { background: var(--panel); border: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--hi), 0 8px 0 #080a0f; border-radius: 4px; padding: 16px; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; position: relative; animation: pop .15s; }
.modal-x { position: absolute; right: 8px; top: 8px; background: var(--panel2); border: 2px solid var(--line); width: 24px; height: 24px; font-size: 13px; color: var(--sub); border-radius: 2px; }
.modal-box h3 { margin-bottom: 10px; color: var(--acc); padding-right: 26px; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.modal-box p { margin: 5px 0; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.opt { background: var(--panel2); border: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--hi), 0 2px 0 var(--line); border-radius: 3px; padding: 12px 6px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.opt small { color: var(--sub); font-size: 11px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; padding: 8px 10px; text-align: left; }
.item-row .ic { display: inline-flex; width: 24px; justify-content: center; }
.item-row .nm { flex: 1; display: flex; flex-direction: column; }
.item-row small { color: var(--sub); font-size: 11px; }
.stat-tbl { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.stat-tbl td { padding: 5px 4px; border-bottom: 1px dashed var(--hi); }
.evo-route { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center; margin: 8px 0; font-size: 11px; }
.evo-route span { background: #161924; padding: 3px 7px; border-radius: 2px; border: 1px solid var(--hi); }
.evo-route span.me { border-color: var(--acc); color: var(--acc); }
.evo { text-align: center; }
.evo canvas { width: 100%; border-radius: 3px; border: 2px solid var(--line); }
.evo-msg { margin-top: 10px; line-height: 1.7; min-height: 40px; }
.evo-msg button { margin-top: 8px; }

/* 전투 */
#battle { position: fixed; inset: 0; z-index: 40; background: #0c0e14; display: flex; justify-content: center; }
.b-wrap { position: relative; width: 100%; max-width: 480px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
.b-top { display: flex; gap: 6px; align-items: center; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 2px solid var(--line); }
.b-title { flex: 1; font-weight: bold; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.b-top button { background: var(--panel2); border: 2px solid var(--line); border-radius: 2px; padding: 4px 8px; font-size: 11px; }
.b-top button.on { background: var(--acc); color: #261800; }
.b-field { position: relative; padding: 8px; }
.b-field canvas { width: 100%; display: block; border: 3px solid var(--line); border-radius: 3px; }
.hud { position: absolute; background: #161924ec; border: 2px solid var(--hi); border-radius: 3px; padding: 5px 7px; width: 48%; font-size: 11px; transition: border-color .2s; }
.hud.foe { left: 14px; top: 14px; }
.hud.me { right: 14px; bottom: 14px; }
.hud.danger { border-color: var(--bad); animation: blink .5s steps(2, end) infinite; }
.hud.warn-od { border-color: var(--acc); }
.hud .own { font-size: 10px; color: var(--sub); }
.hp { height: 8px; background: #0b0d14; border: 1px solid var(--line); overflow: hidden; margin-top: 3px; position: relative; }
.hp .hp-trail { position: absolute; left: 0; top: 0; bottom: 0; background: #fff3bf; transition: width .65s ease-out; }
.hp .hp-fill { position: relative; height: 100%; background: var(--good); transition: width .12s linear; }
.hp .hp-fill.mid { background: var(--acc); } .hp .hp-fill.low { background: var(--bad); }
.od { height: 4px; background: #0b0d14; overflow: hidden; margin-top: 2px; }
.od div { height: 100%; background: var(--sky); transition: width .25s; }
.od div.full { background: var(--acc); }
.hpt { font-size: 10px; color: var(--sub); display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.pips { display: inline-flex; gap: 3px; margin-left: 4px; }
.pips i { display: inline-block; width: 6px; height: 6px; background: var(--good); border: 1px solid var(--line); }
.pips i.dead { background: #444; }
.st-badge { font-size: 10px; display: inline-flex; align-items: center; gap: 2px; }
.intent-od { font-size: 9px; color: #261800; background: var(--acc); padding: 0 4px; font-weight: bold; animation: blink .5s steps(2, end) infinite; border: 1px solid var(--line); }
.b-log { margin: 0 8px; background: #141722; border: 2px solid var(--line); box-shadow: inset 0 0 0 1px var(--hi); border-radius: 3px; padding: 7px 10px; height: 96px; flex-shrink: 0; overflow-y: auto; font-size: 12px; line-height: 1.55; }
.b-log::-webkit-scrollbar { width: 5px; }
.b-log::-webkit-scrollbar-thumb { background: var(--hi); border-radius: 2px; }
.b-log div:last-child { color: var(--acc); }
.b-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; overflow-y: auto; }
.mv { background: var(--panel2); border: 2px solid var(--line); border-left: 4px solid var(--tc, var(--hi)); border-radius: 3px; padding: 8px; text-align: left; box-shadow: 0 2px 0 var(--line); }
.mv b { display: block; font-size: 12px; }
.mv small { color: var(--sub); font-size: 10px; display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }
.od-btn { grid-column: 1 / -1; background: var(--acc); color: #261800; border: 2px solid var(--line); border-radius: 3px; padding: 9px; font-weight: bold; font-size: 13px; box-shadow: 0 3px 0 var(--acc-d); animation: blink .7s steps(2, end) infinite; }
.b-subrow { grid-column: 1 / -1; display: flex; gap: 6px; }
.guard-btn { flex: 1; background: var(--panel); border: 2px solid var(--good); color: var(--good); border-radius: 3px; padding: 7px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.tag-btn { flex: 1; background: var(--panel); border: 2px solid var(--sky); color: var(--sky); border-radius: 3px; padding: 7px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.b-result-layer { position: absolute; inset: 0; background: #080a10b8; z-index: 5; display: flex; align-items: flex-start; justify-content: center; padding: min(200px, 26vh) 14px 14px; }
.b-result { width: 100%; max-width: 380px; text-align: center; padding: 14px; background: var(--panel); border-radius: 4px; border: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--hi), 0 8px 0 #07090e; animation: pop .18s; }
.b-result h2 { font-size: 22px; margin-bottom: 8px; letter-spacing: 2px; }
.b-result.win h2 { color: var(--acc); } .b-result.lose h2 { color: var(--bad); }
.b-result div { margin: 3px 0; }
.b-result .row { justify-content: center; margin-top: 12px; }

/* 모험 */
.tower { display: flex; gap: 10px; }
.tower-l { display: flex; flex-direction: column; gap: 4px; width: 78px; }
.floor { background: #161924; border: 2px solid var(--line); border-radius: 2px; padding: 7px 4px; text-align: center; font-size: 11px; }
.floor.cur { border-color: var(--acc); color: var(--acc); }
.floor.clear { opacity: .65; cursor: pointer; }
.floor.clear:hover { border-color: var(--sky); opacity: 1; }
.floor.boss { background: #361d26; }
.rank-badge { display: inline-block; padding: 1px 6px; font-weight: bold; border-radius: 2px; border: 1px solid var(--line); font-size: 11px; }
.rank-S { background: var(--acc); color: #261800; }
.rank-A { background: var(--sky); color: #091826; }
.rank-B { background: var(--panel2); color: var(--text); }
.tower-r { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.area { background: var(--panel); border: 2px solid var(--line); border-top: 3px solid var(--tc); border-radius: 3px; padding: 0; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; box-shadow: 0 3px 0 var(--line); text-align: center; }
.area:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.area-pv { position: relative; width: 100%; aspect-ratio: 7 / 3; background: #12151e; border-bottom: 2px solid var(--line); overflow: hidden; }
.area-pv canvas { width: 100%; height: 100%; display: block; }
.area-ico { position: absolute; top: 4px; left: 4px; background: #12151ed9; border: 1px solid var(--tc); border-radius: 2px; padding: 2px; display: inline-flex; box-shadow: 0 1px 0 var(--line); }
.area-meta { padding: 6px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.area small { color: var(--sub); font-size: 10px; line-height: 1.25; }
.area.locked { filter: grayscale(1); opacity: .5; }

/* 대전 */
.lb-row { display: flex; gap: 8px; padding: 6px 4px; font-size: 12px; border-bottom: 1px dashed var(--hi); align-items: center; }
.lb-row:last-child { border-bottom: none; }
.lb-row.me { color: var(--acc); }
.lb-row .r { width: 30px; }
.lb-row .n { flex: 1; }

/* 도감 */
.rewards { display: flex; gap: 4px; margin-top: 10px; }
.rw { flex: 1; font-size: 10px; padding: 6px 2px; background: var(--panel2); border: 2px solid var(--acc); border-radius: 3px; line-height: 1.4; }
.rw.got { border-color: var(--hi); }
.filters { display: flex; gap: 5px; overflow-x: auto; margin: 10px 0; padding-bottom: 4px; }
.filters button { background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; padding: 4px 9px; font-size: 11px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.filters button.on { background: var(--acc); color: #261800; }
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dex-card { background: var(--panel); border: 2px solid var(--line); border-radius: 3px; padding: 6px 4px; text-align: center; position: relative; cursor: pointer; }
.dex-card canvas { width: 100%; max-width: 60px; }
.dex-card .no { font-size: 10px; color: var(--sub); }
.dex-card .nm { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-card.unseen { background: #1c202e; }
.dex-card.unseen canvas { filter: blur(2.6px) opacity(0.52); }
.dex-card.seen { border-color: var(--hi); }
.dex-card.seen canvas { filter: grayscale(0.75) opacity(0.65); }
.dex-card.owned { border-color: var(--acc); }
.dex-card.secret { background: #262138; }
.dex-card.fusion { background: #301c2d; }
.dex-card .star { position: absolute; top: 3px; right: 4px; display: inline-flex; }
.dex-card .seen-tag { position: absolute; top: 3px; right: 4px; font-size: 9px; color: var(--sub); background: #12151e; padding: 0 3px; border: 1px solid var(--hi); }

/* 도감 상세: 스탯 바 & 진화 계보 카드 */
.dex-hero { background: #141722; border: 2px solid var(--line); box-shadow: inset 0 0 0 1px var(--hi); border-radius: 3px; padding: 10px; margin-bottom: 10px; text-align: center; }
.dex-hero canvas.unseen-blur { filter: blur(4px) opacity(0.48); }
.dex-hero canvas.seen-dim { filter: grayscale(0.75) opacity(0.7); }
.dex-stats { background: #161924; border: 2px solid var(--line); border-radius: 3px; padding: 8px 10px; margin: 8px 0; }
.dex-stats .bar label { width: 30px; font-weight: bold; }
.dex-stats .bar span { width: 32px; }
.evo-card { background: #161924; border: 2px solid var(--line); border-radius: 3px; padding: 8px; margin-top: 8px; }
.evo-tree { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.evo-tier { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.evo-node { background: var(--panel2); border: 2px solid var(--line); border-radius: 3px; padding: 4px 6px; text-align: center; min-width: 68px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.evo-node:hover { border-color: var(--hi); }
.evo-node.me { border-color: var(--acc); background: #2d2618; }
.evo-node.unseen canvas { filter: blur(1.8px) opacity(0.5); }
.evo-node.seen canvas { filter: grayscale(0.75) opacity(0.65); }
.evo-node small { font-size: 10px; line-height: 1.2; }
.evo-arrow { font-size: 10px; color: var(--sub); text-align: center; letter-spacing: 2px; }

/* 상점 */
.shop-row { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 2px solid var(--line); border-radius: 3px; padding: 9px 10px; margin-bottom: 6px; box-shadow: inset 0 2px 0 var(--hi); }
.shop-row .ic { display: inline-flex; width: 28px; justify-content: center; }
.shop-row .nm { flex: 1; }
.shop-row small { display: block; color: var(--sub); font-size: 11px; }

/* 훈련 미니게임 */
.tg { text-align: center; }
.tg-bar { position: relative; height: 34px; background: #10121a; border: 2px solid var(--line); border-radius: 3px; margin: 14px 0; overflow: hidden; }
.tg-zone { position: absolute; top: 0; bottom: 0; background: #5cd68d77; }
.tg-perfect { position: absolute; top: 0; bottom: 0; background: var(--acc); }
.tg-cur { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #fff; }
.tg-dots span { font-size: 18px; color: #444; margin: 0 4px; }
.tg-dots .ok { color: var(--good); } .tg-dots .ng { color: var(--bad); }
.tg-msg { margin: 10px 0; font-size: 14px; min-height: 22px; }
.big { width: 100%; padding: 14px; font-size: 18px; }

/* 토스트 */
#toast { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 5px; align-items: center; pointer-events: none; width: 90%; max-width: 420px; }
.toast-item { background: #141722f5; border: 2px solid var(--acc); padding: 7px 12px; border-radius: 3px; font-size: 12px; animation: pop .15s; transition: opacity .35s, transform .35s; text-align: center; box-shadow: 0 4px 0 #000a; }
.toast-item.out { opacity: 0; transform: translateY(-8px); }
