:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-top: #111a2a;
  --surface: #111827;
  --surface-2: #0d1422;
  --surface-3: #132238;
  --text: #eef4ff;
  --muted: #9aa8bd;
  --muted-2: #6f7f95;
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(148, 163, 184, 0.34);
  --accent: #19c6a3;
  --accent-dark: #79f2dc;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --amber: #fbbf24;
  --danger: #fb7185;
  --ok: #34d399;
  --ink: #f8fafc;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(56, 189, 248, 0.22);
  --radius: 8px;
  --tap: 48px;
}

:root[data-theme="kitty"] {
  color-scheme: light;
  --bg: #fff0f8;
  --bg-top: #ffd1e8;
  --surface: #fff9fd;
  --surface-2: #ffe7f3;
  --surface-3: #ffc6df;
  --text: #36142c;
  --muted: #9a4775;
  --muted-2: #c15f94;
  --line: rgba(244, 114, 182, 0.34);
  --line-strong: rgba(219, 39, 119, 0.46);
  --accent: #ff4fa3;
  --accent-dark: #db2777;
  --accent-2: #ff9bd0;
  --accent-3: #ffd43b;
  --amber: #d97706;
  --danger: #e11d48;
  --ok: #059669;
  --ink: #4a1738;
  --shadow: 0 18px 42px rgba(219, 39, 119, 0.2);
  --shadow-soft: 0 10px 24px rgba(219, 39, 119, 0.16);
  --focus: 0 0 0 3px rgba(255, 79, 163, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0, rgba(25, 198, 163, 0.16) 0, rgba(25, 198, 163, 0) 34%),
    radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.13) 0, rgba(56, 189, 248, 0) 32%),
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 310px),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

:root[data-theme="kitty"] body {
  background:
    radial-gradient(circle at 12% 0, rgba(255, 79, 163, 0.24) 0, rgba(255, 79, 163, 0) 32%),
    radial-gradient(circle at 90% 6%, rgba(255, 212, 59, 0.22) 0, rgba(255, 212, 59, 0) 29%),
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 310px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:active,
.button-link:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 760;
  text-decoration: none;
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 12px 104px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: -12px -12px 10px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(7, 10, 18, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.brand-block,
.header-actions,
.quick-actions,
.panel-head,
.hero-row,
.item-row,
.item-actions,
.bottom-nav button,
.top-tabs button,
.primary,
.ghost-btn {
  position: relative;
  display: flex;
  align-items: center;
}

.brand-block {
  position: relative;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, #0b1120 0, #164e63 45%, #0f766e 100%);
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(25, 198, 163, 0.16), 0 10px 24px rgba(0, 0, 0, 0.38);
}

.brand-kitty {
  display: none;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  overflow: hidden;
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

.header-actions {
  gap: 8px;
  flex: 0 0 auto;
}

.role-pill,
.soft-pill,
.badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  padding: 0;
}

.theme-select {
  width: auto;
  min-width: 76px;
  min-height: 38px;
  padding: 0 30px 0 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 760;
}

.top-tabs {
  position: sticky;
  top: calc(65px + env(safe-area-inset-top));
  z-index: 12;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -12px 12px;
  padding: 4px 12px 12px;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.96), rgba(7, 10, 18, 0.78));
  backdrop-filter: blur(14px);
  scrollbar-width: none;
  scroll-padding-inline: 12px;
}

.top-tabs::-webkit-scrollbar,
.chip-row::-webkit-scrollbar {
  display: none;
}

.top-tabs button {
  gap: 8px;
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 44px;
  padding: 0 13px;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.top-tabs button.active {
  border-color: rgba(94, 234, 212, 0.5);
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #fff;
}

.section-menu-btn,
.sheet-backdrop,
.section-sheet {
  display: none;
}

.section-menu-btn {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.84);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.section-menu-btn > span,
.sheet-head,
.section-grid button {
  display: flex;
  align-items: center;
}

.section-menu-btn > span {
  gap: 9px;
  min-width: 0;
  font-weight: 800;
}

#sectionMenuLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
}

.section-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 45;
  width: min(520px, 100%);
  max-height: min(76dvh, 620px);
  transform: translateX(-50%);
  gap: 12px;
  overflow-y: auto;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(7, 10, 18, 0.98)),
    var(--bg);
  box-shadow: 0 -24px 54px rgba(0, 0, 0, 0.48);
}

.sheet-handle {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.sheet-head {
  justify-content: space-between;
  gap: 12px;
}

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

.section-grid button {
  justify-content: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 0 12px;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  font-weight: 780;
}

.section-grid button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-grid button.active {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
}

.view {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 12px;
}

.balance-hero,
.metric,
.tool-panel,
.notice,
.data-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-hero {
  min-height: 164px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(25, 198, 163, 0.18), rgba(56, 189, 248, 0.12) 58%, rgba(167, 139, 250, 0.12)),
    var(--surface);
}

.balance-hero > span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

.balance-hero strong {
  display: block;
  margin: 9px 0 20px;
  font-size: clamp(38px, 9vw, 62px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-row {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.hero-row button {
  min-height: 42px;
  padding: 0 13px;
  border-color: rgba(94, 234, 212, 0.34);
  color: var(--accent-dark);
  font-weight: 780;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric {
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(13, 20, 34, 0.96)),
    var(--surface);
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0;
}

.quick-actions {
  gap: 9px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.quick-actions button,
.primary,
.ghost-btn {
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 780;
}

.quick-actions .quick-game,
.quick-actions [data-tab="leaderboard"] {
  border-color: rgba(94, 234, 212, 0.34);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(56, 189, 248, 0.12)),
    rgba(15, 23, 42, 0.86);
  color: var(--accent-dark);
}

.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, #0f9f87, #087db2);
  color: #fff;
  box-shadow: 0 12px 26px rgba(25, 198, 163, 0.22), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.primary:hover {
  background: linear-gradient(135deg, #14b8a6, #0284c7);
}

.contest-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contest-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  overflow: hidden;
  padding: 13px;
  text-align: left;
  border-color: rgba(94, 234, 212, 0.28);
  background:
    radial-gradient(circle at 95% 12%, rgba(56, 189, 248, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(15, 23, 42, 0.9));
  box-shadow: var(--shadow-soft);
}

.contest-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.08) 44%, transparent 55%);
  transform: translateX(-115%);
  animation: contestShine 4.8s ease-in-out infinite;
  pointer-events: none;
}

.contest-arena {
  border-color: rgba(167, 139, 250, 0.32);
  background:
    radial-gradient(circle at 96% 10%, rgba(167, 139, 250, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(30, 41, 59, 0.92));
}

.contest-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.18);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2);
}

.contest-arena .contest-icon {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22);
}

.contest-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.contest-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contest-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contest-value {
  display: grid;
  place-items: center;
  min-width: 56px;
  min-height: 40px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.54);
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 880;
}

.leaderboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(251, 191, 36, 0.44);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 86% 12%, rgba(251, 191, 36, 0.38), transparent 32%),
    radial-gradient(circle at 12% 18%, rgba(20, 184, 166, 0.26), transparent 34%),
    linear-gradient(135deg, rgba(35, 23, 4, 0.92), rgba(15, 23, 42, 0.96) 44%, rgba(8, 13, 24, 0.92));
  box-shadow: 0 18px 42px rgba(251, 191, 36, 0.16), var(--shadow-soft);
}

.leaderboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.11) 44%, transparent 56%);
  transform: translateX(-120%);
  animation: contestShine 4.2s ease-in-out infinite;
  pointer-events: none;
}

.leaderboard-hero > * {
  position: relative;
  z-index: 1;
}

.leaderboard-hero h2 {
  color: #fff7d6;
  font-size: 26px;
}

.leaderboard-hero span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 730;
}

.leaderboard-hero strong {
  display: grid;
  place-items: center;
  min-width: 74px;
  min-height: 74px;
  border: 1px solid rgba(251, 191, 36, 0.58);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(20, 184, 166, 0.16)),
    rgba(8, 13, 24, 0.62);
  color: #fde68a;
  font-size: 26px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(251, 191, 36, 0.16);
}

#leaderboard .tool-panel {
  border-color: rgba(251, 191, 36, 0.22);
}

#leaderboardList .data-item {
  border-color: rgba(251, 191, 36, 0.14);
}

#leaderboardList .data-item:nth-child(1) {
  border-color: rgba(251, 191, 36, 0.46);
  background:
    radial-gradient(circle at 92% 8%, rgba(251, 191, 36, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.9));
  box-shadow: 0 14px 30px rgba(251, 191, 36, 0.12), var(--shadow-soft);
}

#leaderboardList .data-item:nth-child(1) .item-title {
  color: #fde68a;
  font-size: 17px;
}

#leaderboardList .data-item:nth-child(2),
#leaderboardList .data-item:nth-child(3) {
  border-color: rgba(94, 234, 212, 0.26);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(15, 23, 42, 0.82));
}

:root[data-theme="kitty"] .app-header,
:root[data-theme="kitty"] .top-tabs,
:root[data-theme="kitty"] .bottom-nav {
  border-color: rgba(255, 79, 163, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 249, 253, 0.96), rgba(255, 231, 243, 0.92));
  box-shadow: 0 12px 28px rgba(219, 39, 119, 0.12);
}

:root[data-theme="kitty"] h1,
:root[data-theme="kitty"] h2 {
  color: #36142c;
}

:root[data-theme="kitty"] .brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, #ff4fa3 0, #ff88c2 54%, #ffd43b 100%);
  color: #4a1738;
  box-shadow: 0 16px 30px rgba(255, 79, 163, 0.32), 0 6px 14px rgba(255, 212, 59, 0.22);
}

:root[data-theme="kitty"] .brand-mark::after {
  content: "\2661";
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(219, 39, 119, 0.22);
  border-radius: 999px;
  background: #fff;
  color: #ff4fa3;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(219, 39, 119, 0.18);
}

:root[data-theme="kitty"] .brand-kitty {
  position: absolute;
  left: 26px;
  top: -8px;
  z-index: 2;
  display: block;
  width: 32px;
  height: 27px;
  border: 1px solid rgba(219, 39, 119, 0.22);
  border-radius: 46% 46% 44% 44%;
  background: #fff;
  box-shadow: 0 8px 18px rgba(219, 39, 119, 0.2);
  pointer-events: none;
}

:root[data-theme="kitty"] .brand-kitty::before,
:root[data-theme="kitty"] .brand-kitty::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(219, 39, 119, 0.22);
  border-right: 0;
  border-bottom: 0;
  border-radius: 3px;
  background: #fff;
  transform: rotate(45deg);
}

:root[data-theme="kitty"] .brand-kitty::before {
  left: 4px;
}

:root[data-theme="kitty"] .brand-kitty::after {
  right: 4px;
}

:root[data-theme="kitty"] .kitty-bow {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 14px;
  height: 10px;
}

:root[data-theme="kitty"] .kitty-bow::before,
:root[data-theme="kitty"] .kitty-bow::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 7px 2px 7px 2px;
  background: #ff4fa3;
  box-shadow: inset 0 -1px 0 rgba(74, 23, 56, 0.12);
}

:root[data-theme="kitty"] .kitty-bow::before {
  left: 0;
  transform: rotate(-28deg);
}

:root[data-theme="kitty"] .kitty-bow::after {
  right: 0;
  transform: rotate(28deg);
}

:root[data-theme="kitty"] .kitty-eye,
:root[data-theme="kitty"] .kitty-nose {
  position: absolute;
  display: block;
}

:root[data-theme="kitty"] .kitty-eye {
  top: 12px;
  width: 3px;
  height: 5px;
  border-radius: 999px;
  background: #36142c;
}

:root[data-theme="kitty"] .kitty-eye.left {
  left: 9px;
}

:root[data-theme="kitty"] .kitty-eye.right {
  right: 9px;
}

:root[data-theme="kitty"] .kitty-nose {
  left: 50%;
  top: 16px;
  width: 5px;
  height: 4px;
  border-radius: 999px;
  background: #ffd43b;
  transform: translateX(-50%);
}

:root[data-theme="kitty"] .role-pill,
:root[data-theme="kitty"] .soft-pill,
:root[data-theme="kitty"] .badge {
  border-color: rgba(255, 79, 163, 0.34);
  background: rgba(255, 231, 243, 0.86);
  color: #9d174d;
}

:root[data-theme="kitty"] .theme-select,
:root[data-theme="kitty"] button,
:root[data-theme="kitty"] .button-link {
  border-color: rgba(255, 79, 163, 0.32);
}

:root[data-theme="kitty"] .balance-hero,
:root[data-theme="kitty"] .metric,
:root[data-theme="kitty"] .tool-panel,
:root[data-theme="kitty"] .notice,
:root[data-theme="kitty"] .section-menu-btn,
:root[data-theme="kitty"] .section-sheet {
  background:
    linear-gradient(180deg, rgba(255, 250, 253, 0.98), rgba(255, 233, 244, 0.96)),
    var(--surface);
  box-shadow: 0 16px 34px rgba(219, 39, 119, 0.14);
}

:root[data-theme="kitty"] .balance-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.22), rgba(255, 155, 208, 0.18) 52%, rgba(255, 212, 59, 0.2)),
    var(--surface);
}

:root[data-theme="kitty"] .balance-hero::after {
  content: "\2661";
  position: absolute;
  right: 14px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 82px;
  height: 62px;
  border: 1px solid rgba(219, 39, 119, 0.1);
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 34% 45%, #36142c 0 3px, transparent 4px),
    radial-gradient(circle at 66% 45%, #36142c 0 3px, transparent 4px),
    radial-gradient(ellipse at 50% 58%, #ffd43b 0 6px, transparent 7px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  color: rgba(255, 79, 163, 0.56);
  font-size: 16px;
  box-shadow: 0 12px 26px rgba(219, 39, 119, 0.1);
  opacity: 0.58;
  pointer-events: none;
}

:root[data-theme="kitty"] .balance-hero::before {
  content: "";
  position: absolute;
  right: 67px;
  bottom: 61px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
  transform: rotate(45deg);
  opacity: 0.62;
}

:root[data-theme="kitty"] .data-item {
  border-color: rgba(255, 79, 163, 0.24);
  box-shadow: 0 10px 24px rgba(219, 39, 119, 0.1);
}

:root[data-theme="kitty"] .managed-bot-card {
  border-color: rgba(255, 79, 163, 0.24);
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 205, 229, 0.82), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 240, 248, 0.94));
  box-shadow: 0 14px 28px rgba(219, 39, 119, 0.12);
}

:root[data-theme="kitty"] .managed-bot-icon,
:root[data-theme="kitty"] .managed-bot-status,
:root[data-theme="kitty"] .managed-bot-access summary b {
  color: #db2777;
  border-color: rgba(255, 79, 163, 0.28);
  background: rgba(255, 231, 243, 0.82);
}

:root[data-theme="kitty"] .managed-bot-card.bad .managed-bot-icon,
:root[data-theme="kitty"] .managed-bot-card.bad .managed-bot-status {
  color: #be123c;
  background: rgba(255, 228, 230, 0.84);
}

:root[data-theme="kitty"] .managed-bot-hint,
:root[data-theme="kitty"] .managed-bot-access,
:root[data-theme="kitty"] .bot-access-chip,
:root[data-theme="kitty"] .bot-tech-button {
  border-color: rgba(255, 79, 163, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="kitty"] .brand-mark,
:root[data-theme="kitty"] .primary,
:root[data-theme="kitty"] .button-link {
  background: linear-gradient(135deg, #ff4fa3, #ff8cc8 56%, #ffd43b);
  color: #4a1738;
  box-shadow: 0 14px 28px rgba(255, 79, 163, 0.26), 0 6px 16px rgba(255, 212, 59, 0.18);
}

:root[data-theme="kitty"] .primary:hover,
:root[data-theme="kitty"] .top-tabs button.active {
  border-color: rgba(219, 39, 119, 0.36);
  background: linear-gradient(135deg, #ff3f9b, #ff74bb 56%, #ffd43b);
  color: #4a1738;
}

:root[data-theme="kitty"] .quick-actions .quick-game,
:root[data-theme="kitty"] .quick-actions [data-tab="leaderboard"],
:root[data-theme="kitty"] .contest-card,
:root[data-theme="kitty"] .leaderboard-hero {
  border-color: rgba(255, 79, 163, 0.28);
  background:
    radial-gradient(circle at 94% 10%, rgba(255, 212, 59, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(255, 249, 253, 0.96), rgba(255, 231, 243, 0.9));
  color: #4a1738;
  box-shadow: 0 14px 28px rgba(219, 39, 119, 0.13);
}

:root[data-theme="kitty"] .contest-arena {
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 212, 59, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(255, 231, 243, 0.96), rgba(255, 250, 253, 0.92));
}

:root[data-theme="kitty"] .contest-icon,
:root[data-theme="kitty"] .contest-arena .contest-icon {
  background: rgba(255, 79, 163, 0.14);
  color: #db2777;
  box-shadow: inset 0 0 0 1px rgba(255, 79, 163, 0.18);
}

:root[data-theme="kitty"] .contest-copy strong,
:root[data-theme="kitty"] .leaderboard-hero h2 {
  color: #36142c;
}

:root[data-theme="kitty"] .contest-copy small,
:root[data-theme="kitty"] .leaderboard-hero span {
  color: #9d174d;
}

:root[data-theme="kitty"] .contest-value,
:root[data-theme="kitty"] .leaderboard-hero strong {
  border-color: rgba(255, 79, 163, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.12), rgba(255, 212, 59, 0.16)),
    rgba(255, 255, 255, 0.74);
  color: #db2777;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

:root[data-theme="kitty"] #leaderboard .tool-panel {
  border-color: rgba(255, 79, 163, 0.26);
}

:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(1) {
  position: relative;
  overflow: hidden;
  padding-right: 98px;
  border-color: rgba(255, 79, 163, 0.34);
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 212, 59, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 231, 243, 0.98), rgba(255, 255, 255, 0.86));
  box-shadow: 0 14px 28px rgba(219, 39, 119, 0.14);
}

:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(1)::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 35px;
  z-index: 2;
  width: 34px;
  height: 24px;
  background:
    radial-gradient(circle at 6px 5px, #fff7cf 0 3px, transparent 4px),
    radial-gradient(circle at 17px 1px, #fff7cf 0 3px, transparent 4px),
    radial-gradient(circle at 28px 5px, #fff7cf 0 3px, transparent 4px),
    linear-gradient(135deg, #ffd43b, #ff9f1c);
  clip-path: polygon(0 100%, 0 42%, 18% 68%, 32% 20%, 50% 64%, 68% 20%, 82% 68%, 100% 42%, 100% 100%);
  filter: drop-shadow(0 5px 8px rgba(219, 39, 119, 0.22));
}

:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(1)::after {
  content: "";
  position: absolute;
  top: 31px;
  right: 20px;
  z-index: 1;
  width: 64px;
  height: 54px;
  border: 1px solid rgba(219, 39, 119, 0.2);
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 23px 28px, #36142c 0 2px, transparent 3px),
    radial-gradient(circle at 41px 28px, #36142c 0 2px, transparent 3px),
    radial-gradient(ellipse at 32px 36px, #ff74bb 0 4px, transparent 5px),
    radial-gradient(ellipse at 19px 37px, rgba(255, 116, 187, 0.24) 0 7px, transparent 8px),
    radial-gradient(ellipse at 45px 37px, rgba(255, 116, 187, 0.24) 0 7px, transparent 8px),
    linear-gradient(180deg, #fff 0, #fff7fb 100%);
  box-shadow: 0 12px 26px rgba(219, 39, 119, 0.18);
  clip-path: polygon(0 23%, 15% 0, 29% 22%, 50% 10%, 71% 22%, 85% 0, 100% 23%, 100% 100%, 0 100%);
  transform: rotate(4deg);
}

:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(1) .item-title {
  color: #db2777;
}

:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(2),
:root[data-theme="kitty"] #leaderboardList .data-item:nth-child(3) {
  border-color: rgba(255, 79, 163, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 231, 243, 0.9), rgba(255, 255, 255, 0.82));
}

:root[data-theme="kitty"] .top-tabs button,
:root[data-theme="kitty"] .section-grid button {
  border-color: rgba(255, 79, 163, 0.28);
  background: rgba(255, 255, 255, 0.76);
  color: #9d174d;
  box-shadow: 0 8px 18px rgba(219, 39, 119, 0.1);
}

:root[data-theme="kitty"] .bottom-nav button.active {
  border-color: rgba(255, 79, 163, 0.46);
  background: linear-gradient(180deg, rgba(255, 231, 243, 0.96), rgba(255, 203, 226, 0.86));
  color: #db2777;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64), 0 8px 16px rgba(219, 39, 119, 0.12);
}

:root[data-theme="kitty"] input,
:root[data-theme="kitty"] select,
:root[data-theme="kitty"] textarea,
:root[data-theme="kitty"] input[type="file"],
:root[data-theme="kitty"] .method-preview,
:root[data-theme="kitty"] .form-hint,
:root[data-theme="kitty"] .data-item {
  background: rgba(255, 255, 255, 0.84);
}

:root[data-theme="kitty"] input[type="file"]::file-selector-button {
  background: rgba(255, 240, 247, 0.94);
  color: #4a1738;
}

:root[data-theme="kitty"] .badge.pending {
  border-color: rgba(255, 190, 11, 0.42);
  background: rgba(255, 241, 184, 0.7);
  color: #a15c00;
}

:root[data-theme="kitty"] .badge.waiting_payment {
  border-color: rgba(14, 165, 233, 0.32);
  background: rgba(224, 242, 254, 0.84);
  color: #0369a1;
}

:root[data-theme="kitty"] .badge.approved,
:root[data-theme="kitty"] .badge.done,
:root[data-theme="kitty"] .badge.queued,
:root[data-theme="kitty"] .badge.processing {
  border-color: rgba(16, 185, 129, 0.34);
  background: rgba(209, 250, 229, 0.78);
  color: #047857;
}

:root[data-theme="kitty"] .badge.rejected,
:root[data-theme="kitty"] .badge.failed,
:root[data-theme="kitty"] .badge.refunded,
:root[data-theme="kitty"] .badge.expired {
  border-color: rgba(225, 29, 72, 0.32);
  background: rgba(255, 228, 230, 0.8);
  color: #be123c;
}

:root[data-theme="kitty"] .danger {
  border-color: rgba(225, 29, 72, 0.34);
  background: rgba(255, 228, 230, 0.56);
}

:root[data-theme="kitty"] .toast {
  min-height: 48px;
  padding-left: 44px;
  border-color: rgba(255, 79, 163, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 250, 253, 0.98), rgba(255, 231, 243, 0.96)),
    #fff9fd;
  color: #4a1738;
  box-shadow: 0 18px 36px rgba(219, 39, 119, 0.18);
}

:root[data-theme="kitty"] .toast::before {
  content: "\2661";
  position: absolute;
  left: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4fa3, #ff8cc8);
  color: #fff;
  font-size: 13px;
  transform: translateY(-50%);
  box-shadow: 0 6px 14px rgba(219, 39, 119, 0.2);
}

.ghost-btn {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--accent-dark);
}

.tool-panel {
  padding: 14px;
  min-width: 0;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(13, 20, 34, 0.96)),
    var(--surface);
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.item-list {
  display: grid;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
}

.data-item {
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  box-shadow: none;
  background: rgba(13, 20, 34, 0.86);
}

.item-row {
  min-width: 0;
  max-width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.item-row > div {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}

.item-title {
  font-weight: 780;
  line-height: 1.25;
  word-break: break-word;
}

.item-meta,
.item-subline {
  color: var(--muted);
  font-size: 13px;
}

.item-meta {
  margin-top: 5px;
  word-break: break-word;
}

.item-subline {
  margin-top: 8px;
  word-break: break-word;
}

.item-extra {
  margin-top: 10px;
}

.item-actions {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 12px;
}

.item-actions button,
.item-actions .button-link {
  min-height: 38px;
  padding: 0 12px;
  font-weight: 760;
}

.bot-admin-field {
  display: grid;
  gap: 4px;
  min-width: 138px;
  flex: 1 1 160px;
}

.bot-admin-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.bot-admin-field input {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
}

.bot-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bot-access-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.bot-access-chip button {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  width: 26px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  background: rgba(248, 113, 113, 0.12);
}

.managed-bot-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.94), rgba(8, 13, 24, 0.92)),
    var(--surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.managed-bot-card.ok {
  border-color: rgba(45, 212, 191, 0.25);
}

.managed-bot-card.warn {
  border-color: rgba(251, 191, 36, 0.28);
}

.managed-bot-card.bad {
  border-color: rgba(248, 113, 113, 0.34);
}

.managed-bot-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.managed-bot-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #9af7e8;
  background: rgba(20, 184, 166, 0.14);
}

.managed-bot-card.bad .managed-bot-icon {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
}

.managed-bot-card.warn .managed-bot-icon {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
}

.managed-bot-title {
  min-width: 0;
}

.managed-bot-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
}

.managed-bot-title p,
.managed-bot-hint,
.bot-access-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.managed-bot-status {
  justify-self: end;
  max-width: 118px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 999px;
  color: #9af7e8;
  background: rgba(20, 184, 166, 0.11);
  font-size: 12px;
  font-weight: 860;
  text-align: center;
}

.managed-bot-card.bad .managed-bot-status {
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.11);
}

.managed-bot-card.warn .managed-bot-status {
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.11);
}

.managed-bot-hint {
  min-height: 20px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.46);
}

.managed-bot-actions,
.managed-bot-access-form {
  display: grid;
  gap: 8px;
}

.managed-bot-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.managed-bot-access-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.managed-bot-actions button,
.managed-bot-access-form button {
  min-height: 44px;
  font-weight: 860;
}

.managed-bot-actions .icon-only {
  display: grid;
  place-items: center;
  padding: 0;
}

.managed-bot-actions .icon-only i[data-lucide] {
  width: 20px;
  height: 20px;
}

.managed-bot-access {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(7, 10, 18, 0.24);
  overflow: hidden;
}

.managed-bot-access summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 820;
  list-style: none;
}

.managed-bot-access summary::-webkit-details-marker {
  display: none;
}

.managed-bot-access summary b {
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  font-size: 12px;
  text-align: center;
}

.managed-bot-access-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.managed-bot-access-form .bot-admin-field {
  min-width: 0;
}

.managed-bot-access-form .bot-admin-field input {
  min-height: 44px;
}

.bot-tech-button {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.52);
}

@media (max-width: 560px) {
  .managed-bot-top {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .managed-bot-status {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
  }

  .managed-bot-actions,
  .managed-bot-access-form {
    grid-template-columns: 1fr;
  }
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 10, 18, 0.34);
}

.segmented-control button {
  min-height: 34px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.segmented-control button.active {
  background: linear-gradient(135deg, rgba(25, 198, 163, 0.2), rgba(56, 189, 248, 0.2));
  color: var(--text);
  border-color: rgba(25, 198, 163, 0.38);
}

.finance-chart-panel {
  overflow: hidden;
}

.finance-chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.finance-chart-summary span,
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 20, 34, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.finance-chart {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(7, 10, 18, 0.42)),
    rgba(7, 10, 18, 0.38);
  padding: 10px;
}

.finance-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 210px;
}

.chart-grid {
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 1;
}

.chart-zero {
  stroke: rgba(238, 244, 255, 0.24);
  stroke-width: 1.2;
}

.chart-y-label,
.chart-x-label {
  fill: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-bar {
  fill: rgba(56, 189, 248, 0.28);
  stroke: rgba(56, 189, 248, 0.5);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.profit,
.chart-point.profit,
.legend-profit {
  stroke: var(--accent);
  background: var(--accent);
}

.chart-line.cash,
.chart-point.cash,
.legend-cash {
  stroke: var(--amber);
  background: var(--amber);
}

.chart-point {
  fill: var(--surface);
  stroke-width: 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chart-legend i {
  width: 12px;
  height: 8px;
  border-radius: 999px;
}

.legend-bar {
  background: rgba(56, 189, 248, 0.58);
}

.finance-detail-list {
  gap: 8px;
}

.finance-breakdown {
  display: grid;
  gap: 9px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 20, 34, 0.72);
}

.breakdown-row strong,
.breakdown-row em {
  display: block;
  font-style: normal;
  font-weight: 800;
}

.breakdown-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.breakdown-row em.positive {
  color: var(--ok);
}

.breakdown-row em.negative {
  color: var(--danger);
}

.breakdown-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.breakdown-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.breakdown-track i.positive {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.breakdown-track i.negative {
  background: linear-gradient(90deg, var(--danger), var(--amber));
}

:root[data-theme="kitty"] .segmented-control,
:root[data-theme="kitty"] .finance-chart,
:root[data-theme="kitty"] .finance-chart-summary span,
:root[data-theme="kitty"] .chart-legend span,
:root[data-theme="kitty"] .breakdown-row {
  background: rgba(255, 249, 253, 0.84);
  border-color: rgba(244, 114, 182, 0.28);
}

:root[data-theme="kitty"] .segmented-control button.active {
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.2), rgba(255, 212, 59, 0.22));
  border-color: rgba(255, 79, 163, 0.4);
}

:root[data-theme="kitty"] .chart-grid {
  stroke: rgba(219, 39, 119, 0.14);
}

:root[data-theme="kitty"] .chart-zero {
  stroke: rgba(74, 23, 56, 0.22);
}

:root[data-theme="kitty"] .chart-bar {
  fill: rgba(255, 155, 208, 0.38);
  stroke: rgba(255, 79, 163, 0.48);
}

:root[data-theme="kitty"] .chart-point {
  fill: #fff9fd;
}

.assignment-panel {
  scroll-margin-top: calc(88px + env(safe-area-inset-top));
}

.badge.pending {
  border-color: rgba(251, 191, 36, 0.38);
  background: rgba(251, 191, 36, 0.13);
  color: var(--amber);
}

.badge.waiting_payment {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.badge.approved,
.badge.done,
.badge.queued,
.badge.processing {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(52, 211, 153, 0.12);
  color: var(--ok);
}

.badge.rejected,
.badge.failed,
.badge.refunded,
.badge.expired {
  border-color: rgba(251, 113, 133, 0.38);
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
}

.badge.off {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

.danger {
  border-color: rgba(251, 113, 133, 0.42);
  color: var(--danger);
}

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

.filter-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr) minmax(120px, 0.5fr);
  gap: 10px;
  align-items: end;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filter-chip-row button {
  flex: 1 1 116px;
  min-width: 116px;
  min-height: 50px;
  padding: 0 14px;
  font-weight: 800;
}

.filter-chip-row button.active {
  border-color: rgba(94, 234, 212, 0.54);
  background: rgba(20, 184, 166, 0.18);
  color: var(--accent-dark);
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.compact-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.inline-controls {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.team-admin-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.team-admin-note textarea {
  min-height: 74px;
}

.team-admin-note button {
  align-self: stretch;
}

.team-cashier-access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.38);
}

.team-cashier-access span {
  display: block;
  color: var(--muted);
  font-weight: 760;
  font-size: 13px;
}

.team-cashier-access strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
}

.team-cashier-access.enabled {
  border-color: rgba(94, 234, 212, 0.34);
  background: rgba(20, 184, 166, 0.12);
}

.team-cashier-access button {
  min-height: 46px;
}

:root[data-theme="kitty"] .team-cashier-access {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(244, 114, 182, 0.28);
}

:root[data-theme="kitty"] .team-cashier-access.enabled {
  background: linear-gradient(135deg, rgba(255, 240, 246, 0.9), rgba(254, 249, 195, 0.72));
  border-color: rgba(236, 72, 153, 0.3);
}

.admin-only-note,
.admin-note-line,
.direct-admin-note {
  color: var(--accent-dark);
}

.admin-note-line {
  display: inline-flex;
  max-width: 100%;
  align-items: flex-start;
  gap: 5px;
  font-weight: 760;
  white-space: normal;
}

.admin-note-line i {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  flex: 0 0 14px;
}

.admin-note-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.direct-admin-note {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.08);
}

.direct-admin-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.direct-admin-note strong {
  color: var(--text);
  white-space: pre-wrap;
}

.method-editor {
  margin-top: 2px;
}

.memo-box {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  color: var(--text);
  word-break: break-word;
}

.method-preview,
.form-hint {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.46);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.method-preview {
  display: grid;
  gap: 4px;
}

.method-preview strong {
  color: var(--text);
  font-size: 14px;
}

.method-preview small {
  display: block;
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 690;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.82);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

input[type="file"] {
  padding: 8px;
  background: rgba(8, 13, 24, 0.82);
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, 0.94);
  color: var(--text);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: var(--focus);
}

.wide,
.span-2 {
  grid-column: 1 / -1;
}

.soft-note {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.58);
}

.soft-note b {
  font-size: 15px;
}

.soft-note span {
  color: var(--muted);
  font-size: 13px;
}

.soft-note button {
  justify-self: start;
}

.item-list > .wide {
  width: 100%;
  margin-top: 10px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

.chip-row button {
  min-width: max-content;
  min-height: 42px;
  padding: 0 13px;
  font-weight: 760;
}

.chip-row button.active {
  border-color: rgba(94, 234, 212, 0.44);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
}

.chip-row.is-loading button {
  cursor: wait;
}

.payment-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}

.payment-mode-switch button {
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  font-weight: 820;
}

.payment-mode-switch button.active {
  border-color: rgba(94, 234, 212, 0.52);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(14, 165, 233, 0.16));
  color: var(--text);
}

.cashier-result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(14, 165, 233, 0.08));
}

.cashier-result h3 {
  margin: 0;
  font-size: 17px;
}

.cashier-result p {
  margin: 0;
  color: var(--muted);
}

.cashier-result .item-actions {
  margin-top: 0;
}

.cashier-result .cashier-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-dark);
  font-weight: 760;
}

#leaderboardPeriods.is-loading button.active {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12), 0 8px 18px rgba(251, 191, 36, 0.1);
}

.progress {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  max-width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.roulette-panel {
  overflow: hidden;
}

.roulette-hero {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(56, 189, 248, 0.08) 38%, rgba(244, 114, 182, 0.11)),
    linear-gradient(180deg, #101725, #080b13 72%);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.44);
}

.roulette-hero > *,
.roulette-stat-row,
.roulette-modes,
.roulette-drop,
.roulette-prize-strip {
  min-width: 0;
  max-width: 100%;
}

.roulette-hero-head,
.roulette-stat-row {
  display: flex;
  align-items: center;
}

.roulette-hero-head {
  justify-content: space-between;
  gap: 12px;
}

.roulette-hero h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.roulette-hero .soft-pill {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(15, 23, 42, 0.76);
  color: #dffdf8;
}

.roulette-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.roulette-stat-row article {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(8, 13, 24, 0.76));
  padding: 9px 10px;
}

.roulette-stat-row span {
  display: block;
  color: #90a1ba;
  font-size: 11px;
  font-weight: 760;
}

.roulette-stat-row strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  line-height: 1;
}

.roulette-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  position: relative;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(8, 13, 24, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.roulette-mode-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon sub";
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  min-height: 62px;
  padding: 9px 9px;
  overflow: hidden;
  position: relative;
  text-align: left;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  transform: translateZ(0);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.roulette-mode-card::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  opacity: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(45, 212, 191, 0.22), rgba(56, 189, 248, 0.14));
  transition: opacity 180ms ease;
}

.roulette-mode-card:active {
  transform: scale(0.98);
}

.roulette-mode-card.active {
  border-color: rgba(45, 212, 191, 0.58);
  background:
    linear-gradient(180deg, rgba(17, 45, 55, 0.96), rgba(9, 24, 33, 0.9));
  color: #dffdf8;
  box-shadow:
    inset 0 0 0 1px rgba(125, 249, 232, 0.12),
    0 12px 24px rgba(20, 184, 166, 0.12);
}

.roulette-mode-card.active::before {
  opacity: 1;
}

.mode-icon {
  grid-area: icon;
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.12);
  color: #9fb0c7;
}

.mode-icon i[data-lucide] {
  width: 17px;
  height: 17px;
}

.roulette-mode-card.active .mode-icon {
  background: rgba(45, 212, 191, 0.18);
  color: #5eead4;
}

.roulette-modes strong {
  grid-area: title;
  position: relative;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-modes small {
  grid-area: sub;
  position: relative;
  color: var(--muted);
  overflow: hidden;
  font-size: 10px;
  font-weight: 740;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-mode-card.active small {
  color: #8cfdec;
}

.mode-badge {
  position: relative;
  grid-column: 1 / -1;
  justify-self: start;
  display: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.12);
  color: #8cfdec;
  font-size: 10px;
  font-weight: 850;
}

.roulette-drop {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 0, rgba(45, 212, 191, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(8, 13, 24, 0.92), rgba(4, 7, 13, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.roulette-drop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.22) 46%, transparent 56% 100%);
  transform: translateX(-120%);
}

.roulette-drop::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(45, 212, 191, 0.86) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 62%, rgba(56, 189, 248, 0.82) 0 2px, transparent 3px),
    radial-gradient(circle at 52% 22%, rgba(253, 224, 71, 0.86) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 58%, rgba(244, 114, 182, 0.78) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 34%, rgba(94, 234, 212, 0.82) 0 2px, transparent 3px);
  transform: scale(0.72);
}

.roulette-drop-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.roulette-drop-top span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.roulette-drop-top strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-reel-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 116px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(8, 13, 24, 0.98), transparent 16%, transparent 84%, rgba(8, 13, 24, 0.98)),
    linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.06));
}

.roulette-reel-shell::before,
.roulette-reel-shell::after {
  content: "";
  position: absolute;
  top: 0;
  z-index: 3;
  width: 52px;
  height: 100%;
  pointer-events: none;
}

.roulette-reel-shell::before {
  left: 0;
  background: linear-gradient(90deg, rgba(4, 7, 13, 0.96), transparent);
}

.roulette-reel-shell::after {
  right: 0;
  background: linear-gradient(270deg, rgba(4, 7, 13, 0.96), transparent);
}

.roulette-reel-marker {
  position: absolute;
  left: 50%;
  top: 7px;
  bottom: 7px;
  z-index: 4;
  width: 112px;
  border: 1px solid rgba(45, 212, 191, 0.58);
  border-radius: var(--radius);
  transform: translateX(-50%);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.08),
    0 0 34px rgba(45, 212, 191, 0.18);
  pointer-events: none;
}

.roulette-reel-marker::before,
.roulette-reel-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  border-inline: 9px solid transparent;
  transform: translateX(-50%);
}

.roulette-reel-marker::before {
  top: -1px;
  border-top: 12px solid #2dd4bf;
}

.roulette-reel-marker::after {
  bottom: -1px;
  border-bottom: 12px solid #2dd4bf;
}

.roulette-reel-track {
  --reel-offset: 0px;
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 0;
  transform: translate3d(calc(var(--reel-offset) - 50px), 0, 0);
  transition: transform 1550ms cubic-bezier(0.08, 0.86, 0.13, 1);
  will-change: transform;
}

.roulette-reel-track.no-transition {
  transition: none !important;
}

.roulette-reel-track.is-running {
  transition: none !important;
}

.roulette-reel-track.is-settling {
  transition: transform 3180ms cubic-bezier(0.02, 0.78, 0.05, 1) !important;
}

.roulette-hero.is-spinning .roulette-reel-track {
  filter: saturate(1.26) brightness(1.05);
}

.roulette-hero.is-settling .roulette-reel-track {
  transition-duration: 1900ms;
  transition-timing-function: cubic-bezier(0.03, 0.82, 0.08, 1);
}

.roulette-hero.is-spinning .roulette-drop::after {
  opacity: 1;
  animation: rouletteScan 740ms linear infinite;
}

.roulette-hero.is-revealing .roulette-drop::after {
  animation-duration: 1120ms;
}

.roulette-hero.is-spinning .roulette-reel-marker {
  animation: rouletteMarkerPulse 700ms ease-in-out infinite alternate;
}

.roulette-hero.is-spinning .roulette-reel-item {
  animation: rouletteCardPulse 520ms ease-in-out infinite alternate;
}

.roulette-hero.is-windup .roulette-drop {
  animation: rouletteDropBreath 900ms ease-in-out infinite alternate;
}

.roulette-hero.is-impact .roulette-drop::before {
  animation: rouletteConfetti 780ms ease-out;
}

.roulette-hero.is-impact .roulette-reel-item.active {
  animation: roulettePrizeImpact 780ms cubic-bezier(0.18, 0.98, 0.22, 1);
}

.roulette-hero.is-impact .roulette-reel-marker {
  animation: rouletteImpactMarker 680ms ease-out;
}

.roulette-reel-item {
  display: grid;
  flex: 0 0 100px;
  min-height: 78px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.82);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.roulette-reel-item.active {
  border-color: rgba(45, 212, 191, 0.6);
  background:
    linear-gradient(160deg, rgba(45, 212, 191, 0.2), rgba(56, 189, 248, 0.1)),
    rgba(15, 23, 42, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(45, 212, 191, 0.14);
}

.roulette-reel-item strong {
  color: var(--text);
  font-size: 23px;
  line-height: 1;
}

.roulette-reel-item em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.roulette-reel-item.miss strong {
  color: #94a3b8;
}

.roulette-reel-item.soft strong,
.roulette-reel-item.back strong {
  color: #7dd3fc;
}

.roulette-reel-item.profit strong {
  color: #5eead4;
}

.roulette-reel-item.mega strong {
  color: #fde047;
}

.roulette-result {
  min-height: 54px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.56);
  color: var(--muted);
  text-align: center;
}

.roulette-hero.has-result .roulette-result {
  animation: rouletteResultPop 520ms cubic-bezier(0.18, 0.98, 0.22, 1);
}

.roulette-result:empty {
  display: none;
}

.roulette-result strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.roulette-result span,
.roulette-result small {
  font-size: 11px;
  font-weight: 800;
}

.roulette-result.win {
  border-color: rgba(45, 212, 191, 0.3);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(56, 189, 248, 0.08));
}

.roulette-result.flat {
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(14, 165, 233, 0.1);
}

.roulette-result.loss {
  border-color: rgba(244, 114, 182, 0.24);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.13), rgba(251, 191, 36, 0.06));
}

.roulette-spin-btn {
  width: 100%;
  min-height: 58px;
  font-size: 16px;
  border: 0;
  background:
    linear-gradient(135deg, #22c55e, #06b6d4 46%, #8b5cf6);
  background-size: 160% 160%;
  color: #f8fafc;
  box-shadow: 0 16px 32px rgba(6, 182, 212, 0.22), 0 10px 24px rgba(0, 0, 0, 0.34);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.roulette-spin-btn:not(:disabled) {
  animation: rouletteButtonGlow 3.2s ease-in-out infinite;
}

.roulette-spin-btn:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

.roulette-hero.is-spinning .roulette-spin-btn i {
  animation: rouletteIconSpin 900ms linear infinite;
}

.roulette-prize-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 7px;
  overflow: visible;
  padding-bottom: 0;
}

.roulette-prize-strip::-webkit-scrollbar {
  display: none;
}

.roulette-prize-strip span {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  align-content: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(8, 13, 24, 0.72));
  padding: 7px 6px;
  color: var(--muted);
  text-align: center;
}

.roulette-prize-strip span.hit {
  border-color: rgba(0, 245, 212, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 245, 212, 0.12), 0 8px 20px rgba(0, 245, 212, 0.12);
}

.roulette-prize-strip strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1;
}

.roulette-prize-strip em {
  font-style: normal;
  font-size: 10px;
  font-weight: 750;
}

.roulette-prize-strip .miss strong {
  color: #94a3b8;
}

.roulette-prize-strip .soft strong,
.roulette-prize-strip .back strong {
  color: #7dd3fc;
}

.roulette-prize-strip .profit strong {
  color: #00f5d4;
}

.roulette-prize-strip .mega strong {
  color: #fee440;
}

.arena-panel {
  overflow: hidden;
  position: relative;
}

.arena-panel::before {
  content: "";
  position: absolute;
  inset: -45% -20% auto;
  height: 180px;
  background:
    radial-gradient(circle at 22% 35%, rgba(45, 212, 191, 0.28), transparent 34%),
    radial-gradient(circle at 74% 28%, rgba(139, 92, 246, 0.24), transparent 36%);
  pointer-events: none;
}

.arena-panel > * {
  position: relative;
  z-index: 1;
}

.arena-explain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.arena-explain span {
  display: grid;
  gap: 4px;
  min-height: 60px;
  align-content: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.5);
  padding: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.15;
}

.arena-explain strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.18);
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1;
}

.arena-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(139, 92, 246, 0.12)),
    rgba(8, 13, 24, 0.76);
  padding: 14px;
}

.arena-duration-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.58);
  padding: 5px;
}

.arena-duration-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.arena-duration-tabs.is-loading button,
.arena-duration-tabs button:disabled {
  cursor: wait;
  opacity: 1;
}

.arena-duration-tabs button.active {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.28), rgba(139, 92, 246, 0.2)),
    rgba(15, 23, 42, 0.9);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.28);
}

.arena-hero span,
.arena-hero small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.arena-hero strong {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.arena-hero .primary {
  min-width: 132px;
  white-space: nowrap;
}

.arena-stats {
  margin-top: 12px;
}

.arena-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.arena-prizes span {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 54px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.62);
  padding: 9px;
  text-align: center;
}

.arena-prizes strong {
  color: #5eead4;
  font-size: 18px;
  line-height: 1;
}

.arena-prizes em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="kitty"] .arena-panel {
  border-color: rgba(255, 79, 163, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 250, 253, 0.98), rgba(255, 231, 243, 0.96)),
    #fff9fd;
  box-shadow: 0 18px 38px rgba(219, 39, 119, 0.15);
}

:root[data-theme="kitty"] .arena-panel::before {
  inset: -35% -22% auto;
  height: 220px;
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 79, 163, 0.18), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(255, 212, 59, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(255, 155, 208, 0.26), rgba(255, 247, 215, 0.18));
}

:root[data-theme="kitty"] .arena-panel::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 88px;
  z-index: 0;
  width: 48px;
  height: 40px;
  border: 1px solid rgba(219, 39, 119, 0.18);
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 34% 47%, #36142c 0 2px, transparent 3px),
    radial-gradient(circle at 66% 47%, #36142c 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 61%, #ffd43b 0 5px, transparent 6px),
    #fff;
  box-shadow: 0 12px 24px rgba(219, 39, 119, 0.12);
  opacity: 0.7;
  pointer-events: none;
}

:root[data-theme="kitty"] .arena-duration-tabs {
  border-color: rgba(255, 79, 163, 0.22);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="kitty"] .arena-duration-tabs button {
  color: #9d174d;
}

:root[data-theme="kitty"] .arena-duration-tabs button.active {
  background: linear-gradient(135deg, #ff4fa3, #ff8cc8 56%, #ffd43b);
  color: #4a1738;
  box-shadow: 0 10px 22px rgba(219, 39, 119, 0.17), inset 0 0 0 1px rgba(255, 255, 255, 0.66);
}

:root[data-theme="kitty"] .arena-duration-tabs.is-loading button:not(.active) {
  color: rgba(157, 23, 77, 0.58);
}

:root[data-theme="kitty"] .arena-explain span {
  border-color: rgba(255, 79, 163, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: #a54872;
  box-shadow: 0 10px 20px rgba(219, 39, 119, 0.08);
}

:root[data-theme="kitty"] .arena-explain strong {
  background: rgba(255, 79, 163, 0.14);
  color: #db2777;
}

:root[data-theme="kitty"] .arena-hero {
  border-color: rgba(255, 79, 163, 0.23);
  background:
    radial-gradient(circle at 94% 12%, rgba(255, 212, 59, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 231, 243, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 24px rgba(219, 39, 119, 0.1);
}

:root[data-theme="kitty"] .arena-hero span,
:root[data-theme="kitty"] .arena-hero small,
:root[data-theme="kitty"] .arena-prizes em {
  color: #a54872;
}

:root[data-theme="kitty"] .arena-hero strong,
:root[data-theme="kitty"] .arena-prizes strong {
  color: #db2777;
}

:root[data-theme="kitty"] .arena-hero .primary {
  background: linear-gradient(135deg, #ff4fa3, #ff8cc8 56%, #ffd43b);
  color: #4a1738;
}

:root[data-theme="kitty"] .arena-hero .primary:disabled {
  border-color: rgba(255, 79, 163, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.18), rgba(255, 212, 59, 0.18)),
    rgba(255, 255, 255, 0.8);
  color: rgba(74, 23, 56, 0.64);
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

:root[data-theme="kitty"] .arena-stats article,
:root[data-theme="kitty"] .arena-prizes span {
  border-color: rgba(255, 79, 163, 0.2);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(219, 39, 119, 0.1);
}

@keyframes contestShine {
  0%,
  54% {
    transform: translateX(-115%);
  }
  76%,
  100% {
    transform: translateX(115%);
  }
}

@keyframes rouletteScan {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes rouletteMarkerPulse {
  0% {
    box-shadow:
      0 0 0 1px rgba(45, 212, 191, 0.1),
      0 0 26px rgba(45, 212, 191, 0.16);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(45, 212, 191, 0.22),
      0 0 46px rgba(45, 212, 191, 0.34);
  }
}

@keyframes rouletteCardPulse {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-2px) scale(1.015);
  }
}

@keyframes rouletteResultPop {
  0% {
    opacity: 0.5;
    transform: translateY(8px) scale(0.96);
  }
  62% {
    transform: translateY(-2px) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rouletteButtonGlow {
  0%,
  100% {
    background-position: 0% 50%;
    filter: saturate(1);
  }
  50% {
    background-position: 100% 50%;
    filter: saturate(1.14);
  }
}

@keyframes rouletteIconSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rouletteDropBreath {
  0% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 rgba(45, 212, 191, 0);
  }
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 36px rgba(45, 212, 191, 0.13);
  }
}

@keyframes rouletteConfetti {
  0% {
    opacity: 0;
    transform: scale(0.72) translateY(8px);
  }
  32% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.15) translateY(-20px);
  }
}

@keyframes roulettePrizeImpact {
  0% {
    transform: translateY(0) scale(1);
  }
  42% {
    transform: translateY(-6px) scale(1.09);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 18px 42px rgba(45, 212, 191, 0.28);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes rouletteImpactMarker {
  0% {
    transform: translateX(-50%) scale(1);
  }
  40% {
    transform: translateX(-50%) scale(1.08);
    box-shadow:
      0 0 0 1px rgba(45, 212, 191, 0.3),
      0 0 58px rgba(45, 212, 191, 0.42);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

:root[data-theme="kitty"] .roulette-hero {
  border-color: rgba(255, 79, 163, 0.3);
  background:
    radial-gradient(circle at 8% 0, rgba(255, 79, 163, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 231, 243, 0.94) 52%, rgba(255, 243, 197, 0.92)),
    #fff9fd;
  box-shadow: 0 20px 44px rgba(219, 39, 119, 0.16);
}

:root[data-theme="kitty"] .roulette-hero::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 72px;
  width: 54px;
  height: 45px;
  border: 1px solid rgba(219, 39, 119, 0.2);
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 33% 48%, #36142c 0 2px, transparent 3px),
    radial-gradient(circle at 66% 48%, #36142c 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 61%, #ffd43b 0 5px, transparent 6px),
    #fff;
  opacity: 0.72;
  pointer-events: none;
}

:root[data-theme="kitty"] .roulette-hero::before {
  content: "";
  position: absolute;
  right: 17px;
  top: 66px;
  width: 18px;
  height: 13px;
  border-radius: 8px 2px 8px 2px;
  background: #ff4fa3;
  transform: rotate(24deg);
  box-shadow: -10px 0 0 #ff4fa3;
  opacity: 0.84;
}

:root[data-theme="kitty"] .roulette-stat-row article,
:root[data-theme="kitty"] .roulette-mode-card,
:root[data-theme="kitty"] .roulette-prize-strip span {
  border-color: rgba(255, 79, 163, 0.28);
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="kitty"] .roulette-modes {
  border-color: rgba(255, 79, 163, 0.24);
  background: rgba(255, 255, 255, 0.58);
}

:root[data-theme="kitty"] .roulette-hero .soft-pill {
  border-color: rgba(255, 79, 163, 0.34);
  background: rgba(255, 255, 255, 0.74);
  color: #9d174d;
}

:root[data-theme="kitty"] .roulette-mode-card.active {
  border-color: rgba(219, 39, 119, 0.44);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.2), rgba(255, 212, 59, 0.16)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 24px rgba(219, 39, 119, 0.12);
}

:root[data-theme="kitty"] .roulette-mode-card.active small,
:root[data-theme="kitty"] .roulette-mode-card.active .mode-icon,
:root[data-theme="kitty"] .roulette-prize-strip .profit strong,
:root[data-theme="kitty"] .roulette-prize-strip .mega strong {
  color: #db2777;
}

:root[data-theme="kitty"] .mode-icon {
  background: rgba(255, 155, 208, 0.2);
  color: #be185d;
}

:root[data-theme="kitty"] .mode-badge {
  background: rgba(255, 79, 163, 0.14);
  color: #be185d;
}

:root[data-theme="kitty"] .roulette-drop {
  border-color: rgba(255, 79, 163, 0.24);
  background:
    radial-gradient(circle at 24% 0, rgba(255, 79, 163, 0.16), transparent 32%),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="kitty"] .roulette-drop-top {
  border-bottom-color: rgba(255, 79, 163, 0.18);
}

:root[data-theme="kitty"] .roulette-drop-top strong,
:root[data-theme="kitty"] .roulette-reel-item strong,
:root[data-theme="kitty"] .roulette-result strong {
  color: #36142c;
}

:root[data-theme="kitty"] .roulette-reel-shell {
  background:
    linear-gradient(90deg, rgba(255, 240, 248, 0.98), transparent 16%, transparent 84%, rgba(255, 240, 248, 0.98)),
    rgba(255, 255, 255, 0.52);
}

:root[data-theme="kitty"] .roulette-reel-shell::before {
  background: linear-gradient(90deg, rgba(255, 240, 248, 0.96), transparent);
}

:root[data-theme="kitty"] .roulette-reel-shell::after {
  background: linear-gradient(270deg, rgba(255, 240, 248, 0.96), transparent);
}

:root[data-theme="kitty"] .roulette-reel-marker {
  border-color: rgba(255, 79, 163, 0.56);
  box-shadow: 0 0 0 1px rgba(255, 79, 163, 0.08), 0 0 28px rgba(255, 79, 163, 0.17);
}

:root[data-theme="kitty"] .roulette-reel-marker::before {
  border-top-color: #ff4fa3;
}

:root[data-theme="kitty"] .roulette-reel-marker::after {
  border-bottom-color: #ff4fa3;
}

:root[data-theme="kitty"] .roulette-reel-item {
  border-color: rgba(255, 79, 163, 0.2);
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="kitty"] .roulette-reel-item.active {
  border-color: rgba(219, 39, 119, 0.44);
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.18), rgba(255, 212, 59, 0.14)), #fff;
}

:root[data-theme="kitty"] .roulette-reel-item.soft strong,
:root[data-theme="kitty"] .roulette-reel-item.back strong {
  color: #0ea5e9;
}

:root[data-theme="kitty"] .roulette-reel-item.profit strong,
:root[data-theme="kitty"] .roulette-reel-item.mega strong {
  color: #db2777;
}

:root[data-theme="kitty"] .roulette-result {
  border-color: rgba(255, 79, 163, 0.24);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="kitty"] .roulette-result.win {
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.16), rgba(255, 212, 59, 0.16));
}

:root[data-theme="kitty"] .roulette-result.loss {
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.12), rgba(255, 255, 255, 0.8));
}

:root[data-theme="kitty"] .roulette-spin-btn {
  background: linear-gradient(135deg, #ff4fa3, #ff8cc8 58%, #ffd43b);
  color: #4a1738;
  box-shadow: 0 16px 30px rgba(255, 79, 163, 0.24), 0 8px 18px rgba(255, 212, 59, 0.16);
}

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

.chat-shell {
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 0.66fr);
  gap: 12px;
  min-height: 420px;
}

.chat-thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: 520px;
  overflow-y: auto;
}

.chat-thread {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 62px;
  padding: 10px 36px 10px 11px;
  text-align: left;
}

.chat-thread.active {
  border-color: rgba(94, 234, 212, 0.48);
  background: rgba(20, 184, 166, 0.14);
}

.chat-thread span,
.chat-title {
  color: var(--text);
  font-weight: 820;
}

.chat-thread small {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread b {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.chat-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.5);
}

.chat-title {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 190px;
  max-height: 520px;
  overflow-y: auto;
  padding: 12px;
}

.user-chat {
  min-height: 250px;
  max-height: 48vh;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 24, 0.42);
}

.chat-bubble {
  width: fit-content;
  max-width: min(78%, 520px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
}

.chat-bubble.user {
  align-self: flex-end;
  border-color: rgba(94, 234, 212, 0.32);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(56, 189, 248, 0.12));
}

.chat-bubble.admin {
  align-self: flex-start;
}

.chat-bubble small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.chat-bubble small button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  box-shadow: none;
}

.chat-system {
  align-self: center;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 520px);
  padding: 10px 12px;
  border: 1px solid rgba(94, 234, 212, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.12), rgba(56, 189, 248, 0.08));
  color: var(--text);
  overflow-wrap: anywhere;
}

.chat-system small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.chat-reply-preview,
.chat-reply-compose,
.team-chat-pinned {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.team-chat-pinned {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
}

.chat-reply-preview {
  margin-bottom: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.chat-reply-compose {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 8px;
}

.chat-reply-preview div,
.chat-reply-compose div,
.team-chat-pinned div {
  min-width: 0;
}

.chat-reply-preview span,
.chat-reply-compose span,
.team-chat-pinned span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-reply-preview strong,
.chat-reply-compose strong,
.team-chat-pinned strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-chat-pinned button,
.chat-reply-compose button {
  min-height: 36px;
  padding: 0 10px;
}

.nav-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.chat-action,
.chat-delete {
  min-height: 0;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  box-shadow: none;
}

.chat-action {
  color: var(--accent);
}

.chat-delete {
  color: var(--danger);
}

.team-chat-form {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(8, 13, 24, 0.42);
}

.team-chat {
  margin-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.chat-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  min-height: 48px;
}

:root[data-theme="kitty"] .chat-window,
:root[data-theme="kitty"] .user-chat,
:root[data-theme="kitty"] .team-chat-form {
  background: rgba(255, 255, 255, 0.62);
}

:root[data-theme="kitty"] .chat-bubble.admin {
  background: #fff;
}

:root[data-theme="kitty"] .chat-bubble.user {
  border-color: rgba(255, 79, 163, 0.34);
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.2), rgba(255, 212, 59, 0.16));
}

:root[data-theme="kitty"] .chat-system,
:root[data-theme="kitty"] .team-chat-pinned,
:root[data-theme="kitty"] .chat-reply-preview,
:root[data-theme="kitty"] .chat-reply-compose {
  border-color: rgba(255, 79, 163, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 226, 242, 0.82));
}

:root[data-theme="kitty"] .nav-badge {
  border-color: rgba(255, 79, 163, 0.44);
  background: linear-gradient(135deg, #ff4fa3, #ffd43b);
  color: #4a1738;
}

.chat-panel {
  overflow: hidden;
  padding: 0;
  border-color: rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(13, 18, 30, 0.98), rgba(7, 10, 18, 0.98)),
    var(--surface);
}

.chat-panel > .panel-head {
  min-height: 64px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(14px);
}

.chat-panel > .panel-head h2,
.chat-title {
  font-size: 18px;
  line-height: 1.1;
}

.chat-panel > .panel-head .soft-pill {
  min-height: 30px;
  background: rgba(15, 23, 42, 0.72);
}

.chat-only-back {
  display: none;
  min-width: 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.chat-open-chat {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
}

.chat-open-chat i {
  width: 15px;
  height: 15px;
}

.chat-window {
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(7, 10, 18, 0.94);
}

.chat-title {
  min-height: 48px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(11, 18, 32, 0.82);
}

.chat-messages {
  gap: 6px;
  min-height: 360px;
  max-height: min(64vh, 620px);
  padding: 14px 10px 18px;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.035) 0 25%, transparent 25% 50%, rgba(56, 189, 248, 0.028) 50% 75%, transparent 75%) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(7, 10, 18, 0.96), rgba(9, 15, 26, 0.98));
  scrollbar-width: thin;
}

.user-chat {
  min-height: 390px;
  max-height: min(66vh, 680px);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.chat-bubble {
  position: relative;
  max-width: min(82%, 560px);
  margin: 2px 8px 12px;
  padding: 8px 11px 7px;
  border: 0;
  border-radius: 18px 18px 18px 5px;
  background: #172033;
  color: #eef6ff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.chat-bubble.compact {
  margin-top: -8px;
}

.chat-bubble.user {
  border: 0;
  border-radius: 18px 18px 5px 18px;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #f7fffd;
}

.chat-bubble.admin {
  background: #141c2d;
}

.chat-attachment {
  display: grid;
  width: min(250px, 100%);
  margin: 0 0 7px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-attachment.image img {
  display: block;
  width: 100%;
  max-height: 230px;
  background: rgba(7, 10, 18, 0.62);
  object-fit: contain;
}

.chat-attachment.image span {
  padding: 7px 9px;
  overflow: hidden;
  color: rgba(226, 232, 240, 0.78);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment.file {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
}

.chat-attachment.file i {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.chat-attachment.file span {
  min-width: 0;
}

.chat-attachment.file strong,
.chat-attachment.file em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment.file strong {
  font-size: 13px;
  font-style: normal;
}

.chat-attachment.file em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.chat-attachment.audio {
  gap: 9px;
  width: min(280px, 100%);
  padding: 10px;
}

.chat-audio-title {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.chat-audio-title i {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.chat-audio-title span {
  min-width: 0;
}

.chat-audio-title strong,
.chat-audio-title em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-audio-title strong {
  font-size: 13px;
}

.chat-audio-title em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.chat-attachment.audio audio {
  width: 100%;
  height: 34px;
}

.chat-bubble.pending {
  opacity: 0.72;
  filter: saturate(0.85);
}

@keyframes chatSendingPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.chat-bubble > div:not(.chat-reply-preview) {
  font-size: 14px;
  line-height: 1.34;
}

.chat-bubble small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 3px 6px;
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.62);
  font-size: 10.5px;
  line-height: 1.25;
  text-align: right;
}

.chat-meta-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-receipt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: -2px;
  color: currentColor;
  opacity: 0.78;
  vertical-align: middle;
}

.chat-receipt i {
  width: 14px;
  height: 14px;
  stroke-width: 2.8;
}

.chat-receipt.pending i {
  width: 13px;
  height: 13px;
  animation: chatSendingPulse 1s ease-in-out infinite;
}

.chat-receipt.read {
  color: #67e8f9;
  opacity: 1;
}

.chat-bubble.user .chat-receipt.read {
  color: #a7f3d0;
}

.chat-bubble.user small {
  color: rgba(240, 253, 250, 0.7);
}

.chat-bubble.admin small {
  justify-content: flex-start;
  text-align: left;
}

.chat-bubble small button {
  color: currentColor;
  opacity: 0.86;
}

.chat-reply-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
}

.chat-reply-icon i {
  width: 13px;
  height: 13px;
}

.chat-role {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.78);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.chat-role.admin {
  background: rgba(94, 234, 212, 0.16);
  color: #99f6e4;
}

.chat-system-label {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-new-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 8px 14px;
  color: rgba(148, 163, 184, 0.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-new-divider::before,
.chat-new-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.18);
}

.chat-new-divider span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: rgba(226, 232, 240, 0.82);
}

.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 8px 8px 14px;
}

.chat-date-divider span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: rgba(226, 232, 240, 0.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-jump-bottom {
  position: absolute;
  right: 14px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 6;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--accent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.chat-jump-bottom i {
  width: 18px;
  height: 18px;
}

.chat-reply-preview {
  margin: 0 0 6px;
  padding: 6px 8px;
  width: 100%;
  border: 0;
  border-left: 3px solid rgba(94, 234, 212, 0.88);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  appearance: none;
}

.chat-reply-preview span,
.chat-reply-preview strong {
  color: rgba(255, 255, 255, 0.78);
}

.chat-reply-preview:active {
  transform: scale(0.99);
}

.chat-flash {
  animation: chatFlash 1.35s ease;
}

@keyframes chatFlash {
  0%,
  100% {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    outline: 0 solid transparent;
  }
  22% {
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.34), 0 16px 34px rgba(20, 184, 166, 0.18);
    outline: 1px solid rgba(94, 234, 212, 0.58);
  }
}

.chat-system {
  width: fit-content;
  max-width: min(84%, 560px);
  margin: 10px auto 14px;
  padding: 8px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: rgba(226, 232, 240, 0.88);
  box-shadow: none;
}

.chat-system i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.team-chat-pinned {
  margin: 0;
  padding: 9px 12px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(20, 184, 166, 0.11);
}

.team-chat-pinned strong {
  max-width: 100%;
}

.chat-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 13, 24, 0.72);
}

.chat-search-row > i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.chat-search-row input {
  min-width: 0;
  flex: 1;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.chat-search-row input:focus {
  box-shadow: none;
}

.chat-search-row .icon-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
}

.chat-search-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
}

.chat-search-toggle i {
  width: 17px;
  height: 17px;
}

.team-chat-form,
.chat-form {
  gap: 8px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0;
  background: rgba(11, 18, 32, 0.9);
}

.team-chat-form {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.chat-attachment-draft {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 13px;
  background: rgba(94, 234, 212, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.chat-attachment-draft span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-draft i {
  width: 16px;
  min-width: 16px;
  height: 16px;
}

.chat-attachment-draft button,
.chat-attach-btn,
.chat-voice-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
}

.chat-attachment-draft button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.chat-attach-btn i,
.chat-voice-btn i {
  width: 19px;
  height: 19px;
}

.chat-voice-btn.is-recording {
  border-color: rgba(244, 63, 94, 0.46);
  background: rgba(244, 63, 94, 0.16);
  color: #fb7185;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.08);
}

.team-chat-panel .team-chat-form {
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
}

.team-chat-panel .direct-chat-form {
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
}

.direct-chat-threads {
  grid-auto-flow: column;
  grid-auto-columns: minmax(176px, 42%);
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  padding: 2px 0 10px;
}

.direct-chat-panel .chat-thread {
  min-height: 58px;
}

.chat-search-toggle.active {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(20, 184, 166, 0.16);
  color: #d7fffb;
}

.chat-media-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(7, 10, 18, 0.42);
}

.chat-media-panel.hidden {
  display: none;
}

.chat-media-head,
.direct-chat-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-media-head strong,
.direct-chat-quick-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 880;
}

.chat-media-head span {
  min-width: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.chat-media-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 116px;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.chat-media-item {
  display: grid;
  grid-template-rows: 72px auto auto;
  gap: 5px;
  min-width: 0;
  min-height: 126px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  text-align: left;
}

.chat-media-item img,
.chat-media-item > i {
  width: 100%;
  height: 72px;
  border-radius: 10px;
}

.chat-media-item img {
  object-fit: cover;
}

.chat-media-item > i {
  padding: 20px;
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
}

.chat-media-item span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-media-item em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direct-chat-quick {
  display: grid;
  gap: 10px;
  max-height: 232px;
  overflow-y: auto;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(9, 15, 26, 0.78);
  scrollbar-width: thin;
}

.direct-chat-quick.hidden {
  display: none;
}

.direct-chat-quick-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.direct-chat-quick-head button,
.direct-chat-action-row button,
.direct-chat-balance button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.direct-chat-quick-head button i,
.direct-chat-action-row button i,
.direct-chat-balance button i {
  width: 15px;
  height: 15px;
}

.direct-chat-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.direct-chat-stats article {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.62);
}

.direct-chat-stats span,
.direct-chat-stats em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direct-chat-stats strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direct-chat-balance {
  display: grid;
  grid-template-columns: minmax(76px, 0.75fr) minmax(0, 1fr) auto;
  gap: 7px;
}

.direct-chat-balance input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(7, 10, 18, 0.54);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.direct-chat-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.direct-chat-action-row.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.direct-chat-mini-list {
  display: grid;
  gap: 6px;
}

.direct-chat-mini-list h3 {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.direct-chat-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.54);
}

.direct-chat-mini-item div {
  display: grid;
  min-width: 0;
}

.direct-chat-mini-item strong,
.direct-chat-mini-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direct-chat-mini-item strong {
  color: var(--text);
  font-size: 13px;
}

.direct-chat-mini-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

@media (max-width: 520px) {
  .direct-chat-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .direct-chat-balance {
    grid-template-columns: 1fr 1fr;
  }

  .direct-chat-balance button {
    grid-column: 1 / -1;
  }

  .direct-chat-quick {
    max-height: 210px;
  }
}

.chat-form textarea {
  min-height: 42px;
  max-height: 118px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  resize: none;
}

.chat-form .primary {
  align-self: end;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
}

.chat-form .primary span {
  display: none;
}

.chat-form .primary i {
  width: 20px;
  height: 20px;
}

body.chat-only-mode {
  overflow: hidden;
}

body.chat-only-mode .app-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

body.chat-only-mode .app-header,
body.chat-only-mode #topTabs,
body.chat-only-mode #sectionMenuBtn,
body.chat-only-mode #sectionBackdrop,
body.chat-only-mode #sectionSheet,
body.chat-only-mode .bottom-nav {
  display: none !important;
}

body.chat-only-mode .view:not(.hidden) {
  display: block;
  height: 100dvh;
  padding: 0;
}

body.chat-only-mode #adminComms > *:not(.team-chat-panel) {
  display: none !important;
}

body.chat-only-mode .team-chat-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.chat-only-mode .direct-chat-panel {
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
}

.team-chat-panel {
  position: relative;
}

body.chat-only-mode .team-chat-panel > .panel-head {
  min-height: calc(58px + env(safe-area-inset-top));
  padding: calc(9px + env(safe-area-inset-top)) 10px 9px;
  background: rgba(7, 10, 18, 0.94);
}

body.chat-only-mode .chat-only-back {
  display: inline-flex;
}

body.chat-only-mode .chat-open-chat {
  display: none;
}

body.chat-only-mode .team-chat-panel > .panel-head .eyebrow {
  display: none;
}

body.chat-only-mode .team-chat-panel > .panel-head h2 {
  font-size: 18px;
}

body.chat-only-mode .team-chat-panel .chat-messages {
  min-height: 0;
  max-height: none;
  height: auto;
  margin-bottom: 0;
  padding: 12px 7px calc(92px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

body.chat-only-mode .team-chat-form {
  align-self: end;
  position: relative;
  z-index: 3;
  padding-bottom: calc(9px + env(safe-area-inset-bottom));
}

body.chat-only-mode .direct-chat-threads {
  align-content: stretch;
  grid-auto-columns: minmax(136px, 38vw);
  height: 70px;
  max-height: 70px;
  padding: 6px 10px 8px;
  scroll-padding-inline: 10px;
}

body.chat-only-mode .direct-chat-panel .chat-thread {
  min-height: 54px;
  padding: 8px 30px 8px 10px;
  border-radius: 14px;
}

body.chat-only-mode .direct-chat-panel .chat-thread span,
body.chat-only-mode .direct-chat-panel .chat-thread small {
  max-width: 100%;
}

body.chat-only-mode .team-chat-pinned:not(.hidden) {
  display: flex;
  min-height: 42px;
}

.chat-reply-compose {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.chat-thread-list {
  gap: 6px;
  max-height: 620px;
  padding: 2px;
}

.chat-thread {
  min-height: 58px;
  border-radius: 12px;
  background: transparent;
}

.chat-thread.active {
  border-color: rgba(94, 234, 212, 0.2);
  background: rgba(94, 234, 212, 0.1);
}

:root[data-theme="kitty"] .chat-panel {
  border-color: rgba(255, 79, 163, 0.22);
  background: linear-gradient(180deg, rgba(255, 241, 248, 0.98), rgba(255, 224, 239, 0.98));
}

:root[data-theme="kitty"] .chat-panel > .panel-head,
:root[data-theme="kitty"] .chat-title,
:root[data-theme="kitty"] .team-chat-form,
:root[data-theme="kitty"] .chat-form {
  background: rgba(255, 246, 251, 0.9);
}

:root[data-theme="kitty"] .chat-panel > .panel-head .soft-pill {
  border-color: rgba(255, 79, 163, 0.34);
  background: rgba(255, 231, 243, 0.92);
  color: #d72582;
}

:root[data-theme="kitty"] .chat-messages {
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.045) 0 25%, transparent 25% 50%, rgba(255, 212, 59, 0.055) 50% 75%, transparent 75%) 0 0 / 26px 26px,
    linear-gradient(180deg, #fff4fa, #ffe1ef);
}

:root[data-theme="kitty"] .chat-bubble.admin {
  background: #fff;
  color: #3b1730;
}

:root[data-theme="kitty"] .chat-bubble.user {
  background: linear-gradient(135deg, #ff63ae, #ff93cb 58%, #ffd965);
  color: #42132f;
}

:root[data-theme="kitty"] .chat-attachment {
  border-color: rgba(255, 79, 163, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

:root[data-theme="kitty"] .chat-attachment.image img {
  background: rgba(255, 246, 251, 0.78);
}

:root[data-theme="kitty"] .chat-attachment.image span,
:root[data-theme="kitty"] .chat-attachment.file em,
:root[data-theme="kitty"] .chat-audio-title em {
  color: rgba(74, 23, 56, 0.62);
}

:root[data-theme="kitty"] .chat-attachment.file i,
:root[data-theme="kitty"] .chat-audio-title i {
  color: #d72582;
}

:root[data-theme="kitty"] .chat-attachment-draft {
  border-color: rgba(255, 79, 163, 0.22);
  background: rgba(255, 255, 255, 0.62);
}

:root[data-theme="kitty"] .chat-voice-btn.is-recording {
  border-color: rgba(255, 79, 163, 0.42);
  background: rgba(255, 79, 163, 0.16);
  color: #d72582;
}

:root[data-theme="kitty"] .chat-bubble small,
:root[data-theme="kitty"] .chat-bubble.user small {
  color: rgba(74, 23, 56, 0.56);
}

:root[data-theme="kitty"] .chat-receipt.read,
:root[data-theme="kitty"] .chat-bubble.user .chat-receipt.read {
  color: #d72582;
}

:root[data-theme="kitty"] .chat-reply-preview,
:root[data-theme="kitty"] .chat-reply-compose {
  background: rgba(255, 255, 255, 0.54);
}

:root[data-theme="kitty"] .chat-reply-preview span,
:root[data-theme="kitty"] .chat-reply-preview strong {
  color: #7a2454;
}

:root[data-theme="kitty"] .team-chat-pinned {
  background: rgba(255, 79, 163, 0.12);
}

:root[data-theme="kitty"] .chat-search-row {
  border-color: rgba(255, 79, 163, 0.16);
  background: rgba(255, 246, 251, 0.9);
}

:root[data-theme="kitty"] .chat-search-row input {
  color: #3b1730;
}

:root[data-theme="kitty"] .chat-system {
  background: rgba(255, 255, 255, 0.72);
  color: #7a2454;
}

:root[data-theme="kitty"] .chat-search-toggle.active {
  border-color: rgba(255, 79, 163, 0.34);
  background: rgba(255, 79, 163, 0.14);
  color: #d72582;
}

:root[data-theme="kitty"] .chat-media-panel,
:root[data-theme="kitty"] .direct-chat-quick {
  border-color: rgba(255, 79, 163, 0.14);
  background: rgba(255, 246, 251, 0.88);
}

:root[data-theme="kitty"] .chat-media-item,
:root[data-theme="kitty"] .direct-chat-stats article,
:root[data-theme="kitty"] .direct-chat-mini-item,
:root[data-theme="kitty"] .direct-chat-quick-head button,
:root[data-theme="kitty"] .direct-chat-action-row button,
:root[data-theme="kitty"] .direct-chat-balance button,
:root[data-theme="kitty"] .direct-chat-balance input {
  border-color: rgba(255, 79, 163, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #3b1730;
}

:root[data-theme="kitty"] .chat-media-item > i {
  background: rgba(255, 79, 163, 0.12);
  color: #d72582;
}

:root[data-theme="kitty"] .chat-media-item span {
  color: #d72582;
}

:root[data-theme="kitty"] .chat-media-item em,
:root[data-theme="kitty"] .direct-chat-quick-head span,
:root[data-theme="kitty"] .direct-chat-stats span,
:root[data-theme="kitty"] .direct-chat-stats em,
:root[data-theme="kitty"] .direct-chat-mini-item span,
:root[data-theme="kitty"] .direct-chat-mini-list h3 {
  color: rgba(74, 23, 56, 0.62);
}

:root[data-theme="kitty"] .chat-role {
  background: rgba(255, 79, 163, 0.12);
  color: #9d326d;
}

:root[data-theme="kitty"] .chat-role.admin,
:root[data-theme="kitty"] .chat-system-label {
  color: #d72582;
}

:root[data-theme="kitty"] .chat-new-divider {
  color: rgba(157, 50, 109, 0.72);
}

:root[data-theme="kitty"] .chat-new-divider::before,
:root[data-theme="kitty"] .chat-new-divider::after {
  background: rgba(255, 79, 163, 0.18);
}

:root[data-theme="kitty"] .chat-new-divider span {
  background: rgba(255, 255, 255, 0.78);
  color: #9d326d;
}

:root[data-theme="kitty"] .chat-date-divider span,
:root[data-theme="kitty"] .chat-jump-bottom {
  background: rgba(255, 255, 255, 0.84);
  color: #d72582;
}

:root[data-theme="kitty"] .chat-form textarea {
  background: rgba(255, 255, 255, 0.86);
}

.model-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.toggle-chip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  text-align: left;
}

.toggle-chip.active {
  border-color: rgba(94, 234, 212, 0.44);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
}

.toggle-chip small {
  color: var(--muted);
  font-size: 11px;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.browser-login-gate {
  align-items: flex-start;
  max-width: 520px;
  margin: 24px auto 0;
  padding: 18px;
}

.browser-login-content {
  flex: 1;
  min-width: 0;
}

.browser-login-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.browser-login-form label {
  display: grid;
  gap: 7px;
}

.browser-login-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: min(760px, 100%);
  transform: translateX(-50%);
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(7, 10, 18, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 -18px 34px rgba(0, 0, 0, 0.35);
}

.bottom-nav button {
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 0 2px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 780;
}

.bottom-nav button span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button.active {
  border-color: rgba(94, 234, 212, 0.36);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
}

.admin-bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-bottom-nav button span {
  max-width: calc(100vw / 5 - 14px);
}

body.has-file-viewer {
  overflow: hidden;
}

.file-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.96), rgba(7, 10, 18, 0.9)),
    var(--bg);
  backdrop-filter: blur(18px);
}

.file-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(62px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line);
}

.file-viewer-title,
.file-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-viewer-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 860;
}

.file-viewer-title svg {
  color: var(--accent-dark);
}

.file-viewer-download {
  min-height: 42px;
  padding: 0 12px;
  border-color: rgba(94, 234, 212, 0.34);
  background: rgba(20, 184, 166, 0.16);
  color: var(--accent-dark);
  font-weight: 820;
  text-decoration: none;
}

.file-viewer-body {
  min-height: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-viewer.fullscreen-image {
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.1), transparent 34%),
    rgba(3, 7, 18, 0.98);
  backdrop-filter: none;
}

.file-viewer.fullscreen-image .file-viewer-head {
  border-bottom-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.88), rgba(3, 7, 18, 0.58));
}

.file-viewer.fullscreen-image .file-viewer-body {
  padding: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.22), transparent 18%, transparent 82%, rgba(15, 23, 42, 0.22)),
    rgba(2, 6, 23, 0.28);
}

.file-viewer-image,
.file-viewer-frame,
.file-viewer-fallback {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.file-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
}

.file-viewer.fullscreen-image .file-viewer-image {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.file-viewer-frame {
  width: 100%;
  height: 100%;
  min-height: min(76vh, 760px);
  background: #fff;
}

.file-viewer-fallback {
  display: grid;
  gap: 8px;
  place-items: center;
  width: min(360px, 100%);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.file-viewer-fallback svg {
  width: 36px;
  height: 36px;
  color: var(--accent-dark);
}

.file-viewer-fallback span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-viewer-fallback small {
  max-width: 100%;
  color: var(--muted);
  line-height: 1.45;
}

:root[data-theme="kitty"] .file-viewer {
  background:
    linear-gradient(180deg, rgba(255, 240, 248, 0.96), rgba(255, 231, 243, 0.92)),
    var(--bg);
}

:root[data-theme="kitty"] .file-viewer.fullscreen-image {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 79, 163, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(255, 241, 248, 0.98), rgba(255, 214, 234, 0.95));
}

:root[data-theme="kitty"] .file-viewer.fullscreen-image .file-viewer-head {
  background: linear-gradient(180deg, rgba(255, 241, 248, 0.94), rgba(255, 241, 248, 0.72));
}

:root[data-theme="kitty"] .file-viewer.fullscreen-image .file-viewer-body {
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 79, 163, 0.12), transparent 34%),
    radial-gradient(circle at 86% 24%, rgba(255, 212, 59, 0.16), transparent 30%);
}

:root[data-theme="kitty"] .file-viewer-download {
  border-color: rgba(219, 39, 119, 0.3);
  background: linear-gradient(135deg, rgba(255, 79, 163, 0.18), rgba(255, 212, 59, 0.18));
  color: var(--accent-dark);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  z-index: 35;
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

@media (min-width: 781px) {
  .app-shell {
    padding-bottom: 40px;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(128px + env(safe-area-inset-bottom));
  }

  .app-header {
    margin: -10px -10px 8px;
    padding: calc(10px + env(safe-area-inset-top)) 10px 9px;
  }

  .top-tabs {
    display: none;
  }

  .section-menu-btn {
    position: sticky;
    top: calc(61px + env(safe-area-inset-top));
    z-index: 12;
    display: flex;
    margin: 0 0 10px;
  }

  .sheet-backdrop:not(.hidden) {
    display: block;
  }

  .section-sheet:not(.hidden) {
    display: grid;
  }

  .summary-layout,
  .admin-grid,
  .chat-shell,
  .form-grid,
  .compact-form,
  .inline-controls,
  .team-admin-note,
  .team-cashier-access,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .chat-shell {
    min-height: 0;
  }

  .chat-thread-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 72%);
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-bottom: 2px;
  }

  .chat-messages {
    max-height: 44vh;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions .primary {
    grid-column: 1 / -1;
  }

  .quick-actions button {
    min-width: 0;
    min-height: 54px;
    padding-inline: 10px;
  }

  .quick-actions button span {
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.15;
  }

  .contest-preview {
    grid-template-columns: 1fr;
  }

  .contest-card {
    min-height: 78px;
  }

  .contest-copy small {
    white-space: normal;
  }

  #leaderboardPeriods,
  #adminReportPeriods,
  #adminShopOrderFilters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  #leaderboardPeriods button,
  #adminReportPeriods button,
  #adminShopOrderFilters button {
    min-width: 0;
  }

  .bottom-nav {
    display: grid;
  }

  .tool-panel,
  .data-item,
  .metric,
  .balance-hero {
    box-shadow: var(--shadow-soft);
  }

  .item-actions {
    justify-content: stretch;
  }

  .item-actions button,
  .item-actions .button-link {
    flex: 1 1 calc(50% - 7px);
  }
}

@media (max-width: 480px) {
  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 22px;
  }

  .role-pill {
    display: none;
  }

  .theme-select {
    min-width: 74px;
    max-width: 82px;
    padding-left: 8px;
  }

  .icon-btn {
    width: 44px;
    min-height: 44px;
  }

  .top-tabs button {
    justify-content: center;
    min-width: max-content;
    padding: 0 12px;
    font-size: 13px;
  }

  .balance-hero {
    min-height: 132px;
    padding: 16px;
  }

  .balance-hero strong {
    margin-bottom: 14px;
    font-size: clamp(38px, 14vw, 52px);
  }

  .metric-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 82px;
    padding: 12px;
  }

  .metric strong {
    font-size: 23px;
  }

  .quick-actions .primary {
    grid-column: auto;
  }

  .contest-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contest-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    min-height: 118px;
    padding: 11px;
  }

  .contest-icon {
    width: 32px;
    height: 32px;
  }

  .contest-copy strong {
    font-size: 16px;
    white-space: normal;
  }

  .contest-copy small {
    display: -webkit-box;
    min-height: 30px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .contest-value {
    justify-self: start;
    min-width: 48px;
    min-height: 34px;
    font-size: 15px;
  }

  .hero-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-row button {
    width: 100%;
  }

  .panel-head {
    align-items: flex-start;
  }

  .metric strong {
    font-size: 27px;
  }

  textarea {
    min-height: 108px;
  }

  .roulette-hero {
    gap: 10px;
    padding: 12px;
  }

  .roulette-hero h2 {
    font-size: 21px;
  }

  .roulette-stat-row {
    gap: 7px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .roulette-stat-row article {
    padding: 8px;
  }

  .roulette-stat-row strong {
    font-size: 17px;
  }

  .roulette-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 4px;
  }

  .roulette-modes::-webkit-scrollbar {
    display: none;
  }

  .roulette-mode-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "icon"
      "title";
    justify-items: center;
    min-height: 56px;
    padding: 7px;
    column-gap: 0;
    text-align: center;
  }

  .roulette-mode-card small {
    display: none;
  }

  .mode-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
  }

  .mode-icon i[data-lucide] {
    width: 15px;
    height: 15px;
  }

  .roulette-mode-card strong {
    font-size: 13px;
    max-width: 100%;
  }

  .roulette-drop-top {
    min-height: 36px;
  }

  .roulette-reel-shell {
    height: 104px;
  }

  .roulette-reel-item {
    min-height: 70px;
  }

  .roulette-prize-strip span {
    min-height: 44px;
    padding: 6px 5px;
  }

  .leaderboard-hero {
    min-height: 96px;
    padding: 14px;
  }

  .leaderboard-hero h2 {
    font-size: 22px;
  }

  .leaderboard-hero strong {
    min-width: 62px;
    min-height: 62px;
    font-size: 23px;
  }

  .arena-explain {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arena-explain span {
    min-height: 52px;
  }

  .arena-hero {
    grid-template-columns: 1fr;
  }

  .arena-hero .primary {
    width: 100%;
  }

  .arena-hero strong {
    font-size: 28px;
  }

  .arena-duration-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .bottom-nav {
    gap: 3px;
    padding-inline: 5px;
  }

  .bottom-nav button {
    font-size: 10px;
  }

  i[data-lucide] {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 760px) {
  .chat-panel {
    margin-inline: -1px;
  }

  .chat-messages {
    min-height: 52vh;
    max-height: 62vh;
    padding: 12px 7px 18px;
  }

  body.chat-only-mode .team-chat-panel .chat-messages {
    min-height: 0;
    max-height: none;
    height: auto;
    margin-bottom: 0;
    padding: 12px 7px calc(92px + env(safe-area-inset-bottom));
  }

  body.chat-only-mode .direct-chat-threads {
    grid-auto-columns: minmax(132px, 42vw);
    height: 68px;
    max-height: 68px;
  }

  .chat-bubble {
    max-width: 86%;
    margin-inline: 5px;
  }

  .chat-form,
  .team-chat-form {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .team-chat-panel .team-chat-form {
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
  }

  .team-chat-panel .direct-chat-form {
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
  }

  .chat-form .primary {
    width: 44px;
  }

}
