:root {
  --page: #0e0e10;
  --body: #2b2c31;
  --body-hi: #3a3b41;
  --body-lo: #19191c;
  --bezel: #121214;
  --lcd: #b9c5a5;
  --lcd-lo: #a7b393;
  --seg: #1e2a21;
  --ghost: rgba(30, 42, 33, 0.1);
  --ghost2: rgba(30, 42, 33, 0.22);
  --pix: 'Press Start 2P', 'Galmuri11', monospace;
  --txt: 'Galmuri11', 'Press Start 2P', 'Malgun Gothic', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--page);
  background-image: radial-gradient(circle at 50% 0%, #1b1b1f, var(--page) 70%);
  color: var(--seg);
  font-family: var(--txt);
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: none;
  padding: 18px 12px 40px;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.g { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.12em; }

/* ---------- device body ---------- */
.device {
  max-width: 1120px; margin: 0 auto;
  background: linear-gradient(160deg, var(--body-hi), var(--body) 30%, var(--body-lo));
  border-radius: 34px;
  padding: 18px 22px 26px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08), inset 0 -4px 0 rgba(0,0,0,.5), 0 30px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 16px;
}
.top { display: flex; justify-content: space-between; align-items: center; padding: 0 8px; gap: 12px; }
.brand { font-family: var(--pix); font-size: 14px; color: #d9d2b5; letter-spacing: .08em; text-shadow: 0 1px 0 #000; }
.top-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.best { font-family: var(--pix); font-size: 8px; color: #8d8e95; letter-spacing: .1em; white-space: nowrap; }

.screens { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.bezel {
  display: flex; background: var(--bezel); border-radius: 18px; padding: 14px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.06);
}
.bezel > .lcd { flex: 1; }
.lcd {
  position: relative; overflow: hidden; border-radius: 6px;
  background: var(--lcd);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--lcd), var(--lcd-lo));
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 6px 18px rgba(0,0,0,.18);
  color: var(--seg);
}
#game { min-height: 600px; padding: 16px 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lcd.rank { padding: 10px 10px 12px; max-height: 700px; overflow: auto; min-height: 300px; display: flex; flex-direction: column; }
.lcd.flash { animation: flash .6s steps(1) 2; }
@keyframes flash { 50% { filter: invert(1) hue-rotate(180deg); } }

/* ---------- buttons ----------
   켜진 버튼: 두꺼운 테두리 + 아래 그림자(눌리는 느낌). primary는 반전.
   꺼진 버튼: 점선 테두리 + 연한 글자. 불투명도 대신 모양으로 구분 */
.btn {
  font-family: var(--pix); font-size: 11px; letter-spacing: .04em;
  border: 3px solid var(--seg); background: var(--lcd); color: var(--seg);
  padding: 10px 16px; border-radius: 3px; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 0 var(--seg);
}
.btn:hover:not(:disabled), .btn.primary { background: var(--seg); color: var(--lcd); }
.btn.primary:hover:not(:disabled) { background: var(--lcd); color: var(--seg); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.btn.big { font-size: 13px; padding: 14px 24px; }
.btn.big small { font-size: 8px; opacity: .8; }
.btn:disabled { border-style: dashed; border-color: var(--ghost2); color: var(--ghost2); background: transparent; box-shadow: none; }
.btn.pill {
  background: #1b1b1e; color: #f0e9c8; border-color: #0a0a0b; border-radius: 999px; font-size: 10px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 3px 0 #000;
}
.btn.pill:hover { background: #26262a; color: #fff; }
.btn.pill:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 1px 0 #000; }

/* ---------- start ---------- */
.start { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0; }
.title { font-family: var(--pix); font-size: clamp(30px, 6vw, 44px); line-height: 1.15; margin: 0; letter-spacing: .04em; text-shadow: 3px 3px 0 var(--ghost2); }
.tagline { margin: 0; font-size: 15px; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; text-align: left; font-size: 13px; }
.rules li { display: flex; align-items: center; gap: 10px; }
.rules b { font-family: var(--pix); font-size: 9px; width: 46px; }
.rules .g { font-size: 16px; }
.modes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.daily-status { margin: 0; font-size: 12px; min-height: 1.3em; opacity: .85; max-width: 440px; }
#ts { min-height: 0; }

/* ---------- HUD ---------- */
.hud { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hud-top { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.stage { font-family: var(--pix); font-size: 10px; letter-spacing: .1em; display: flex; align-items: baseline; gap: 8px; grid-column: 2; }
.stage b { font-size: 28px; }
.stage small { font-size: 7px; border: 2px solid var(--seg); padding: 2px 4px; align-self: center; }
.stage small:empty { display: none; }
.wallet { grid-column: 3; justify-self: end; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.wallet .w { font-family: var(--pix); font-size: 9px; display: inline-flex; align-items: center; gap: 5px; }
.wallet .w b { font-size: 12px; }
.wallet .w small { font-size: 7px; opacity: .75; }
.wallet .g { font-size: 12px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-family: var(--pix); font-size: 9px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px; border: 2px solid var(--seg);
}
.chip .g { font-size: 12px; }
.chip b { font-size: 12px; }
.chip.zero { border-color: var(--ghost2); color: var(--ghost2); }
.hint { margin: 0; min-height: 1.4em; font-size: 13px; }

/* ---------- doors (10 fixed LCD slots) ---------- */
.doors {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 10px;
  width: 100%; max-width: 400px; margin: auto 0;
}
.door {
  position: relative; width: 100%; aspect-ratio: 3 / 4; padding: 0;
  border: 4px solid var(--seg); border-radius: 40% 40% 0 0 / 28% 28% 0 0;
  background: var(--seg); color: var(--lcd);
  display: grid; place-items: center; overflow: hidden;
}
.door .num { font-family: var(--pix); font-size: clamp(12px, 2.4vw, 16px); }
.door .knob { position: absolute; right: 16%; top: 54%; width: 6px; height: 6px; background: var(--lcd); }
.door .g { display: none; font-size: clamp(26px, 5vw, 34px); }
.doors:not(.locked) .door:not(:disabled):hover { background: transparent; color: var(--seg); }
.door.ghost { border-color: var(--ghost); background: transparent; color: var(--ghost); pointer-events: none; }
.door.ghost .knob { background: var(--ghost); }
.door.open { background: transparent; color: var(--seg); }
.door.open .num, .door.open .knob { display: none; }
.door.open .g { display: block; }
.door.known:not(.picked)::after { content: '?'; position: absolute; right: 4px; top: 2px; font-family: var(--pix); font-size: 8px; }
.door.known.fail { border-style: dashed; }
.door.dim { opacity: .35; }
.door.picked { animation: blink .5s steps(1) 3; }
.door.knock { animation: blink .3s steps(1) infinite; }
@keyframes blink { 50% { filter: invert(1) hue-rotate(180deg); } }

/* ---------- tray: items + bank (한 줄 컴팩트) ---------- */
.tray { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: stretch; justify-content: center; }
.items { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.item { display: inline-flex; border: 3px dashed var(--ghost2); height: 38px; border-radius: 3px; }
.item.has { border-style: solid; border-color: var(--seg); box-shadow: 0 3px 0 var(--seg); }
.item .use {
  font-family: var(--pix); font-size: 9px; display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; color: var(--seg); padding: 0 10px; white-space: nowrap;
}
.item .use:hover:not(:disabled) { background: var(--seg); color: var(--lcd); }
.item .use:disabled { color: var(--ghost2); }
.item.has .use:disabled { color: var(--seg); opacity: .7; }
.item .use .g { font-size: 15px; }
.item .use .lbl { font-family: var(--txt); font-size: 13px; font-weight: bold; }
.item .use b { font-size: 10px; }
.item .buy {
  font-family: var(--pix); font-size: 9px; border: none; border-left: 3px dashed var(--ghost2);
  background: transparent; color: var(--ghost2); padding: 0 10px; letter-spacing: .02em; white-space: nowrap;
}
.item.has .buy { border-left-style: solid; }
.item .buy:not(:disabled) { background: var(--seg); color: var(--lcd); border-left-style: solid; border-left-color: var(--seg); }
.item .buy:hover:not(:disabled) { background: var(--lcd); color: var(--seg); }
/* 살 수 있는 아이템은 테두리도 진하게 */
.item:has(.buy:not(:disabled)) { border-style: solid; border-color: var(--seg); }

/* ---------- 스테이지 단계별 화면·문 장식 (data-tier 0..5) ---------- */
#game { transition: background-color .6s, color .6s; }
#game[data-tier="1"] { --lcd: #c9c690; --lcd-lo: #b8b57c; --seg: #2a2614; --ghost: rgba(42,38,20,.1); --ghost2: rgba(42,38,20,.22); }
#game[data-tier="2"] { --lcd: #a6cbc9; --lcd-lo: #92bab8; --seg: #13303a; --ghost: rgba(19,48,58,.1); --ghost2: rgba(19,48,58,.22); }
#game[data-tier="3"] { --lcd: #c3b3d9; --lcd-lo: #b0a0c8; --seg: #2a1840; --ghost: rgba(42,24,64,.1); --ghost2: rgba(42,24,64,.22); }
#game[data-tier="4"] { --lcd: #e3c277; --lcd-lo: #d2b062; --seg: #3b2408; --ghost: rgba(59,36,8,.1); --ghost2: rgba(59,36,8,.22); }
#game[data-tier="5"] { --lcd: #e0a7b9; --lcd-lo: #cf93a7; --seg: #3c0f22; --ghost: rgba(60,15,34,.1); --ghost2: rgba(60,15,34,.22); }

/* 배경 패턴: 스캔라인 위에 단계별 무늬 */
#game[data-tier="1"] {
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(135deg, var(--ghost) 0 6px, transparent 6px 18px),
    linear-gradient(180deg, var(--lcd), var(--lcd-lo));
}
#game[data-tier="2"] {
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-conic-gradient(var(--ghost) 0 25%, transparent 0 50%),
    linear-gradient(180deg, var(--lcd), var(--lcd-lo));
  background-size: auto, auto, 24px 24px, auto;
}
#game[data-tier="3"], #game[data-tier="4"], #game[data-tier="5"] {
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    radial-gradient(var(--ghost2) 1.5px, transparent 1.5px),
    radial-gradient(var(--ghost2) 1.5px, transparent 1.5px),
    radial-gradient(var(--ghost) 3px, transparent 3px),
    linear-gradient(180deg, var(--lcd), var(--lcd-lo));
  background-size: auto, auto, 60px 60px, 90px 90px, 120px 120px, auto;
  background-position: 0 0, 0 0, 10px 20px, 40px 5px, 70px 50px, 0 0;
}
#game[data-tier="4"] {
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    radial-gradient(var(--ghost2) 1.5px, transparent 1.5px),
    radial-gradient(var(--ghost2) 1.5px, transparent 1.5px),
    repeating-linear-gradient(45deg, var(--ghost) 0 2px, transparent 2px 28px),
    repeating-linear-gradient(-45deg, var(--ghost) 0 2px, transparent 2px 28px),
    linear-gradient(180deg, var(--lcd), var(--lcd-lo));
  background-size: auto, auto, 60px 60px, 90px 90px, auto, auto, auto;
  background-position: 0 0, 0 0, 10px 20px, 40px 5px, 0 0, 0 0, 0 0;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 6px 18px rgba(0,0,0,.18), inset 0 0 60px rgba(255,245,200,.35);
}
#game[data-tier="5"] {
  animation: drift 12s linear infinite;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 6px 18px rgba(0,0,0,.18), inset 0 0 80px rgba(255,255,255,.3);
}
@keyframes drift { to { background-position: 0 0, 0 0, 70px 80px, -50px 95px, 190px 170px, 0 0; } }

/* 문 장식 */
#game[data-tier="1"] .door, #game[data-tier="2"] .door, #game[data-tier="3"] .door, #game[data-tier="4"] .door, #game[data-tier="5"] .door {
  box-shadow: inset 0 0 0 3px var(--lcd), inset 0 0 0 5px currentColor;
}
.door::before { content: ''; position: absolute; inset: 0; pointer-events: none; display: none; }
#game[data-tier="2"] .door::before, #game[data-tier="3"] .door::before { /* 아치 상단 띠 */
  display: block;
  background: repeating-linear-gradient(90deg, var(--lcd) 0 3px, transparent 3px 8px);
  top: 14%; bottom: auto; height: 4px; left: 20%; right: 20%; opacity: .7;
}
#game[data-tier="3"] .door, #game[data-tier="4"] .door, #game[data-tier="5"] .door { border-radius: 50% 50% 0 0 / 38% 38% 0 0; }
#game[data-tier="3"] .door .knob, #game[data-tier="4"] .door .knob, #game[data-tier="5"] .door .knob { top: 66%; box-shadow: 0 0 0 2px var(--seg), 0 0 0 4px var(--lcd); }
#game[data-tier="4"] .door::before, #game[data-tier="5"] .door::before { /* 마름모 격자 + 모서리 징 */
  display: block;
  background:
    radial-gradient(circle at 18% 86%, var(--lcd) 2px, transparent 2.5px),
    radial-gradient(circle at 82% 86%, var(--lcd) 2px, transparent 2.5px),
    repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 2px, transparent 2px 12px);
  opacity: .9;
}
#game[data-tier="5"] .door:not(.open):not(.ghost)::after {
  content: ''; position: absolute; top: -60%; left: -60%; width: 40%; height: 220%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: rotate(25deg); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.door.open::before, .door.ghost::before { display: none !important; }

/* ---------- banner / toast ---------- */
.banner {
  position: absolute; left: 0; right: 0; top: 44%; transform: translateY(-50%);
  text-align: center; font-family: var(--pix); font-size: clamp(18px, 3.6vw, 30px); letter-spacing: .06em;
  pointer-events: none; opacity: 0; padding: 14px 8px;
  background: var(--lcd); box-shadow: 0 0 0 6px var(--lcd); white-space: pre-wrap;
}
.banner.show { opacity: 1; animation: blink .4s steps(1) 2; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); opacity: 0;
  background: var(--seg); color: var(--lcd); font-family: var(--pix); font-size: 9px;
  padding: 10px 16px; border: 3px solid var(--lcd); pointer-events: none; z-index: 10; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }
.blink { animation: blink 1s steps(1) infinite; }

/* ---------- ranking ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab {
  flex: 1; font-family: var(--pix); font-size: 9px; letter-spacing: .08em; padding: 9px 4px;
  border: 3px solid var(--seg); background: transparent; color: var(--seg); border-radius: 3px;
}
.tab:hover { background: var(--ghost2); }
.tab.on { background: var(--seg); color: var(--lcd); }
.ranking-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 8px; border-bottom: 3px double var(--seg); margin-bottom: 6px; font-family: var(--pix); font-size: 8px; }
.my-rank { white-space: nowrap; margin-left: auto; }
.ranking-head .flag { vertical-align: -3px; }
.rank-country {
  width: auto; max-width: 150px; font-family: var(--txt); font-size: 12px; padding: 3px 6px; border-width: 2px;
}
.rank-list li.link { cursor: pointer; }
.rank-list li.link:hover { background: var(--ghost2); }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank-list li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 18px; align-items: start; gap: 6px;
  padding: 7px 4px; border-bottom: 1px dotted var(--ghost2);
}
.rank-list li.mine { background: var(--seg); color: var(--lcd); }
.rank-list li.empty { display: block; text-align: center; padding: 30px 10px; font-size: 14px; }
.pos { font-family: var(--pix); font-size: 9px; padding-top: 3px; }
.who { min-width: 0; }
.line { display: flex; align-items: center; gap: 6px; }
.flag { flex: none; width: 20px; height: 15px; object-fit: cover; outline: 1px solid rgba(0,0,0,.35); }
.nm { font-family: var(--pix); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; }
.sub { font-family: var(--pix); font-size: 7px; opacity: .7; padding-top: 3px; white-space: nowrap; }
.memo { margin: 4px 0 0; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; opacity: .85; }
.memo a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.memo a:hover { background: var(--seg); color: var(--lcd); }
.rank-list li.mine .memo a:hover { background: var(--lcd); color: var(--seg); }
.score { font-family: var(--pix); font-size: 11px; padding-top: 2px; }
.report { border: 2px solid transparent; background: none; color: inherit; opacity: 0; font-size: 10px; padding: 2px 4px; white-space: nowrap; font-family: var(--pix); border-radius: 3px; }
.rank-list li:hover .report, .report.confirm, .report:disabled { opacity: .9; border-color: currentColor; }

/* ---------- dialogs & forms ---------- */
.dialog {
  border: none; padding: 12px; width: min(460px, calc(100vw - 24px));
  background: var(--bezel); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.8), inset 0 3px 8px rgba(0,0,0,.9);
}
.dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dialog-body { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; overflow: visible; }
.dialog h2 { font-family: var(--pix); font-size: 14px; margin: 0; letter-spacing: .06em; }
.dialog h3 { margin: 0 0 4px; font-family: var(--pix); font-size: 9px; letter-spacing: .06em; }
.close { position: absolute; top: 10px; right: 10px; border: none; background: none; font-family: var(--pix); font-size: 12px; }
.over-title { text-align: center; font-size: 22px !important; }
.over-score { text-align: center; font-family: var(--pix); font-size: 12px; margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.over-score b { font-size: 40px; }
.over-stage { text-align: center; margin: 0; font-family: var(--pix); font-size: 9px; opacity: .85; }
.over-sub { text-align: center; margin: 0; min-height: 1.2em; font-size: 14px; }
#over-actions { display: flex; flex-direction: column; gap: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form-intro { margin: 0; text-align: center; font-size: 14px; }
.fields { display: flex; flex-direction: column; gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-family: var(--pix); font-size: 8px; letter-spacing: .08em; position: relative; }
input, select, textarea {
  font-family: var(--txt); font-size: 15px; color: var(--seg); background: transparent; border: 3px solid var(--seg);
  border-radius: 0; padding: 8px 10px; width: 100%;
}
select option { background: var(--lcd); }
textarea { resize: vertical; min-height: 66px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--ghost2); }
.counter { position: absolute; right: 8px; bottom: 6px; font-size: 7px; }
.form-error { margin: 0; min-height: 1em; font-size: 13px; font-weight: bold; }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.form .row { justify-content: flex-end; }
.keybox { border-top: 3px double var(--seg); padding-top: 12px; }
.keybox .row { justify-content: stretch; flex-wrap: nowrap; }
.keybox code {
  flex: 1; min-width: 0; font-size: 11px; border: 3px solid var(--seg); padding: 8px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
}
.keybox input { flex: 1; min-width: 0; font-size: 12px; }
.muted { font-size: 13px; margin: 0 0 8px; opacity: .85; }

/* ---------- ads ----------
   본체 위·아래 배너. 본체와 같은 폭, 어두운 틀에 'AD' 표시. 광고 코드 없으면 ads.js가 숨긴다 */
.ad {
  position: relative; max-width: 1120px; margin: 0 auto; min-height: 102px;
  background: #151517; border: 1px solid #26262b; border-radius: 12px; padding: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ad::before {
  content: 'AD'; position: absolute; top: 4px; right: 8px; z-index: 1;
  font-family: var(--pix); font-size: 7px; letter-spacing: .1em; color: #55565e;
}
.ad-top { margin-bottom: 16px; }
.ad-bottom { margin-top: 16px; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  body { padding: 8px 6px 30px; }
  .ad { min-height: 110px; border-radius: 8px; padding: 4px; }
  .ad-top { margin-bottom: 10px; }
  .ad-bottom { margin-top: 10px; }
  .device { border-radius: 24px; padding: 14px 12px 20px; gap: 12px; }
  .screens { grid-template-columns: 1fr; gap: 12px; }
  .lcd.rank { max-height: 480px; }
  #game { min-height: 560px; padding: 12px 10px; }
  .report { opacity: .6; }
  .hud-top { grid-template-columns: 1fr auto; }
  .stage { grid-column: 1; }
  .wallet { grid-column: 2; }
}
@media (max-width: 480px) {
  .item .use .lbl { display: none; }
  .item .use { padding: 0 7px; }
  .doors { gap: 8px; }
  .btn.pill { max-width: 150px; }
  .modes .btn.big { font-size: 10px; padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
