:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #9aa7b6;
  --panel: rgba(16, 24, 39, 0.88);
  --panel-strong: rgba(5, 10, 20, 0.92);
  --card-dark: rgba(11, 18, 30, 0.9);
  --card-dark-soft: rgba(16, 25, 39, 0.82);
  --line: rgba(255, 255, 255, 0.14);
  --green: #43d883;
  --cyan: #35c7e8;
  --amber: #ffbd4a;
  --red: #f05b64;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(53, 199, 232, 0.18), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(67, 216, 131, 0.16), transparent 28%),
    linear-gradient(135deg, #06111d 0%, #101827 48%, #111111 100%);
}

body.login-open {
  overflow: hidden;
}

button,
output {
  font: inherit;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(67, 216, 131, 0.22), transparent 34%),
    rgba(5, 10, 20, 0.9);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(53, 199, 232, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(67, 216, 131, 0.2), rgba(53, 199, 232, 0.08)),
    var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
  margin: 0;
  color: var(--green);
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 0.95;
}

.login-copy {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}

.discord-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(53, 199, 232, 0.64);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(53, 199, 232, 0.14);
  font-size: 0.96rem;
  font-weight: 900;
  text-decoration: none;
}

.discord-login-link:hover {
  border-color: rgba(53, 199, 232, 0.9);
  background: rgba(53, 199, 232, 0.2);
}

.login-button {
  background: var(--green);
  color: #06111d;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.register-button {
  border-color: rgba(53, 199, 232, 0.64);
  background: rgba(53, 199, 232, 0.16);
  color: var(--cyan);
}

.login-recovery {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.login-recovery .buy-button {
  min-height: 44px;
}

.login-recovery-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-recovery-actions .small-action-button.active {
  color: #08131d;
  border-color: rgba(255, 190, 74, 0.9);
  background: var(--amber);
}

.login-recovery-panel {
  display: grid;
  gap: 8px;
}

.login-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.3;
}

.dev-note-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(67, 216, 131, 0.22), transparent 34%),
    rgba(5, 10, 20, 0.9);
}

.dev-note-modal[hidden] {
  display: none;
}

.dev-note-card h2 {
  font-size: clamp(1.7rem, 7vw, 3rem);
}

.dev-note-list {
  margin: 0 0 20px;
  padding-left: 24px;
  color: var(--text);
}

.dev-note-list li + li {
  margin-top: 8px;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.arena {
  position: relative;
  width: min(100%, 760px);
  padding: clamp(20px, 5vw, 36px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

@media (min-width: 980px) {
  .game-shell {
    place-items: start center;
    padding-top: clamp(28px, 5vh, 72px);
  }

  .arena {
    width: min(920px, calc(100vw - 48px));
  }
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent);
}

.top-row,
.tab-list,
.tab-panel,
.counter-panel,
.coins-panel,
.progress-area,
.stats-grid {
  position: relative;
  z-index: 1;
}

.top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.player-id-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(53, 199, 232, 0.55);
  border-radius: 999px;
  color: #9ee8f7;
  background: rgba(53, 199, 232, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.change-name-button {
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 189, 74, 0.5);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(255, 189, 74, 0.1);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.change-name-button:hover {
  border-color: rgba(255, 189, 74, 0.9);
  background: rgba(255, 189, 74, 0.16);
}

.tab-list {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 189, 74, 0.72) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab-list::-webkit-scrollbar {
  height: 8px;
}

.tab-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tab-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 189, 74, 0.72);
}

.tab-button {
  flex: 1 0 112px;
  min-width: 112px;
  scroll-snap-align: center;
}

.stacked-tab {
  display: inline-grid;
  place-items: center;
  gap: 1px;
}

.tab-button,
.sub-tab-button,
.buy-button {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: clamp(0.78rem, 2.5vw, 1rem);
  font-weight: 900;
  line-height: 1.05;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-button:hover,
.sub-tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.buy-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 205, 100, 0.92);
}

.buy-button.confirming {
  border-color: rgba(67, 216, 131, 0.95);
  background: linear-gradient(180deg, #43d883, #32bd70);
  box-shadow: 0 0 0 2px rgba(67, 216, 131, 0.22);
}

.tab-button.active {
  color: #06111d;
  border-color: rgba(67, 216, 131, 0.75);
  background: var(--green);
}

.sub-tab-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

#statsTab .sub-tab-list {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 189, 74, 0.72) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#statsTab .sub-tab-list::-webkit-scrollbar {
  height: 8px;
}

#statsTab .sub-tab-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

#statsTab .sub-tab-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 189, 74, 0.72);
}

#statsTab .sub-tab-button {
  flex: 1 0 132px;
  scroll-snap-align: start;
}

.sub-tab-button.active {
  color: #06111d;
  border-color: rgba(255, 189, 74, 0.75);
  background: var(--amber);
}

.stats-sub-panel {
  position: relative;
  z-index: 1;
}

.mods-sub-panel {
  position: relative;
  z-index: 1;
}

.stats-sub-panel[hidden] {
  display: none;
}

.mods-sub-panel[hidden] {
  display: none;
}

.mods-sub-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.tab-panel {
  margin-top: 22px;
}

.tab-panel[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.reset-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.reset-display {
  min-width: 94px;
  padding: 7px 9px;
  border: 1px solid rgba(240, 91, 100, 0.3);
  border-radius: 8px;
  color: var(--red);
  background: rgba(240, 91, 100, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.reset-display.holding {
  border-color: rgba(240, 91, 100, 0.72);
  background: rgba(240, 91, 100, 0.16);
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.settings-modal[hidden] {
  display: none;
}

.settings-card {
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.settings-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.settings-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(54, 207, 232, 0.24);
  border-radius: 8px;
  background: rgba(5, 13, 24, 0.3);
}

.backup-code {
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 1000;
}

.backup-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: right;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.save-transfer {
  width: 100%;
  resize: vertical;
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
}

.note-bell {
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.note-bell.unread {
  color: #ff6a72;
  border-color: rgba(240, 91, 100, 0.8);
  background: rgba(240, 91, 100, 0.16);
  animation: note-bell-blink 1s steps(2, end) infinite;
}

@keyframes note-bell-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.counter-panel {
  position: relative;
  margin: 0 0 28px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-strong);
}

.counter-panel-head {
  display: block;
}

.counter-hour {
  position: absolute;
  top: 18px;
  right: 20px;
  max-width: 42%;
  min-width: 0;
  text-align: right;
}

.counter-hour span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.counter-hour output {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0;
  white-space: nowrap;
  color: var(--green);
  font-size: clamp(0.86rem, 2.3vw, 1.25rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  text-shadow: 0 0 20px rgba(67, 216, 131, 0.22);
}

.rate-unit {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 800;
  vertical-align: baseline;
  text-shadow: none;
}

.counter-label,
.rate {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.counter-panel > .rate {
  text-align: center;
}

.counter-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 8.2vw, 6rem);
  font-weight: 900;
  line-height: 0.95;
  color: var(--green);
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
  text-align: center;
  text-shadow: 0 0 34px rgba(67, 216, 131, 0.26);
}

.counter-decimal {
  font-size: 0.48em;
  vertical-align: baseline;
}

.small-decimal {
  font-size: 0.52em;
  vertical-align: baseline;
}

.number-shrink {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
}

.decimal-small {
  display: inline;
  font-size: 0.68em;
  line-height: 1;
  vertical-align: baseline;
  white-space: nowrap;
}

.coins-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px 0 22px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 189, 74, 0.2);
  border-radius: 8px;
  background: rgba(255, 189, 74, 0.08);
}

.coins-value {
  display: flex;
  align-items: baseline;
  margin-top: 2px;
  color: var(--amber);
  font-size: clamp(1.55rem, 4.5vw, 3.1rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
}

.coins-rate {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: clamp(1rem, 2.8vw, 1.28rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.active-gold-table {
  position: relative;
  z-index: 1;
  margin: -10px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.active-gold-head,
.active-gold-list {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.active-gold-head {
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.active-gold-list {
  position: relative;
  padding: 14px 16px 12px;
  color: var(--amber);
  font-size: clamp(0.86rem, 2.15vw, 1rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 8px 26px;
  align-items: start;
}

.gold-reserve-column,
.gold-reserve-stat {
  min-width: 0;
}

.gold-reserve-column {
  display: grid;
  align-content: start;
  gap: 7px;
}

.gold-reserve-right {
  justify-self: end;
  width: min(100%, 330px);
}

.gold-reserve-inline {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 7px;
}

.gold-reserve-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.gold-reserve-label,
.gold-reserve-value {
  min-width: 0;
  white-space: nowrap;
}

.gold-reserve-value {
  color: var(--green);
  text-align: left;
  font-size: clamp(0.98rem, 2.7vw, 1.16rem);
  line-height: 1.05;
}

.gold-reserve-toggle-cell {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
}

.compact-toggle {
  width: 86px;
  min-height: 24px;
  padding: 3px 7px;
  gap: 7px;
  font-size: 0.62rem;
}

.compact-toggle .slider-knob {
  width: 28px;
  height: 16px;
}

.compact-toggle .slider-knob::after {
  top: 3px;
  left: 14px;
  width: 10px;
  height: 10px;
}

.compact-toggle.off .slider-knob::after {
  left: 4px;
}

.gold-reserve-value .decimal-small {
  font-size: 0.72em;
}

.gold-reserve-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.gold-reserve-left-buttons {
  gap: 8px;
  margin-top: 0;
}

.mini-action-button {
  min-height: 28px;
  min-width: 70px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 190, 73, 0.72);
  border-radius: 8px;
  color: #061018;
  background: var(--amber);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.mini-action-button:disabled {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  cursor: not-allowed;
}

.install-battery-button {
  min-width: 112px;
}

.hold-battery-button {
  min-width: 70px;
}

.gold-reserve-note {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.gold-reserve-queue-toggle {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.03);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.gold-reserve-queue {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.gold-reserve-queue[hidden] {
  display: none;
}

.gold-reserve-queue-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(90px, auto) minmax(120px, auto);
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.gold-reserve-queue-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.gold-reserve-queue-row small {
  color: var(--muted);
  font-size: 0.68rem;
}

.gold-reserve-queue-row > strong {
  color: var(--amber);
  text-align: right;
}

.gold-reserve-time {
  white-space: nowrap;
}

.gold-reserve-position {
  color: var(--cyan);
  font-weight: 900;
}

.gold-reserve-empty {
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.shop-header,
.free-gold-panel,
.stats-header,
.inventory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-strong);
}

.inventory-header {
  margin-top: 14px;
}

#modsInventoryPanel .inventory-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

#modsInventoryPanel .inventory-header > div:first-child {
  min-width: 0;
}

#modsInventoryPanel .inventory-header .buy-button {
  width: 100%;
}

.permanent-funding-control {
  display: grid;
  gap: 8px;
  width: 100%;
}

.permanent-funding-control .slider-toggle {
  justify-content: center;
  width: 100%;
}

.permanent-funding-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.permanent-funding-slider input {
  width: 100%;
  min-width: 0;
  accent-color: var(--cyan);
}

.permanent-funding-slider strong {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mods-notice {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 189, 74, 0.3);
  border-radius: 8px;
  color: var(--amber);
  background: rgba(255, 189, 74, 0.08);
  font-weight: 900;
  text-align: center;
}

.mods-notice[hidden] {
  display: none;
}

.mod-total {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: clamp(1.35rem, 4.3vw, 3rem);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
}

.shop-coins {
  text-align: right;
}

.auto-buy-badge {
  min-height: 38px;
  border-radius: 999px;
  text-align: center;
}

.auto-buy-badge:hover {
  transform: none;
}

.auto-buy-badge.off {
  color: var(--muted);
}

.auto-buy-control {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.slider-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(53, 199, 232, 0.55);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(53, 199, 232, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.slider-toggle:hover {
  border-color: rgba(53, 199, 232, 0.9);
  background: rgba(53, 199, 232, 0.16);
}

.slider-toggle.off {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.slider-knob {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(53, 199, 232, 0.34);
}

.slider-knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 17px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--cyan);
  transition: left 160ms ease, background 160ms ease;
}

.slider-toggle.off .slider-knob {
  background: rgba(255, 255, 255, 0.16);
}

.slider-toggle.off .slider-knob::after {
  left: 5px;
  background: var(--muted);
}

.slider-label {
  white-space: nowrap;
}

.auto-buy-mode-toggle {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 0.68rem;
}

.shop-coins-value {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: clamp(1.3rem, 4.2vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
}

.mods-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.card-pager {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  margin: 12px 8px 0;
}

.card-pager[hidden] {
  display: none;
}

.card-pager + .mods-list,
.card-pager + .bank-loan-list {
  padding-inline: 8px;
}

.pager-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.pager-button:not(:disabled):hover {
  border-color: rgba(53, 199, 232, 0.55);
  background: rgba(53, 199, 232, 0.12);
}

.pager-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.pager-info {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mod-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--card-dark-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 10px 28px rgba(0, 0, 0, 0.14);
}

#modsUpgradePanel .mods-list {
  gap: 8px;
  margin-top: 10px;
}

.upgrade-card {
  grid-template-columns: minmax(0, 1fr) minmax(128px, auto);
  gap: 10px;
  padding: 10px 12px;
}

.upgrade-card .mod-title-row {
  gap: 6px 8px;
  margin-bottom: 5px;
}

.upgrade-card h2 {
  font-size: clamp(1rem, 2.4vw, 1.22rem);
}

.upgrade-card p {
  font-size: 0.8rem;
  line-height: 1.2;
}

.upgrade-card .mod-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  margin-top: 10px;
  font-size: clamp(0.9rem, 2.8vw, 1.08rem);
}

.upgrade-card .mod-meta span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.upgrade-card .mod-meta .value-line {
  grid-column: 1 / -1;
}

.upgrade-card .mod-meta strong:not(.gain-chip) {
  color: var(--gold);
}

.gain-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(67, 216, 131, 0.3);
  border-radius: 8px;
  color: var(--green);
  background: rgba(67, 216, 131, 0.1);
  font-weight: 900;
  line-height: 1;
}

.upgrade-card .buy-button {
  min-width: 124px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.shop-item-card {
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px;
}

#modsShopPanel .inventory-header {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 0.78fr);
  gap: 12px 18px;
  align-items: center;
  padding: 16px 18px;
}

#modsShopPanel .inventory-header > div:first-child {
  min-width: 0;
  align-self: center;
}

#modsShopPanel .inventory-slots {
  margin-top: 10px;
  font-size: clamp(1.28rem, 3.4vw, 1.85rem);
}

#modsShopPanel .refresh-info {
  margin-top: 5px;
  font-size: 0.82rem;
  line-height: 1.12;
}

.shop-gold-battery-info {
  display: block;
  gap: 2px;
  white-space: normal;
}

.shop-gold-battery-info span,
.shop-gold-battery-info strong {
  display: block;
}

.shop-gold-battery-info strong {
  color: var(--muted);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.05;
  white-space: nowrap;
}

#modsShopPanel .shop-upgrade-control {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#modsShopPanel .shop-upgrade-control,
#modsShopPanel #goldNeededToggle,
#modsShopPanel #holdPermanentToggle,
#modsShopPanel #refreshShopButton {
  grid-column: 2;
}

#modsShopPanel .slider-toggle {
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

#modsShopPanel #refreshShopButton,
#modsShopPanel #upgradeCardPoolButton {
  min-height: 44px;
}

#modsShopPanel #refreshShopButton {
  width: 100%;
  min-width: 0;
}

#modsShopPanel #upgradeCardPoolButton {
  width: 100%;
  min-width: 0;
}

#itemShopList {
  gap: 8px;
  margin-top: 10px;
}

#itemShopList .shop-item-card {
  grid-template-columns: minmax(0, 1fr) minmax(172px, 220px);
  gap: 10px;
  padding: 10px 12px;
}

#itemShopList .shop-item-card .mod-title-row {
  gap: 6px 8px;
  margin-bottom: 5px;
}

#itemShopList .shop-item-card h2 {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}

#itemShopList .shop-item-card p {
  font-size: 0.82rem;
  line-height: 1.2;
}

#itemShopList .shop-card-lines {
  gap: 3px;
  margin-top: 7px;
}

#itemShopList .shop-card-lines span {
  white-space: nowrap;
}

#itemShopList .shop-card-action {
  gap: 5px;
  font-size: 0.82rem;
}

#itemShopList .buy-button {
  min-height: 36px;
}

.shop-card-info {
  min-width: 0;
}

.shop-card-lines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 10px;
}

.shop-card-action {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: center;
  color: var(--amber);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.shop-card-action .buy-button {
  width: 100%;
  min-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-card-action .pay-over-time-button {
  min-height: 32px;
  padding: 7px 12px;
  border-color: rgba(53, 211, 235, 0.55);
  background: rgba(53, 211, 235, 0.12);
  color: var(--cyan);
  font-size: 0.78rem;
  text-transform: lowercase;
}

.shop-card-action .pay-over-time-button:not(:disabled):hover {
  border-color: rgba(53, 211, 235, 0.78);
  background: rgba(53, 211, 235, 0.18);
}

.shop-card-action > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-card-action > span strong,
.shop-card-action .number-shrink,
.shop-card-action .decimal-small {
  display: inline;
}

.inventory-list {
  gap: 8px;
  margin-top: 10px;
}

.inventory-card {
  gap: 10px;
  padding: 10px 12px;
}

.inventory-card .mod-title-row {
  gap: 6px 8px;
  margin-bottom: 5px;
}

.inventory-card h2 {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.inventory-card p {
  font-size: 0.82rem;
  line-height: 1.2;
}

.inventory-card .shop-card-lines {
  gap: 3px;
  margin-top: 7px;
}

.inventory-card .shop-card-action {
  gap: 5px;
  font-size: 0.82rem;
}

.inventory-card .payment-progress-readout {
  color: var(--gold);
  font-size: 0.94rem;
  font-weight: 1000;
}

.inventory-card .buy-button {
  min-height: 36px;
}

.mod-card.best-value {
  border-color: rgba(67, 216, 131, 0.7);
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(255, 255, 255, 0.018) 46%, rgba(67, 216, 131, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(67, 216, 131, 0.18),
    0 0 18px rgba(67, 216, 131, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mod-card.rare-card {
  border-color: rgba(79, 156, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(79, 156, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(79, 156, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(79, 156, 255, 0.2),
    0 0 18px rgba(79, 156, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.shop-item-card.card-rarity-common {
  border-color: rgba(248, 250, 252, 0.52);
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.055), rgba(255, 255, 255, 0.014)),
    var(--card-dark-soft);
}

.shop-item-card.card-rarity-normal {
  border-color: rgba(67, 216, 131, 0.7);
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(255, 255, 255, 0.018) 46%, rgba(67, 216, 131, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(67, 216, 131, 0.18),
    0 0 18px rgba(67, 216, 131, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.shop-item-card.card-rarity-rare {
  border-color: rgba(79, 156, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(79, 156, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(79, 156, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(79, 156, 255, 0.2),
    0 0 18px rgba(79, 156, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.shop-item-card.card-rarity-epic {
  border-color: rgba(173, 116, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(173, 116, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(173, 116, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(173, 116, 255, 0.2),
    0 0 18px rgba(173, 116, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.shop-item-card.card-rarity-legendary {
  border-color: rgba(255, 93, 117, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 93, 117, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(255, 93, 117, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(255, 93, 117, 0.2),
    0 0 18px rgba(255, 93, 117, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.card-rarity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 900;
}

.card-rarity-inner {
  opacity: 0.86;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.055);
}

.card-rarity-normal .card-rarity-badge {
  color: var(--green);
  background: rgba(67, 216, 131, 0.12);
}

.card-rarity-rare .card-rarity-badge {
  color: #9fc8ff;
  background: rgba(79, 156, 255, 0.14);
}

.card-rarity-epic .card-rarity-badge {
  color: #d7c0ff;
  background: rgba(173, 116, 255, 0.14);
}

.card-rarity-legendary .card-rarity-badge {
  color: #ffb8c2;
  background: rgba(255, 93, 117, 0.14);
}

.mod-card.blue-tier {
  border-color: rgba(79, 156, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(79, 156, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(79, 156, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(79, 156, 255, 0.2),
    0 0 18px rgba(79, 156, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mod-card.blue-tier.best-value {
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(79, 156, 255, 0.09)),
    var(--card-dark);
}

.mod-card.purple-tier {
  border-color: rgba(173, 116, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(173, 116, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(173, 116, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(173, 116, 255, 0.2),
    0 0 18px rgba(173, 116, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mod-card.purple-tier.best-value {
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(173, 116, 255, 0.09)),
    var(--card-dark);
}

.mod-card.red-tier {
  border-color: rgba(255, 93, 117, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 93, 117, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(255, 93, 117, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(255, 93, 117, 0.2),
    0 0 18px rgba(255, 93, 117, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mod-card.red-tier.best-value {
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(255, 93, 117, 0.09)),
    var(--card-dark);
}

.mod-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.mod-card h2 {
  margin: 0;
  font-size: clamp(1.05rem, 2.8vw, 1.45rem);
  line-height: 1.05;
}

.value-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(67, 216, 131, 0.7);
  border-radius: 999px;
  color: #08131d;
  background: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
}

.item-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(53, 199, 232, 0.55);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(53, 199, 232, 0.1);
  font-size: 0.75rem;
  font-weight: 900;
}

.item-type-badge.item-type-gold {
  border-color: rgba(255, 189, 74, 0.72);
  color: var(--amber);
  background: rgba(255, 189, 74, 0.13);
}

.item-type-badge.item-type-counter {
  border-color: rgba(67, 216, 131, 0.72);
  color: var(--green);
  background: rgba(67, 216, 131, 0.13);
}

.item-type-badge.item-type-customer-training {
  border-color: rgba(53, 199, 232, 0.72);
  color: var(--cyan);
  background: rgba(53, 199, 232, 0.13);
}

.permanent-word {
  display: inline-block;
  font: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  white-space: nowrap;
  paint-order: stroke fill;
}

.permanent-word-gold {
  color: #342006;
  -webkit-text-stroke: 2px #ffc25b;
  text-shadow: 0 0 14px rgba(255, 194, 91, 0.28);
}

.permanent-word-counter {
  color: #082516;
  -webkit-text-stroke: 2px #4cf49a;
  text-shadow: 0 0 14px rgba(76, 244, 154, 0.24);
}

.rare-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(79, 156, 255, 0.76);
  border-radius: 999px;
  color: #d8e8ff;
  background: rgba(79, 156, 255, 0.2);
  font-size: 0.75rem;
  font-weight: 900;
}

.mod-card p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.86rem, 2.4vw, 1rem);
  font-weight: 700;
}

.mod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 12px;
  color: var(--amber);
  font-size: clamp(0.88rem, 2.6vw, 1rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.mod-meta span,
.stat-detail strong,
.refresh-info,
.inventory-slots {
  min-width: 0;
}

.mod-meta span,
.stat-detail strong,
.inventory-slots,
.refresh-info,
.level-percent,
.coins-rate,
.rate {
  overflow-wrap: normal;
  white-space: nowrap;
}

.buy-button {
  min-width: 132px;
  padding: 0 14px;
  color: #08131d;
  background: var(--amber);
  font-size: clamp(0.78rem, 2.5vw, 0.95rem);
  white-space: nowrap;
}

.buy-button:disabled {
  color: rgba(248, 250, 252, 0.45);
  background: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.buy-button.unaffordable {
  color: rgba(248, 250, 252, 0.48);
  background: rgba(255, 255, 255, 0.1);
}

.buy-button.unaffordable:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
}

.secondary-button {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.bank-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  gap: 18px;
  align-items: end;
  margin-top: 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 189, 74, 0.22);
  border-radius: 8px;
  background: var(--panel-strong);
}

.bank-balance-block,
.bank-pocket-block {
  min-width: 0;
}

.bank-pocket-block {
  display: grid;
  gap: 6px;
  justify-items: end;
  padding-bottom: 4px;
}

.bank-pocket-block strong {
  color: var(--amber);
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.bank-value {
  display: block;
  margin-top: 8px;
  color: var(--amber);
  font-size: clamp(1.7rem, 6vw, 3.25rem);
  font-weight: 900;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.bank-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.bank-loan-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.bank-loan-panel {
  min-width: 0;
}

.bank-loan-panel[hidden] {
  display: none !important;
}

.bank-section {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.bank-section > div > strong {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-variant-numeric: tabular-nums;
}

.bank-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: start;
}

.bank-offer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.bank-offer-head .rules-button {
  align-self: start;
}

.bank-section-head > div > strong {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-variant-numeric: tabular-nums;
}

.bank-risk-roll {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.bank-risk-roll strong {
  display: block;
  color: var(--amber);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-variant-numeric: tabular-nums;
}

.bank-risk-grid {
  display: grid;
  gap: 8px;
}

.robbery-history-block {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.robbery-history-list {
  display: grid;
  gap: 6px;
}

.robbery-history-row,
.robbery-history-empty {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.robbery-history-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  align-items: start;
}

.robbery-history-row div,
.robbery-history-row div:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.robbery-history-row strong {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.robbery-history-row span,
.robbery-history-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.15;
}

.bank-future-pressure {
  margin-top: 10px;
}

.bank-upgrade-control {
  display: grid;
  gap: 4px;
  justify-items: stretch;
}

.bank-upgrade-control .buy-button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.bank-upgrade-control .refresh-info {
  text-align: center;
  white-space: nowrap;
}

.rules-button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(75, 214, 238, 0.5);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(75, 214, 238, 0.1);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.rules-button:hover {
  border-color: rgba(75, 214, 238, 0.9);
  background: rgba(75, 214, 238, 0.18);
}

.bank-risk-roll .rules-button {
  margin-bottom: 6px;
}

.rules-card {
  border-color: rgba(75, 214, 238, 0.55);
  box-shadow: 0 0 0 1px rgba(75, 214, 238, 0.15), 0 24px 60px rgba(0, 0, 0, 0.35);
}

.rules-copy {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.25;
}

.rules-copy p {
  margin: 0;
}

.customer-info-card {
  width: min(760px, calc(100vw - 28px));
}

.customer-info-sort {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.customer-info-sort .sub-tab-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.customer-info-list {
  display: grid;
  gap: 5px;
  max-height: min(58vh, 560px);
  margin: 12px 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.customer-info-row {
  display: grid;
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.customer-info-row:last-child {
  border-bottom: 0;
}

.customer-info-empty {
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.customer-info-row strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.05;
}

.customer-info-main-line,
.customer-info-drop-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.customer-info-main-line {
  flex-wrap: wrap;
  gap: 6px;
}

.customer-info-main-line strong {
  margin-right: 2px;
}

.customer-info-drop-line {
  flex-wrap: wrap;
  gap: 6px;
}

.customer-info-drop-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.customer-info-rarity-badge {
  flex: 0 0 auto;
}

.customer-info-drops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}

.customer-info-drop-tag {
  display: inline-flex;
}

.bank-section p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.bank-slider-row,
.bank-input-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bank-flow-slider {
  --bank-flow-start: 50%;
  --bank-flow-end: 50%;
  --bank-flow-notch-step: 5%;
  appearance: none;
  width: 100%;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(
      to right,
      transparent 0 var(--bank-flow-start),
      var(--cyan) var(--bank-flow-start) var(--bank-flow-end),
      transparent var(--bank-flow-end) 100%
    ) center / 100% 6px no-repeat,
    linear-gradient(
      to right,
      rgba(255, 255, 255, 0.34),
      rgba(255, 255, 255, 0.34)
    ) center / 100% 6px no-repeat;
  cursor: pointer;
}

.bank-flow-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(53, 199, 232, 0.18);
}

.bank-flow-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(53, 199, 232, 0.18);
}

.bank-flow-slider::-moz-range-track {
  height: 26px;
  background: transparent;
}

.bank-flow-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.bank-flow-readout span:nth-child(2) {
  text-align: center;
}

.bank-flow-readout span:last-child {
  text-align: right;
}

.bank-input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 900;
}

.bank-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bank-actions .buy-button,
.bank-section > .buy-button {
  width: 100%;
  min-width: 0;
}

.bank-stat-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

.bank-stat-line strong {
  color: var(--green);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bank-training-line {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.bank-training-line strong {
  display: block;
  min-width: 0;
  line-height: 1.05;
  white-space: normal;
}

.bank-training-line strong small {
  display: inline-block;
  max-width: 100%;
  color: var(--gold);
  font-size: 0.78em;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.bank-loan-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.bank-active-loans {
  margin-top: 10px;
}

.bank-loan-panel.bank-active-loans {
  margin-top: 10px;
}

.active-bank-loan-list {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.bank-customer-card {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.bank-customer-card .shop-card-action {
  align-self: stretch;
  justify-content: center;
}

.bank-customer-card .buy-button {
  width: 100%;
  min-width: 0;
}

.bank-customer-card .shop-card-lines {
  margin-top: 5px;
}

.bank-customer-card.customer-common {
  border-color: rgba(248, 250, 252, 0.52);
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.055), rgba(255, 255, 255, 0.014)),
    var(--card-dark-soft);
}

.bank-customer-card.customer-normal {
  border-color: rgba(67, 216, 131, 0.7);
  background:
    linear-gradient(135deg, rgba(67, 216, 131, 0.085), rgba(255, 255, 255, 0.018) 46%, rgba(67, 216, 131, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(67, 216, 131, 0.18),
    0 0 18px rgba(67, 216, 131, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.bank-customer-card.customer-rare {
  border-color: rgba(79, 156, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(79, 156, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(79, 156, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(79, 156, 255, 0.2),
    0 0 18px rgba(79, 156, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.bank-customer-card.customer-epic {
  border-color: rgba(173, 116, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(173, 116, 255, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(173, 116, 255, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(173, 116, 255, 0.2),
    0 0 18px rgba(173, 116, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.bank-customer-card.customer-legendary {
  border-color: rgba(255, 93, 117, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 93, 117, 0.09), rgba(255, 255, 255, 0.018) 46%, rgba(255, 93, 117, 0.035)),
    var(--card-dark);
  box-shadow:
    0 0 0 1px rgba(255, 93, 117, 0.2),
    0 0 18px rgba(255, 93, 117, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.leaderboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.leaderboard-header strong {
  display: block;
  margin-top: 5px;
  color: var(--amber);
  font-size: clamp(1.15rem, 3.4vw, 1.8rem);
  font-variant-numeric: tabular-nums;
}

.leaderboard-update-control {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.leaderboard-update-cooldown {
  text-align: center;
  font-weight: 800;
}

.leaderboard-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leaderboard-table {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: minmax(30px, 0.32fr) minmax(0, 1.25fr) minmax(48px, 0.6fr) minmax(66px, 0.9fr);
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 5px 7px;
  font-variant-numeric: tabular-nums;
}

.leaderboard-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.055);
}

.leaderboard-row:nth-child(odd) {
  background: rgba(0, 0, 0, 0.12);
}

.leaderboard-head {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-row span {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.68rem, 2.4vw, 0.9rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row span:first-child {
  color: var(--muted);
}

.leaderboard-row span:nth-child(2) {
  color: var(--cyan);
}

.leaderboard-row span:nth-child(3) {
  color: var(--ink);
  text-align: center;
}

.leaderboard-row span:nth-child(4) {
  color: var(--ink);
  text-align: right;
}

.leaderboard-row.current-player {
  background: rgba(67, 216, 131, 0.18);
}

.rate-rank-cell {
  display: inline-grid;
  grid-template-columns: 14px auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.rate-rank-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--green);
  filter: drop-shadow(0 0 5px rgba(67, 216, 131, 0.45));
}

.rate-rank-arrow.hidden {
  visibility: hidden;
}

.leaderboard-row.bot-row span:nth-child(2) {
  display: flex;
  align-items: center;
  gap: 5px;
}

.leaderboard-row.bot-balanced {
  background: linear-gradient(90deg, rgba(75, 190, 255, 0.12), rgba(0, 0, 0, 0.08));
}

.leaderboard-row.bot-mod-chaser {
  background: linear-gradient(90deg, rgba(67, 216, 131, 0.13), rgba(0, 0, 0, 0.08));
}

.leaderboard-row.bot-card-hunter {
  background: linear-gradient(90deg, rgba(255, 184, 77, 0.13), rgba(0, 0, 0, 0.08));
}

.leaderboard-row.bot-banker {
  background: linear-gradient(90deg, rgba(255, 214, 111, 0.14), rgba(0, 0, 0, 0.08));
}

.leaderboard-row.bot-risk-player {
  background: linear-gradient(90deg, rgba(255, 103, 129, 0.14), rgba(0, 0, 0, 0.08));
}

.bot-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: clamp(0.48rem, 1.5vw, 0.62rem);
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}

.bot-balanced .bot-chip {
  border-color: rgba(116, 213, 255, 0.55);
  background: rgba(116, 213, 255, 0.12);
  color: #74d5ff;
}

.bot-mod-chaser .bot-chip {
  border-color: rgba(67, 216, 131, 0.55);
  background: rgba(67, 216, 131, 0.12);
  color: #43d883;
}

.bot-card-hunter .bot-chip {
  border-color: rgba(255, 189, 89, 0.55);
  background: rgba(255, 189, 89, 0.12);
  color: #ffbd59;
}

.bot-banker .bot-chip {
  border-color: rgba(255, 214, 111, 0.55);
  background: rgba(255, 214, 111, 0.12);
  color: #ffd66f;
}

.bot-risk-player .bot-chip {
  border-color: rgba(255, 108, 130, 0.55);
  background: rgba(255, 108, 130, 0.12);
  color: #ff6c82;
}

.leaderboard-empty {
  grid-template-columns: 1fr;
  min-width: 0;
  color: var(--muted);
  text-align: center;
}

.customer-rarity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 900;
}

.customer-rank-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 190, 70, 0.72);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 190, 70, 0.12);
  font-size: 0.75rem;
  font-weight: 900;
}

.customer-rank-xp-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(54, 205, 230, 0.55);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(54, 205, 230, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.customer-rank-counter-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(67, 216, 131, 0.58);
  border-radius: 6px;
  color: var(--green);
  background: rgba(67, 216, 131, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.customer-common .customer-rarity-badge {
  color: var(--ink);
}

.customer-normal .customer-rarity-badge {
  color: var(--green);
  background: rgba(67, 216, 131, 0.12);
}

.customer-rare .customer-rarity-badge {
  color: #9fc8ff;
  background: rgba(79, 156, 255, 0.14);
}

.customer-epic .customer-rarity-badge {
  color: #d7c0ff;
  background: rgba(173, 116, 255, 0.14);
}

.customer-legendary .customer-rarity-badge {
  color: #ffb8c2;
  background: rgba(255, 93, 117, 0.14);
}

.customer-rarity-badge.rarity-common {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.customer-rarity-badge.rarity-normal {
  color: var(--green);
  background: rgba(67, 216, 131, 0.12);
}

.customer-rarity-badge.rarity-rare {
  color: #9fc8ff;
  background: rgba(79, 156, 255, 0.14);
}

.customer-rarity-badge.rarity-epic {
  color: #d7c0ff;
  background: rgba(173, 116, 255, 0.14);
}

.customer-rarity-badge.rarity-legendary {
  color: #ffb8c2;
  background: rgba(255, 93, 117, 0.14);
}

.inventory-slots {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}

.refresh-info {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.settings-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.settings-input {
  min-height: 42px;
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 900;
}

.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.shop-upgrade-control {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.inventory-empty {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
  text-align: center;
}

.level-stats-table,
.stats-table {
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.level-stats-list,
.compact-stats-table {
  display: grid;
}

.level-stat-row,
.stats-table-row {
  display: grid;
  grid-template-columns: 0.55fr 1fr 0.9fr 1fr 0.9fr;
  gap: 4px;
  align-items: center;
  min-width: 600px;
  padding: 2px 7px;
  border-top: 0;
}

.level-stat-row {
  grid-template-columns: 64px 112px 100px 86px 82px;
  gap: 2px;
  width: max-content;
  min-width: 472px;
  min-height: 26px;
  line-height: 1.1;
}

.level-stat-row strong,
.level-stat-row span {
  white-space: nowrap;
}

.stats-table-row {
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto);
  min-width: 0;
}

.level-stat-row:nth-child(even),
.stats-table-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.055);
}

.level-stat-row:nth-child(odd),
.stats-table-row:nth-child(odd) {
  background: rgba(0, 0, 0, 0.1);
}

.level-stat-head,
.stats-table-head {
  border-top: 0;
  background: rgba(255, 255, 255, 0.1);
}

.level-stats-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  width: max-content;
  min-width: 472px;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.level-stats-pager output {
  color: var(--muted);
  font-weight: 1000;
  text-align: center;
}

.small-action-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 1000;
}

.small-action-button:disabled {
  color: var(--muted);
  opacity: 0.45;
}

.stats-table-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-table-row > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stats-table-row > strong {
  justify-self: end;
  color: var(--amber);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.stats-table-row.featured-row > span,
.stats-table-row.featured-row > strong {
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 900;
}

.counter-stats-table .featured-row > strong,
.counter-stats-table .stats-table-row:nth-child(4) > strong,
.gold-stats-table .stats-table-row:nth-child(4) > strong {
  color: var(--green);
}

.level-stat-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.level-stat-row strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.level-stat-row strong:nth-child(3),
.level-stat-row strong:nth-child(4),
.level-stat-row strong:nth-child(5) {
  color: var(--amber);
}

.progress-area {
  margin-top: 10px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.progress-eta {
  color: var(--amber);
}

.level-percent {
  display: block;
  width: 50%;
  margin-bottom: 10px;
  color: var(--green);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.progress-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
  box-shadow: 0 0 26px rgba(67, 216, 131, 0.36);
  transition: width 180ms linear;
}

.counter-card-bank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(67, 216, 131, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.counter-card-bank .counter-label {
  margin-bottom: 4px;
}

.counter-card-bank strong {
  color: var(--green);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.counter-card-bank > div:first-child > strong {
  display: block;
  font-size: clamp(1rem, 3vw, 1.4rem);
}

.counter-card-bank-stats {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px;
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.inventory-passive-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(53, 199, 232, 0.45);
  border-radius: 8px;
  color: var(--cyan);
  font-weight: 1000;
  background: rgba(53, 199, 232, 0.1);
}

.global-counter-panel {
  border-color: rgba(53, 199, 232, 0.28);
}

.global-rate-output {
  display: block;
  min-width: max-content;
  white-space: nowrap;
  word-break: keep-all;
}

.global-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.global-stats-grid .stat {
  padding: 10px 12px;
}

.global-progress-area {
  margin-top: 16px;
}

.global-rules-table {
  margin-top: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 22px;
}

.stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

#gameTab .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

#gameTab .stat {
  padding: 10px 12px;
}

#gameTab .stat:first-child {
  grid-column: 1 / -1;
}

#gameTab .stat-detail {
  grid-template-columns: minmax(120px, 1fr) minmax(0, auto);
  gap: 5px 12px;
  margin-top: 8px;
  padding-top: 8px;
}

#gameTab .stat-detail > strong {
  max-width: 100%;
  justify-self: end;
}

#gameTab .stat > span {
  margin-bottom: 4px;
  font-size: 0.68rem;
}

#gameTab .stat > strong {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
}

#gameTab .stat-detail > span {
  font-size: 0.66rem;
}

#gameTab .stat-detail > strong {
  font-size: clamp(0.9rem, 2.4vw, 1rem);
}

.stat > span,
.stat > strong,
.stat-detail > span,
.stat-detail > strong {
  display: block;
}

.stat > span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat > strong {
  font-size: clamp(0.92rem, 2.6vw, 1.35rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
  overflow: hidden;
}

.stat-detail {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-detail > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-detail > strong {
  color: var(--amber);
  font-size: 0.95rem;
  text-align: right;
}

.stat .number-shrink,
.stat .decimal-small,
.stat .small-decimal,
.stat .counter-decimal {
  display: inline;
}

#bestModGain,
.gain-value {
  color: var(--green);
}

.counter-gain-readout {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.level-toast {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  max-width: min(340px, calc(100% - 48px));
  padding: 12px 16px;
  border: 1px solid rgba(67, 216, 131, 0.42);
  border-radius: 8px;
  color: #08131d;
  background: var(--green);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  animation: pop 1.5s ease forwards;
}

.level-toast.notice-toast {
  color: var(--cyan);
  border-color: rgba(53, 199, 232, 0.58);
  background:
    linear-gradient(135deg, rgba(53, 199, 232, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(7, 13, 24, 0.96);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(53, 199, 232, 0.14);
  animation-duration: 2.2s;
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  16%,
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@media (max-width: 620px) {
  .game-shell {
    padding: 14px;
    align-items: stretch;
  }

  .arena {
    min-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .counter-panel {
    padding: 18px;
  }

  .counter-hour {
    top: 14px;
    right: 14px;
    max-width: 46%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .coins-panel {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 10px 12px;
  }

  .coins-panel .counter-label {
    font-size: 0.78rem;
  }

  .coins-value {
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .coins-rate {
    font-size: clamp(0.84rem, 4.2vw, 1rem);
    text-align: right;
  }

  .active-gold-table {
    margin: -8px 0 14px;
  }

  .bank-display {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .bank-pocket-block {
    justify-items: start;
  }

  .bank-pocket-block strong {
    text-align: left;
  }

  .bank-value {
    font-size: clamp(1.55rem, 7vw, 2.25rem);
  }

  .bank-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .global-stats-grid {
    grid-template-columns: 1fr;
  }

  .bank-loan-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bank-section {
    padding: 12px;
  }

  .bank-section-head {
    grid-template-columns: 1fr;
  }

  .bank-offer-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-info-row {
    grid-template-columns: 1fr;
  }

  .customer-info-sort {
    grid-template-columns: 1fr;
  }

  .bank-customer-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .bank-customer-card .shop-card-action {
    align-items: stretch;
  }

  .active-gold-head,
  .active-gold-list {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
  }

  .active-gold-list {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 10px;
  }

  .active-gold-head,
  .active-gold-list {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gold-reserve-queue-row {
    grid-template-columns: 20px minmax(0, 1fr) minmax(76px, auto) minmax(98px, auto);
    gap: 6px;
  }

  .counter-card-bank {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .counter-card-bank-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .shop-header,
  .free-gold-panel,
  .stats-header,
  .inventory-header,
  .mod-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .shop-header,
  .free-gold-panel,
  .stats-header,
  .inventory-header {
    flex-direction: column;
  }

  #modsInventoryPanel .inventory-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    padding: 12px;
  }

  #modsInventoryPanel .inventory-header > div:first-child {
    min-width: 0;
  }

  #modsInventoryPanel .inventory-header .refresh-info {
    white-space: normal;
  }

  #modsShopPanel .inventory-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 44%);
    gap: 8px 10px;
    align-items: center;
    padding: 10px 12px;
    overflow: hidden;
  }

  #modsShopPanel .inventory-header > div:first-child {
    grid-row: span 5;
    min-width: 0;
  }

  #modsShopPanel .shop-upgrade-control {
    justify-items: stretch;
  }

  #modsShopPanel #upgradeCardPoolButton,
  #modsShopPanel .slider-toggle {
    width: 100%;
    min-width: 0;
  }

  #modsShopPanel #refreshShopButton {
    grid-column: 2;
    width: 100%;
    min-width: 0;
  }

  #modsShopPanel .slider-toggle {
    grid-column: 2;
    justify-content: center;
  }

  #modsShopPanel .slider-label {
    font-size: 0;
  }

  #modsShopPanel #goldNeededToggle .slider-label::after {
    content: "G needed";
    font-size: 0.72rem;
  }

  #modsShopPanel #holdPermanentToggle .slider-label::after {
    content: "Hold P/Leg";
    font-size: 0.72rem;
  }

  .shop-coins {
    text-align: left;
  }

  #modsTab > .shop-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 14px;
    align-items: center;
    padding: 12px;
  }

  #modsTab > .shop-header > div:first-child {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  #modsTab > .shop-header .auto-buy-control {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    width: min(100%, 320px);
  }

  #modsTab > .shop-header .shop-coins {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
    min-width: 0;
  }

  #modsTab > .shop-header .mod-total,
  #modsTab > .shop-header .shop-coins-value {
    font-size: clamp(1.18rem, 5.4vw, 1.75rem);
  }

  #modsInventoryPanel > .inventory-header .buy-button {
    width: auto;
    min-width: 0;
    justify-self: stretch;
  }

  .buy-button {
    min-width: 0;
    width: 100%;
  }

  #modsInventoryPanel > .inventory-header .buy-button {
    width: 100%;
  }

  .shop-item-card {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 36%);
    gap: 10px;
    align-items: start;
    padding: 12px;
  }

  .upgrade-card {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 32%);
    gap: 8px;
    padding: 9px 10px;
  }

  .upgrade-card .mod-title-row {
    gap: 5px 7px;
    margin-bottom: 4px;
  }

  .upgrade-card h2 {
    font-size: 0.98rem;
  }

  .upgrade-card p {
    font-size: 0.74rem;
  }

  .upgrade-card .mod-meta {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 8px;
    margin-top: 7px;
    font-size: 0.82rem;
  }

  .upgrade-card .mod-meta span {
    padding: 0;
  }

  .gain-chip {
    min-height: 20px;
    padding: 2px 6px;
  }

  .upgrade-card .buy-button {
    min-width: 0;
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.68rem;
  }

  #itemShopList {
    gap: 7px;
    margin-top: 8px;
  }

  #itemShopList .shop-item-card {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 30%);
    gap: 10px;
    padding: 9px 12px;
  }

  #itemShopList .shop-item-card h2 {
    font-size: 0.98rem;
  }

  #itemShopList .shop-item-card p {
    font-size: 0.76rem;
  }

  .shop-item-card .mod-title-row {
    gap: 6px 8px;
    margin-bottom: 6px;
  }

  .shop-card-lines {
    gap: 4px 10px;
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .shop-card-action {
    gap: 6px;
    font-size: 0.78rem;
  }

  .shop-card-action .buy-button {
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.72rem;
    line-height: 1;
  }

  .inventory-list {
    gap: 7px;
    margin-top: 8px;
  }

  .inventory-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .inventory-card .mod-title-row {
    gap: 5px 7px;
    margin-bottom: 4px;
  }

  .inventory-card h2 {
    font-size: 0.98rem;
  }

  .inventory-card p {
    font-size: 0.76rem;
  }

  .inventory-card .shop-card-lines {
    gap: 2px;
    margin-top: 6px;
    font-size: 0.78rem;
  }

  .inventory-card .shop-card-action {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 6px;
    width: 100%;
    font-size: 0.72rem;
  }

  .inventory-card .buy-button {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    font-size: 0.7rem;
  }

  .inventory-card .shop-card-action > span {
    grid-column: 1 / -1;
    justify-self: end;
    max-width: 100%;
    white-space: normal;
    text-align: right;
  }

  .level-stat-row {
    gap: 2px;
    padding: 2px 6px;
  }
}

.number-shrink {
  font-size: 1.06em;
}

.coins-value,
.coins-rate,
.level-percent,
.stat > strong,
.stat-detail > strong,
.mod-total,
.shop-coins-value,
.inventory-slots,
.refresh-info,
.mod-meta,
.shop-card-action,
.level-stat-row strong,
.buy-button,
.auto-buy-badge,
.slider-toggle {
  font-size: 1.06em;
}

.counter-value .number-shrink,
h1 .number-shrink {
  font-size: 1em;
}

.level-percent {
  width: 50%;
  font-size: clamp(2rem, 6vw, 3.4rem);
}

.coins-value {
  font-size: clamp(1.75rem, 5vw, 3.4rem);
}

@media (max-width: 620px) {
  .coins-value {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  #statsTab .sub-tab-list {
    gap: 6px;
  }

  .stats-table-row {
    gap: 6px;
    padding: 5px 8px;
  }

  .stats-table-row.featured-row > span,
  .stats-table-row.featured-row > strong {
    font-size: 0.92rem;
  }
}

/* Cold vault theme */
:root {
  --muted: #aeb9c8;
  --panel: rgba(10, 18, 29, 0.9);
  --panel-strong: rgba(4, 10, 17, 0.92);
  --card-dark: rgba(5, 11, 18, 0.9);
  --card-dark-soft: rgba(10, 18, 29, 0.86);
  --line: rgba(170, 190, 218, 0.18);
  --gold: var(--amber);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(53, 199, 232, 0.12), transparent 28%),
    radial-gradient(circle at 92% 28%, rgba(240, 91, 100, 0.08), transparent 22%),
    linear-gradient(180deg, #101925 0%, #070c13 72%, #06090f 100%);
}

.login-screen,
.dev-note-modal {
  background:
    radial-gradient(circle at 18% 0%, rgba(53, 199, 232, 0.14), transparent 30%),
    rgba(3, 8, 14, 0.94);
}

.login-card,
.dev-note-card,
.arena {
  background:
    radial-gradient(circle at 18% 0%, rgba(53, 199, 232, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(16, 25, 37, 0.96), rgba(7, 12, 19, 0.96));
  border-color: rgba(170, 190, 218, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 24px 80px rgba(0, 0, 0, 0.45);
}

.arena::before {
  display: none;
}

.counter-panel,
.coins-panel,
.bank-section,
.mod-card,
.active-gold-table,
.leaderboard-table,
.level-stat-list,
.rules-card,
.shop-status,
.inventory-status,
.customer-name-modal,
.customer-name-card,
.save-backup-list,
.stat-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.006)),
    rgba(4, 10, 17, 0.88);
  border-color: rgba(170, 190, 218, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.coins-panel {
  border-color: rgba(255, 189, 74, 0.22);
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 189, 74, 0.09), transparent 30%),
    rgba(6, 10, 16, 0.88);
}

#bankRiskPanel .bank-section,
.bank-section.risk,
.robbery-history-row {
  background:
    radial-gradient(circle at 94% 16%, rgba(240, 91, 100, 0.1), transparent 32%),
    rgba(10, 7, 8, 0.86);
  border-color: rgba(240, 91, 100, 0.22);
}

#bankRiskPanel .bank-section h2,
#bankRiskPanel .bank-risk-roll strong,
.robbery-history-row strong {
  color: #ff6b55;
}

.counter-value,
.counter-hour output,
.progress-percent {
  text-shadow: 0 0 24px rgba(67, 216, 131, 0.24);
}
