/* Bubble Tanks HTML5 — UI styles (owner: UI). Original Bubble Tanks look: rounded bubbly type, translucent white panels
 * (20–40 %), translucent bubble buttons that lighten on hover, 70 % black pause overlay, "Upgrade!" blue #3aaae7. */
:root {
  --font: "Arial Rounded MT Bold", "Varela Round", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --panel: rgba(255, 255, 255, 0.16);
  --panel-2: rgba(255, 255, 255, 0.26);
  --line: rgba(255, 255, 255, 0.62);
  --line-soft: rgba(255, 255, 255, 0.22);
  --accent: #3aaae7;
  --gold: #ffd36a;
  --dim: rgba(232, 246, 255, 0.78);
  --deep: rgba(4, 30, 64, 0.62);
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; overflow: hidden; height: 100%; background: #1b6389;
  touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;
}
#game { position: fixed; inset: 0; display: block; }
#ui {
  position: fixed; inset: 0; pointer-events: none; font-family: var(--font); color: #fff; line-height: 1.35;
  -webkit-font-smoothing: antialiased; text-shadow: 0 1px 2px rgba(6, 34, 70, 0.35);
}
#ui button, #ui input, #ui select { font-family: inherit; }
.safe-probe { position: absolute; visibility: hidden; pointer-events: none; padding: var(--sat) var(--sar) var(--sab) var(--sal); }
.layer { position: absolute; inset: 0; pointer-events: none; }
.layer-screen, .layer-pause, .layer-modal, .layer-loading { display: none; }
.layer-screen, .layer-pause, .layer-modal, .layer-loading, .layer-toasts, .layer-touch, .sandbox-panel { zoom: var(--uiz, 1); }
.layer-screen.show, .layer-pause.show, .layer-modal.show { display: block; }
.panel, .ui-interactive, .btn { pointer-events: auto; }
.scroll { overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.4) transparent; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); border-radius: 4px; }
.en { font-size: 0.72em; opacity: 0.72; letter-spacing: 0.03em; text-transform: lowercase; font-weight: normal; }
.empty { opacity: 0.7; text-align: center; padding: 18px; }
:focus-visible { outline: 2px solid #ffe39a; outline-offset: 2px; }

/* ------------------------------------------------------------------ buttons (translucent bubbles) */
.btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff; font-size: 16px; font-weight: bold; padding: 0.5em 1.5em; border-radius: 999px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.14) 42%, rgba(255, 255, 255, 0.07) 72%);
  box-shadow: inset 0 -5px 12px rgba(255, 255, 255, 0.12), 0 2px 14px rgba(120, 210, 255, 0.18);
  text-shadow: 0 1px 2px rgba(6, 34, 70, 0.45); touch-action: manipulation;
  transition: transform 0.14s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s;
}
.btn:hover:not(:disabled) {
  background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.26) 45%, rgba(255, 255, 255, 0.14) 75%);
  border-color: #fff; transform: translateY(-1px) scale(1.03); box-shadow: inset 0 -5px 12px rgba(255, 255, 255, 0.18), 0 0 22px rgba(170, 230, 255, 0.45);
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:disabled { opacity: 0.42; cursor: default; }
.btn-label { display: block; }
.btn-sub { display: block; font-size: 0.66em; font-weight: normal; opacity: 0.8; letter-spacing: 0.04em; text-transform: lowercase; }
.btn.primary { border-color: #fff; background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.62), rgba(90, 190, 245, 0.55) 45%, rgba(58, 170, 231, 0.45) 80%); }
.btn.small { font-size: 13px; padding: 0.36em 1em; }
.btn.danger { border-color: #ffb3a8; }
.btn.on { background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.75), rgba(255, 236, 170, 0.45) 50%, rgba(255, 211, 106, 0.35) 85%); border-color: #ffe39a; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.btn-row.tight { margin-top: 8px; gap: 6px; }
.btn.big-ish { font-size: 18px; padding: 0.5em 2em; }
.bubble.big {
  min-width: 250px; font-size: 22px; padding: 0.45em 1.6em 0.5em; overflow: hidden;
  animation: bob 4.5s ease-in-out infinite;
}
.bubble.big:nth-child(2n) { animation-delay: -1.6s; }
.bubble.big:nth-child(3n) { animation-delay: -3s; }
.bubble.big::before, .bubble.round::before {
  content: ""; position: absolute; left: 12%; top: 10%; width: 22%; height: 26%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55); filter: blur(0.5px); pointer-events: none;
}
.bubble.big::before { width: 12%; height: 34%; left: 6%; top: 14%; }
.bubble.big.accent { border-color: #ffe39a; box-shadow: 0 0 24px rgba(255, 227, 154, 0.35), inset 0 -5px 12px rgba(255, 255, 255, 0.15); }
.bubble.round {
  width: 92px; height: 92px; border-radius: 50%; padding: 6px; font-size: 14px;
  animation: bob 5s ease-in-out infinite;
}
.bubble.round:nth-child(2n) { animation-delay: -2s; }
.bubble.round:nth-child(3n) { animation-delay: -3.4s; }
.btn-icon { font-size: 24px; line-height: 1; margin-bottom: 3px; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

/* ------------------------------------------------------------------ controls */
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.seg.wrap, .seg.tabs { flex-wrap: wrap; }
.seg.wrap { border-radius: 14px; }
.seg-btn { background: transparent; border: 0; color: #fff; padding: 0.4em 0.95em; font-size: 13px; cursor: pointer; touch-action: manipulation; transition: background 0.2s; }
.seg-btn:hover { background: rgba(255, 255, 255, 0.14); }
.seg-btn.on { background: rgba(255, 255, 255, 0.34); font-weight: bold; }
.seg.tabs { margin: 0 0 12px; align-self: flex-start; flex: none; }
.seg.tabs .seg-btn { font-size: 14px; padding: 0.45em 1.2em; }
.toggle { position: relative; width: 50px; height: 28px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.16); cursor: pointer; flex: none; transition: background 0.2s; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: left 0.2s; }
.toggle.on { background: var(--accent); }
.toggle.on .knob { left: 24px; }
.slider-wrap { display: inline-flex; align-items: center; gap: 10px; }
.slider { -webkit-appearance: none; appearance: none; width: 170px; height: 7px; border-radius: 4px; background: linear-gradient(to right, #fff var(--p, 50%), rgba(255, 255, 255, 0.25) var(--p, 50%)); outline: none; touch-action: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; }
.slider-val { min-width: 3em; font-size: 13px; text-align: right; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.step-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; touch-action: manipulation; }
.step-btn:disabled { opacity: 0.35; cursor: default; }
.step-val { min-width: 24px; text-align: center; font-weight: bold; }
kbd { display: inline-block; min-width: 1.6em; padding: 0.1em 0.5em; border-radius: 7px; border: 1.5px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.16); font-family: inherit; font-size: 0.85em; font-weight: bold; text-align: center; }

/* ------------------------------------------------------------------ screens */
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden; padding: var(--sat) var(--sar) var(--sab) var(--sal); animation: fadein 0.25s ease; }
.screen.framed { background: linear-gradient(180deg, rgba(4, 30, 64, 0.42), rgba(4, 24, 52, 0.62)); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.screen-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px 10px; flex: none; }
.screen-title h2 { margin: 0; font-size: 26px; display: inline; }
.screen-title .en { margin-left: 8px; font-size: 14px; }
.head-right { margin-left: auto; font-size: 14px; opacity: 0.85; }
.screen-body { flex: 1; min-height: 0; padding: 0 18px 18px; }
.screen-intro { margin: 0 0 12px; color: var(--dim); font-size: 14px; }
.corner-back { position: absolute; top: calc(12px + var(--sat)); left: calc(12px + var(--sal)); }

/* title */
.title-screen { align-items: center; justify-content: flex-start; gap: 14px; overflow-y: auto; touch-action: pan-y; }
.title-screen > .title-top { margin-top: auto; padding-top: 10px; }
.title-screen > .menu-more { margin-bottom: auto; }
.title-top { display: flex; justify-content: center; width: 100%; flex: none; }
canvas.logo { width: min(92vw, 720px); height: min(calc(min(92vw, 720px) * 0.34), 30vh); display: block; }
.menu-main { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; max-width: 900px; padding: 0 12px; }
.menu-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; padding: 0 12px; }
.title-foot { position: relative; flex: none; width: 100%; padding: 8px calc(14px + var(--sar)) calc(8px + var(--sab)) calc(14px + var(--sal)); display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; font-size: 12px; color: var(--dim); }
.title-records { text-align: left; }
.title-tip { text-align: center; max-width: 46vw; }
.title-ver { text-align: right; text-transform: lowercase; }

/* dialogs */
.dialog-back { position: absolute; inset: 0; background: rgba(2, 16, 36, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; animation: fadein 0.2s ease; overflow: auto; }
.dialog {
  width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 18px 22px 20px; border-radius: 24px; border: 2px solid rgba(255, 255, 255, 0.75);
  background: radial-gradient(140% 70% at 30% 0%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%), linear-gradient(180deg, rgba(52, 138, 206, 0.95), rgba(20, 76, 138, 0.96));
  box-shadow: 0 10px 40px rgba(0, 20, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dialog-title { margin: 0 0 6px; font-size: 24px; text-align: center; }
.dialog-text { margin: 6px 0 10px; font-size: 14px; color: var(--dim); text-align: center; }
.dialog-sub { margin: 14px 0 8px; font-size: 14px; opacity: 0.85; }
.dialog-note { font-size: 12.5px; color: #ffe1b0; text-align: center; margin: 12px 0 0; }
.preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.preset-card { flex: 1 1 140px; text-align: left; color: #fff; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line-soft); background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color 0.2s, background 0.2s, transform 0.15s; }
.preset-card:hover { transform: translateY(-1px); border-color: var(--line); }
.preset-card b { font-size: 17px; }
.preset-card small { font-size: 12px; opacity: 0.85; line-height: 1.35; margin-top: 3px; }
.preset-card.on { border-color: #ffe39a; background: rgba(255, 236, 170, 0.2); box-shadow: 0 0 16px rgba(255, 227, 154, 0.3); }
.newgame .seg { display: flex; width: 100%; }
.newgame .seg-btn { flex: 1; }

/* settings */
.settings-form { max-width: 780px; margin: 0 auto; }
.set-section { margin-bottom: 14px; padding: 6px 16px 4px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-soft); }
.set-title { margin: 8px 0 2px; font-size: 15px; color: #bfe9ff; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-label span { font-size: 15px; }
.set-label small { display: block; font-size: 11.5px; opacity: 0.66; margin-top: 1px; }
.set-static { opacity: 0.8; font-size: 14px; }
.set-row .btn-row { margin: 0; justify-content: flex-end; }

/* help */
.help-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; max-width: 1100px; margin: 0 auto; }
.help-sec { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px; padding: 10px 16px 12px; }
.help-sec h4 { margin: 4px 0 8px; color: #bfe9ff; }
.help-row { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; font-size: 14px; }
.help-row kbd { flex: none; min-width: 7.5em; }
.help-sec p { margin: 5px 0; font-size: 14px; color: var(--dim); }

/* split screens (codex / pedia) */
.screen-codex .screen-body, .screen-pedia .screen-body { display: flex; flex-direction: column; overflow: hidden; }
.split { flex: 1; min-height: 0; display: flex; gap: 14px; }
.detail-panel { width: 310px; flex: none; overflow: auto; padding: 12px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-soft); touch-action: pan-y; }
.detail-preview { display: block; margin: 0 auto 6px; border-radius: 16px; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 70%); }
.detail-name { margin: 2px 0 0; font-size: 21px; text-align: center; }
.detail-en { text-align: center; font-size: 12.5px; opacity: 0.75; margin-bottom: 8px; }
.facts { display: grid; gap: 4px; margin: 6px 0; }
.fact { display: flex; gap: 10px; font-size: 13px; }
.fact .k { flex: none; width: 5.6em; opacity: 0.7; }
.fact .v { flex: 1; }
.detail-desc { font-size: 13px; color: var(--dim); margin: 8px 0; }
.detail-flavor { font-size: 12.5px; color: #ffe9b5; font-style: italic; margin: 6px 0; }
.detail-line { font-size: 12.5px; opacity: 0.85; margin-top: 4px; }
.tree-area { flex: 1; min-width: 0; border-radius: 18px; background: rgba(0, 20, 50, 0.22); border: 1px solid var(--line-soft); position: relative; }
.tree-inner { position: relative; }
.tree-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.tier-label { position: absolute; left: 8px; z-index: 2; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(4, 26, 56, 0.72); color: rgba(220, 240, 255, 0.85); pointer-events: none; }
.tree-node { position: absolute; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: #fff; cursor: pointer; touch-action: manipulation; }
.tree-node canvas { border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55); background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.05) 70%); transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s; }
.tree-node:hover canvas { transform: scale(1.08); }
.tree-node.locked canvas { border-color: rgba(255, 255, 255, 0.16); background: rgba(0, 12, 32, 0.38); }
.tree-node.sel canvas { border-color: #ffe39a; box-shadow: 0 0 16px rgba(255, 227, 154, 0.75); }
.node-name { font-size: 11px; line-height: 1.15; text-align: center; max-width: 80px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tree-node.locked .node-name { opacity: 0.5; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 10px; align-content: start; }
.enemy-grid { flex: 1; min-width: 0; padding: 4px; }
.mini-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 16px; border: 2px solid var(--line-soft); background: var(--panel); color: #fff; cursor: pointer; touch-action: manipulation; transition: border-color 0.2s, transform 0.15s, background 0.2s; }
.mini-card:hover { transform: translateY(-2px); border-color: var(--line); }
.mini-card.sel { border-color: #ffe39a; background: rgba(255, 236, 170, 0.18); box-shadow: 0 0 14px rgba(255, 227, 154, 0.35); }
.mini-card.locked { opacity: 0.72; }
.mini-name { font-size: 12px; text-align: center; line-height: 1.2; }
.mini-sub { font-size: 10.5px; opacity: 0.7; }
.mini-card.pick .stepper { display: none; margin-top: 4px; }
.mini-card.pick.sel .stepper { display: inline-flex; }

/* achievements */
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; margin-bottom: 14px; }
.record, .stat { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); text-align: center; }
.record b, .stat b { font-size: 20px; }
.record span, .stat span { font-size: 12px; opacity: 0.75; }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line-soft); }
.ach.done { background: rgba(255, 236, 170, 0.16); border-color: rgba(255, 227, 154, 0.6); }
.ach-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: rgba(255, 255, 255, 0.6); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), rgba(120, 150, 180, 0.25) 60%); border: 2px solid rgba(255, 255, 255, 0.3); }
.ach.done .ach-icon { color: #6a4a00; background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd36a 55%, #d2a800); border-color: #fff; text-shadow: none; }
.ach-text { flex: 1; min-width: 0; }
.ach-name { font-size: 15px; font-weight: bold; }
.ach-desc { font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.ach-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); margin-top: 6px; overflow: hidden; }
.ach-fill { height: 100%; background: #fff; border-radius: 3px; }
.ach-prog, .ach-date { font-size: 11px; opacity: 0.7; margin-top: 3px; }

/* arena / sandbox setup */
.screen-arena .screen-body, .screen-sandbox .screen-body { padding-bottom: 10px; }
.setup-sec { margin-bottom: 14px; }
.setup-sec h4 { margin: 4px 0 8px; color: #bfe9ff; font-size: 15px; }
.setup-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px calc(18px + var(--sar)) calc(10px + var(--sab)) calc(18px + var(--sal)); background: rgba(4, 30, 64, 0.62); border-top: 1px solid var(--line-soft); }
.setup-summary { font-size: 13px; color: var(--dim); }
.chip-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.chip-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 4px solid var(--rc); }
.chip-row-name { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }

/* ------------------------------------------------------------------ loading */
.layer-loading { background: #010812; pointer-events: auto; transition: opacity 0.35s ease; }
.layer-loading.show { display: flex; align-items: center; justify-content: center; }
.layer-loading.fade { opacity: 0; }
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-shadow: none; }
.loading-title { color: #00ccff; font-size: 30px; font-weight: bold; letter-spacing: 0.08em; }
.loading-pct { color: #ffcc00; font-size: 28px; font-weight: bold; }
.loading-bar { width: 260px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.loading-fill { height: 100%; width: 0; background: linear-gradient(90deg, #00ccff, #8fe6ff); border-radius: 4px; }
.loading-line { color: #fff; font-size: 14px; min-height: 1.4em; }

/* ------------------------------------------------------------------ toasts */
.layer-toasts { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: calc(var(--sat) + 96px); }
#ui[data-state="menu"] .layer-toasts, #ui[data-state="paused"] .layer-toasts, #ui[data-state="modal"] .layer-toasts { justify-content: flex-end; padding-top: 0; padding-bottom: calc(var(--sab) + 52px); }
.toast { display: inline-flex; align-items: center; gap: 8px; max-width: 86vw; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: bold; color: #fff; background: rgba(8, 38, 74, 0.62); border: 1.5px solid var(--tc, rgba(255, 255, 255, 0.7)); box-shadow: 0 0 14px rgba(0, 20, 50, 0.25); opacity: 0; transform: translateY(-10px); transition: opacity 0.35s ease, transform 0.35s ease; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast-icon { color: var(--tc, #fff); }

/* ------------------------------------------------------------------ modals */
.modal-back { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); background: rgba(2, 16, 36, 0.58); overflow: auto; animation: fadein 0.2s ease; touch-action: pan-y; }
.modal-frame { margin: auto; width: auto; min-width: min(460px, 100%); max-width: min(1000px, 100%); text-align: center; padding: 14px 18px 16px; border-radius: 26px; border: 2px solid rgba(255, 255, 255, 0.7); background: radial-gradient(120% 60% at 30% 0%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%), linear-gradient(180deg, rgba(46, 128, 196, 0.9), rgba(16, 64, 120, 0.92)); box-shadow: 0 10px 50px rgba(0, 20, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); animation: pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 34px; font-weight: bold; letter-spacing: 0.06em; }
.modal-title.upgrade { color: var(--accent); text-shadow: 0 0 2px #fff, 0 0 18px rgba(58, 170, 231, 0.65), 0 2px 0 rgba(255, 255, 255, 0.9); -webkit-text-stroke: 1px rgba(255, 255, 255, 0.85); }
.modal-title.gold, .modal-title.chips { color: var(--gold); text-shadow: 0 0 16px rgba(255, 211, 106, 0.6), 0 2px 2px rgba(80, 50, 0, 0.4); }
.modal-title.special { color: #d9c2ff; text-shadow: 0 0 16px rgba(190, 150, 255, 0.6); }
.modal-sub { font-size: 13.5px; color: var(--dim); margin-top: 2px; }
.modal-text { margin: 8px auto; max-width: 640px; font-size: 15px; color: #eaf7ff; }
.modal-text.big { font-size: 19px; }
.modal-foot { font-size: 12px; opacity: 0.66; margin-top: 4px; }
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 14px 0 8px; }
.guard > * { transition: opacity 0.3s ease, filter 0.3s ease; }
.guarding .guard > * { opacity: 0.55; filter: saturate(0.6); pointer-events: none; }
.key-badge { position: absolute; top: 8px; right: 9px; width: 21px; height: 21px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; background: rgba(255, 255, 255, 0.24); border: 1px solid rgba(255, 255, 255, 0.6); }
.evo-card, .special-card { position: relative; width: 214px; text-align: left; color: #fff; padding: 10px 12px 12px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, 0.55); background: radial-gradient(130% 90% at 30% 0%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1) 60%); cursor: pointer; touch-action: manipulation; transition: transform 0.16s ease, border-color 0.2s, box-shadow 0.2s, opacity 0.3s; display: flex; flex-direction: column; gap: 3px; }
.evo-card:hover:not(:disabled), .special-card:hover { transform: translateY(-4px); border-color: #fff; box-shadow: 0 0 24px rgba(160, 225, 255, 0.5); }
.evo-card:disabled { opacity: 0.45; cursor: default; }
.evo-preview { display: block; margin: 0 auto 4px; max-width: 100%; height: auto !important; aspect-ratio: 3 / 2; border-radius: 14px; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%); }
.evo-name { font-size: 18px; font-weight: bold; }
.evo-en { font-size: 12px; opacity: 0.72; }
.evo-weapons { margin: 4px 0 2px; font-size: 13px; color: #e9f6ff; }
.evo-weapons .w { line-height: 1.35; }
.evo-weapons .pas { opacity: 0.85; }
.evo-desc { font-size: 12.5px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.evo-lock { font-size: 12px; color: #ffcbb8; }
.chip-card { position: relative; width: 226px; text-align: left; color: #fff; padding: 12px 13px; border-radius: 20px; border: 2px solid var(--rc); background: radial-gradient(130% 90% at 25% 0%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 65%); box-shadow: 0 0 18px var(--rg), inset 0 0 12px rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; gap: 5px; transition: transform 0.16s ease, box-shadow 0.2s, opacity 0.3s; }
button.chip-card { cursor: pointer; touch-action: manipulation; }
button.chip-card:hover { transform: translateY(-4px); box-shadow: 0 0 28px var(--rg); }
.chip-card.compact { width: 205px; padding: 9px 10px; gap: 3px; }
.chip-card.curse { background: radial-gradient(130% 90% at 25% 0%, rgba(255, 140, 140, 0.25), rgba(80, 0, 0, 0.12) 65%); }
.chip-top { display: flex; gap: 10px; align-items: center; }
.chip-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: bold; color: #0b2c4c; text-shadow: none; background: radial-gradient(circle at 35% 30%, #fff, var(--rc, #cfe6f7) 62%); border: 2px solid rgba(255, 255, 255, 0.85); }
.chip-icon.small { width: 26px; height: 26px; font-size: 13px; }
.chip-name { font-size: 17px; font-weight: bold; }
.chip-rarity { font-size: 12px; color: var(--rc); font-weight: bold; }
.chip-level { font-size: 13px; }
.chip-level .up { color: #8ff7c1; }
.chip-level .max { opacity: 0.6; font-size: 12px; }
.chip-desc { font-size: 13px; color: #eaf7ff; }
.chip-syn { margin-top: 2px; display: flex; flex-direction: column; gap: 2px; }
.syn-hint { font-size: 11.5px; color: #ffe9b5; }
.syn-hint.complete { color: var(--gold); font-weight: bold; }
.special-card { align-items: center; text-align: center; }
.special-icon { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: radial-gradient(circle at 35% 30%, #fff, #b043f1 70%); border: 2px solid #fff; color: #fff; }
.special-name { font-size: 18px; font-weight: bold; }
.special-en { font-size: 12px; opacity: 0.7; }
.special-desc { font-size: 13px; color: var(--dim); }
.special-cd { font-size: 12px; color: #d9c2ff; }
.victory-time { color: var(--gold); font-size: 16px; margin: 6px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; margin-top: 12px; }
.stat-grid.summary { width: min(720px, 82vw); max-width: 100%; margin: 14px auto 0; }

/* ------------------------------------------------------------------ pause */
.pause-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; gap: 10px; padding: calc(14px + var(--sat)) calc(18px + var(--sar)) calc(12px + var(--sab)) calc(18px + var(--sal)); animation: fadein 0.18s ease; }
.pause-title { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
.pause-title h2 { margin: 0; font-size: 30px; letter-spacing: 0.08em; }
.pause-main { flex: 1; min-height: 0; display: flex; gap: 14px; width: min(1100px, 100%); margin: 0 auto; }
.pause-tabs { display: flex; flex-direction: column; gap: 10px; width: 112px; flex: none; }
.pause-tabs .tab-btn { width: 100%; }
.pause-tabs .tab-btn.on { background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.78), rgba(90, 190, 245, 0.5) 50%, rgba(58, 170, 231, 0.42)); border-color: #fff; }
.pause-content { flex: 1; min-width: 0; border-radius: 20px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.25); padding: 14px 16px; }
.pause-content.tab-map { display: flex; padding: 8px; }
.map-wrap { position: relative; flex: 1; min-height: 240px; }
.map-wrap canvas { position: absolute; left: 0; top: 0; }
.pause-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pause-hint { font-size: 12px; opacity: 0.6; }
.stats-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.stats-preview { border-radius: 16px; background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 70%); flex: none; }
.stats-info { flex: 1; min-width: 220px; }
.stats-info h3 { margin: 0; font-size: 22px; }
.loadout { margin: 8px 0; font-size: 14px; display: grid; gap: 3px; }
.stats-info .desc { font-size: 13px; color: var(--dim); margin: 6px 0 0; }
.seed-line { font-size: 11px; opacity: 0.5; margin-top: 10px; text-align: right; }
.tab-title { margin: 6px 0 10px; color: #bfe9ff; font-size: 15px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.special-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.syn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.syn { padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); opacity: 0.85; }
.syn.on { opacity: 1; background: rgba(255, 236, 170, 0.16); border-color: rgba(255, 227, 154, 0.65); }
.syn-name { font-weight: bold; font-size: 14px; }
.syn.on .syn-name { color: var(--gold); }
.syn-req { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.need { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); opacity: 0.75; }
.need.ok { border-color: #8ff7c1; color: #c8ffe2; opacity: 1; }
.syn-desc { font-size: 12px; color: var(--dim); }

/* ------------------------------------------------------------------ HUD DOM bits */
.mm-hit { position: absolute; pointer-events: auto; cursor: pointer; border-radius: 12px; }
.sandbox-panel { position: absolute; right: calc(10px + var(--sar)); top: 50%; transform: translateY(-50%); display: flex; align-items: flex-start; gap: 6px; pointer-events: none; }
.sandbox-panel .sb-toggle { pointer-events: auto; writing-mode: vertical-rl; padding: 0.9em 0.45em; letter-spacing: 0.15em; }
.sb-box { display: none; flex-direction: column; gap: 8px; width: 236px; max-height: min(68vh, 520px); padding: 10px; border-radius: 18px; background: rgba(4, 30, 64, 0.72); border: 1.5px solid var(--line); }
.sandbox-panel.open .sb-box { display: flex; }
.sb-select { width: 100%; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 13px; }
.sb-select option { color: #0b2c4c; }
.sb-box .seg { width: 100%; }
.sb-box .seg-btn { flex: 1; }
.sb-box > * { flex-shrink: 0; }
.sb-box > .sb-list { flex: 1 1 auto; min-height: 80px; display: flex; flex-direction: column; gap: 2px; }
.sb-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; color: #fff; padding: 3px 6px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.sb-item:hover { background: rgba(255, 255, 255, 0.16); }

/* ------------------------------------------------------------------ touch controls */
.touch-ui { position: absolute; inset: 0; pointer-events: none; }
.tbtn {
  position: absolute; pointer-events: auto; border-radius: 50%; color: #fff; font-weight: bold; padding: 0;
  display: flex; align-items: center; justify-content: center; touch-action: none; -webkit-user-select: none; user-select: none;
  border: 2px solid rgba(255, 255, 255, 0.75); text-shadow: 0 1px 2px rgba(6, 34, 70, 0.5);
  background: radial-gradient(120% 120% at 32% 22%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.14) 45%, rgba(255, 255, 255, 0.06) 75%);
  transition: transform 0.08s ease, background 0.15s;
}
.tbtn.down { transform: scale(0.92); background: radial-gradient(120% 120% at 32% 22%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.2)); }
.tbtn-label { position: relative; z-index: 1; pointer-events: none; }
.tbtn-sec { width: 86px; height: 86px; right: calc(22px + var(--sar)); bottom: calc(30px + var(--sab)); font-size: 16px; }
.tbtn-sp { width: 64px; height: 64px; right: calc(126px + var(--sar)); bottom: calc(22px + var(--sab)); font-size: 14px; }
.ring::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(191, 241, 255, 0.95) var(--p, 100%), rgba(255, 255, 255, 0.12) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
.tbtn-sp.ring::before { background: conic-gradient(rgba(220, 196, 255, 0.95) var(--p, 100%), rgba(255, 255, 255, 0.12) 0); }
.tbtn.ready { box-shadow: 0 0 18px rgba(170, 235, 255, 0.55); }
.tbtn-top { width: 44px; height: 44px; top: calc(10px + var(--sat)); font-size: 14px; }
.tbtn-pause { right: calc(10px + var(--sar)); letter-spacing: -2px; }
.tbtn-auto { right: calc(62px + var(--sar)); font-size: 12px; }
.tbtn-fs { right: calc(114px + var(--sar)); font-size: 18px; }
.tbtn-top.on { background: radial-gradient(120% 120% at 32% 22%, rgba(255, 255, 255, 0.7), rgba(58, 170, 231, 0.65) 55%); border-color: #fff; }
.rotate-hint { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); display: none; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: rgba(8, 38, 74, 0.68); border: 1.5px solid var(--line); font-size: 15px; font-weight: bold; white-space: nowrap; }
.rotate-hint.show { display: flex; animation: fadein 0.4s ease; }
.rot-icon { font-size: 22px; display: inline-block; animation: spin 2.4s ease-in-out infinite; }
@keyframes spin { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
.key-hints { position: absolute; left: 50%; bottom: calc(68px + var(--sab)); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; width: max-content; max-width: 92vw; font-size: 13px; padding: 7px 16px; border-radius: 999px; background: rgba(8, 38, 74, 0.4); opacity: 0; transition: opacity 0.7s ease; }
.key-hints.show { opacity: 0.92; }
.kh kbd { margin-right: 4px; }

/* ------------------------------------------------------------------ responsive */
@media (max-height: 560px) {
  .title-screen { gap: 8px; }
  canvas.logo { height: min(calc(min(92vw, 720px) * 0.34), 26vh); }
  .bubble.big { min-width: 180px; font-size: 17px; }
  .bubble.round { width: 70px; height: 70px; font-size: 12px; }
  .btn-icon { font-size: 18px; margin-bottom: 1px; }
  .menu-main { gap: 8px 12px; }
  .menu-more { gap: 8px; }
  .title-foot { font-size: 11px; padding-top: 4px; }
  .modal-title { font-size: 26px; }
  .modal-frame { padding: 10px 12px 12px; }
  .cards { gap: 10px; margin: 8px 0 6px; }
  .evo-card { width: 190px; padding: 8px 10px 10px; }
  .evo-desc { -webkit-line-clamp: 2; }
  .chip-card { width: 206px; padding: 9px 11px; }
  .pause-title h2 { font-size: 22px; }
  .pause-tabs { width: 92px; gap: 6px; }
  .pause-tabs .tab-btn { font-size: 13px; padding: 0.35em 0.6em; }
  .pause-content { padding: 10px 12px; }
  .screen-head { padding: 8px 14px 6px; }
  .screen-title h2 { font-size: 21px; }
  .detail-panel { width: 270px; }
  .tbtn-sec { width: 76px; height: 76px; }
  .tbtn-sp { width: 58px; height: 58px; right: calc(110px + var(--sar)); }
  .title-foot { grid-template-columns: 1fr auto; }
  .title-tip { display: none; }
  .layer-toasts { justify-content: flex-end; padding-top: 0; padding-bottom: calc(var(--sab) + 64px); }
  .dialog { padding: 10px 16px 12px; border-radius: 20px; }
  .dialog-title { font-size: 20px; margin-bottom: 2px; }
  .dialog-text { font-size: 12.5px; margin: 2px 0 4px; }
  .dialog-sub { margin: 6px 0 5px; font-size: 13px; }
  .dialog-note { margin-top: 6px; font-size: 11.5px; }
  .preset-card { padding: 6px 10px; }
  .preset-card b { font-size: 15px; }
  .preset-card small { font-size: 11px; line-height: 1.3; }
  .btn-row { margin-top: 8px; }
  .newgame .seg-btn { padding: 0.32em 0.6em; }
  .stats-info h3 { font-size: 18px; }
  .loadout { font-size: 13px; margin: 4px 0; }
  .stat b { font-size: 17px; }
}
@media (max-width: 760px) {
  .split { flex-direction: column; }
  .detail-panel { width: auto; max-height: 42%; }
  .title-foot { grid-template-columns: 1fr; text-align: center; }
  .title-records, .title-ver { text-align: center; }
  .title-tip { max-width: none; }
  .title-ver { display: none; }
}
@media (max-width: 760px) and (max-height: 560px) {
  .split { flex-direction: row; }
  .detail-panel { width: 240px; max-height: none; }
}
@media (max-width: 420px) {
  .tbtn-fs { display: none; }
}
@media (max-width: 600px) {
  .pause-main { flex-direction: column; }
  .pause-tabs { flex-direction: row; width: auto; flex-wrap: wrap; justify-content: center; }
  .pause-tabs .tab-btn { width: auto; }
  .bubble.big { min-width: 66vw; font-size: 18px; padding: 0.35em 1.4em 0.4em; }
  .bubble.round { width: 72px; height: 72px; font-size: 12px; }
  .btn-icon { font-size: 19px; }
  .menu-main { gap: 10px; }
  .menu-more { gap: 10px; }
  .pause-tabs .tab-btn { font-size: 14px; padding: 0.38em 0.9em; }
  .pause-title h2 { font-size: 24px; }
  .modal-frame { padding: 12px 10px 14px; }
  .cards { gap: 10px; }
  .evo-card, .chip-card, .special-card { width: calc(50% - 5px); max-width: 214px; padding: 9px 10px 10px; }
  .evo-desc { -webkit-line-clamp: 3; }
  .slider { width: 120px; }
  .tbtn-sec { bottom: calc(96px + var(--sab)); }
  .tbtn-sp { bottom: calc(86px + var(--sab)); }
  .modal-title { font-size: 28px; }
}
@media (hover: none) {
  .btn:hover:not(:disabled) { transform: none; }
  .evo-card:hover:not(:disabled), .special-card:hover, button.chip-card:hover, .mini-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble.big, .bubble.round, .rot-icon { animation: none; }
}

/* === rogue ui === (owner: rogue-ui, js/ui/rogue_ui.js — shop / altar / event / gamble / challenge modals, chip-pick bar,
   run summary, 远征 pause tab, 进化实验室 / 深渊契约 / 每日挑战 screens, rogue start dialog) */
.rg-ico { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.14em; flex: none; position: relative; }
.rg-pearl { background: radial-gradient(circle at 34% 30%, #fff 0 16%, #f6efff 30%, #d6c3f2 66%, #a58fcf); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 6px rgba(240, 222, 255, 0.65); }
.rg-bubble { background: radial-gradient(circle at 34% 30%, #fff 0 14%, #edf5fc 28%, #89bceb 60%, #288bd5); border: 1px solid rgba(255, 255, 255, 0.85); }
.rg-core { background: radial-gradient(circle at 34% 30%, #fff 0 14%, #ffeda6 28%, #fbc900 60%, #d2a800); border: 1px solid #fff4c8; box-shadow: 0 0 7px rgba(255, 211, 106, 0.6); }
.rg-core.off { background: rgba(90, 106, 128, 0.6); border-color: rgba(255, 255, 255, 0.35); box-shadow: none; transform: scale(0.78); }
.rg-essence { background: radial-gradient(circle at 34% 30%, #fff 0 12%, #d6fdff 26%, #7fe0ff 52%, #8a5cff); border: 1px solid #e8fdff; box-shadow: 0 0 8px rgba(127, 224, 255, 0.75); }
.rg-reroll { width: auto; height: auto; border-radius: 0; vertical-align: baseline; }
.rg-reroll::before { content: "↻"; color: #bfe8ff; font-weight: bold; }
.rg-money { display: inline-flex; align-items: center; gap: 0.32em; font-weight: bold; white-space: nowrap; }
.rg-money.short b { color: #ffb0b8; }
.rg-money.big { font-size: 18px; }
.rg-cores { display: inline-flex; align-items: center; gap: 3px; }
.rg-cores .rg-ico { width: 15px; height: 15px; }
.rg-wallet { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 10px auto 2px; }
.rg-wal { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 10px; border-radius: 999px; background: rgba(4, 30, 64, 0.38); border: 1px solid var(--line-soft); font-size: 15px; }
.rg-wal small { font-size: 11px; opacity: 0.7; }
.rg-modal { max-width: min(980px, 100%); }
.modal-title.rg-red { color: #ff9aa5; text-shadow: 0 0 16px rgba(255, 90, 110, 0.55); }
.modal-title.rg-green { color: #b6ffc9; text-shadow: 0 0 16px rgba(110, 240, 150, 0.5); }
.modal-title.rg-orange { color: #ffc9a0; text-shadow: 0 0 16px rgba(255, 150, 80, 0.55); }
.modal-title.rg-cyan { color: #c8fbff; text-shadow: 0 0 16px rgba(130, 240, 255, 0.55); }
.modal-title.rg-mystery { color: #efe6ff; text-shadow: 0 0 16px rgba(205, 184, 255, 0.65); }
.rg-skip { visibility: hidden; }
.rg-warn { font-size: 12px; color: #ffcf8a; font-weight: bold; }
.rg-note { font-size: 11.5px; opacity: 0.72; }
.rg-none { font-size: 13px; opacity: 0.7; margin: 2px 0 10px; }
.rg-dialog-note { font-size: 12.5px; color: var(--dim); margin: 0; }
.rg-msg { width: fit-content; max-width: 100%; margin: 8px auto 0; padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: bold; color: #c8ffe2; background: rgba(40, 140, 100, 0.25); border: 1px solid rgba(143, 247, 193, 0.7); animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.rg-msg.neg, .rg-msg.bad { color: #ffd0d5; background: rgba(150, 30, 50, 0.28); border-color: rgba(255, 107, 122, 0.8); }
.rg-msg.pure { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: #e8fbff; }
.rg-pickbar .rg-msg { flex-basis: 100%; margin: 0 auto; }

/* shop offers */
.rg-offers { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 12px 0 6px; }
.rg-offer { position: relative; width: 196px; text-align: left; color: #fff; padding: 11px 12px 10px; border-radius: 20px; border: 2px solid var(--rc); background: radial-gradient(130% 90% at 25% 0%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.07) 65%); box-shadow: 0 0 14px rgba(0, 0, 0, 0.08), inset 0 0 12px rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; gap: 4px; cursor: pointer; touch-action: manipulation; transition: transform 0.16s ease, box-shadow 0.2s, opacity 0.3s; overflow: hidden; }
.rg-offer:hover { transform: translateY(-3px); box-shadow: 0 0 22px rgba(255, 255, 255, 0.25); }
.rg-offer.cant { opacity: 0.7; }
.rg-offer.sold { opacity: 0.5; filter: saturate(0.4); cursor: default; }
.rg-offer.bought { animation: rgbought 0.6s ease; }
@keyframes rgbought { 0% { box-shadow: 0 0 0 rgba(255, 231, 163, 0); } 35% { box-shadow: 0 0 34px rgba(255, 231, 163, 0.95); transform: scale(1.04); } 100% { box-shadow: 0 0 0 rgba(255, 231, 163, 0); } }
.rg-offer-top { display: flex; gap: 9px; align-items: center; padding-right: 20px; }
.rg-offer .chip-icon { width: 34px; height: 34px; }
.rg-offer-name { font-size: 16px; font-weight: bold; line-height: 1.2; }
.rg-offer-kind { font-size: 11.5px; color: var(--rc); font-weight: bold; }
.rg-offer-desc { font-size: 12.5px; color: #eaf7ff; flex: 1; }
.rg-offer .chip-level { font-size: 12px; }
.rg-offer .syn-hint { font-size: 11px; }
.rg-offer-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.rg-price { font-size: 17px; }
.rg-price.short b { color: #ffb0b8; }
.rg-reason { font-size: 11.5px; color: #ffb0b8; font-weight: bold; }
.rg-stamp { position: absolute; right: -30px; top: 16px; transform: rotate(32deg); width: 130px; text-align: center; font-size: 12px; font-weight: bold; letter-spacing: 0.2em; padding: 2px 0; background: rgba(255, 90, 110, 0.85); color: #fff; }
.rg-restock .btn-sub { text-transform: none; }

/* altar pairs */
.rg-pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 12px 0 6px; }
.rg-pair { position: relative; width: 236px; text-align: left; color: #fff; padding: 0; border-radius: 20px; overflow: hidden; border: 2px solid rgba(214, 180, 255, 0.85); background: rgba(10, 20, 50, 0.25); cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; transition: transform 0.16s ease, box-shadow 0.2s, opacity 0.3s; }
.rg-pair:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 0 24px rgba(199, 146, 255, 0.55); }
.rg-pair:disabled { opacity: 0.45; cursor: default; }
.rg-pair.chosen { opacity: 1; border-color: #ffe39a; box-shadow: 0 0 22px rgba(255, 227, 154, 0.55); }
.rg-bless, .rg-cursehalf { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; }
.rg-bless { background: radial-gradient(130% 120% at 20% 0%, rgba(232, 208, 255, 0.4), rgba(150, 90, 230, 0.18) 70%); padding-right: 34px; }
.rg-cursehalf { background: linear-gradient(180deg, rgba(150, 20, 45, 0.42), rgba(90, 10, 30, 0.35)); flex: 1; }
.rg-cursehalf.none { background: rgba(60, 140, 90, 0.25); }
.rg-plus { font-size: 11px; font-weight: bold; text-align: center; padding: 2px 0; background: rgba(0, 0, 0, 0.25); letter-spacing: 0.15em; color: #ffd0d8; }
.rg-pair.free .rg-plus { color: #b6ffc9; }
.rg-orb { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: bold; text-shadow: none; border: 2px solid rgba(255, 255, 255, 0.85); }
.rg-orb.bless { color: #4a1a7a; background: radial-gradient(circle at 35% 30%, #fff, #d8b4ff 62%); }
.rg-orb.curse { color: #fff; background: radial-gradient(circle at 35% 30%, #ffc0c6, #e0304a 66%); }
.rg-pair-name { font-size: 15px; font-weight: bold; }
.rg-pair-desc { font-size: 12.5px; color: #eaf7ff; }
.rg-cursehalf .rg-pair-name { color: #ffc0c8; }
.rg-cleanse { margin: 12px auto 0; max-width: 620px; padding: 8px 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-soft); }
.rg-cleanse-title { font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin-bottom: 7px; }
.rg-curse-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-bottom: 4px; }
.rg-curse-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px; border-radius: 999px; border: 1.5px solid #ff6b7a; background: rgba(130, 12, 32, 0.45); color: #ffd6da; font-size: 13px; font-weight: bold; cursor: pointer; touch-action: manipulation; transition: background 0.2s, transform 0.15s; }
.rg-curse-btn i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, #ffc0c6, #e0304a 66%); color: #fff; font-size: 12px; }
.rg-curse-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.rg-curse-btn:disabled { opacity: 0.45; cursor: default; }

/* results / choices / events */
.rg-result { margin: 12px auto 4px; max-width: 640px; padding: 9px 14px 10px; border-radius: 16px; border: 1.5px solid rgba(143, 247, 193, 0.75); background: rgba(40, 140, 100, 0.22); animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.rg-result.bad { border-color: rgba(255, 138, 149, 0.8); background: rgba(150, 30, 50, 0.25); }
.rg-result-text { font-size: 14.5px; }
.rg-result-lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.rg-line { font-size: 12.5px; font-weight: bold; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35); }
.rg-line.pos { color: #c8ffe2; border-color: rgba(143, 247, 193, 0.7); }
.rg-line.neg { color: #ffd0d5; border-color: rgba(255, 107, 122, 0.8); }
.rg-line.pure { color: #fff; border-color: #e8fbff; }
.rg-art { width: 62px; height: 62px; margin: 2px auto 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: bold; border: 2px solid rgba(255, 255, 255, 0.85); background: radial-gradient(circle at 34% 28%, #fff 0 10%, rgba(230, 216, 255, 0.95) 24%, #b49aff 70%); box-shadow: 0 0 26px rgba(205, 184, 255, 0.6); animation: rgfloat 3.2s ease-in-out infinite; text-shadow: 0 1px 3px rgba(40, 10, 90, 0.6); }
.rg-art.crown { background: radial-gradient(circle at 34% 28%, #fff 0 10%, #fff2b8 24%, #ffc94a 70%); box-shadow: 0 0 30px rgba(255, 211, 106, 0.7); }
.rg-art.totem { background: radial-gradient(circle at 34% 28%, #fff 0 10%, #ffd2a8 24%, #ff8a4a 70%); box-shadow: 0 0 26px rgba(255, 155, 84, 0.65); }
.rg-art.spring { background: radial-gradient(circle at 34% 28%, #fff 0 10%, #d9fbff 24%, #6fd8ff 70%); box-shadow: 0 0 26px rgba(159, 246, 255, 0.65); }
.rg-art.guardian { background: radial-gradient(circle at 34% 28%, #fff 0 10%, #ffc0c0 24%, #e03030 70%); box-shadow: 0 0 26px rgba(255, 64, 64, 0.6); }
.rg-art.seal { background: radial-gradient(circle at 34% 28%, #fff 0 10%, #fff2b8 24%, #ffc94a 70%); box-shadow: 0 0 30px rgba(255, 211, 106, 0.7); }
@keyframes rgfloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.rg-story { font-size: 15px; line-height: 1.6; max-width: 620px; }
.rg-choices { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 620px; margin: 12px auto 4px; }
.rg-choice { position: relative; text-align: left; color: #fff; padding: 9px 40px 9px 16px; border-radius: 18px; border: 2px solid rgba(255, 255, 255, 0.6); background: radial-gradient(130% 120% at 20% 0%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.07) 70%); cursor: pointer; touch-action: manipulation; transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s, opacity 0.3s; }
.rg-choice:hover:not(:disabled) { transform: translateX(3px); border-color: #fff; box-shadow: 0 0 20px rgba(200, 235, 255, 0.4); }
.rg-choice:disabled { opacity: 0.5; cursor: default; }
.rg-choice.chosen { opacity: 1; border-color: #ffe39a; box-shadow: 0 0 18px rgba(255, 227, 154, 0.45); }
.rg-choice.danger { border-color: rgba(255, 120, 140, 0.85); }
.rg-choice.abyss { border-color: rgba(201, 184, 255, 0.95); background: radial-gradient(130% 120% at 20% 0%, rgba(214, 196, 255, 0.4), rgba(90, 60, 180, 0.2) 70%); }
.rg-choice.home { border-color: rgba(255, 227, 154, 0.9); }
.rg-choice .key-badge { top: 50%; transform: translateY(-50%); right: 12px; }
.rg-choice-text { font-size: 15.5px; font-weight: bold; }
.rg-choice-hint { font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.rg-choice-reason { font-size: 11.5px; color: #ffb0b8; font-weight: bold; margin-top: 2px; }
.rg-cursed-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.rg-cursed-wrap .rg-story { flex: 1 1 280px; text-align: left; margin: 0; }
.rg-mini-stats { width: min(560px, 100%); margin: 10px auto 0; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* gambler */
.rg-last { min-height: 40px; margin: 10px auto 2px; max-width: 560px; display: flex; align-items: center; justify-content: center; padding: 6px 14px; border-radius: 999px; background: rgba(4, 30, 64, 0.35); border: 1px solid var(--line-soft); font-size: 15px; }
.rg-last-idle { color: var(--dim); font-style: italic; }
.rg-last.rolling { border-color: #ffe39a; box-shadow: 0 0 18px rgba(255, 227, 154, 0.35); }
.rg-roll { font-size: 20px; font-weight: bold; letter-spacing: 0.08em; }
.rg-last.reveal { animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.rg-last.win { border-color: rgba(143, 247, 193, 0.85); }
.rg-last.lose { border-color: rgba(255, 138, 149, 0.8); }
.rg-last-text { font-weight: bold; font-size: 16px; }
.rg-games { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0 4px; }
.rg-game { position: relative; width: 300px; text-align: left; padding: 11px 13px 12px; border-radius: 20px; border: 2px solid rgba(142, 240, 166, 0.75); background: radial-gradient(130% 90% at 25% 0%, rgba(210, 255, 220, 0.25), rgba(255, 255, 255, 0.06) 65%); display: flex; flex-direction: column; gap: 7px; }
.rg-game.cant { opacity: 0.75; }
.rg-game-name { font-size: 17px; font-weight: bold; padding-right: 26px; }
.rg-game-price { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.rg-game-price .rg-money { font-size: 16px; }
.rg-game-left { margin-left: auto; font-size: 12px; opacity: 0.8; }
.rg-odds { display: flex; height: 12px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.5); }
.rg-odds-seg { height: 100%; min-width: 3px; }
.rg-odds-seg + .rg-odds-seg { border-left: 1px solid rgba(4, 30, 64, 0.5); }
.rg-odds-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11.5px; }
.rg-odds-item { display: inline-flex; align-items: center; gap: 4px; }
.rg-odds-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rg-play { align-self: center; margin-top: 2px; }

/* challenge */
.rg-medal { width: 70px; height: 70px; margin: 2px auto 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: bold; color: #4a3200; text-shadow: none; border: 3px solid #fff; background: radial-gradient(circle at 34% 28%, #fff 0 12%, var(--mc) 62%, rgba(0, 0, 0, 0.25)); box-shadow: 0 0 26px var(--mc); animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.rg-medal.fail { color: #fff; }
.rg-medal.small { width: 26px; height: 26px; font-size: 12px; border-width: 2px; margin: 0; box-shadow: 0 0 8px var(--mc); animation: none; }
.rg-tiers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin: 8px 0 2px; }
.rg-tier { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }

/* spring / guardian */
.rg-bar { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.18); overflow: hidden; max-width: 420px; margin: 10px auto 4px; }
.rg-bar i { display: block; height: 100%; border-radius: 5px; background: #fff; }
.rg-bar.cyan i { background: linear-gradient(90deg, #9ff6ff, #e9feff); }
.rg-bar.heat i { background: linear-gradient(90deg, #ffb27a, #ff5d6c); }
.rg-rings { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 2px; }
.rg-ring { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(4, 30, 64, 0.35); }
.rg-ring.done { border-color: #ffe39a; background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd36a 60%); color: #5a3c00; text-shadow: none; }
.rg-ring.cur { border-color: #ff6b6b; box-shadow: 0 0 12px rgba(255, 107, 107, 0.7); }

/* chip pick bar */
.rg-pickbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin: 8px auto 0; padding: 7px 12px; border-radius: 999px; background: rgba(4, 30, 64, 0.35); border: 1px solid var(--line-soft); width: fit-content; max-width: 100%; }
.rg-pick-wallet { display: inline-flex; gap: 10px; font-size: 14px; padding: 0 4px; }
.rg-pickbar .btn-sub { text-transform: none; }
.rg-banish-btn.on { border-color: #ff8a95; background: radial-gradient(120% 140% at 30% 18%, rgba(255, 255, 255, 0.6), rgba(255, 110, 130, 0.45) 50%, rgba(200, 40, 70, 0.4)); }
.rg-forgot { flex-basis: 100%; text-align: center; font-size: 12px; color: #ffb0b8; }
.rg-banishing .chip-cards .chip-card { border-color: #ff6b7a; box-shadow: 0 0 18px rgba(255, 90, 110, 0.45); }
.rg-banish-x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 18px; font-size: 22px; font-weight: bold; letter-spacing: 0.3em; color: #fff; background: rgba(150, 20, 45, 0.45); opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.rg-banishing .chip-card:hover .rg-banish-x { opacity: 1; }
@media (hover: none) { .rg-banishing .rg-banish-x { opacity: 0.75; font-size: 17px; } }

/* run summary */
.rg-summary { width: min(900px, 100%); }
.rg-sum-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "left ess" "left right" "chips chips"; grid-template-rows: auto 1fr auto; align-items: start; gap: 10px 12px; margin-top: 10px; text-align: left; }
.rg-sum-left { grid-area: left; }
.rg-sum-ess { grid-area: ess; }
.rg-sum-right { grid-area: right; }
.rg-sum-chips { grid-area: chips; }
.rg-sum-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rg-sum-tank { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line-soft); }
.rg-sum-preview { flex: none; border-radius: 14px; background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 70%); }
.rg-sum-tankinfo { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rg-sum-tankname { font-size: 19px; font-weight: bold; }
.rg-sum-tanksub { font-size: 12.5px; color: var(--dim); }
.rg-sum-cores { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.rg-sum-stats { margin: 0; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.rg-sum-stats .stat { padding: 5px 4px; }
.rg-sum-stats .stat b { font-size: 16px; }
.rg-sum-stats .stat span { font-size: 11px; }
.rg-box-title { font-size: 13px; font-weight: bold; color: #bfe9ff; margin-bottom: 5px; letter-spacing: 0.05em; }
.rg-essence-box { padding: 8px 12px 10px; border-radius: 16px; background: rgba(4, 30, 64, 0.38); border: 1px solid rgba(127, 224, 255, 0.45); }
.rg-ess-list { display: flex; flex-direction: column; gap: 2px; }
.rg-ess-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 2px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12); }
.rg-ess-row .k { font-weight: bold; }
.rg-ess-row .d { font-size: 11.5px; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-ess-row .v { font-weight: bold; color: #c8fbff; }
.rg-ess-row.mul .v { color: #ffb27a; }
.rg-ess-row.empty { display: block; opacity: 0.7; }
.rg-ess-total { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 26px; }
.rg-ess-total .rg-ico { width: 24px; height: 24px; }
.rg-ess-total b { color: #e2fdff; text-shadow: 0 0 14px rgba(127, 224, 255, 0.7); }
.rg-ess-bal { margin-left: auto; font-size: 12.5px; opacity: 0.8; }
.rg-score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line-soft); }
.rg-score span { font-size: 13px; opacity: 0.8; }
.rg-score b { font-size: 24px; color: var(--gold); }
.rg-score small { margin-left: auto; font-size: 11.5px; opacity: 0.75; }
.rg-unlocks { display: flex; flex-direction: column; gap: 4px; padding: 7px 12px; border-radius: 14px; background: rgba(255, 236, 170, 0.16); border: 1px solid rgba(255, 227, 154, 0.7); }
.rg-unlock { font-size: 13.5px; font-weight: bold; color: #ffe9a8; animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.rg-sum-chips { text-align: left; padding: 8px 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-soft); }
.rg-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.rg-pills.center { justify-content: center; margin: 8px 0 2px; }
.rg-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 3px; border-radius: 999px; font-size: 12.5px; font-weight: bold; border: 1.5px solid var(--pc, #fff); background: rgba(4, 30, 64, 0.3); }
.rg-pill i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #0b2c4c; text-shadow: none; background: radial-gradient(circle at 35% 30%, #fff, var(--pc, #cfe6f7) 70%); }
.rg-pill.curse { background: rgba(130, 12, 32, 0.4); color: #ffd6da; }
.rg-pill.curse i { color: #fff; }
.rg-pill.perk { padding: 2px 10px; font-size: 12px; }
.rg-pill.banished { opacity: 0.75; text-decoration: line-through; }
.rg-sum-lab .btn-sub { text-transform: none; }

/* pause tab */
.rg-pause-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.rg-pause-title h3 { margin: 0; display: inline; font-size: 20px; }
.rg-pause-title .en { margin-left: 8px; }
.rg-pause-top .rg-wallet { margin: 0; }
.rg-pause-stats { margin-bottom: 10px; }
.rg-asc-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-bottom: 12px; }
.rg-asc-row { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: rgba(255, 120, 90, 0.12); border: 1px solid rgba(255, 178, 122, 0.5); font-size: 12.5px; }
.rg-asc-row b { font-size: 13.5px; color: #ffc9a0; }
.rg-asc-row.gold { background: rgba(255, 236, 170, 0.12); border-color: rgba(255, 227, 154, 0.55); }
.rg-asc-row.gold b { color: #ffe39a; }
.rg-endrun { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.rg-endrun-q { font-size: 13px; color: #ffd0c6; }

/* start dialog */
.rg-start-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 2px; }
.rg-fact { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 84px; padding: 6px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 15px; }
.rg-fact small { font-size: 11px; opacity: 0.7; }
.rg-tank-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.rg-start-asc { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13.5px; }

/* screens: lab / ascension / daily */
.rg-screen .head-right { display: flex; align-items: center; gap: 6px; font-weight: bold; opacity: 1; }
.rg-screen .screen-head .btn-back, .rg-screen .setup-foot .btn { flex: none; white-space: nowrap; }
.rg-lab-recs { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.rg-lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-width: 1180px; margin: 0 auto 14px; }
.rg-lab-card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 18px; background: var(--panel); border: 1.5px solid var(--line-soft); transition: border-color 0.2s, box-shadow 0.2s; }
.rg-lab-card.can { border-color: rgba(127, 224, 255, 0.8); box-shadow: 0 0 14px rgba(127, 224, 255, 0.25); }
.rg-lab-card.max { border-color: rgba(255, 227, 154, 0.7); background: rgba(255, 236, 170, 0.12); }
.rg-lab-card.locked { opacity: 0.6; }
.rg-lab-card.bought { animation: rgbought 0.7s ease; }
.rg-lab-top { display: flex; align-items: center; gap: 10px; }
.rg-lab-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; font-weight: bold; color: #0b2c4c; text-shadow: none; background: radial-gradient(circle at 35% 30%, #fff, #8fe6ff 62%, #5aa8e0); border: 2px solid rgba(255, 255, 255, 0.85); }
.rg-lab-card.max .rg-lab-icon { background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd36a 60%, #d2a800); }
.rg-lab-titles { min-width: 0; flex: 1; }
.rg-lab-name { font-size: 16px; font-weight: bold; }
.rg-pips { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.rg-pips i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08); }
.rg-pips i.on { background: radial-gradient(circle at 35% 30%, #fff, #7fe0ff 70%); border-color: #fff; box-shadow: 0 0 6px rgba(127, 224, 255, 0.7); }
.rg-pips span { font-size: 11px; opacity: 0.75; margin-left: 3px; }
.rg-lab-desc { font-size: 13px; color: #eaf7ff; flex: 1; }
.rg-lab-next { font-size: 12px; color: #9ff6ff; }
.rg-lab-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); min-height: 34px; }
.rg-lab-foot .rg-money { font-size: 16px; }
.rg-lab-max { font-size: 13px; color: var(--gold); font-weight: bold; }
.rg-lab-lock { font-size: 12px; opacity: 0.8; }
.rg-history { max-width: 1180px; margin: 0 auto; }
.rg-hist-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.rg-hist-row { display: grid; grid-template-columns: 52px minmax(90px, 0.9fr) minmax(0, 2fr) auto auto; gap: 10px; align-items: center; padding: 5px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 12.5px; }
.rg-hist-row.won { border-color: rgba(255, 227, 154, 0.6); background: rgba(255, 236, 170, 0.1); }
.rg-hist-row .d { opacity: 0.75; }
.rg-hist-row .x { opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-hist-row .s { font-weight: bold; color: var(--gold); text-align: right; }
.rg-locked { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 12px; margin: 0 auto 12px; max-width: 640px; border-radius: 16px; background: rgba(0, 0, 0, 0.22); border: 1px dashed rgba(255, 255, 255, 0.4); font-size: 14px; }
.rg-lock-icon { font-size: 26px; opacity: 0.8; }
.rg-heat { max-width: 760px; margin: 0 auto 12px; padding: 8px 14px 10px; border-radius: 16px; background: rgba(90, 30, 8, 0.28); border: 1px solid rgba(255, 178, 122, 0.55); }
.rg-heat-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rg-heat-top b { font-size: 22px; color: #ffc9a0; }
.rg-heat-top span { font-size: 13px; opacity: 0.85; }
.rg-heat .rg-bar { max-width: none; margin: 7px 0 0; }
.rg-asc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; max-width: 1100px; margin: 0 auto 10px; }
.rg-asc-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line-soft); transition: border-color 0.2s, background 0.2s; }
.rg-asc-card.on { border-color: rgba(255, 150, 100, 0.9); background: rgba(255, 120, 80, 0.16); }
.rg-asc-card.locked { opacity: 0.55; }
.rg-asc-titles { flex: 1; min-width: 0; }
.rg-asc-name { font-size: 15px; font-weight: bold; }
.rg-asc-desc { font-size: 12.5px; color: var(--dim); }
.rg-asc-ctl { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
.rg-asc-heat { flex-basis: 100%; text-align: right; font-size: 11px; color: #ffb27a; }
.rg-asc-ctl .rg-pips { margin: 0; }
.rg-asc-ctl .rg-pips i.on { background: radial-gradient(circle at 35% 30%, #fff, #ff9a6a 70%); box-shadow: 0 0 6px rgba(255, 150, 100, 0.7); }
.rg-daily-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: 900px; margin: 0 auto 10px; padding: 12px 18px; border-radius: 20px; background: radial-gradient(120% 140% at 20% 0%, rgba(255, 236, 170, 0.3), rgba(255, 180, 80, 0.1) 60%); border: 1.5px solid rgba(255, 227, 154, 0.7); }
.rg-daily-date { display: flex; flex-direction: column; }
.rg-daily-date b { font-size: 28px; color: #ffe9a8; }
.rg-daily-date span { font-size: 12.5px; opacity: 0.8; }
.rg-daily-cd { font-size: 14px; font-weight: bold; padding: 4px 14px; border-radius: 999px; background: rgba(4, 30, 64, 0.4); }
.rg-daily-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 12px; }
.rg-daily-mod { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 236, 170, 0.12); border: 1px solid rgba(255, 227, 154, 0.55); font-size: 12.5px; }
.rg-daily-mod b { font-size: 15px; color: #ffe39a; }
.rg-daily-mod.contract { background: rgba(255, 120, 80, 0.12); border-color: rgba(255, 178, 122, 0.55); }
.rg-daily-mod.contract b { color: #ffc9a0; }
.screen-rogue_lab .screen-body, .screen-rogue_ascension .screen-body, .screen-rogue_daily .screen-body { padding-bottom: 12px; }

/* title badges */
.rg-badge { position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; color: #4a3200; text-shadow: none; background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd36a 60%); border: 1.5px solid #fff; box-shadow: 0 0 10px rgba(255, 211, 106, 0.7); }
.rg-badge.new { color: #fff; background: radial-gradient(circle at 35% 30%, #ffc0c6, #e8473a 65%); box-shadow: 0 0 10px rgba(255, 90, 90, 0.6); }
.bubble.round.rg-dim { opacity: 0.72; }
.bubble.round.menu-rogue_lab .btn-label { font-size: 0.9em; white-space: nowrap; letter-spacing: -0.02em; }

@media (max-height: 560px) {
  .rg-art, .rg-medal { width: 46px; height: 46px; font-size: 22px; margin-bottom: 2px; }
  .rg-wallet { margin-top: 6px; }
  .rg-wal { font-size: 13.5px; padding: 2px 10px 2px 8px; }
  .rg-offers, .rg-pairs, .rg-games { gap: 8px; margin: 8px 0 4px; }
  .rg-offer { width: 172px; padding: 8px 10px; gap: 3px; }
  .rg-offer-name { font-size: 14.5px; }
  .rg-offer-desc { font-size: 12px; }
  .rg-pair { width: 210px; }
  .rg-bless, .rg-cursehalf { padding: 7px 10px; }
  .rg-story { font-size: 13.5px; line-height: 1.5; margin: 4px auto; }
  .rg-choices { gap: 6px; margin-top: 8px; }
  .rg-choice { padding: 6px 38px 6px 12px; }
  .rg-choice-text { font-size: 14px; }
  .rg-choice-hint { font-size: 11.5px; }
  .rg-game { width: 270px; padding: 8px 11px; gap: 5px; }
  .rg-sum-grid { gap: 8px; margin-top: 6px; }
  .rg-ess-total { font-size: 21px; margin-top: 4px; }
  .rg-ess-row { font-size: 12px; padding: 1px 0; }
  .rg-summary .rg-box-title { margin-bottom: 3px; }
  .rg-sum-tank { padding: 4px 8px; gap: 8px; }
  .rg-sum-tankname { font-size: 16px; }
  .rg-sum-stats .stat { padding: 3px 4px; }
  .rg-sum-stats .stat b { font-size: 14px; }
  .rg-sum-col { gap: 6px; }
  .rg-score { padding: 4px 10px; }
  .rg-score b { font-size: 20px; }
  .rg-unlocks { padding: 5px 10px; gap: 2px; }
  .rg-unlock { font-size: 12.5px; }
  .rg-pill { font-size: 11.5px; padding: 1px 8px 1px 2px; }
  .rg-pill i { width: 17px; height: 17px; font-size: 10px; }
  .rg-choices.resolved .rg-choice:not(.chosen) { display: none; }
  .rg-mini-stats { margin-top: 6px; }
  .rg-mini-stats .stat { padding: 3px 4px; }
  .rg-mini-stats .stat b { font-size: 15px; }
  .rg-start .dialog-text { display: none; }
  .rg-start .rg-start-facts { margin: 2px 0 0; gap: 6px; }
  .rg-start .rg-fact { flex-direction: row; gap: 6px; min-width: 0; padding: 3px 10px; font-size: 13.5px; }
  .rg-start .rg-pills.center { margin: 5px 0 0; }
  .rg-start .rg-start-asc { margin-top: 6px; }
  .rg-start .rg-tank-pick { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
  .rg-start .rg-tank-pick .mini-card { padding: 3px 3px 5px; }
  .rg-daily-date b { font-size: 22px; }
  .rg-daily-hero { padding: 8px 14px; }
}
@media (max-height: 560px) and (min-width: 700px) {
  .rg-summary { width: min(980px, 100%); }
  .rg-sum-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "left ess right" "left ess chips"; grid-template-rows: auto 1fr; }
  .rg-sum-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .rg-sum-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "ess" "right" "chips"; grid-template-rows: none; }
  .rg-offer { width: calc(50% - 6px); max-width: 196px; }
  .rg-pair { width: 100%; max-width: 340px; }
  .rg-game { width: 100%; max-width: 340px; }
  .rg-asc-list { grid-template-columns: minmax(0, 1fr); }
  .rg-hist-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .rg-hist-row .x, .rg-hist-row .e { display: none; }
  .rg-cursed-wrap .rg-story { text-align: center; }
}
@media (max-width: 420px) {
  .rg-screen .screen-title .en { display: none; }
  .rg-screen .screen-title h2 { font-size: 21px; }
  .rg-screen .screen-head { gap: 10px; padding: 10px 12px 8px; }
}
@media (max-width: 380px) {
  .rg-offer { width: 100%; max-width: 300px; }
  .rg-wal small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-art { animation: none; }
}
