:root {
  --bg: #07040f;
  --panel: rgba(18, 13, 36, 0.72);
  --panel-solid: #120d24;
  --line: rgba(140, 120, 255, 0.24);
  --text: #eef2ff;
  --muted: #a49ec6;
  --cyan: #45e2ff;
  --pink: #ff5ec4;
  --gold: #ffd76a;
  --green: #8affc1;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}

#app { position: fixed; inset: 0; }

#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.stage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 38%, transparent 40%, rgba(4, 2, 10, 0.72) 100%),
    linear-gradient(to bottom, rgba(4,2,10,0.55), transparent 22%, transparent 72%, rgba(4,2,10,0.8));
}

/* ── 상단 HUD ───────────────────────────────── */
#hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 4, 15, 0.92), rgba(7, 4, 15, 0.35) 70%, transparent);
}
#hud > * { pointer-events: auto; }

.brand { display: flex; flex-direction: column; gap: 2px; min-width: 132px; white-space: nowrap; }
.brand-main {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 22px; font-weight: 900; letter-spacing: -0.5px;
  background: linear-gradient(92deg, #fff 10%, var(--cyan) 55%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(69, 226, 255, 0.35));
}
.brand-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(150deg, var(--cyan), #7b5cff 60%, var(--pink));
  color: #08040f; font-size: 15px; font-weight: 900;
  box-shadow: 0 0 18px rgba(123, 92, 255, 0.6);
}
.brand-sub { font-size: 9.5px; letter-spacing: 2.6px; color: var(--muted); font-weight: 700; }

#machine-tabs {
  flex: 1; display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none; padding: 4px 2px;
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent);
}
#machine-tabs::-webkit-scrollbar { display: none; }

.mtab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 12px; cursor: pointer;
  background: rgba(23, 17, 44, 0.6);
  border: 1px solid rgba(140, 120, 255, 0.16);
  color: #bdb6dd; font-size: 12px; font-weight: 700;
  transition: transform 0.15s ease, border-color 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.mtab:hover { transform: translateY(-1px); color: #fff; border-color: rgba(69, 226, 255, 0.5); }
.mtab.is-active {
  background: linear-gradient(135deg, rgba(69, 226, 255, 0.22), rgba(123, 92, 255, 0.28));
  border-color: rgba(69, 226, 255, 0.9);
  color: #fff;
  box-shadow: 0 0 20px rgba(69, 226, 255, 0.28), inset 0 0 12px rgba(69, 226, 255, 0.12);
}
.mtab-ico {
  font-size: 8.5px; font-weight: 900; letter-spacing: 0.4px;
  padding: 3px 5px; border-radius: 6px;
  background: rgba(69, 226, 255, 0.12); color: var(--cyan);
}
.mtab.is-active .mtab-ico { background: var(--cyan); color: #05121a; }

.wallet { display: flex; align-items: center; gap: 8px; }
.stat {
  display: flex; align-items: baseline; gap: 5px;
  padding: 6px 10px; border-radius: 12px;
  background: rgba(20, 14, 38, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.stat-label { font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.2px; }
.stat-value { font-size: 14px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.stat-value .won, .stat-value .c, .stat-value .of { font-size: 10px; font-weight: 700; color: var(--muted); margin-left: 1px; }
.stat-manner .stat-value { color: #ffb26b; }

.btn-charge, .btn-shelf, .btn-icon {
  height: 34px; padding: 0 13px; border-radius: 11px; cursor: pointer;
  font-size: 12px; font-weight: 800; font-family: inherit;
  border: 1px solid rgba(69, 226, 255, 0.45);
  background: linear-gradient(135deg, rgba(69, 226, 255, 0.2), rgba(123, 92, 255, 0.24));
  color: #eafcff; transition: transform 0.12s, filter 0.2s;
}
.btn-charge:hover, .btn-shelf:hover, .btn-icon:hover { transform: translateY(-1px); filter: brightness(1.15); }
.btn-charge.is-poor { border-color: rgba(255, 94, 196, 0.8); animation: poorPulse 1.4s infinite; }
.btn-shelf { border-color: rgba(255, 215, 106, 0.5); background: linear-gradient(135deg, rgba(255, 215, 106, 0.18), rgba(255, 94, 196, 0.18)); color: #fff5d8; }
.btn-icon { width: 40px; padding: 0; border-color: var(--line); background: rgba(20, 14, 38, 0.72); color: var(--muted); }
.btn-icon.is-off { color: #ff7d9c; border-color: rgba(255, 125, 156, 0.4); }

@keyframes poorPulse { 0%, 100% { box-shadow: 0 0 0 rgba(255, 94, 196, 0); } 50% { box-shadow: 0 0 18px rgba(255, 94, 196, 0.4); } }

/* ── 상태 ──────────────────────────────────── */
#status {
  position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%);
  z-index: 15; pointer-events: none;
  padding: 8px 18px; border-radius: 999px;
  background: rgba(10, 7, 20, 0.66);
  border: 1px solid rgba(140, 120, 255, 0.22);
  backdrop-filter: blur(10px);
  font-size: 12.5px; font-weight: 700; color: #d9d4f2;
  white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

/* ── 카메라 바 ─────────────────────────────── */
#camera-bar {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 18; display: flex; flex-direction: column; gap: 6px;
}
.cam-btn {
  width: 62px; padding: 8px 0; border-radius: 11px; cursor: pointer;
  font-size: 11px; font-weight: 800; font-family: inherit;
  color: #b9b2da; background: rgba(18, 13, 36, 0.66);
  border: 1px solid rgba(140, 120, 255, 0.2);
  backdrop-filter: blur(8px);
  transition: all 0.16s;
}
.cam-btn:hover { color: #fff; border-color: rgba(69, 226, 255, 0.5); }
.cam-btn.is-active { color: #05121a; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 18px rgba(69,226,255,0.4); }

/* ── 조작 패널 ─────────────────────────────── */
#controls {
  position: absolute; left: 0; right: 0; bottom: 22px; z-index: 16;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px; pointer-events: none;
}
#controls > * { pointer-events: auto; }

#dpad {
  position: relative; width: 168px; height: 168px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 5px; touch-action: none;
}
.pad-btn {
  display: grid; place-items: center; cursor: pointer;
  border-radius: 16px; font-size: 17px; color: #cfeeff;
  background: linear-gradient(160deg, rgba(38, 30, 70, 0.92), rgba(18, 13, 36, 0.86));
  border: 1px solid rgba(69, 226, 255, 0.26);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.08s, background 0.12s, box-shadow 0.12s;
  touch-action: none;
}
.pad-btn:hover { border-color: rgba(69, 226, 255, 0.6); }
.pad-btn:active, .pad-btn.is-down {
  transform: scale(0.95);
  background: linear-gradient(160deg, rgba(69, 226, 255, 0.32), rgba(28, 20, 54, 0.9));
  box-shadow: 0 0 22px rgba(69, 226, 255, 0.32);
}
.pad-up { grid-area: 1 / 2; }
.pad-left { grid-area: 2 / 1; }
.pad-right { grid-area: 2 / 3; }
.pad-down { grid-area: 3 / 2; }
.pad-center {
  grid-area: 2 / 2; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(123, 92, 255, 0.5), rgba(12, 8, 24, 0.9));
  border: 1px solid rgba(140, 120, 255, 0.3);
  box-shadow: inset 0 0 18px rgba(69, 226, 255, 0.18);
}

.slide-pad {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 20px;
  background: rgba(12, 8, 24, 0.6); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.slide-pad .pad-btn { width: 62px; height: 62px; font-size: 20px; }
.slide-mid { padding: 0 10px; font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }

.drop-btn {
  position: relative; width: 132px; height: 132px; border-radius: 50%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: inherit; color: #04121a;
  background:
    radial-gradient(circle at 35% 28%, #b6fbff, #45e2ff 42%, #1a9cd8 74%, #0c5f92 100%);
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 42px rgba(69, 226, 255, 0.45), 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 -8px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
}
.drop-btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.06); }
.drop-btn:active { transform: scale(0.96); }
.drop-main { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.drop-sub { font-size: 11px; font-weight: 800; letter-spacing: 1.6px; opacity: 0.72; }
.drop-btn.is-hot {
  background: radial-gradient(circle at 35% 28%, #ffe9a8, #ffd76a 45%, #ff9a3d 80%, #c2621a 100%);
  box-shadow: 0 0 52px rgba(255, 154, 61, 0.55), 0 16px 40px rgba(0, 0, 0, 0.5);
}
.drop-btn.is-poor { filter: saturate(0.55) brightness(0.8); }

.gacha-pad { display: flex; gap: 12px; }
.btn-gacha {
  width: 132px; height: 92px; border-radius: 20px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #1a0a16; border: 2px solid rgba(255,255,255,0.4);
  background: radial-gradient(circle at 35% 25%, #ffd6e6, #ff8fb1 55%, #d94f7e 100%);
  box-shadow: 0 0 30px rgba(255, 143, 177, 0.45), 0 12px 30px rgba(0,0,0,0.45);
  transition: transform 0.1s, filter 0.2s;
}
.btn-gacha strong { font-size: 20px; font-weight: 900; }
.btn-gacha span { font-size: 11px; font-weight: 800; opacity: 0.75; }
.btn-gacha-5 { background: radial-gradient(circle at 35% 25%, #fff0b8, #ffd76a 55%, #d59a1a 100%); box-shadow: 0 0 30px rgba(255, 215, 106, 0.45), 0 12px 30px rgba(0,0,0,0.45); }
.btn-gacha:hover { transform: translateY(-2px); }
.btn-gacha:disabled { filter: grayscale(0.6) brightness(0.7); cursor: default; transform: none; }

.blind-toggle {
  display: flex; align-items: center; gap: 8px; align-self: center;
  padding: 9px 14px; border-radius: 12px; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: #cdc7e8;
  background: rgba(14, 10, 28, 0.72); border: 1px solid var(--line);
  backdrop-filter: blur(8px); margin-right: 12px;
}
.blind-toggle input { accent-color: var(--cyan); width: 14px; height: 14px; }

/* ── 토스트 / 플래시 ────────────────────────── */
#toast {
  position: absolute; left: 50%; top: 92px; transform: translate(-50%, -12px);
  z-index: 200; padding: 12px 22px; border-radius: 14px;
  font-size: 13.5px; font-weight: 800; color: #fff;
  background: rgba(18, 12, 34, 0.92); border: 1px solid rgba(140, 120, 255, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  backdrop-filter: blur(12px); max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.good { border-color: rgba(138, 255, 193, 0.65); box-shadow: 0 0 32px rgba(138, 255, 193, 0.25); }
#toast.sale { border-color: rgba(255, 176, 90, 0.7); background: linear-gradient(135deg, rgba(58, 30, 12, 0.95), rgba(30, 16, 8, 0.95)); box-shadow: 0 0 32px rgba(255, 154, 61, 0.3); }
#toast.warn { border-color: rgba(255, 125, 156, 0.6); }
#toast.info { border-color: rgba(69, 226, 255, 0.5); }

#flash {
  position: absolute; inset: 0; z-index: 55; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.85), rgba(69, 226, 255, 0.25) 40%, transparent 70%);
}
#flash.on { animation: flashAnim 0.55s ease-out; }
@keyframes flashAnim { 0% { opacity: 0.9; } 100% { opacity: 0; } }

#score-hud {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%);
  z-index: 30; padding: 8px 20px; border-radius: 12px;
  font-weight: 900; font-size: 15px; color: var(--gold);
  background: rgba(10, 6, 20, 0.8); border: 1px solid rgba(255, 215, 106, 0.4);
}
.hidden { display: none !important; }

/* ── 모달 공통 ─────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(4, 2, 10, 0.72);
  backdrop-filter: blur(14px);
  animation: modalIn 0.22s ease-out;
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative; width: min(560px, 96vw); max-height: 92vh;
  padding: 26px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(30, 22, 58, 0.96), rgba(14, 10, 28, 0.98));
  border: 1px solid rgba(140, 120, 255, 0.32);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes cardIn { from { transform: translateY(16px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-card h2 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -0.6px; }
.modal-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  color: #cfc9e8; font-size: 14px; font-family: inherit;
}
.modal-close:hover { background: rgba(255, 94, 196, 0.18); color: #fff; }

/* ── 장식장 ────────────────────────────────── */
.shelf-card { width: min(880px, 96vw); display: flex; flex-direction: column; padding: 24px 26px 18px; overflow: hidden; }
.shelf-card .modal-head, .shelf-summary, .shelf-tabs { flex: 0 0 auto; }
.shelf-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 12px;
}
.sum-item {
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(140, 120, 255, 0.16);
  display: flex; flex-direction: column; gap: 3px;
}
.sum-item span { font-size: 10px; color: var(--muted); font-weight: 700; }
.sum-item strong { font-size: 15px; font-weight: 900; color: #fff; }

.shelf-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.stab {
  flex: 0 0 auto; padding: 7px 12px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 800; color: #b4adcf;
  background: rgba(255, 255, 255, 0.04); border: 1px solid transparent;
}
.stab.is-active { color: #05121a; background: var(--cyan); border-color: var(--cyan); }

.shelf-scroll { overflow-y: auto; padding-right: 4px; flex: 1 1 auto; min-height: 0; }
.shelf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }

.shelf-item {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(140, 120, 255, 0.16);
  transition: transform 0.15s, border-color 0.2s;
}
.shelf-item:hover { transform: translateY(-2px); border-color: rgba(69, 226, 255, 0.4); }
.shelf-item.locked { opacity: 0.62; }
.shelf-item.rarity-rare { border-color: rgba(199, 155, 255, 0.4); }
.shelf-item.rarity-secret { border-color: rgba(255, 215, 106, 0.55); box-shadow: inset 0 0 26px rgba(255, 215, 106, 0.08); }

.shelf-art {
  position: relative; height: 92px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(123, 92, 255, 0.26), rgba(10, 6, 20, 0.15) 70%);
}
.shelf-item.rarity-rare .shelf-art { background: radial-gradient(circle at 50% 35%, rgba(160, 92, 255, 0.32), rgba(10, 6, 20, 0.15) 70%); }
.shelf-item.rarity-secret .shelf-art { background: radial-gradient(circle at 50% 35%, rgba(255, 200, 61, 0.3), rgba(10, 6, 20, 0.15) 70%); }
.shelf-art .portrait-svg { width: 68px; height: 68px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45)); }
.shelf-item.locked .portrait-svg { filter: grayscale(1) brightness(0.28) contrast(1.1); }
.shelf-art .rarity-badge { position: absolute; top: 8px; right: 8px; }

.rarity-badge, .cat-badge {
  padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 900; letter-spacing: 0.3px;
}
.rarity-badge.common { color: #04222c; background: #7fd6ff; }
.rarity-badge.rare { color: #1a0730; background: #c79bff; }
.rarity-badge.secret { color: #2a1a00; background: linear-gradient(135deg, #ffe9a8, #ffc83d); box-shadow: 0 0 14px rgba(255, 200, 61, 0.6); }
.cat-badge { color: #bdb6dd; background: rgba(255, 255, 255, 0.08); }

.shelf-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.shelf-info h3 { margin: 0; font-size: 13.5px; font-weight: 900; letter-spacing: -0.3px; }
.shelf-info .cat { margin: 0; font-size: 9.5px; color: var(--cyan); font-weight: 700; }
.shelf-info .desc { margin: 2px 0 3px; font-size: 10px; color: var(--muted); line-height: 1.35; min-height: 26px; }
.shelf-meta { display: flex; justify-content: space-between; align-items: baseline; }
.shelf-meta .price { font-size: 12px; font-weight: 900; color: var(--gold); }
.shelf-meta .count { font-size: 12px; font-weight: 900; color: var(--green); }
.shelf-info .last { margin: 0; font-size: 9px; color: #7e77a0; }
.btn-sell {
  margin-top: 5px; padding: 7px 6px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 900; color: #2a1400;
  background: linear-gradient(135deg, #ffd08a, #ff9a3d);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-sell:hover { filter: brightness(1.08); }
.btn-sell:disabled { filter: grayscale(1) brightness(0.5); cursor: default; }

/* ── 획득 모달 ─────────────────────────────── */
.catch-card { width: min(400px, 94vw); text-align: center; padding: 28px 26px 22px; overflow: hidden; }
.catch-card .modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; }
.catch-card.rarity-rare { border-color: rgba(199, 155, 255, 0.6); }
.catch-card.rarity-secret { border-color: rgba(255, 215, 106, 0.75); }
.catch-glow {
  position: absolute; left: 50%; top: -40%; width: 380px; height: 380px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(123, 92, 255, 0.5), transparent 62%);
  pointer-events: none; animation: glowPulse 2.4s infinite;
}
.catch-card.rarity-rare .catch-glow { background: radial-gradient(circle, rgba(199, 155, 255, 0.55), transparent 62%); }
.catch-card.rarity-secret .catch-glow { background: radial-gradient(circle, rgba(255, 200, 61, 0.55), transparent 62%); }
@keyframes glowPulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.catch-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 900; letter-spacing: 3px; color: var(--cyan); text-transform: uppercase; }
.rarity-rare .catch-kicker { color: #c79bff; }
.rarity-secret .catch-kicker { color: var(--gold); }
.catch-portrait { width: 148px; height: 148px; margin: 6px auto 4px; filter: drop-shadow(0 14px 30px rgba(0,0,0,0.5)); animation: portraitPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes portraitPop { from { transform: scale(0.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.catch-portrait .portrait-svg, .catch-portrait svg { width: 100%; height: 100%; }
.catch-name { margin: 6px 0 8px; font-size: 24px; font-weight: 900; letter-spacing: -0.8px; }
.catch-badges { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.catch-blurb { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.catch-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-primary {
  padding: 14px; border-radius: 14px; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 900; color: #2a1400;
  background: linear-gradient(135deg, #ffd08a, #ff9a3d 60%, #ff7a3d);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 26px rgba(255, 122, 61, 0.32);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  padding: 12px; border-radius: 13px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 800; color: #cfc9e8;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-ghost:disabled { opacity: 0.45; cursor: default; }
.catch-note { margin: 12px 0 0; font-size: 10.5px; color: #7e77a0; }

/* ── 충전 / 광고 ───────────────────────────── */
.charge-card { width: min(430px, 94vw); }
.charge-options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ad-option {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; cursor: pointer; text-align: left;
  font-family: inherit; color: #fff;
  background: linear-gradient(135deg, rgba(69, 226, 255, 0.16), rgba(123, 92, 255, 0.24));
  border: 1px solid rgba(69, 226, 255, 0.45);
  box-shadow: 0 0 26px rgba(69, 226, 255, 0.16);
}
.ad-option:hover { filter: brightness(1.12); }
.ad-ico {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--cyan); color: #04121a; font-size: 15px; font-weight: 900; flex: 0 0 auto;
}
.ad-txt { display: flex; flex-direction: column; gap: 3px; }
.ad-txt strong { font-size: 14px; font-weight: 900; }
.ad-txt small { font-size: 10.5px; color: var(--muted); }
.free-option {
  padding: 11px; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 700; color: #9d96bd;
  background: transparent; border: 1px dashed rgba(140, 120, 255, 0.35);
}
.free-option:hover { color: #fff; border-color: rgba(140, 120, 255, 0.7); }

.ad-card { width: min(420px, 94vw); padding: 16px; }
.ad-creative {
  position: relative; height: 300px; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 94, 196, 0.55), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(69, 226, 255, 0.5), transparent 55%),
    linear-gradient(150deg, #1b1038, #0a0618);
  border: 1px solid rgba(140, 120, 255, 0.3);
  text-align: center;
}
.ad-brand { font-size: 12px; letter-spacing: 4px; font-weight: 900; color: #9fe8ff; }
.ad-copy { font-size: 30px; font-weight: 900; line-height: 1.25; letter-spacing: -1px; text-shadow: 0 0 30px rgba(69, 226, 255, 0.5); }
.ad-sticker {
  position: absolute; top: 12px; right: 12px; padding: 4px 9px; border-radius: 6px;
  font-size: 10px; font-weight: 900; color: #04121a; background: #ffd76a;
}
.ad-progress { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); overflow: hidden; }
.ad-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width 0.9s linear; }
.ad-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 0 4px; }
#ad-count { font-size: 12px; font-weight: 800; color: var(--muted); }
#ad-close { padding: 10px 16px; }
#ad-close.is-ready { color: #04121a; background: var(--green); border-color: var(--green); font-weight: 900; }
.ad-note { margin: 10px 4px 2px; font-size: 10.5px; color: #7e77a0; line-height: 1.5; }

/* ── 모바일 ────────────────────────────────── */
@media (max-width: 1000px) {
  .brand-sub { display: none; }
  .brand { min-width: 92px; }
  .brand-main { font-size: 18px; }
  .stat-manner { display: none; }
  .mtab-txt { font-size: 11px; }
}

@media (max-width: 720px) {
  #hud {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand wallet" "tabs tabs";
    gap: 5px 8px; padding: 8px 10px;
  }
  .brand { grid-area: brand; min-width: 0; }
  .brand-main { font-size: 15px; gap: 5px; }
  .brand-badge { width: 21px; height: 21px; font-size: 12px; border-radius: 7px; }
  .wallet { grid-area: wallet; justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
  #machine-tabs { grid-area: tabs; width: 100%; }
  .stat { padding: 4px 7px; }
  .stat-label { display: none; }
  .stat-manner { display: none; }
  .stat-value { font-size: 11.5px; white-space: nowrap; }
  .stat-value .won, .stat-value .of { font-size: 9px; }
  .btn-charge, .btn-shelf { height: 28px; padding: 0 8px; font-size: 10.5px; white-space: nowrap; }
  .btn-icon { width: 30px; height: 28px; font-size: 10px; }
  .mtab { padding: 5px 8px; font-size: 10.5px; }
  .mtab-txt { font-size: 10.5px; }
  #status {
    top: 122px; bottom: auto; font-size: 10.5px; padding: 6px 12px;
    max-width: 92vw;
  }
  #controls { padding: 0 14px; bottom: 14px; }
  #dpad { width: 132px; height: 132px; }
  .drop-btn { width: 104px; height: 104px; }
  .drop-main { font-size: 20px; }
  .drop-sub { font-size: 9px; }
  .btn-gacha { width: 100px; height: 74px; }
  .btn-gacha strong { font-size: 15px; }
  .slide-pad .pad-btn { width: 48px; height: 48px; }
  #camera-bar {
    right: 8px; top: 168px; bottom: auto; transform: none;
    flex-direction: column; gap: 4px;
  }
  .cam-btn { width: 46px; padding: 5px 0; font-size: 9.5px; border-radius: 9px; }
  .shelf-grid { grid-template-columns: repeat(2, 1fr); }
  .shelf-summary { grid-template-columns: repeat(2, 1fr); }
  .shelf-card { padding: 16px 12px 12px; }
  .modal { padding: 10px; }
  .catch-portrait { width: 118px; height: 118px; }
  .catch-name { font-size: 20px; }
  .blind-toggle { margin-right: 0; font-size: 10px; padding: 6px 9px; }
  .ad-creative { height: 230px; }
  .ad-copy { font-size: 23px; }
}

[hidden] { display: none !important; }
