:root {
  --bg: #1a1440;
  --panel: rgba(26, 20, 64, 0.9);
  --line: rgba(255, 255, 255, 0.18);
  --sky: #7fe8ff;
  --gold: #ffd23f;
  --pink: #ff6ad5;
  --green: #7be07b;
  --purple: #9a7aff;
  --ink: #120c2e;
  --muted: #cfc6ee;
  --display: 'Black Han Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --pixel: 'Press Start 2P', monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #000; color: #fff;
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; overscroll-behavior: none;
}
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ─────────── 화면 공통 ─────────── */
.screen {
  position: absolute; inset: 0; overflow-y: auto; display: flex; z-index: 10;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(18, 12, 46, 0.84);
  touch-action: pan-y;
}
#scr-title { background: radial-gradient(ellipse at center, rgba(18, 12, 46, 0.2), rgba(18, 12, 46, 0.78)); }
#scr-cards { background: rgba(18, 12, 46, 0.72); }
.inner { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 560px; }
.inner.wide { max-width: 940px; }
h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: 30px; color: var(--gold); text-align: center; text-shadow: 0 3px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.note { margin: 0; color: var(--muted); text-align: center; }

.btn {
  font-family: var(--display); font-size: 21px; color: #fff; line-height: 1.15;
  background: #2c2270; border: 3px solid var(--sky); border-radius: 12px;
  padding: 8px 20px; min-width: 200px; cursor: pointer; box-shadow: 0 4px 0 #0a0620;
  transition: transform 0.08s, background 0.1s;
}
.btn small { display: block; font-family: inherit; font-size: 12px; color: var(--muted); letter-spacing: 0.3px; }
.btn.small { font-size: 16px; min-width: 110px; padding: 7px 14px; }
.btn.primary { background: var(--gold); color: var(--ink); border-color: #fff3b0; box-shadow: 0 4px 0 #a07a10; }
.btn.primary small { color: #4a3800; }
.btn.danger { border-color: #ff6a6a; }
.btn:hover, .btn:focus-visible { outline: none; background: #fff3b0; color: var(--ink); border-color: #fff; transform: translateY(-2px); }
.btn:hover small, .btn:focus-visible small { color: #3a2a00; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a0620; }

/* ─────────── 첫 화면 ─────────── */
.logo { text-align: center; }
.logo-top { font-family: var(--pixel); font-size: 15px; color: var(--sky); letter-spacing: 5px; text-shadow: 3px 3px 0 var(--ink); }
.logo-main {
  font-family: var(--display); font-size: 66px; line-height: 1.1; color: var(--gold); margin-top: 6px;
  text-shadow: 4px 4px 0 #7a3cd0, 8px 8px 0 var(--ink);
  animation: bob 2.4s ease-in-out infinite;
}
.logo-sub { font-family: var(--display); font-size: 15px; color: #fff; margin-top: 6px; text-shadow: 0 2px 0 var(--ink); }
@keyframes bob { 50% { transform: translateY(-4px); } }
.menu { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; width: 100%; }
.menu .btn { min-width: 0; width: 100%; }
.my-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 4px 16px; font-family: var(--display); font-size: 15px; flex-wrap: wrap; justify-content: center; }
.my-card img { height: 40px; image-rendering: pixelated; }
.my-card b { font-weight: 400; color: var(--gold); font-size: 18px; }
.my-card span { color: var(--muted); }
.copyright { font-size: 12px; color: rgba(255, 255, 255, 0.85); text-decoration: none; text-shadow: 0 1px 2px #000; }
.copyright:hover { color: var(--gold); text-decoration: underline; }
#btn-sound, #btn-menu {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--sky); background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 18px; cursor: pointer;
}
#btn-sound { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; }
#hud-btns { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); z-index: 5; }

/* ─────────── 필살기·슝 버튼 ─────────── */
#ctrl { position: absolute; z-index: 5; right: max(16px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: flex-end; }
.act {
  --cd: 0; position: relative; width: 92px; height: 92px; border-radius: 50%; cursor: pointer; color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.85); font-family: var(--display); display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(rgba(0, 0, 0, 0.6) calc(var(--cd) * 360deg), transparent 0), rgba(60, 200, 255, 0.72);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); touch-action: none;
}
.act b { font-weight: 400; font-size: 24px; line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.act small { font-size: 11px; opacity: 0.95; }
#btn-special { --fill: 0; width: 82px; height: 82px; margin-bottom: 56px;
  background: conic-gradient(rgba(255, 210, 63, 0.95) calc(var(--fill) * 360deg), rgba(30, 20, 70, 0.7) 0); }
#btn-special b { font-size: 18px; }
#btn-special.full { border-color: #fff6b0; animation: glowpulse 0.6s ease-in-out infinite alternate; background: radial-gradient(circle, #fff3b0, #ffb020); color: var(--ink); }
#btn-special.full b, #btn-special.full small { text-shadow: none; }
@keyframes glowpulse { from { box-shadow: 0 0 6px 2px rgba(255, 210, 63, 0.6), 0 4px 0 rgba(0, 0, 0, 0.4); transform: scale(1); } to { box-shadow: 0 0 22px 8px rgba(255, 210, 63, 0.9), 0 4px 0 rgba(0, 0, 0, 0.4); transform: scale(1.07); } }
.act.ready { animation: ready 0.3s ease-out; }
@keyframes ready { 50% { transform: scale(1.12); } }
.act:active { transform: scale(0.94); }

/* 아래 가운데: 모아 둔 카드 버튼 */
#btn-cards { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); cursor: pointer; touch-action: none;
  font-family: var(--display); font-size: 20px; color: var(--ink); line-height: 1.1; padding: 7px 22px 5px; border-radius: 16px; border: 3px solid #fff6b0;
  background: linear-gradient(180deg, #ffe680, #ffb020); box-shadow: 0 4px 0 #a06a00, 0 0 16px rgba(255, 210, 63, 0.7); animation: cardGlow 1.2s ease-in-out infinite; }
#btn-cards b { font-family: var(--pixel); font-weight: 400; font-size: 17px; }
#btn-cards small { display: block; font-size: 11px; color: #5a3a00; text-align: center; }
#btn-cards.got { animation: cardGot 0.45s cubic-bezier(.2, 1.8, .4, 1), cardGlow 1.2s ease-in-out 0.45s infinite; }
#btn-cards:active { transform: translateX(-50%) scale(0.95); }
@keyframes cardGlow { 50% { box-shadow: 0 4px 0 #a06a00, 0 0 26px 6px rgba(255, 210, 63, 0.9); } }
@keyframes cardGot { 0% { transform: translateX(-50%) scale(0.6); } 100% { transform: translateX(-50%) scale(1); } }

/* ─────────── 큰 글자·도움말 ─────────── */
#callout {
  position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  font-family: var(--display); font-size: clamp(30px, 10vh, 70px); color: #fff; white-space: nowrap; text-align: center;
  text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(0, 0, 0, 0.6);
}
#callout.pop { animation: pop 0.4s cubic-bezier(.2, 1.7, .4, 1); }
#callout.gold { color: var(--gold); text-shadow: 0 4px 0 #7a3cd0, 0 0 24px rgba(255, 210, 63, 0.8); }
#callout.bad { color: #ff8a9a; }
#callout.sky { color: var(--sky); }
#callout small { display: block; font-size: 0.34em; color: #fff; margin-top: 4px; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0.3) rotate(-6deg); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
#tip {
  position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 34px); transform: translateX(-50%); z-index: 6; pointer-events: none;
  max-width: min(52vw, 540px); background: rgba(18, 12, 46, 0.88); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0;
  padding: 6px 14px; font-family: var(--display); font-size: clamp(14px, 4vh, 18px); color: #fff; text-align: left;
}
#tip.in { animation: tipIn 0.25s ease-out; }
@keyframes tipIn { from { transform: translate(-50%, -8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ─────────── 레인저 고르기 ─────────── */
#scr-hero { background: rgba(18, 12, 46, 0.9); }
.hero-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; }
.hc { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; border: 3px solid var(--line); background: var(--panel); color: #fff; cursor: pointer; font-family: inherit; text-align: center; min-width: 0; }
.hc img { height: 76px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }
.hc b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.hc .wp { font-size: 12px; color: var(--sky); }
.hc .pk { font-size: 12px; background: rgba(255, 210, 63, 0.16); color: #ffe9a0; border-radius: 8px; padding: 2px 6px; line-height: 1.35; word-break: keep-all; }
.hc .pk em { font-style: normal; display: block; font-family: var(--display); color: var(--gold); font-size: 14px; }
.hc.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.16); transform: translateY(-3px); }
.hc.on img { animation: bob 0.8s ease-in-out infinite; }
.look-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: center; }
.g-row { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 15px; color: var(--muted); }
.g-row input { font-family: var(--display); font-size: 17px; width: 160px; padding: 5px 10px; border-radius: 9px; border: 2px solid var(--sky); background: #120c3a; color: #fff; user-select: text; -webkit-user-select: text; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { padding: 5px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); color: #fff; font-family: var(--display); font-size: 15px; cursor: pointer; }
.pick.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.2); }
.pick.dot { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.pick.dot.on { box-shadow: 0 0 0 3px var(--gold); }

/* ─────────── 마을 상점 ─────────── */
#scr-town { background: rgba(18, 12, 46, 0.88); }
.town { margin: auto; width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 8px; }
.town-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coins { font-family: var(--display); font-size: 24px; color: #ffe680; display: flex; align-items: center; gap: 6px; }
.coins i { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c0, #ffd23f 60%, #c08a10); display: inline-block; }
.town-who { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.town-who img { height: 40px; image-rendering: pixelated; }
.town-who b { font-weight: 400; color: #fff; font-size: 19px; }
.town-who .rec b { color: var(--gold); font-size: 15px; }
.upg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px; }
.upg { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 5px 8px; }
.upg .ic { font-size: 24px; text-align: center; }
.upg .nm { font-family: var(--display); font-size: 17px; }
.upg .val { font-size: 12px; color: var(--sky); }
.pips { display: flex; gap: 3px; margin-top: 2px; }
.pips i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); }
.pips i.on { background: var(--gold); }
.upg .buy { min-width: 92px; font-size: 15px; padding: 6px 10px; }
.upg .buy.max { border-color: var(--green); color: var(--green); }
.upg .buy.poor { opacity: 0.55; }
.upg.flash { animation: upgFlash 0.6s ease-out; }
@keyframes upgFlash { 0% { background: rgba(255, 210, 63, 0.6); } 100% { background: var(--panel); } }
.btn.go { min-width: 190px; }

/* ─────────── 공격력·방어력·무기고 ─────────── */
.pw { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--display); font-size: 15px; }
.pw .lvb { color: var(--gold); }
.pw .atk { color: #ffb0a0; } .pw .def { color: #9fe8ff; }
.pw small { color: var(--muted); font-size: 12px; }
.xpb { position: relative; height: 16px; width: 100%; max-width: 240px; background: rgba(0, 0, 0, 0.45); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.xpb i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ff9f40, #ffd23f); }
.xpb span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; color: #fff; text-shadow: 0 1px 1px #000; }
.armory-btn { position: relative; }
.armory-btn i { position: absolute; top: -8px; right: -6px; font-style: normal; font-family: var(--pixel); font-size: 9px; background: var(--pink); color: #fff; padding: 3px 5px; border-radius: 6px; }
.armory-btn i:empty { display: none; }
.eqn { font-family: var(--display); font-size: 14px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
#scr-armory { background: rgba(18, 12, 46, 0.92); }
.armory { margin: auto; width: 100%; max-width: 980px; display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.6fr); gap: 14px; align-items: start; }
.arm-left { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.arm-left > img { height: 80px; image-rendering: pixelated; animation: bob 2s ease-in-out infinite; }
.arm-name { font-family: var(--display); font-weight: 400; font-size: 22px; }
.arm-sub { color: var(--muted); font-size: 13px; margin-top: -6px; }
.arm-left .pw { justify-content: center; }
.arm-cap { font-family: var(--display); color: var(--muted); font-size: 13px; margin-top: 4px; }
.arm-left .it { width: 100%; }
.arm-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.arm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.arm-head h2 { text-align: left; }
.arm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.note.small { font-size: 12px; text-align: left; }
.it { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); text-align: left; min-width: 0; }
.it b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.it .it-top { display: flex; gap: 6px; align-items: center; }
.it .tier { font-family: var(--display); font-size: 12px; padding: 1px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); }
.it .nw { font-family: var(--pixel); font-size: 9px; background: var(--pink); color: #fff; padding: 2px 5px; border-radius: 5px; }
.it .st { font-size: 13px; color: #ffe0d0; }
.it .fx { font-size: 12px; color: #9fe8ff; }
.it .req { font-size: 12px; color: var(--muted); }
.it .req.no { color: #ff8a9a; font-weight: 600; }
.it .it-btns { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.it .it-btns .btn { min-width: 0; font-size: 14px; padding: 4px 10px; }
.it .sell.arm { border-color: var(--pink); background: rgba(255, 106, 213, 0.25); }
.it.t-n { border-color: #8a86a8; } .it.t-n .tier { color: #e8e8f0; }
.it.t-r { border-color: #4fa8ff; box-shadow: 0 0 10px rgba(79, 168, 255, 0.35); } .it.t-r .tier { background: #1f5fa8; } .it.t-r b { color: #9fd0ff; }
.it.t-l { border-color: #ffb020; box-shadow: 0 0 16px rgba(255, 176, 32, 0.55); background: linear-gradient(160deg, rgba(90, 55, 0, 0.9), var(--panel)); } .it.t-l .tier { background: #b06a00; } .it.t-l b { color: #ffd23f; }
.it.on { outline: 3px solid var(--green); outline-offset: 1px; }
.it.lock { opacity: 0.78; }
.it.basic { font-family: var(--display); color: var(--muted); }
.res-items { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.res-items .cap { font-family: var(--display); color: var(--muted); font-size: 14px; }
.chip-it { font-family: var(--display); font-size: 14px; padding: 3px 10px; border-radius: 999px; border: 2px solid #8a86a8; }
.chip-it.t-r { border-color: #4fa8ff; color: #9fd0ff; }
.chip-it.t-l { border-color: #ffb020; color: #ffd23f; background: rgba(255, 176, 32, 0.2); animation: bob 0.9s ease-in-out infinite; }
.eqn.t-r { color: #9fd0ff; } .eqn.t-l { color: #ffd23f; }
.hc { position: relative; }
.hc .hlv { position: absolute; top: 4px; left: 6px; font-family: var(--pixel); font-size: 9px; color: var(--gold); }

/* ─────────── 레벨업 카드 ─────────── */
.card-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 16px; border: 3px solid #fff3b0;
  background: linear-gradient(160deg, #3a2a90, #251a66); color: #fff; cursor: pointer; font-family: inherit; text-align: center; box-shadow: 0 6px 0 #0a0620;
  animation: cardIn 0.35s cubic-bezier(.2, 1.6, .4, 1) both; }
.card:nth-child(2) { animation-delay: 0.07s; } .card:nth-child(3) { animation-delay: 0.14s; }
@keyframes cardIn { from { transform: translateY(40px) scale(0.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.card .ci { font-size: 44px; line-height: 1; }
.card b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold); }
.card .lv { font-family: var(--pixel); font-size: 10px; color: var(--sky); }
.card p { margin: 0; font-size: 14px; line-height: 1.4; word-break: keep-all; }
.card.new::after { content: 'NEW'; position: absolute; top: -10px; right: -6px; font-family: var(--pixel); font-size: 10px; background: var(--pink); color: #fff; padding: 4px 6px; border-radius: 6px; }
.card:hover, .card:focus-visible { outline: none; border-color: #fff; transform: translateY(-4px); background: linear-gradient(160deg, #5a3cd0, #3a2a90); }
.card:active { transform: scale(0.97); }

/* ─────────── 설정·도움말 ─────────── */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; max-width: 440px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; font-family: var(--display); font-size: 17px; }
.seg { display: flex; gap: 6px; }
.chip { font-family: var(--display); font-size: 14px; color: #fff; background: #2c2270; border: 2px solid var(--line); border-radius: 9px; padding: 5px 10px; cursor: pointer; }
.chip.on { border-color: var(--gold); background: #4a3a10; }
.tips { margin: 0; padding: 14px 18px 14px 34px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; line-height: 1.65; font-size: 15px; max-width: 660px; }
.tips b { color: var(--gold); font-weight: 600; }
kbd { font-family: var(--pixel); font-size: 10px; background: #2c2270; border: 1px solid var(--sky); border-bottom-width: 3px; border-radius: 5px; padding: 2px 6px; }

/* ─────────── 결과 ─────────── */
.res-head { font-family: var(--display); font-size: 36px; color: var(--gold); text-shadow: 0 3px 0 var(--ink); text-align: center; }
.res-head small { display: block; font-size: 15px; color: #fff; }
.res-head.down { color: #ffb0c0; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.badge { font-family: var(--display); font-size: 15px; padding: 4px 12px; border-radius: 999px; background: var(--gold); color: var(--ink); }
.badge.pink { background: var(--pink); color: #fff; animation: bob 1s ease-in-out infinite; }
.res-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; }
.stat { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: #fff; margin-top: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.big { border-color: var(--gold); }
.stat.big b { color: #ffe680; }

.cn { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; margin-right: 5px; vertical-align: -0.05em; background: radial-gradient(circle at 35% 35%, #fff6c0, #ffd23f 55%, #c08a10); box-shadow: inset 0 0 0 1px #a06a00; }

#toast {
  position: absolute; left: 50%; top: 66%; transform: translateX(-50%); z-index: 30; pointer-events: none; white-space: nowrap;
  background: rgba(18, 12, 46, 0.92); border: 2px solid var(--sky); border-radius: 12px; padding: 8px 16px; font-family: var(--display); font-size: 16px;
  opacity: 0; transition: opacity 0.25s;
}
#toast.show { opacity: 1; }

/* ─────────── 세로 화면 안내 ─────────── */
#rotate { display: none; position: absolute; inset: 0; z-index: 50; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); }
#rotate div { font-size: 56px; animation: tilt 1.6s ease-in-out infinite; }
#rotate p { margin: 0; font-size: 20px; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 820px) { #rotate { display: flex; } }

/* ─────────── 낮은 가로 화면 (폰) ─────────── */
@media (max-height: 460px) {
  .inner { gap: 8px; }
  .logo-top { font-size: 11px; }
  .logo-main { font-size: 48px; margin-top: 2px; }
  .logo-sub { font-size: 13px; margin-top: 2px; }
  .btn { font-size: 18px; padding: 6px 14px; }
  .btn small { font-size: 11px; }
  .btn.small { font-size: 14px; padding: 5px 12px; }
  h2 { font-size: 24px; }
  .my-card img { height: 32px; }
  .hc { padding: 5px 4px; }
  .hc img { height: 56px; }
  .hc b { font-size: 15px; }
  .hc .wp, .hc .pk { font-size: 11px; }
  .hc .pk em { font-size: 12px; }
  .look-row { gap: 10px; }
  .g-row input { font-size: 15px; padding: 3px 8px; width: 130px; }
  .pick { font-size: 13px; padding: 3px 9px; }
  .pick.dot { width: 28px; height: 28px; }
  .town { gap: 5px; }
  .town-who img { height: 32px; }
  .upg { padding: 3px 8px; }
  .upg .nm { font-size: 15px; }
  .upg .buy { min-width: 78px; font-size: 14px; padding: 4px 8px; }
  .upg .ic { font-size: 20px; }
  .card { padding: 10px 8px; gap: 4px; }
  .card .ci { font-size: 34px; }
  .card b { font-size: 19px; }
  .card p { font-size: 13px; }
  .res-head { font-size: 28px; }
  .stat b { font-size: 17px; }
  .act { width: 76px; height: 76px; }
  #btn-special { width: 68px; height: 68px; margin-bottom: 46px; }
  #btn-special b { font-size: 15px; }
  .act b { font-size: 21px; }
  .act small { font-size: 10px; }
  .tips { font-size: 13px; line-height: 1.5; }
  #btn-cards { font-size: 17px; padding: 5px 16px 4px; }
  .arm-left > img { height: 58px; }
  .arm-name { font-size: 18px; }
  .pw { font-size: 13px; gap: 6px; }
  .it { padding: 5px 8px; } .it b { font-size: 15px; } .it .st { font-size: 12px; }
  .arm-grid { max-height: 52vh; }
  #btn-cards b { font-size: 14px; }
}
