/* Idle Cash & Cartel - hub UI. Logical stage 540 wide, scaled by ui.js. */
@font-face { font-family: "ICC Display"; src: local("Impact"), local("Haettenschweiler"), local("Anton"), local("Oswald Bold"), local("Arial Narrow Bold"), local("Liberation Sans Narrow Bold"), local("Arial Black"), local("DejaVu Sans Bold"), local("Liberation Sans Bold"), local("Arial Bold"), local("Helvetica Bold"), local("Roboto Bold"); }
:root {
  --char: #14161a; --panel: #1f2227; --panel2: #292d34; --amber: #e8a317; --amber-d: #a86f08; --red: #b3202a;
  --green: #4caf50; --gem: #8e44ad; --text: #f2efe9; --dim: #a9a49a; --ink: #0b0c0e;
  --display: "ICC Display", Impact, "Haettenschweiler", "Arial Narrow Bold", "Franklin Gothic Heavy", "Arial Black", sans-serif;
  --body: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ol: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  --ui: url("../assets/ui/");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07080a; overflow: hidden; color: var(--text); font-family: var(--body); }
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; }

#stage { position: absolute; left: 50%; top: 50%; width: 540px; height: 960px; transform-origin: 50% 50%; overflow: hidden; background: var(--char); }
.screen { position: absolute; inset: 0; }

/* ---------- loading ---------- */
#scr-loading { z-index: 50; background: #0a0b0e url("../assets/bg/loading.jpg") center bottom / cover no-repeat; transition: opacity .35s; }
#scr-loading.out { opacity: 0; pointer-events: none; }
#scr-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,12,.55) 0%, transparent 28%, transparent 62%, rgba(8,9,12,.8) 100%); pointer-events: none; }
.load-rain { position: absolute; inset: 0; opacity: .35; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(190,210,255,.22) 14px 15px, transparent 15px 41px);
  background-size: 200px 200px; animation: rain .55s linear infinite; }
@keyframes rain { to { background-position: -40px 200px; } }
.load-title { position: absolute; z-index: 2; top: 70px; left: 0; right: 0; text-align: center; font-family: var(--display); line-height: .88; transform: rotate(-3deg); }
.load-title span { display: block; white-space: nowrap; text-shadow: var(--ol), 0 6px 0 var(--ink), 0 12px 24px rgba(0,0,0,.7); }
.lt-1 { font-size: 78px; color: var(--amber); letter-spacing: 2px; }
.lt-2 { font-size: 54px; color: var(--text); letter-spacing: 6px; margin-top: 4px; }
.load-foot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 64px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loadbar { position: relative; width: 470px; height: 38px; background: url("../assets/ui/loadbar_2_empty.png") 0 0 / 100% 100% no-repeat; }
.loadbar-fill { position: absolute; left: 4.5%; top: 17%; height: 66%; width: 0; max-width: 91%; background: url("../assets/ui/loadbar_2_fill.png") 0 0 / 100% 100% no-repeat; border-radius: 99px; }
.loadbar.done { display: none; }
.load-note { font-size: 16px; color: var(--dim); letter-spacing: .04em; text-shadow: 0 1px 0 #000; }
.tap-start { font-family: var(--display); font-size: 40px; letter-spacing: 3px; color: var(--amber); text-shadow: var(--ol); padding: 10px 30px; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); opacity: .75; } }

/* ---------- hub shell ---------- */
#scr-hub { background: linear-gradient(180deg, rgba(10,11,14,.78), rgba(10,11,14,.93)), #14161a url("../assets/bg/bg_alley.jpg") center top / cover no-repeat; display: flex; flex-direction: column; }
#topbar { flex: none; display: flex; gap: 6px; align-items: center; padding: 12px 10px 6px; }
.cur { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px 0 4px; background: #0c0d10; border: 3px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(232,163,23,.55); }
.cur b { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .5px; overflow: hidden; text-overflow: clip; white-space: nowrap; text-shadow: 0 2px 0 #000; }
.cur[data-cur="cash"] b { color: #7fd982; } .cur[data-cur="gold"] b { color: #f4c34a; } .cur[data-cur="gems"] b { color: #c58be0; } .cur[data-cur="respect"] b { color: var(--text); }
.ci { flex: none; width: 34px; height: 34px; background: center / contain no-repeat; display: inline-block; filter: drop-shadow(0 2px 0 #000); }
.ci.sm { width: 22px; height: 22px; vertical-align: -5px; margin-right: 3px; }
.ci-cash { background-image: url("../assets/icons/cash_stack.png"); } .ci-gold { background-image: url("../assets/icons/gold_bars.png"); }
.ci-gems { background-image: url("../assets/icons/ruby_gem.png"); } .ci-respect { background-image: url("../assets/icons/crown.png"); }
.gear { flex: none; width: 48px; height: 48px; background: url("../assets/ui/btn_round.png") center / 100% 100% no-repeat; position: relative; }
.gear::after { content: ""; position: absolute; inset: 11px; background: url("../assets/icons/gear.png") center / contain no-repeat; }
.gear:active { transform: scale(.93); }
#subbar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 6px; min-height: 30px; }
.income { font-family: var(--display); font-size: 22px; letter-spacing: 1px; color: #7fd982; text-shadow: var(--ol); }
.boostchip { font-family: var(--display); font-size: 17px; color: var(--ink); background: var(--amber); border: 2px solid var(--ink); border-radius: 99px; padding: 1px 12px; box-shadow: 0 0 12px rgba(232,163,23,.7); }

#panes { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#panes::-webkit-scrollbar { display: none; }
.list { display: flex; flex-direction: column; gap: 12px; }

/* tab bar */
#tabbar { flex: none; height: 98px; margin: 0 6px 8px; padding: 10px 8px 8px; display: flex; gap: 2px; border: solid transparent; border-width: 12px 15px; border-image: url("../assets/ui/btn_secondary.png") 24 30 24 30 fill / 12px 15px 12px 15px; padding: 0; position: relative; }
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-family: var(--display); font-size: 14px; letter-spacing: .6px; min-width: 0; border-radius: 6px; margin: 0 1px; }
.tab span { text-shadow: 0 2px 0 #000; }
.tab .ti { width: 38px; height: 38px; background: center / contain no-repeat; filter: drop-shadow(0 2px 0 #000) grayscale(.6) brightness(.8); }
.ti-biz { background-image: url("../assets/icons/biz_bank.png"); } .ti-crew { background-image: url("../assets/icons/crew.png"); }
.ti-work { background-image: url("../assets/icons/upgrade_chevrons.png"); } .ti-shop { background-image: url("../assets/icons/gift_box.png"); } .ti-raid { background-image: url("../assets/icons/skull.png"); }
.tab.on { color: var(--ink); background: url("../assets/ui/tab_active.png") center top / 100% calc(100% + 7px) no-repeat; margin-bottom: -4px; padding-bottom: 4px; clip-path: inset(0 0 3px 0); }
.tab.on span { text-shadow: none; }
.tab.on .ti { filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.dot { position: absolute; width: 18px; height: 18px; background: url("../assets/ui/notif_dot.png") center / contain no-repeat; pointer-events: none; animation: dotp 1.2s ease-in-out infinite; }
.tab .dot { top: 6px; right: 10px; }
@keyframes dotp { 50% { transform: scale(1.25); } }

/* ---------- shared card + button frames ---------- */
.card { position: relative; border: solid transparent; border-width: 14px 20px; border-image: url("../assets/ui/panel_wide.png") 34 44 34 44 fill / 14px 20px 14px 20px; padding: 2px 0; }
.btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 52px; padding: 2px 10px; font-family: var(--display); font-size: 21px; letter-spacing: 1px; line-height: 1.05; text-align: center; white-space: nowrap; border: solid transparent; transition: transform .08s; }
.btn-primary { color: var(--ink); border-width: 14px 17px; border-image: url("../assets/ui/btn_primary.png") 30 34 30 34 fill / 14px 17px 14px 17px; }
.btn-primary:active:not(:disabled) { border-image-source: url("../assets/ui/btn_primary_pressed.png"); transform: translateY(2px); }
.btn-primary.is-off, .btn-primary:disabled { color: #70757c; border-image-source: url("../assets/ui/btn_primary_disabled.png"); cursor: default; }
.btn-secondary { color: var(--text); border-width: 12px 15px; border-image: url("../assets/ui/btn_secondary.png") 24 30 24 30 fill / 12px 15px 12px 15px; text-shadow: 0 2px 0 #000; }
.btn-secondary:active:not(:disabled) { border-image-source: url("../assets/ui/btn_secondary_pressed.png"); transform: translateY(2px); }
.btn-secondary.is-off, .btn-secondary:disabled { opacity: .55; cursor: default; }
.btn .buy-l { font-size: 18px; } .btn .buy-c { font-size: 17px; opacity: .9; font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.btn .buy-c:empty { display: none; }
.nope { animation: nope .3s; } @keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- buy mode ---------- */
.buymode { display: flex; gap: 6px; padding: 2px 2px 10px; position: sticky; top: -4px; z-index: 5; }
.buymode button { flex: 1; height: 38px; font-family: var(--display); font-size: 20px; letter-spacing: 1px; color: var(--dim); background: #0c0d10; border: 3px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 2px #3a3e46; }
.buymode button.on { color: var(--ink); background: var(--amber); box-shadow: inset 0 0 0 2px #ffd36a, 0 0 12px rgba(232,163,23,.5); }

/* ---------- business cards ---------- */
.biz { display: grid; grid-template-columns: 112px 1fr; gap: 10px; min-height: 148px; padding: 0 0 2px; }
.biz-art { position: relative; margin: -14px 0 -4px -10px; display: flex; align-items: flex-end; justify-content: center; }
.biz-art img { width: 120px; max-height: 128px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(0,0,0,.55)); }
.biz-art::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 20px; background: radial-gradient(ellipse at center, rgba(232,163,23,.35), transparent 70%); }
.biz-lock { display: none; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; background: url("../assets/icons/lock.png") center / contain no-repeat; filter: drop-shadow(0 2px 0 #000); }
.is-locked .biz-art img { filter: brightness(0) drop-shadow(0 0 0 #000); opacity: .85; }
.is-locked .biz-lock { display: block; }
.biz-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.biz-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.biz-name { font-family: var(--display); font-size: 24px; letter-spacing: .5px; text-shadow: var(--ol); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-lv { flex: none; font-family: var(--display); font-size: 18px; color: var(--amber); text-shadow: var(--ol); }
.biz-inc { font-size: 15px; font-weight: 700; color: #cfd8cf; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-locked .biz-name { color: var(--dim); } .is-locked .biz-inc { color: var(--dim); font-weight: 600; }
.bar { position: relative; height: 28px; border: solid transparent; border-width: 7px 11px; border-image: url("../assets/ui/bar_amber_empty.png") 20 22 20 22 / 7px 11px 7px 11px; background: #0b0c0e; border-radius: 99px; }
.bar { background-clip: padding-box; }
.bar-fill { position: absolute; left: -9px; top: -5px; bottom: -5px; width: 0; max-width: calc(100% + 18px); border-radius: 99px; background: url("../assets/ui/bar_amber_full.png") 0 0 / 100% 100%; transition: width .1s linear; }
.bar-text { position: absolute; left: -9px; right: -9px; top: 50%; transform: translateY(-50%); text-align: center; font-size: 14px; font-weight: 800; color: var(--text); text-shadow: var(--ol); white-space: nowrap; pointer-events: none; }
.bar.collect { cursor: pointer; }
.bar.ready .bar-text { color: #fff; }
.bar.ready { animation: readyglow 1s ease-in-out infinite; }
@keyframes readyglow { 50% { filter: brightness(1.25); } }
.bar.auto .bar-fill { background: repeating-linear-gradient(115deg, #7a5206 0 12px, #a56f0a 12px 24px); opacity: .85; animation: flow 1.2s linear infinite; background-size: 34px 100%; transition: none; }
@keyframes flow { to { background-position: 34px 0; } }
.bar.auto { cursor: default; }
.biz-acts { display: flex; gap: 8px; margin-top: 2px; }
.biz-acts .buy { flex: 1; min-width: 0; min-height: 52px; }
.biz-acts .mgr { flex: none; width: 108px; flex-direction: row; gap: 4px; padding: 0 4px; font-size: 16px; }
.mgr-ic { width: 32px; height: 32px; object-fit: contain; border-radius: 50%; }
.mgr.hired .mgr-ic { filter: none; } .mgr.hired { opacity: .85; color: var(--green); }
.mgr .mgr-c { font-family: var(--body); font-weight: 800; font-size: 15px; }
.biz .dot { right: 8px; top: 2px; }
.biz.pop { animation: pop .3s; } @keyframes pop { 40% { transform: scale(1.02); filter: brightness(1.2); } }
.biz.is-avail .biz-art img { filter: drop-shadow(0 4px 0 rgba(0,0,0,.55)) saturate(.6) brightness(.8); }

/* ---------- crew ---------- */
.crew { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; }
.crew-ic { width: 74px; height: 74px; border: solid transparent; border-width: 18px; border-image: url("../assets/ui/icon_frame_orange.png") 40 fill / 18px; padding: 0; position: relative; margin: -4px 0 -4px 0; }
.crew-ic img { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); object-fit: cover; border-radius: 10px; }
.crew-name { font-family: var(--display); font-size: 21px; letter-spacing: .5px; text-shadow: var(--ol); }
.crew-of { font-size: 14px; font-weight: 700; color: var(--amber); margin: 1px 0 2px; }
.crew-bio { font-size: 13px; color: var(--dim); line-height: 1.25; }
.crew .hire { min-width: 96px; }
.crew.is-locked .crew-ic img { filter: grayscale(1) brightness(.5); } .crew.is-locked .crew-name, .crew.is-locked .crew-bio { opacity: .6; }
.crew.is-hired .crew-of { color: var(--green); }

/* ---------- workshop ---------- */
.sec-title { font-family: var(--display); font-size: 30px; letter-spacing: 1.5px; color: var(--amber); text-shadow: var(--ol); margin: 6px 4px 0; }
.sec-sub { font-size: 14px; color: var(--dim); margin: 2px 4px 10px; line-height: 1.3; }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 0; border: solid transparent; border-width: 30px 18px 22px; border-image-slice: 62 36 62 36 fill; border-image-width: 30px 18px 22px 18px; border-image-source: url("../assets/ui/card_frame_gray.png"); min-height: 236px; }
.wcard.rar-green { border-image-source: url("../assets/ui/card_frame_green.png"); } .wcard.rar-blue { border-image-source: url("../assets/ui/card_frame_blue.png"); }
.wcard.rar-purple { border-image-source: url("../assets/ui/card_frame_purple.png"); } .wcard.rar-orange { border-image-source: url("../assets/ui/card_frame_orange.png"); } .wcard.rar-red { border-image-source: url("../assets/ui/card_frame_red.png"); }
.w-img { width: 100%; height: 66px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); margin-top: -2px; }
.w-name { font-family: var(--display); font-size: 20px; letter-spacing: .5px; text-shadow: var(--ol); text-align: center; line-height: 1.05; }
.w-lv { font-size: 13px; font-weight: 700; color: var(--dim); }
.wcard .btn { width: 100%; min-height: 44px; font-size: 17px; } .wcard .btn .buy-l { font-size: 16px; } .wcard .btn .buy-c { font-size: 14px; }
.wcard .w-eq { min-height: 38px; }
.wcard.is-locked .w-img { filter: brightness(.25) drop-shadow(0 0 0 #000); }
.wcard.is-eq .w-eq { color: var(--green); opacity: 1; }
.wcard.is-eq::after { content: "Start"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 14px; color: var(--ink); background: var(--amber); padding: 0 10px; border-radius: 99px; border: 2px solid var(--ink); }
.wcard .dot { top: -18px; right: -10px; }
.plist { margin-bottom: 8px; }
.perm { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; }
.perm-ic { width: 54px; height: 54px; border: solid transparent; border-width: 14px; border-image: url("../assets/ui/icon_frame_gray.png") 40 fill / 14px; position: relative; margin: -4px 0; }
.perm-ic img { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); object-fit: contain; }
.perm-name { font-family: var(--display); font-size: 20px; letter-spacing: .5px; text-shadow: var(--ol); }
.perm-desc { font-size: 13px; font-weight: 700; color: var(--amber); }
.perm .btn { min-width: 100px; min-height: 48px; }

/* ---------- shop ---------- */
.boostcard { display: grid; grid-template-columns: 84px 1fr; gap: 8px 10px; align-items: center; margin-bottom: 8px; }
.boostcard .shop-btns { grid-column: 1 / -1; display: flex; gap: 8px; } .boostcard .shop-btns .btn { flex: 1; }
.shop-ic { width: 84px; height: 76px; display: flex; align-items: center; justify-content: center; } .shop-ic img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
.shop-name { font-family: var(--display); font-size: 22px; letter-spacing: .5px; text-shadow: var(--ol); }
.shop-desc { font-size: 14px; color: var(--dim); line-height: 1.3; margin-top: 2px; }
.pack { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; }
.pack .shop-ic { width: 70px; height: 62px; } .pack .btn { min-width: 98px; }
.pack.hot { filter: drop-shadow(0 0 8px rgba(232,163,23,.45)); }
.adbox { height: 120px; margin: 4px 0; border: 3px dashed #555; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--dim); font-weight: 700; }
.ad-count { text-align: center; margin-top: 6px; font-family: var(--display); font-size: 22px; color: var(--amber); }

/* ---------- raid ---------- */
.raid-hero { position: relative; height: 270px; border-radius: 14px; overflow: hidden; border: 4px solid var(--ink); box-shadow: 0 0 0 3px var(--amber-d); margin: 4px 2px 14px; }
.raid-map { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(10,11,14,.85)), url("../assets/bg/map_london.png") center / cover; filter: saturate(.75) brightness(.8); }
.raid-med { position: absolute; left: 50%; top: 50%; width: 190px; transform: translate(-50%, -52%); filter: drop-shadow(0 8px 0 rgba(0,0,0,.5)) drop-shadow(0 0 22px rgba(179,32,42,.8)); }
.raid-stats { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 10px; } .rs { font-family: var(--display); font-size: 19px; letter-spacing: .5px; text-shadow: var(--ol); text-align: center; flex: 1; }
.raid-weapon { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.raid-weapon .w-img { height: 56px; } .raid-wt .w-name { text-align: left; font-size: 22px; } .raid-wt .sec-sub { margin: 0; }
.raid-go { display: flex; width: 100%; min-height: 110px; font-size: 64px; letter-spacing: 8px; border-width: 30px 34px; border-image-width: 30px 34px; animation: raidpulse 1.6s ease-in-out infinite; }
.raid-go span { text-shadow: 0 3px 0 rgba(255,255,255,.35); }
@keyframes raidpulse { 50% { filter: brightness(1.15) drop-shadow(0 0 14px rgba(232,163,23,.7)); } }
.raid-note { text-align: center; margin-top: 12px; }

/* ---------- floaters / toast ---------- */
#fx-root { position: absolute; inset: 0; pointer-events: none; z-index: 90; }
.float { position: absolute; transform: translate(-50%, 0); font-family: var(--display); font-size: 26px; letter-spacing: .5px; white-space: nowrap; text-shadow: var(--ol); animation: floatup 1.1s ease-out forwards; }
.f-cash { color: #8be58e; } .f-lv { color: var(--amber); font-size: 22px; }
@keyframes floatup { 0% { opacity: 0; margin-top: 10px; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -64px; } }
.toast { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); background: var(--ink); color: var(--text); border: 3px solid var(--amber); border-radius: 10px; padding: 8px 16px; font-weight: 800; font-size: 15px; animation: toastin 1.8s forwards; white-space: nowrap; }
@keyframes toastin { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ---------- modals ---------- */
#modal-root { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.modal-back { position: absolute; inset: 0; background: rgba(5,6,8,.78); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .2s; pointer-events: auto; overflow-y: auto; }
.modal-back.in { opacity: 1; } .modal-back.in .modal { transform: none; }
.modal { position: relative; width: 480px; max-width: 100%; margin: auto; transform: translateY(18px) scale(.97); transition: transform .22s; border: solid transparent; border-width: 66px 28px 28px; border-image: url("../assets/ui/popup_frame.png") 78 34 34 34 fill / 66px 28px 28px 28px; padding: 6px 4px 4px; }
.modal-title { position: absolute; left: 50%; top: -52px; transform: translateX(-50%); width: 300px; text-align: center; font-family: var(--display); font-size: 30px; letter-spacing: 1.5px; color: #fff; text-shadow: var(--ol), 0 4px 0 rgba(0,0,0,.4); white-space: nowrap; }
.close-x { position: absolute; right: -9px; top: -40px; width: 44px; height: 46px; background: url("../assets/ui/btn_close.png") center / contain no-repeat; }
.modal-body { padding-top: 12px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.modal-foot { display: flex; gap: 10px; margin-top: 14px; } .modal-foot .btn { flex: 1; min-height: 58px; }
.off-away { text-align: center; font-size: 16px; font-weight: 700; color: var(--dim); }
.off-cash { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--display); font-size: 58px; color: #8be58e; text-shadow: var(--ol), 0 5px 0 var(--ink); } .off-cash img { width: 76px; filter: drop-shadow(0 4px 0 #000); }
.off-sub { text-align: center; font-size: 13px; color: var(--dim); }
.res-hero { position: relative; margin-top: -10px; }
.res-banner { display: block; width: 100%; filter: drop-shadow(0 6px 0 rgba(0,0,0,.5)); }
.res-word { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-38%); text-align: center; font-family: var(--display); font-size: 52px; letter-spacing: 4px; color: #fff; text-shadow: var(--ol), 0 5px 0 rgba(0,0,0,.45); }
.lose .res-word { color: #ffb3b3; }
.res-new { position: absolute; right: -8px; bottom: -22px; width: 92px; transform: rotate(8deg); filter: drop-shadow(0 3px 0 #000); }
.res-rows { display: flex; flex-direction: column; gap: 6px; }
.res-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: rgba(0,0,0,.4); border: 2px solid #000; border-radius: 8px; animation: rowin .35s backwards; }
@keyframes rowin { from { opacity: 0; transform: translateX(-24px); } }
.res-row img { width: 34px; height: 34px; object-fit: contain; } .res-l { flex: 1; font-weight: 800; font-size: 16px; }
.res-v { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--amber); text-shadow: 0 2px 0 #000; }
.modal-sm { width: 360px; }
.set-row { display: flex; align-items: center; justify-content: space-between; font-size: 20px; font-weight: 800; padding: 4px 6px; }
.toggle { width: 86px; height: 48px; background: url("../assets/ui/toggle_off.png") center / contain no-repeat; } .toggle.on { background-image: url("../assets/ui/toggle_on.png"); }
.set-sec { font-family: var(--display); font-size: 22px; color: var(--amber); letter-spacing: 1px; margin-top: 8px; text-shadow: var(--ol); }
.save-box { width: 100%; background: #0b0c0e; color: var(--text); border: 3px solid #000; box-shadow: inset 0 0 0 2px #3a3e46; border-radius: 8px; padding: 8px; font: 12px/1.3 ui-monospace, Menlo, monospace; resize: none; -webkit-user-select: text; user-select: text; }
.set-btns { display: flex; gap: 8px; } .set-btns .btn { flex: 1; min-height: 48px; font-size: 18px; }
.danger { color: #ff8b8b; }

/* ---------- arena overlays (arena_ui.js classes) ---------- */
#scr-arena { left: 50%; top: 50%; width: 540px; height: 960px; right: auto; bottom: auto; background: #000; }
#scr-arena canvas { position: absolute; left: 0; top: 0; width: 540px; height: 960px; display: block; touch-action: none; }
.arena-layer { background: linear-gradient(180deg, rgba(10,11,14,.93), rgba(10,11,14,.97)), url("../assets/bg/bg_alley.jpg") center / cover !important; padding: 28px 22px 24px !important; gap: 14px !important; font-family: var(--body) !important; }
.arena-title { font-family: var(--display) !important; font-weight: 400 !important; font-size: 44px !important; letter-spacing: 3px !important; color: var(--amber) !important; text-shadow: var(--ol), 0 5px 0 var(--ink) !important; line-height: 1 !important; margin: 2px 0 0 !important; }
.arena-sub { font-size: 15px !important; font-weight: 700; color: var(--dim); opacity: 1 !important; }
.arena-cards { gap: 10px !important; }
.arena-card, .arena-offer { border: solid transparent !important; border-width: 31px 18px 26px !important; border-image: url("../assets/ui/card_frame_gray.png") 62 36 62 36 fill / 31px 18px 26px 18px !important; border-radius: 0 !important; background: none !important; padding: 2px 0 0 !important; min-height: 190px !important; gap: 6px !important; color: var(--text); box-shadow: none !important; }
.arena-offer { min-height: 210px !important; }
.arena-card.arena-tier-2, .arena-offer.arena-tier-2 { border-image-source: url("../assets/ui/card_frame_blue.png") !important; }
.arena-card.arena-tier-3, .arena-offer.arena-tier-3 { border-image-source: url("../assets/ui/card_frame_purple.png") !important; }
.arena-card.arena-tier-4, .arena-offer.arena-tier-4 { border-image-source: url("../assets/ui/card_frame_orange.png") !important; filter: drop-shadow(0 0 10px rgba(232,163,23,.55)); }
.arena-card:active { transform: scale(.97) !important; }
.arena-emblem { width: 50px !important; height: 50px !important; border-radius: 12px !important; border: 3px solid var(--ink); font-family: var(--display); font-size: 20px !important; font-weight: 400 !important; }
.arena-name { font-family: var(--display) !important; font-weight: 400 !important; font-size: 21px !important; letter-spacing: .5px; text-shadow: var(--ol); line-height: 1.1; }
.arena-tag { font-size: 13px !important; color: var(--amber); }
.arena-desc { font-size: 14px !important; line-height: 1.25; color: #d9d5cc; opacity: 1 !important; }
.arena-btn { border: solid transparent !important; border-width: 14px 17px !important; border-image: url("../assets/ui/btn_primary.png") 30 34 30 34 fill / 14px 17px 14px 17px !important; border-radius: 0 !important; background: none !important; color: var(--ink) !important; font-family: var(--display) !important; font-weight: 400 !important; font-size: 20px !important; letter-spacing: 1px; min-height: 52px !important; padding: 0 6px !important; white-space: nowrap; }
.arena-btn.arena-sec { border-width: 12px 15px !important; border-image: url("../assets/ui/btn_secondary.png") 24 30 24 30 fill / 12px 15px 12px 15px !important; color: var(--text) !important; text-shadow: 0 2px 0 #000; }
.arena-btn.arena-lock.arena-on { border-image-source: url("../assets/ui/btn_primary.png") !important; background: none !important; color: #fff !important; filter: hue-rotate(-30deg) saturate(1.6); }
.arena-btn[disabled], .arena-offer[disabled] { opacity: 1 !important; color: #70757c !important; border-image-source: url("../assets/ui/btn_primary_disabled.png") !important; }
.arena-btn.arena-sec[disabled] { border-image-source: url("../assets/ui/btn_secondary.png") !important; opacity: .5 !important; color: var(--text) !important; }
.arena-btn:active:not([disabled]) { transform: translateY(2px); }
.arena-money { font-family: var(--display); font-weight: 400 !important; font-size: 28px; color: #8be58e !important; text-shadow: var(--ol); }
.arena-row .arena-buy, .arena-offer .arena-row { gap: 6px !important; flex-wrap: nowrap !important; }
.arena-offer .arena-row .arena-btn { flex: 1; min-width: 0; font-size: 15px !important; letter-spacing: 0 !important; border-width: 12px 14px !important; padding: 0 !important; min-height: 46px !important; }
.arena-wslot { border: solid transparent !important; border-width: 14px !important; border-image: url("../assets/ui/icon_frame_gray.png") 40 fill / 14px !important; border-radius: 0 !important; background: none !important; padding: 0 !important; min-height: 92px !important; font-size: 14px; }
.arena-wslot .arena-name { font-size: 16px !important; }
.arena-wslot .arena-btn { min-height: 34px !important; font-size: 14px !important; border-width: 9px 11px !important; border-image-width: 9px 11px !important; }
.arena-wslot.arena-tier-2 { border-image-source: url("../assets/ui/icon_frame_blue.png") !important; } .arena-wslot.arena-tier-3 { border-image-source: url("../assets/ui/icon_frame_purple.png") !important; } .arena-wslot.arena-tier-4 { border-image-source: url("../assets/ui/icon_frame_orange.png") !important; }
.arena-wslot.arena-empty { opacity: .4 !important; }
.arena-chip { background: var(--panel2) !important; border: 2px solid #000; box-shadow: inset 0 0 0 1px var(--amber-d); font-weight: 700; padding: 4px 12px !important; font-size: 13px; }
.arena-toast { font-family: var(--display) !important; font-weight: 400 !important; font-size: 22px; letter-spacing: 1px; border: 3px solid var(--ink); }
.arena-pause-box { width: 78% !important; gap: 16px !important; }
.arena-pause-box .arena-btn { font-size: 26px !important; min-height: 66px !important; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
