﻿:root {
  --bg: #0f172a;
  --panel: #1f2937;
  --text: #e2e8f0;
  --accent: #38bdf8;
  --accent-2: #fb7185;
  --shadow: 0 20px 35px rgba(15, 23, 42, 0.45);
  --sidepanel-width: 100vw;
  --sidepanel-max-width: 100vw;
  --sidebar-native-header-height: 92px;
}

.app-shell {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  width: min(var(--sidepanel-width), var(--sidepanel-max-width));
  padding: 14px 18px 18px;
  background:
    linear-gradient(180deg, rgba(3, 9, 24, 0.96), rgba(4, 7, 18, 0.98)),
    url('style/background/cavern_background.png') center top / cover fixed,
    #050914;
  border-left: 1px solid rgba(84, 216, 255, 0.28);
  box-shadow:
    -22px 0 48px rgba(0, 0, 0, 0.72),
    inset 1px 0 0 rgba(132, 77, 255, 0.42);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2147483647;
  overflow-y: auto; /* allow scrolling if content exceeds viewport */
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

body:not(.mw-top-screen-fullscreen) .app-shell {
  padding-top: var(--floating-launcher-offset, calc(var(--sidebar-native-header-height) + 12px));
}

body.mw-sidebar-menu-hidden:not(.mw-top-screen-fullscreen) .app-shell {
  padding-top: 14px;
}

.sidebar-android-header {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--sidepanel-width), var(--sidepanel-max-width));
  height: var(--sidebar-native-header-height);
  padding: 6px 10px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  justify-content: stretch;
  align-items: stretch;
  gap: 8px;
  background: linear-gradient(180deg, #071126 0%, #081329 100%);
  border-left: 1px solid rgba(84, 216, 255, 0.28);
  border-bottom: 1px solid rgba(84, 216, 255, 0.36);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  z-index: 2147483647;
}

body.mw-top-screen-fullscreen .sidebar-android-header {
  display: none;
}

.sidebar-menu-unhide {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(82, 216, 243, 0.72);
  border-radius: 10px;
  color: #eafcff;
  background: linear-gradient(145deg, rgba(11, 36, 60, 0.98), rgba(7, 18, 38, 0.98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(82, 216, 243, 0.12);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  cursor: pointer;
}

#sidebarHeaderUnhide {
  position: fixed;
  left: auto;
  width: auto;
  max-width: calc(100vw - 24px);
  z-index: 2147483647;
}

.sidebar-menu-unhide svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-menu-unhide:hover,
.sidebar-menu-unhide:focus-visible {
  border-color: #77ecff;
  background: linear-gradient(145deg, rgba(17, 61, 83, 0.99), rgba(9, 28, 50, 0.99));
  outline: none;
}

body.mw-sidebar-menu-hidden .sidebar-android-header {
  display: none;
}

body.mw-sidebar-menu-hidden .sidebar-menu-unhide {
  display: inline-flex;
}

.sidebar-android-logo {
  width: 76px;
  height: 76px;
  padding: 0;
  align-self: center;
  border: 1px solid rgba(41, 91, 119, 0.75);
  border-radius: 2px;
  overflow: hidden;
  background: #020713;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.sidebar-android-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sidebar-android-controls {
  min-width: 0;
  display: grid;
  grid-template-rows: 38px 38px;
  align-content: center;
  gap: 4px;
}

.sidebar-android-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(288px, auto) 88px 40px 40px;
  justify-content: end;
  align-items: stretch;
  gap: 4px;
  padding: 0;
  border-radius: 5px;
  background: rgba(16, 25, 55, 0.84);
}

.sidebar-display-controls {
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 3px;
}

.sidebar-display-segment {
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(48px, 1fr) 20px;
  overflow: hidden;
  border: 1px solid rgba(40, 93, 115, 0.9);
  border-radius: 8px;
  background: rgba(9, 16, 34, 0.96);
}

.sidebar-display-step,
.sidebar-display-value,
.sidebar-display-auto {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  color: #f8fbff;
  background: transparent;
  font: inherit;
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-display-step {
  color: #71eaff;
  font-size: 0.78rem;
}

.sidebar-display-value {
  border-left: 1px solid rgba(40, 93, 115, 0.48);
  border-right: 1px solid rgba(40, 93, 115, 0.48);
  white-space: nowrap;
}

.sidebar-display-auto {
  width: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(40, 93, 115, 0.9);
  border-radius: 8px;
  background: rgba(9, 16, 34, 0.96);
  color: #bdefff;
}

.sidebar-display-step:hover,
.sidebar-display-step:focus-visible,
.sidebar-display-value:hover,
.sidebar-display-value:focus-visible,
.sidebar-display-auto:hover,
.sidebar-display-auto:focus-visible,
.sidebar-display-auto.active {
  color: #ffffff;
  background: rgba(18, 54, 75, 0.98);
  outline: none;
}

.sidebar-display-auto.active {
  border-color: rgba(72, 210, 184, 0.98);
  box-shadow: inset 0 0 0 1px rgba(72, 210, 184, 0.24);
}

.sidebar-android-action,
.sidebar-android-tab,
.sidebar-android-tab-main,
.sidebar-android-tab-refresh {
  color: #f8fbff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-android-action {
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(40, 93, 115, 0.9);
  border-radius: 8px;
  background: rgba(9, 16, 34, 0.96);
  box-shadow: inset 0 0 0 1px rgba(43, 86, 112, 0.12);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-android-action:hover,
.sidebar-android-action:focus-visible,
.sidebar-android-tab:hover,
.sidebar-android-tab:focus-visible {
  border-color: rgba(72, 172, 205, 0.95);
  background: rgba(13, 29, 55, 0.98);
  outline: none;
}

.sidebar-android-donate {
  gap: 5px;
  padding: 0 7px;
}

.sidebar-android-donate svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}

.sidebar-android-donate span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.sidebar-android-donate strong {
  font-size: 0.6rem;
  letter-spacing: 0.02em;
}

.sidebar-android-donate small {
  margin-top: 2px;
  color: #6ceaff;
  font-size: 0.44rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sidebar-android-icon-action svg {
  width: 25px;
  height: 25px;
  display: block;
}

.sidebar-menu-eye-closed {
  display: none !important;
}

body.mw-sidebar-menu-hidden .sidebar-menu-eye-open {
  display: none !important;
}

body.mw-sidebar-menu-hidden .sidebar-menu-eye-closed {
  display: block !important;
}

body.mw-sidebar-menu-hidden .floating-chat-launcher {
  display: none !important;
}

.sidebar-android-tabs {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  background: rgba(12, 18, 48, 0.82);
}

.sidebar-android-tab {
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(40, 93, 115, 0.9);
  border-radius: 8px;
  background: rgba(9, 16, 34, 0.96);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
}

.sidebar-android-tab.sidebar-android-tab-active {
  border-color: rgba(70, 151, 178, 0.98);
  box-shadow: inset 0 0 0 1px rgba(70, 151, 178, 0.28);
  background: rgba(15, 32, 55, 0.98);
}

.sidebar-android-tab-main {
  min-width: 0;
  height: 100%;
  padding: 0 5px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.sidebar-android-tab-main img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  display: block;
}

.sidebar-android-tab-main span {
  min-width: 0;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.sidebar-android-tab-refresh {
  width: 34px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(40, 93, 115, 0.55);
  background: rgba(10, 22, 42, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-items: center;
  padding-bottom: 0;
}

.sidebar-android-tab-refresh:hover,
.sidebar-android-tab-refresh:focus-visible {
  background: rgba(24, 51, 78, 0.96);
  outline: none;
}

.sidebar-android-tab-refresh svg {
  width: 18px;
  height: 18px;
}

.sidebar-android-license-tab {
  grid-template-columns: minmax(0, 1fr);
  border-color: rgba(80, 69, 155, 0.86);
  justify-content: flex-start;
}

.sidebar-android-license-tab.sidebar-android-tab-active {
  border-color: rgba(139, 92, 246, 0.96);
  background: rgba(42, 28, 86, 0.94);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.32);
}

@media (max-width: 520px) {
  :root {
    --sidebar-native-header-height: 82px;
  }

  .sidebar-android-header {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 4px;
    padding: 4px 6px 4px 4px;
  }

  .sidebar-android-logo {
    width: 64px;
    height: 64px;
  }

  .sidebar-android-controls {
    grid-template-rows: 34px 34px;
    gap: 3px;
  }

  .sidebar-android-actions {
    grid-template-columns: minmax(190px, 1fr) 64px 32px 32px;
    gap: 3px;
  }

  .sidebar-android-action {
    height: 34px;
  }

  .sidebar-android-tab {
    height: 34px;
  }

  .sidebar-android-tab-main img {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
}

@media (max-width: 700px) {
  :root {
    --sidebar-native-header-height: 96px;
  }

  .sidebar-android-header {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
    padding: 6px 10px;
  }

  .sidebar-android-logo {
    width: 76px;
    height: 76px;
    align-self: center;
  }

  .sidebar-android-controls {
    grid-template-rows: 38px 38px;
    gap: 4px;
  }

  .sidebar-android-actions {
    grid-template-columns: minmax(288px, 1fr) 88px 40px 40px;
    grid-template-rows: 38px;
    gap: 4px;
    padding: 0;
  }

  .sidebar-display-controls {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar-display-segment,
  .sidebar-display-auto {
    height: 38px;
  }

  #sidebarHeaderDonate {
    grid-column: auto;
    grid-row: auto;
  }

  #sidebarHeaderMenuToggle {
    grid-column: auto;
    grid-row: auto;
  }

  #sidebarHeaderDiscord {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar-android-action {
    height: 38px;
  }
}

@media (max-width: 520px) {
  :root {
    --sidebar-native-header-height: 82px;
  }

  .sidebar-android-header {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 4px;
    padding: 4px 6px 4px 4px;
  }

  .sidebar-android-logo {
    width: 64px;
    height: 64px;
  }

  .sidebar-android-controls {
    grid-template-rows: 34px 34px;
    gap: 3px;
  }

  .sidebar-android-actions {
    grid-template-columns: minmax(190px, 1fr) 64px 32px 32px;
    grid-template-rows: 34px;
    gap: 3px;
  }

  .sidebar-android-action,
  .sidebar-android-tab {
    height: 34px;
  }

  .sidebar-display-controls {
    gap: 3px;
  }

  .sidebar-display-segment {
    height: 34px;
    grid-template-columns: 18px minmax(42px, 1fr) 18px;
  }

  .sidebar-display-auto {
    width: 44px;
    height: 34px;
    flex-basis: 44px;
  }

  .sidebar-display-step,
  .sidebar-display-value,
  .sidebar-display-auto {
    font-size: 0.5rem;
  }

  .sidebar-android-donate small {
    display: none;
  }

  .sidebar-android-donate {
    gap: 2px;
    padding: 0 3px;
  }

  .sidebar-android-donate strong {
    font-size: 0.48rem;
  }

  .sidebar-android-donate svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .sidebar-android-icon-action svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 380px) {
  .sidebar-android-header {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .sidebar-android-logo {
    width: 58px;
    height: 58px;
  }

  .sidebar-android-actions {
    grid-template-columns: minmax(174px, 1fr) 56px 30px 30px;
  }

  .sidebar-display-segment {
    grid-template-columns: 16px minmax(34px, 1fr) 16px;
  }

  .sidebar-display-auto {
    width: 40px;
    flex-basis: 40px;
    font-size: 0.5rem;
  }
}

@media (max-width: 360px) {
  :root {
    --sidebar-native-header-height: 74px;
  }

  .sidebar-android-header {
    grid-template-columns: minmax(0, 1fr);
    padding: 3px 5px;
  }

  .sidebar-android-logo {
    display: none;
  }

  .sidebar-android-actions {
    grid-template-columns: minmax(166px, 1fr) 50px 28px 28px;
  }
}

.header-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: transparent;
}

.menu-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-top-bar .app-notice-bar {
  flex: 1;
  margin: 0;
}

.menu-toggle-btn {
  position: relative;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.menu-toggle-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.menu-toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  display: block;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 15;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--sidepanel-width), var(--sidepanel-max-width));
  background:
    linear-gradient(180deg, rgba(3, 9, 24, 0.97), rgba(4, 7, 18, 0.99)),
    url('style/background/cavern_background.png') center top / cover fixed,
    #050914;
  border-left: 1px solid rgba(84, 216, 255, 0.3);
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.68);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(105%);
  transition: transform 0.3s ease;
  z-index: 20;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.menu-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  cursor: pointer;
}

.menu-close-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.menu-drawer .tab-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-user-card {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(12, 15, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  min-width: 0;
}

.menu-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(251, 191, 36, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #f8fafc;
}

.menu-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
}

.menu-user-license {
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.85);
}

.menu-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-user-subscription {
  padding: 2px 8px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 999px;
  color: #f8fafc;
}

.menu-logout-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.menu-logout-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.menu-tree {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.menu-tree-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-tree-title {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 6px;
}

.menu-tree-item {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  padding: 8px 14px;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
}

.menu-drawer .tab::before {
  display: none;
}

.menu-drawer .tab.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(251, 191, 36, 0.4));
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.4);
  transform: none;
}

.app-shell.legacy-menu-disabled .menu-top-bar,
.app-shell.legacy-menu-disabled .menu-overlay,
.app-shell.legacy-menu-disabled .menu-drawer {
  display: none !important;
}

.app-shell.legacy-menu-disabled.menu-open {
  overflow-y: auto;
}

.app-shell.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.app-shell.menu-open .menu-drawer {
  transform: translateX(0);
}

.app-shell.menu-open {
  overflow: hidden;
}

.logo-section {
  flex-shrink: 0;
}

.logo-image {
  width: 100px;
  height: auto;
  max-width: 100%;
  display: block;
}

.tab-nav {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
}

.app-notice-bar {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.55);
}

:root[data-theme='cavern'] .app-notice-bar {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.35), rgba(251, 191, 36, 0.35));
  border: 1px solid rgba(167, 139, 250, 0.5);
  color: #fef3c7;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: #050914;
  color: var(--text);
  min-height: 100vh;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-radius: 18px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
}

.app-logo {
  font-size: 1.2rem;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-controls {
  display: none;
}

.theme-select {
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.3);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  padding: 6px 12px;
}

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

.tab {
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  position: relative;
  background-clip: padding-box;
}

.tab-home {
  display: none;
}

.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.4), rgba(100, 116, 139, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.tab:nth-child(1)::before {
  background: linear-gradient(135deg, #a3e635, #22c55e);
}

.tab:nth-child(2)::before {
  background: linear-gradient(135deg, #f97316, #eab308);
}

.tab:nth-child(3)::before {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.tab:nth-child(4)::before {
  background: linear-gradient(135deg, #a855f7, #ec4899);
}

.tab:nth-child(5)::before {
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
}

.tab:nth-child(6)::before {
  background: linear-gradient(135deg, #eab308, #f97316);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.tab.active::before {
  display: none;
}

.tab-content {
  background: rgba(2, 8, 28, 0.42);
  border: 1px solid rgba(84, 216, 255, 0.14);
  border-radius: 14px;
  padding: 10px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(132, 77, 255, 0.08);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* allow children to shrink and scroll */
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.debug-panel-visible .tab-content {
  padding-bottom: 50px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tab-panel.active {
  display: flex;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

#tabContent .tab-panel {
  zoom: var(--mw-content-scale, 1);
}

#tabContent [data-mw-user-font] {
  font-size: var(--mw-user-font-size) !important;
}

#tabContent.mw-font-measuring [data-mw-user-font] {
  font-size: var(--mw-user-font-base) !important;
}

.live-disclaimer {
  margin: 8px 12px 4px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(203, 213, 225, 0.95);
  background: rgba(10, 14, 24, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}


.tab-panel h2 {
  margin: 8px 0 4px;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  user-select: none;
}

.tab-panel h2:first-child {
  margin-top: 0;
}

.home-panel {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
}

.home-panel .card-grid {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  padding: 0 12px 12px;
  box-sizing: border-box;
}

.home-section-title {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-news-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 14, 24, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  text-align: left;
}

.home-news-item h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.home-news-body {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.45;
}

.home-news-meta {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.home-news-editor {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.home-news-editor input,
.home-news-editor select,
.home-news-editor .home-news-body.editable {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 14, 24, 0.7);
  color: #f8fafc;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.home-news-editor .home-news-body.editable {
  min-height: 90px;
  outline: none;
}

.home-news-editor .home-news-body.editable:empty::before {
  content: attr(data-placeholder);
  color: rgba(148, 163, 184, 0.75);
}

.home-news-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.home-news-toolbar .btn.sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.home-news-toolbar select {
  width: auto;
  min-width: 120px;
  padding: 4px 8px;
}

.home-license-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  position: relative;
  padding-right: 170px;
}

.home-license-status {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.home-license-status.valid {
  color: #7dff8a;
}

.home-license-status.invalid {
  color: #ff7b7b;
}

.home-license-paynote {
  margin: 6px 0 8px;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.85);
}

.home-license-qr {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
}

.home-license-qr img {
  width: 150px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-license-qr img:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.home-license-qr-note {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.8);
  text-align: center;
}

@media (max-width: 520px) {
  .home-license-block {
    padding-right: 0;
  }

  .home-license-qr {
    position: static;
    padding: 8px 0 0;
  }
}

.home-license-feature-list {
  min-width: 0;
}

.home-feature-journey {
  --home-feature-line: #29405f;
  --home-feature-surface: #071020;
  --home-feature-surface-strong: #0b172a;
  --home-feature-border: #293e5d;
  --home-feature-cyan: #4cc9f0;
  --home-feature-green: #4ce7a5;
  --home-feature-pink: #f1739b;
  --home-feature-yellow: #f7c95b;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--home-feature-border);
  border-radius: 8px;
  background: var(--home-feature-surface);
  color: #f5f7ff;
}

.home-feature-journey-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--home-feature-border);
  background: #0c172b;
}

.home-feature-journey-number {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--home-feature-green);
  color: #06120e;
  font-size: 1rem;
  font-weight: 900;
}

.home-feature-journey-header > div {
  min-width: 0;
}

.home-feature-journey-header h3 {
  margin: 0;
  color: #f5f7ff;
  font-size: 1.05rem;
  line-height: 1.2;
}

.home-feature-journey-header p {
  margin: 3px 0 0;
  color: #9aabc3;
  font-size: 0.76rem;
  line-height: 1.3;
}

.home-feature-goal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
}

.home-feature-goal-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-feature-goal-tab {
  display: grid;
  min-width: 0;
  min-height: 36px;
  place-items: center;
  padding: 6px 4px;
  border: 1px solid #334967;
  border-radius: 4px;
  background: #0a1527;
  color: #aab9cd;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.home-feature-goal-input:checked + .home-feature-goal-tab {
  border-color: var(--home-feature-pink);
  background: #34172a;
  color: #fff;
}

.home-feature-goal-input:focus-visible + .home-feature-goal-tab {
  outline: 2px solid var(--home-feature-cyan);
  outline-offset: 2px;
}

.home-feature-goal-panels {
  min-width: 0;
}

.home-feature-goal-panel {
  display: none;
  min-width: 0;
  padding: 14px 12px 16px;
}

.home-feature-goal-panel:first-child,
.home-feature-journey:has(#homeFeatureGoal0:checked) .home-feature-goal-panel:nth-child(1),
.home-feature-journey:has(#homeFeatureGoal1:checked) .home-feature-goal-panel:nth-child(2),
.home-feature-journey:has(#homeFeatureGoal2:checked) .home-feature-goal-panel:nth-child(3) {
  display: block;
}

.home-feature-journey:has(#homeFeatureGoal1:checked) .home-feature-goal-panel:first-child,
.home-feature-journey:has(#homeFeatureGoal2:checked) .home-feature-goal-panel:first-child {
  display: none;
}

.home-feature-goal-eyebrow {
  display: block;
  color: var(--home-feature-cyan);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-feature-goal-panel > h4 {
  margin: 4px 0 6px;
  color: #f5f7ff;
  font-size: 1.22rem;
  line-height: 1.15;
}

.home-feature-goal-description {
  margin: 0 0 13px;
  color: #9aabc3;
  font-size: 0.76rem;
  line-height: 1.35;
}

.home-feature-route {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.home-feature-route::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 20px;
  width: 2px;
  background: var(--home-feature-line);
}

.home-feature-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.home-feature-step-marker {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--home-feature-cyan);
  border-radius: 50%;
  background: var(--home-feature-surface-strong);
  font-size: 1.12rem;
  line-height: 1;
}

.home-feature-step-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 36%);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--home-feature-border);
  border-radius: 4px;
  background: var(--home-feature-surface-strong);
}

.home-feature-step-copy {
  min-width: 0;
}

.home-feature-step-number {
  display: block;
  margin-bottom: 3px;
  color: var(--home-feature-cyan);
  font-size: 0.61rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-feature-step-copy h5 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.2;
}

.home-feature-step-copy p,
.home-feature-step-copy li {
  color: #a8b5c8;
  font-size: 0.69rem;
  line-height: 1.35;
}

.home-feature-step-copy p {
  margin: 0 0 7px;
}

.home-feature-step-copy ul {
  margin: 7px 0 0;
  padding-left: 15px;
}

.home-feature-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.home-feature-tier {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 6px;
  border: 1px solid #37506f;
  border-radius: 999px;
  color: #c8d7ea;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
}

.home-feature-tier-clan {
  border-color: #4cc9f0;
  color: #8ce5ff;
}

.home-feature-tier-premium {
  border-color: var(--home-feature-green);
  background: rgba(76, 231, 165, 0.12);
  color: #8ff2c5;
}

.home-feature-tier-elite {
  border-color: var(--home-feature-yellow);
  background: rgba(247, 201, 91, 0.12);
  color: #ffe18d;
}

.home-feature-shot {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #365372;
  border-radius: 4px;
  background: #050b16;
  aspect-ratio: 3 / 4;
}

.home-feature-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.home-license-block[data-active-license-page="clan"],
.home-license-block[data-active-license-page="features"],
.home-license-block[data-active-license-page="register"] {
  padding-right: 0;
}

.home-clan-account {
  --home-clan-surface: #071020;
  --home-clan-panel: #0b172a;
  --home-clan-panel-strong: #0e2135;
  --home-clan-border: #29405f;
  --home-clan-cyan: #4cc9f0;
  --home-clan-green: #4ce7a5;
  --home-clan-yellow: #f7c95b;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--home-clan-border);
  border-radius: 8px;
  background: var(--home-clan-surface);
  color: #f5f7ff;
}

.home-clan-account-hero {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--home-clan-border);
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.16), rgba(76, 231, 165, 0.08) 46%, rgba(247, 201, 91, 0.09));
}

.home-clan-account-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(76, 201, 240, 0.45);
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.16);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: inset 0 0 18px rgba(76, 201, 240, 0.12);
}

.home-clan-account-hero > div {
  min-width: 0;
}

.home-clan-account-eyebrow {
  display: block;
  color: var(--home-clan-cyan);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-clan-account-hero h4 {
  margin: 3px 0 4px;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.18;
}

.home-clan-account-hero p {
  margin: 0;
  color: #a8b5c8;
  font-size: 0.75rem;
  line-height: 1.35;
}

.home-clan-account-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px;
}

.home-clan-account-options article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(76, 201, 240, 0.24);
  border-radius: 7px;
  background: var(--home-clan-panel);
}

.home-clan-account-options article > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(76, 231, 165, 0.14);
  font-size: 1.1rem;
  line-height: 1;
}

.home-clan-account-options strong,
.home-clan-account-steps strong,
.home-clan-discord-btn strong {
  display: block;
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.2;
}

.home-clan-account-options small,
.home-clan-account-steps small,
.home-clan-discord-btn small {
  display: block;
  margin-top: 2px;
  color: #9aabc3;
  font-size: 0.66rem;
  line-height: 1.28;
}

.home-clan-account-steps {
  margin: 0 12px;
  padding: 10px;
  border: 1px solid var(--home-clan-border);
  border-radius: 7px;
  background: var(--home-clan-panel);
}

.home-clan-account-steps h5 {
  margin: 0 0 8px;
  color: var(--home-clan-cyan);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-clan-account-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-clan-account-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.home-clan-account-steps li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(76, 201, 240, 0.42);
  border-radius: 50%;
  background: rgba(76, 201, 240, 0.12);
  color: #dff8ff;
  font-size: 0.72rem;
  font-weight: 900;
}

.home-clan-account-steps code,
.home-clan-command code {
  color: #c8f5ff;
  font-family: inherit;
  font-size: 0.68rem;
  word-break: break-word;
}

.home-clan-command {
  display: grid;
  gap: 4px;
  margin: 0 12px;
  padding: 9px 10px;
  border: 1px solid rgba(247, 201, 91, 0.28);
  border-radius: 7px;
  background: rgba(247, 201, 91, 0.08);
}

.home-clan-command > span {
  color: var(--home-clan-yellow);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-clan-discord-btn {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  margin: 0 12px;
  padding: 10px;
  border: 1px solid rgba(88, 101, 242, 0.55);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.28), rgba(14, 165, 233, 0.12));
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
}

.home-clan-discord-btn:hover {
  border-color: rgba(110, 231, 255, 0.72);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.38), rgba(14, 165, 233, 0.18));
}

.home-clan-discord-btn > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.28);
  font-size: 1.05rem;
  line-height: 1;
}

.home-clan-account .home-license-status {
  margin: 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.28);
  font-size: 0.74rem;
  line-height: 1.3;
}

.home-clan-account .home-license-status.valid {
  border-color: rgba(76, 231, 165, 0.35);
  background: rgba(76, 231, 165, 0.08);
}

.home-clan-account .home-license-status.invalid {
  border-color: rgba(255, 123, 123, 0.28);
  background: rgba(255, 123, 123, 0.06);
}

.home-clan-account-note {
  margin: 0;
  padding: 0 12px 12px;
  color: #9aabc3;
  font-size: 0.68rem;
  line-height: 1.35;
}

@media (max-width: 420px) {
  .home-feature-journey-header {
    padding: 10px;
  }

  .home-feature-journey-number {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .home-feature-goal-tabs {
    gap: 4px;
    padding: 10px 9px 0;
  }

  .home-feature-goal-tab {
    min-height: 34px;
    padding-inline: 2px;
    font-size: 0.66rem;
  }

  .home-feature-goal-panel {
    padding: 12px 9px 14px;
  }

  .home-feature-goal-panel > h4 {
    font-size: 1.05rem;
  }

  .home-feature-route::before {
    left: 17px;
  }

  .home-feature-step {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 7px;
  }

  .home-feature-step-marker {
    width: 36px;
    height: 36px;
    font-size: 0.98rem;
  }

  .home-feature-step-card {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 34%);
    gap: 7px;
    padding: 8px;
  }

  .home-feature-step-copy h5 {
    font-size: 0.78rem;
  }

  .home-feature-step-copy p,
  .home-feature-step-copy li {
    font-size: 0.64rem;
  }

  .home-clan-account-hero {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .home-clan-account-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1.12rem;
  }

  .home-clan-account-hero h4 {
    font-size: 0.94rem;
  }

  .home-clan-account-options {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 9px;
  }

  .home-clan-account-steps,
  .home-clan-command,
  .home-clan-discord-btn,
  .home-clan-account .home-license-status {
    margin-inline: 9px;
  }

  .home-clan-account-note {
    padding-inline: 9px;
  }
}

@media (max-width: 330px) {
  .home-feature-step-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-feature-shot {
    max-height: 190px;
    aspect-ratio: 16 / 9;
  }
}

.home-auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.home-auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-auth-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 14, 24, 0.7);
  color: #f8fafc;
  padding: 8px 10px;
  font-size: 0.85rem;
}

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

.home-auth-status {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.85);
}

.home-auth-status.ok {
  color: #7dff8a;
}

.home-auth-status.error {
  color: #ff7b7b;
}

.home-auth-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
  font-size: 0.75rem;
}

.home-license-page h4 {
  margin: 0 0 8px;
  color: #f5f7ff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.home-tier-matrix {
  width: 100%;
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid rgba(82, 216, 243, 0.28);
  border-radius: 8px;
  background: rgba(5, 11, 25, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.home-tier-matrix-row {
  display: grid;
  grid-template-columns: minmax(88px, 1.35fr) repeat(var(--home-tier-count, 3), minmax(62px, 0.82fr));
  min-width: var(--home-tier-min-width, 0);
  border-top: 1px solid rgba(125, 146, 178, 0.16);
}

.home-tier-matrix-row:first-child {
  border-top: 0;
}

.home-tier-matrix-row > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 5px 3px;
  border-left: 1px solid rgba(125, 146, 178, 0.13);
  color: #c7d2e4;
  font-size: 0.64rem;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.home-tier-matrix-row > span:first-child {
  justify-content: flex-start;
  padding-left: 8px;
  border-left: 0;
  color: #f3f6fb;
  font-weight: 700;
  text-align: left;
}

.home-tier-matrix-row > span.current {
  background: rgba(82, 216, 243, 0.09);
  box-shadow: inset 0 0 0 1px rgba(82, 216, 243, 0.12);
}

.home-tier-matrix-head > span {
  min-height: 39px;
  color: #8fa2bc;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(19, 33, 58, 0.86);
}

.home-tier-matrix-head > span.current {
  color: #62e6ff;
}

.home-tier-yes {
  color: #4ee7a8;
  font-size: 0.9rem;
  font-weight: 900;
}

.home-tier-no {
  color: #65748a;
}

.home-tier-limit {
  color: #f5c94a;
  font-size: 0.72rem;
}

.home-tier-matrix-price > span {
  min-height: 66px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.home-tier-matrix-price > span:not(:first-child) {
  flex-direction: column;
  gap: 2px;
}

.home-tier-matrix-price > span > strong {
  display: block;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.1;
}

.home-tier-matrix-price small {
  margin-left: 0;
  color: #8fa2bc;
  font-size: 0.5rem;
  font-weight: 700;
}

.home-tier-matrix-price .home-tier-price-usd {
  color: #59e7b0;
  font-size: 0.56rem;
  white-space: nowrap;
}

.home-tier-matrix-price .home-tier-price-period {
  color: #8fa2bc;
  font-weight: 600;
}

.home-license-term-discounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.home-license-term-discounts > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 4px;
  border: 1px solid rgba(82, 216, 243, 0.23);
  border-radius: 7px;
  background: rgba(9, 29, 47, 0.72);
  text-align: center;
}

.home-license-term-discounts strong {
  color: #f3f6fb;
  font-size: 0.62rem;
}

.home-license-term-discounts small {
  color: #59e7b0;
  font-size: 0.58rem;
  font-weight: 800;
}

@media (max-width: 420px) {
  .home-tier-matrix-row {
    grid-template-columns: minmax(82px, 1.25fr) repeat(var(--home-tier-count, 3), minmax(58px, 0.75fr));
  }

  .home-tier-matrix-row > span {
    min-height: 32px;
    padding: 5px 2px;
    font-size: 0.59rem;
  }

  .home-tier-matrix-head > span {
    font-size: 0.6rem;
  }

  .home-tier-matrix-price > span {
    min-height: 60px;
  }

  .home-license-term-discounts {
    gap: 4px;
  }
}

.home-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.home-pricing-table th,
.home-pricing-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  text-align: left;
}

.home-pricing-table th:first-child,
.home-pricing-table td:first-child {
  width: 180px;
  max-width: 180px;
}

.home-pricing-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.85);
}

.home-license-name-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.home-license-name-cell span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-license-info-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #8fffe0;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.home-license-info-btn:hover {
  background: rgba(14, 165, 233, 0.24);
}

.home-license-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.72);
}

.home-license-info-modal {
  width: min(420px, 100%);
  max-height: min(78vh, 520px);
  overflow: auto;
  border: 1px solid rgba(110, 231, 255, 0.32);
  border-radius: 8px;
  background: rgba(10, 14, 31, 0.98);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  color: var(--text);
}

.home-license-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.home-license-info-title {
  font-weight: 900;
  color: #f8fbff;
}

.home-license-info-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  cursor: pointer;
}

.home-license-info-body {
  padding: 16px;
  color: rgba(226, 232, 240, 0.94);
  line-height: 1.55;
  white-space: pre-wrap;
}

.home-wallet-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.home-wallet-short {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
}

.home-wallet-copy {
  padding: 3px 8px;
  font-size: 0.7rem;
}

.home-license-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-license-inputs input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 14, 24, 0.7);
  color: #f8fafc;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.home-donation-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(22, 18, 5, 0.78), rgba(5, 13, 28, 0.9));
}

.home-donation-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.home-donation-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.28);
  font-size: 1.55rem;
}

.home-donation-kicker {
  display: block;
  margin-bottom: 3px;
  color: #facc15;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-donation-hero h4 {
  margin: 0 0 4px;
  color: #fff7d1;
  font-size: 1.05rem;
  line-height: 1.15;
}

.home-donation-hero p {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.8rem;
  line-height: 1.35;
}

.home-donation-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(88px, 0.6fr);
  gap: 8px;
  align-items: end;
}

.home-donation-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
}

.home-donation-form input {
  min-width: 0;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 14, 24, 0.72);
  color: #f8fafc;
  padding: 8px 9px;
  font-size: 0.84rem;
}

.home-donation-show-btn {
  grid-column: 1 / -1;
}

.home-donation-placeholder {
  padding: 10px;
  border: 1px dashed rgba(250, 204, 21, 0.28);
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.74);
  font-size: 0.78rem;
  text-align: center;
}

.home-donation-order {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 9px;
  background: rgba(7, 12, 24, 0.78);
}

.home-donation-order .home-payment-order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.home-donation-order .home-payment-kicker,
.home-donation-order .home-payment-amount span,
.home-donation-order .home-payment-address span {
  display: block;
  color: rgba(148, 163, 184, 0.88);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-donation-order .home-payment-order-head strong,
.home-donation-order .home-payment-amount strong {
  display: block;
  color: #fff7d1;
  font-size: 1rem;
}

.home-donation-order .home-payment-order-head span:not(.home-payment-kicker) {
  display: block;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.76rem;
}

.home-donation-order .home-payment-amount,
.home-donation-order .home-payment-address {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
}

.home-donation-order .home-payment-amount span,
.home-donation-order .home-payment-address span {
  grid-column: 1 / -1;
}

.home-donation-order code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d7f8ff;
  font-size: 0.78rem;
}

.home-donation-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.4);
}

.home-donation-qr img {
  width: min(160px, 72vw);
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.28);
}

@media (max-width: 430px) {
  .home-donation-form {
    grid-template-columns: 1fr;
  }

  .home-donation-order .home-payment-amount,
  .home-donation-order .home-payment-address {
    grid-template-columns: 1fr;
  }
}

.subscription-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subscription-section {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 14, 24, 0.65);
}

.subscription-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subscription-note {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 8px;
}

.subscription-status {
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.subscription-status.ok {
  color: #7dff8a;
}

.subscription-status.error {
  color: #ff7b7b;
}

.subscription-license-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.subscription-license-table th,
.subscription-license-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  text-align: left;
  vertical-align: top;
}

.subscription-license-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.85);
}

.tab[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding-right: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-grid > * {
  min-width: 0;
}

.card-grid.current-round {
  grid-template-columns: 1fr !important;
}

/* Calculator cards should use full width and stack vertically */
#calculatorGrid {
  grid-template-columns: 1fr;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.calculator-inputs-card {
  max-height: none;
  overflow: hidden;
}

#toolsGrid .clan-tools-card {
  padding: 16px;
}

.muted {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.8rem;
}

.clan-comm .title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 6px;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.2);
}

.btn.ghost {
  background: transparent;
}

.btn.sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.comm-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
}

.comm-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7dff8a;
}

.comm-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: #aaa;
}

.comm-card input,
.comm-card textarea {
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
}

.comm-status {
  margin-top: 8px;
  font-size: 12px;
  min-height: 16px;
}

.comm-log {
  margin-top: 8px;
  max-height: 140px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.35);
}

.experimental-round-alert-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.experimental-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.experimental-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(56, 213, 255, 0.2);
  border-radius: 8px;
  background: rgba(7, 12, 27, 0.72);
}

.experimental-switch {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(125, 146, 178, 0.26);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.58);
  color: rgba(226, 232, 240, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.experimental-switch.active {
  border-color: rgba(56, 213, 255, 0.55);
  background: rgba(14, 116, 144, 0.32);
  color: #e0f2fe;
}

.experimental-view {
  display: none;
}

.experimental-view.active {
  display: block;
}

.round-details-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-live-data-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-details-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(56, 213, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 13, 27, 0.72);
}

.round-details-hero h3 {
  margin: 3px 0 6px;
}

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

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

.round-details-table {
  display: grid;
  gap: 7px;
}

.round-details-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(92px, 0.35fr) minmax(0, 1.35fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(125, 146, 178, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.36);
}

.round-details-row span {
  color: #93c5fd;
  font-weight: 800;
}

.round-details-row p {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
}

.experimental-round-alert-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.experimental-round-alert-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: #f8fafc;
}

.experimental-round-alert-kicker,
.experimental-round-alert-section-title {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(125, 255, 138, 0.92);
}

.experimental-round-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.experimental-round-alert-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.experimental-round-alert-section.wide {
  grid-column: 1 / -1;
}

.round-alert-embed {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-left: 4px solid rgba(56, 189, 248, 0.85);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.88), rgba(17, 24, 39, 0.9)),
    rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  min-width: 0;
}

.round-alert-embed.clan {
  border-left-color: rgba(34, 197, 94, 0.9);
}

.round-alert-embed.combined {
  border-left-color: rgba(245, 158, 11, 0.9);
}

.round-alert-embed.personal {
  border-left-color: rgba(244, 114, 182, 0.9);
}

.round-alert-embed-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.round-alert-subtitle {
  margin: -2px 0 10px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.78rem;
  line-height: 1.35;
}

.round-alert-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.round-alert-fields.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.round-alert-field {
  min-width: 0;
}

.round-alert-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.round-alert-code,
.round-alert-badge {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.16);
  color: #f8fafc;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.round-alert-badge.accent {
  border-color: rgba(125, 255, 138, 0.35);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.round-alert-subblock {
  margin-top: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.round-alert-subblock strong {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
}

.round-alert-contributors {
  display: grid;
  gap: 4px;
}

.round-alert-contributor {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.round-alert-contributor span,
.round-alert-footer {
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.72rem;
}

.round-alert-footer {
  margin-top: 12px;
  font-weight: 700;
}

.round-alert-combined-grid,
.round-alert-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.round-alert-combined-grid > div,
.round-alert-personal-metric {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(2, 6, 23, 0.24);
  min-width: 0;
}

.round-alert-combined-grid strong,
.round-alert-personal-metric strong {
  display: block;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.round-alert-combined-grid small {
  display: block;
  margin-top: 2px;
  color: rgba(226, 232, 240, 0.72);
  overflow-wrap: anywhere;
}

.round-alert-mini-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.round-alert-personal-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.round-alert-personal-metric span {
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
}

.round-alert-list {
  margin: 8px 0 0 18px;
  padding: 0;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.82rem;
  line-height: 1.45;
}

.round-alert-payload {
  margin-top: 10px;
  color: rgba(226, 232, 240, 0.88);
}

.round-alert-payload summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.round-alert-payload pre {
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.5);
  color: #dbeafe;
  font-size: 0.72rem;
  line-height: 1.45;
}

.round-alert-control-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.22fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.round-alert-control-row label {
  color: rgba(226, 232, 240, 0.84);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.round-alert-select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

.round-alert-select:disabled {
  opacity: 0.58;
}

.round-alert-selected-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.28);
}

.round-alert-selected-title {
  margin-bottom: 7px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.round-alert-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.28);
}

.round-alert-live-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.76rem;
}

.round-alert-live-table th,
.round-alert-live-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  text-align: left;
  vertical-align: top;
}

.round-alert-live-table th {
  color: #93c5fd;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.55);
}

.round-alert-live-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 520px) {
  .round-alert-fields.three,
  .round-alert-combined-grid,
  .round-alert-notes-grid,
  .round-details-grid,
  .round-live-data-grid,
  .round-details-row {
    grid-template-columns: 1fr;
  }

  .round-details-hero {
    flex-direction: column;
  }

  .round-alert-control-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .round-alert-embed {
    padding: 10px;
  }
}

.comm-korrel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.comm-korrel-api-actions {
  margin-top: 10px;
}

.comm-korrel-detail-actions {
  margin-top: 10px;
}

.comm-korrel-api-settings {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.comm-korrel-api-settings label {
  display: block;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  color: #9aa4b2;
}

.comm-korrel-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comm-korrel-slider-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7dff8a;
}

.comm-korrel-slider {
  flex: 1;
}

.comm-korrel-input {
  flex: 0 0 auto;
  width: 90px;
  max-width: 120px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  box-sizing: border-box;
}

.comm-korrel-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.comm-korrel-modal-card {
  background: rgba(10, 15, 26, 0.96);
  border: 1px solid rgba(125, 255, 138, 0.2);
  border-radius: 12px;
  padding: 12px;
  width: min(1000px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
}

.comm-korrel-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7dff8a;
  margin-bottom: 8px;
}

.comm-korrel-detail-body {
  overflow: auto;
}

.comm-korrel-raw-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  color: #e2e8f0;
}

.comm-korrel-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.comm-korrel-detail-table th,
.comm-korrel-detail-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}

.comm-korrel-detail-table th {
  color: #7dff8a;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.comm-korrel-table {
  margin-top: 8px;
}

.comm-korrel-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.comm-korrel-table th,
.comm-korrel-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.comm-korrel-table th {
  color: #7dff8a;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  width: 40%;
}

.comm-korrel-table td {
  color: #cbd5f5;
  word-break: break-word;
}

.comm-korrel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.comm-korrel-tab {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5f5;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.comm-korrel-tab.active {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.comm-korrel-tab-panel {
  display: none;
  margin-top: 10px;
}

.comm-korrel-tab-panel.active {
  display: block;
}

.comm-korrel-schema {
  margin-top: 10px;
}

.comm-korrel-schema-table {
  margin-top: 8px;
}

.comm-korrel-schema-table th[colspan] {
  color: #7dff8a;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(125, 255, 138, 0.08);
}

.comm-korrel-schema-table th,
.comm-korrel-schema-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comm-korrel-schema-input {
  width: 100%;
  min-width: 80px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  box-sizing: border-box;
}

.comm-log-line {
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: #cbd5f5;
}

.comm-log-line.error {
  color: #ff6b6b;
}

.comm-log-line.success {
  color: #7dff8a;
}

.comm-log-time {
  font-variant-numeric: tabular-nums;
  color: #9aa4b2;
}

.comm-korrel-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.comm-korrel-log-section {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 8px;
}

.comm-korrel-log-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  color: #cbd5f5;
}

.comm-korrel-log-section[data-category="api"] .comm-log-line {
  color: #38bdf8;
}

.comm-korrel-log-section[data-category="allUsers"] .comm-log-line {
  color: #0ea5e9;
}

  .comm-korrel-log-section[data-category="cache"] .comm-log-line {
    color: #f59e0b;
  }
  
  .comm-korrel-log-section[data-category="rest"] .comm-log-line {
    color: #cbd5f5;
  }

  .comm-korrel-log-section[data-category="refresh"] .comm-log-line {
    color: #14b8a6;
  }

  .comm-korrel-refresh-overview {
    margin: 10px 0 12px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(20, 184, 166, 0.3);
  }

  .comm-korrel-refresh-overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #cbd5f5;
    margin-bottom: 4px;
  }

  .comm-korrel-refresh-overview-row:last-child {
    margin-bottom: 0;
  }

  .comm-korrel-refresh-overview-row span.value {
    font-weight: 600;
    color: #f8fafc;
  }

  .comm-api-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
  }

  .comm-api-test-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 220px;
  }

  .comm-api-test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .comm-api-test-label {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
  }

  .comm-api-test-description {
    font-size: 0.75rem;
    color: #9aa4b2;
    min-height: 2.4rem;
  }

  .comm-api-test-actions {
    margin-top: auto;
  }

  .comm-api-test-log {
    margin-top: 6px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.6);
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: #cbd5f5;
  }

  .comm-api-test-inputs {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.6);
    padding: 6px;
    font-size: 0.7rem;
    max-height: 180px;
    overflow-y: auto;
  }

  .comm-api-test-inputs .comm-korrel-schema-table {
    margin: 0;
    border-top: none;
  }

  .comm-api-test-output {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.6);
    padding: 6px;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .comm-api-test-output-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
  }

  .comm-api-test-output-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .comm-api-test-output-section {
    border: 1px solid transparent;
    padding: 4px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
  }

  .comm-api-test-output-section-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #cbd5f5;
    margin-bottom: 2px;
  }

  .comm-api-test-output-meta {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-bottom: 4px;
  }

  .comm-api-test-output-section pre {
    margin: 0;
    background: rgba(2, 6, 23, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px;
    font-size: 0.65rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 140px;
    overflow-y: auto;
  }

  .comm-api-test-output-section.error pre {
    border-color: #f43f5e;
  }

  .comm-api-test-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 2000;
  }

  .comm-api-test-modal-card {
    background: #0f172a;
    border-radius: 12px;
    border: 1px solid #2dd4bf;
    width: min(720px, 90%);
    max-height: 80%;
    display: flex;
    flex-direction: column;
    padding: 12px;
  }

  .comm-api-test-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }

  .comm-api-test-modal-body {
    background: #020617;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.75rem;
    overflow-y: auto;
    white-space: pre-wrap;
  }

  .comm-live-clan-power-header,
  .comm-live-clan-power-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .comm-live-clan-power-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9aa4b2;
  }

  .comm-live-clan-power-row:last-child {
    border-bottom: none;
  }
  
  .comm-korrel-roster-progress-card {
    margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.65);
}

.comm-korrel-roster-progress-header {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #cbd5f5;
}

.comm-korrel-roster-progress-list {
  margin-top: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 6px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
}

.comm-korrel-roster-progress-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.comm-korrel-roster-progress-bar-label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #cbd5f5;
}

.comm-korrel-roster-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.comm-korrel-roster-progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #667eea);
  transition: width 0.3s ease;
}

.comm-korrel-roster-progress-bar-meta {
  font-size: 0.72rem;
  color: #94a3b8;
}

.comm-korrel-roster-progress-leagues {
  margin-top: 10px;
}

.comm-korrel-roster-progress-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(59, 130, 246, 0.08);
}

.comm-korrel-roster-progress-item.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.comm-korrel-roster-progress-clan {
  font-weight: 600;
  color: #93c5fd;
}

.comm-korrel-roster-progress-note {
  color: #cbd5f5;
  opacity: 0.9;
}

.comm-korrel-roster-progress-empty {
  font-size: 0.8rem;
  opacity: 0.7;
}

.comm-private {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.55);
  margin-top: 12px;
}

.comm-chat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  height: 130px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
}

.live-recent-rounds-scroll {
  width: 100%;
  overflow-x: auto;
}

.live-recent-rounds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  min-width: 760px;
  table-layout: fixed;
}

.live-recent-rounds-table th,
.live-recent-rounds-table td {
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}

.live-recent-rounds-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.75);
  background: rgba(15, 23, 42, 0.55);
}

.live-recent-rounds-table th:first-child {
  width: 130px;
  text-align: left;
}

.live-recent-rounds-table td {
  background: rgba(15, 23, 42, 0.35);
  color: #e2e8f0;
}

.live-recent-rounds-table td.round-winner {
  font-weight: 600;
  color: #7dff8a;
}

.live-recent-rounds-table td.round-user {
  font-weight: 600;
  color: #93c5fd;
}

.live-recent-rounds-table td.round-top {
  font-weight: 600;
  color: #fbbf24;
}

.live-recent-rounds-table td.round-boosts {
  text-align: left;
  font-size: 0.66rem;
  line-height: 1.35;
}

.round-boost-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.round-boost-more {
  align-self: flex-start;
  border: 1px solid rgba(167, 139, 250, 0.6);
  background: rgba(124, 58, 237, 0.16);
  color: #e9d5ff;
  border-radius: 999px;
  padding: 2px 8px;
  font: inherit;
  font-size: 0.64rem;
  cursor: pointer;
}

.round-boost-more:active {
  transform: translateY(1px);
}

.round-debug-table {
  min-width: 900px;
}

.round-debug-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
}

.round-debug-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(139, 92, 246, 0.65);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.78);
  color: #e9d5ff;
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
}

.round-debug-open:hover {
  background: rgba(88, 28, 135, 0.58);
}

.round-debug-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.round-debug-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.68rem;
  font-weight: 700;
  user-select: none;
}

.round-debug-filter input {
  width: 14px;
  height: 14px;
  accent-color: #8b5cf6;
}

.round-debug-table td {
  font-size: 0.64rem;
}

.round-capture-health {
  border: 1px solid rgba(105, 75, 220, 0.45);
  border-radius: 8px;
  background: rgba(10, 16, 32, 0.78);
  padding: 10px;
  margin: 8px 0 10px;
}

.round-capture-health-title {
  color: #c9b7ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.round-capture-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.round-capture-health-item {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.72);
  display: grid;
  gap: 4px;
}

.round-capture-health-item.wide {
  grid-column: span 2;
}

.round-capture-health-item > span:first-child {
  color: #9ca3af;
  font-size: 0.64rem;
  text-transform: uppercase;
}

.round-capture-health-item small {
  color: #cbd5e1;
  font-size: 0.64rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-capture-health-status {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-capture-health-status.ok {
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(20, 83, 45, 0.32);
}

.round-capture-health-status.warn {
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(113, 63, 18, 0.32);
}

.round-debug-ok {
  color: #7dff8a !important;
  font-weight: 700;
}

.round-debug-warn {
  color: #fbbf24 !important;
  font-weight: 700;
}

.round-debug-preview {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  font-size: 0.68rem;
  color: rgba(226, 232, 240, 0.86);
}

.round-debug-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px;
  overflow: auto;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
}

.round-debug-modal {
  width: calc(100vw - 20px);
  max-width: none;
  max-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(139, 92, 246, 0.72);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.98);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
}

.round-debug-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.round-debug-modal-header > div:first-child {
  min-width: 0;
}

.round-debug-modal-title {
  font-size: 1rem;
  font-weight: 800;
}

.round-debug-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.round-debug-copy {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.24);
  color: #cffafe;
  font-weight: 800;
  cursor: pointer;
}

.round-debug-copy:hover {
  border-color: rgba(103, 232, 249, 0.8);
  background: rgba(14, 116, 144, 0.38);
}

.round-debug-copy:disabled {
  cursor: default;
  opacity: 0.72;
}

.round-debug-modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-weight: 800;
  cursor: pointer;
}

.round-debug-modal-close:hover {
  border-color: rgba(248, 113, 113, 0.75);
  color: #fecaca;
}

.round-debug-modal-body {
  padding: 14px 16px 16px;
  overflow: auto;
}

.round-debug-modal .live-recent-rounds-scroll {
  overflow: visible;
}

.round-debug-modal .round-debug-table {
  min-width: 1400px;
  table-layout: auto;
}

.round-debug-modal .round-debug-table th,
.round-debug-modal .round-debug-table td {
  white-space: nowrap;
}

.round-debug-modal .round-debug-table th:last-child,
.round-debug-modal .round-debug-table td:last-child {
  min-width: 520px;
  white-space: normal;
  text-align: left;
}

.mini-comm-bar {
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(6, 11, 20, 0.6);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.mini-comm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.mini-comm-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.mini-comm-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-comm-messages {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  line-height: 1.3;
}

.mini-comm-input {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.mini-comm-input input {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 18, 34, 0.8);
  color: #fff;
  font-size: 0.75rem;
}

.mini-comm-message {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.mini-comm-message .sender {
  font-weight: 600;
  color: #7dff8a;
}

.mini-comm-message.ping {
  color: #ffb347;
  font-weight: 600;
}

.mini-comm-empty {
  font-size: 0.75rem;
  opacity: 0.8;
}

.comm-message {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.comm-message strong {
  color: #7dff8a;
}

.comm-message.ping {
  color: #ffb347;
  font-weight: 600;
}

.comm-message.boost-msg,
.comm-message.round-msg {
  background: rgba(148, 163, 184, 0.2);
}

.comm-chat-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comm-chat-input input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  color: #fff;
}

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

.comm-meta {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 6px;
}

.comm-members {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.comm-members h5 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dff8a;
}

.comm-member-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  gap: 8px;
}

.comm-member-row:last-child {
  margin-bottom: 0;
}

.comm-member-row .status {
  font-weight: 600;
}

.comm-member-row.online .status {
  color: #7dff8a;
}

.comm-member-row.offline .status {
  color: #999;
}

.comm-member-actions {
  display: flex;
  gap: 6px;
}

.comm-member-actions .btn {
  padding: 2px 6px;
  font-size: 0.7rem;
}

.comm-snapshots {
  margin-top: 8px;
  max-height: 320px;
  overflow: auto;
}

.comm-snapshot {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.comm-snapshot h5 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dff8a;
}

.comm-snapshot table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.comm-snapshot th,
.comm-snapshot td {
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.comm-snapshot tr:last-child td {
  border-bottom: none;
}

#calculatorGrid .card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 1rem;
}

#calculatorGrid h3 {
  margin: 0 0 10px 0;
}

#calculatorGrid input {
  min-width: 0;
  padding: 3px 6px !important;
  height: 24px;
  font-size: 0.92rem !important;
  line-height: 1.15;
}

#calculatorGrid label span {
  font-size: 0.72rem !important;
}

#calculatorGrid button {
  padding: 6px 8px !important;
  font-size: 0.82rem !important;
}

#calculatorGrid .calc-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#calculatorGrid .calc-section {
  margin-bottom: 0 !important;
}

.sidebar-resizer {
  width: 8px;
  background:
    linear-gradient(180deg, rgba(84, 216, 255, 0.18), rgba(132, 77, 255, 0.28)),
    rgba(2, 8, 28, 0.66);
  position: fixed;
  left: auto;
  right: min(var(--sidepanel-width), var(--sidepanel-max-width));
  top: 0;
  bottom: 0;
  cursor: ew-resize;
  border: 1px solid rgba(84, 216, 255, 0.18);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.38);
  z-index: 2147483647;
}

.card {
  position: relative;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 15px 25px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(226, 232, 240, 0.1);
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.2s ease;
  overflow: visible;
  box-sizing: border-box;
}

.admin-payload-status {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0;
}
.admin-payload-status.warn {
  color: #fbbf24;
}

.global-game-tab-warning {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(248, 113, 113, 0.15);
  color: #ffbebe;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  display: none;
  z-index: 999;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Remove padding from cards that contain special styled cards */
.card:has(.current-round-card),
.card:has(.boost-summary-card),
.card.special-card-wrapper {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Card delete button for individual cards */
.card-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 100;
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  line-height: 1;
  opacity: 0;
  pointer-events: auto;
}

.card-delete-btn {
  display: none !important;
}

/* Cavern theme overrides (asset pack) */
/* === CAVERN THEME - PREMIUM REDESIGN === */
:root[data-theme='cavern'] {
  /* Color Palette */
  --cavern-purple-1: #7c3aed;
  --cavern-purple-2: #a78bfa;
  --cavern-purple-3: #c4b5fd;
  --cavern-indigo: #6366f1;
  --cavern-gold: #fbbf24;
  --cavern-orange: #fb923c;
  --cavern-red: #ef4444;
  --cavern-cyan: #22d3ee;
  --cavern-green: #10b981;

  /* Backgrounds */
  --cavern-bg-primary: #0a0c14;
  --cavern-bg-secondary: rgba(10, 12, 20, 0.95);
  --cavern-bg-tertiary: rgba(15, 18, 28, 0.92);
  --cavern-panel-bg: rgba(12, 15, 24, 0.88);
  --cavern-card-bg: rgba(15, 18, 26, 0.85);

  /* Borders & Glows */
  --cavern-border-primary: rgba(124, 58, 237, 0.4);
  --cavern-border-secondary: rgba(167, 139, 250, 0.3);
  --cavern-glow-purple: rgba(124, 58, 237, 0.5);
  --cavern-glow-gold: rgba(251, 191, 36, 0.6);

  /* Shadows */
  --cavern-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --cavern-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --cavern-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --cavern-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.7);
}

/* === BODY & SHELL === */
:root[data-theme='cavern'] body {
  background: url('style/background/cavern_background.png') center / cover no-repeat fixed;
}

:root[data-theme='cavern'] .app-shell {
  background:
    linear-gradient(180deg, rgba(6, 8, 14, 0.92) 0%, rgba(6, 8, 14, 0.95) 100%),
    url('style/background/cavern_background.png') center / cover no-repeat fixed;
  border-left: 2px solid var(--cavern-border-primary);
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.8);
  position: fixed;
  padding-right: 26px;
}

:root[data-theme='cavern'] .app-shell > *:not(.menu-overlay):not(.menu-drawer) {
  position: relative;
  z-index: 1;
}

/* === HEADER CONTAINER === */
:root[data-theme='cavern'] .header-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: transparent;
}

/* === LOGO SECTION === */
:root[data-theme='cavern'] .logo-section {
  flex-shrink: 0;
}

:root[data-theme='cavern'] .logo-image {
  width: 100px;
  height: auto;
  display: block;
}

/* === TAB NAVIGATION === */
:root[data-theme='cavern'] .tab-nav {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
}

/* === THEME CONTROLS === */
:root[data-theme='cavern'] .theme-controls {
  padding: 0 16px 16px 16px;
}

/* === LOGO SECTION === */
:root[data-theme='cavern'] .cavern-logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(167, 139, 250, 0.12)),
    rgba(15, 18, 28, 0.6);
  border: 1px solid var(--cavern-border-secondary);
  border-radius: 16px;
  box-shadow:
    0 0 30px var(--cavern-glow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  width: 88px;
  height: 88px;
}

:root[data-theme='cavern'] .cavern-logo-section::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(124, 58, 237, 0.1) 50%,
    transparent 100%
  );
  animation: rotateLogo 10s linear infinite;
}

@keyframes rotateLogo {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

:root[data-theme='cavern'] .cavern-logo-image {
  position: relative;
  width: 64px;
  height: 64px;
  background: url('style/minecart_logo.png') center / contain no-repeat;
  filter: drop-shadow(0 4px 16px rgba(251, 191, 36, 0.7));
  animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

:root[data-theme='cavern'] .cavern-logo-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

:root[data-theme='cavern'] .cavern-logo-title {
  font-family: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--cavern-gold) 0%, var(--cavern-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(251, 191, 36, 0.6));
  text-transform: uppercase;
}

:root[data-theme='cavern'] .cavern-logo-subtitle {
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cavern-purple-2);
  text-transform: uppercase;
  opacity: 0.8;
}

/* === NAVIGATION === */
:root[data-theme='cavern'] .cavern-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
  max-width: 700px;
}

:root[data-theme='cavern'] .nav-btn {
  font-size: 13px;
  padding: 14px 12px;
  min-height: 52px;
}

:root[data-theme='cavern'] .tab-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 10px 12px 14px;
}

:root[data-theme='cavern'] body.debug-panel-visible .tab-content {
  padding-bottom: 50px;
}

/* === PILL-STYLE BUTTON SYSTEM === */
:root[data-theme='cavern'] .tab,
:root[data-theme='cavern'] .btn {
  position: relative;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

:root[data-theme='cavern'] .tab {
  min-height: 36px;
  width: 100%;
  padding: 8px 12px;
  font-size: 10px;
}

/* Different colored borders for each tab */
:root[data-theme='cavern'] .tab[data-tab='live'] {
  border-color: #a78bfa;
}

:root[data-theme='cavern'] .tab[data-tab='calculator'] {
  border-color: #f97316;
}

:root[data-theme='cavern'] .tab[data-tab='tools'] {
  border-color: #22d3ee;
}

:root[data-theme='cavern'] .tab[data-tab='stats'] {
  border-color: #a78bfa;
}

:root[data-theme='cavern'] .tab[data-tab='personal'] {
  border-color: #34d399;
}

:root[data-theme='cavern'] .tab[data-tab='clans'] {
  border-color: #fbbf24;
}

:root[data-theme='cavern'] .tab[data-tab='clan-selection'] {
  border-color: #38bdf8;
}

:root[data-theme='cavern'] .tab[data-tab='subscription'] {
  border-color: #f97316;
}

:root[data-theme='cavern'] .btn {
  min-height: 36px;
  padding: 8px 14px;
  border-color: #a78bfa;
}

:root[data-theme='cavern'] .btn.sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
}

/* === BUTTON HOVER === */
:root[data-theme='cavern'] .tab:hover,
:root[data-theme='cavern'] .btn:hover {
  background: rgba(20, 20, 30, 0.9);
  box-shadow: 0 0 20px currentColor;
  transform: translateY(-1px);
}

/* === BUTTON ACTIVE/PRESSED === */
:root[data-theme='cavern'] .tab.active {
  background: rgba(30, 30, 40, 1);
  box-shadow: 0 0 25px currentColor, inset 0 0 20px rgba(255, 255, 255, 0.1);
}

:root[data-theme='cavern'] .btn:active {
  transform: translateY(0);
}

/* === BUTTON DISABLED === */
:root[data-theme='cavern'] .tab:disabled,
:root[data-theme='cavern'] .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* === GHOST BUTTON VARIANT === */
:root[data-theme='cavern'] .btn.ghost {
  background: transparent;
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow: none;
}

:root[data-theme='cavern'] .btn.ghost:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
}

/* === PREMIUM CARD SYSTEM === */
:root[data-theme='cavern'] .card,
:root[data-theme='cavern'] .comm-card,
:root[data-theme='cavern'] .stats-win-section {
  position: relative;
  background:
    linear-gradient(135deg, rgba(15, 18, 28, 0.92), rgba(12, 15, 24, 0.88)),
    rgba(10, 12, 20, 0.6);
  border: 2px solid rgba(124, 58, 237, 0.5) !important;
  border-radius: 14px !important;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(124, 58, 237, 0.3);
  backdrop-filter: blur(12px) saturate(180%);
  padding: 16px !important;
  margin: 0 !important;
  overflow: hidden !important;
  transition: all 0.3s ease;
  box-sizing: border-box !important;
  width: 100% !important;
}

:root[data-theme='cavern'] .card *,
:root[data-theme='cavern'] .comm-card *,
:root[data-theme='cavern'] .stats-win-section * {
  box-sizing: border-box !important;
  max-width: 100%;
}

:root[data-theme='cavern'] .card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(124, 58, 237, 0.08) 0%,
    transparent 50%,
    rgba(251, 191, 36, 0.05) 100%);
  pointer-events: none;
  opacity: 0.6;
  border-radius: 14px;
}

:root[data-theme='cavern'] .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cavern-purple-2) 50%,
    transparent 100%);
  opacity: 0.3;
  border-radius: 14px 14px 0 0;
}

:root[data-theme='cavern'] .card:has(.current-round-card),
:root[data-theme='cavern'] .card:has(.boost-summary-card),
:root[data-theme='cavern'] .card.special-card-wrapper {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.1)),
    rgba(12, 15, 24, 0.95);
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 24px;
}

:root[data-theme='cavern'] .current-round-card {
  background: transparent;
  border: none;
  box-shadow: none;
}

:root[data-theme='cavern'] .current-round-card::before {
  display: none;
}

/* === CARD INTERACTIONS === */
:root[data-theme='cavern'] .card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(124, 58, 237, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme='cavern'] .card:hover::before {
  opacity: 0.6;
}

:root[data-theme='cavern'] .card[draggable="true"] {
  border-color: rgba(124, 58, 237, 0.6);
  cursor: default;
}

:root[data-theme='cavern'] .card:active {
  cursor: default;
  transform: none;
}

:root[data-theme='cavern'] .card.deleted {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

:root[data-theme='cavern'] .card:hover .card-delete-btn {
  opacity: 1;
}

:root[data-theme='cavern'] .card-delete-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #fff;
  opacity: 0;
  transition: all 0.2s ease;
}

:root[data-theme='cavern'] .card-delete-btn:hover {
  background: rgba(239, 68, 68, 0.5);
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
  transform: scale(1.1);
}

:root[data-theme='cavern'] .card-delete-btn:active {
  transform: scale(0.95);
}

/* === CHAT & COMMUNICATION === */
:root[data-theme='cavern'] .comm-chat,
:root[data-theme='cavern'] .comm-card,
:root[data-theme='cavern'] .stats-win-section,
:root[data-theme='cavern'] .stats-tabs-card {
  border-radius: 16px;
}

:root[data-theme='cavern'] .stats-win-section {
  padding: 10px !important;
  margin-top: 8px;
}

:root[data-theme='cavern'] .card[data-card-id="stats-dashboard-card"] {
  padding: 12px !important;
}

:root[data-theme='cavern'] .comm-chat {
  background:
    linear-gradient(135deg, rgba(15, 18, 28, 0.95), rgba(12, 15, 24, 0.92)),
    rgba(10, 12, 20, 0.8);
  border: 1px solid var(--cavern-border-primary);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 24px var(--cavern-glow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme='cavern'] .comm-chat-input input {
  background: rgba(12, 15, 24, 0.9);
  border: 1px solid var(--cavern-border-secondary);
  border-radius: 10px;
  padding: 12px 16px;
  color: #f8fafc;
  font-family: 'Rajdhani', system-ui, sans-serif;
  transition: all 0.3s ease;
}

:root[data-theme='cavern'] .comm-chat-input input:focus {
  border-color: var(--cavern-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  outline: none;
}

/* === TYPOGRAPHY === */
:root[data-theme='cavern'] .tab-panel h2,
:root[data-theme='cavern'] .clan-comm .title,
:root[data-theme='cavern'] .stats-win-title {
  font-family: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cavern-purple-2), var(--cavern-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
  letter-spacing: 0.05em;
}

/* === PREMIUM COMPONENT CLASSES === */
.cavern-input {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(99, 102, 241, 0.05)),
    rgba(12, 15, 24, 0.95);
  border: 1px solid var(--cavern-border-secondary);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f8fafc;
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-size: 1em;
  font-weight: 500;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 0 rgba(124, 58, 237, 0);
}

.cavern-input:focus {
  outline: none;
  border-color: var(--cavern-gold);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 146, 60, 0.08)),
    rgba(15, 18, 28, 1);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(251, 191, 36, 0.4);
}

.cavern-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.cavern-header {
  font-family: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  font-size: 1.3em;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--cavern-gold), var(--cavern-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(251, 191, 36, 0.5));
  margin: 0 0 16px 0;
  text-transform: uppercase;
}

.cavern-section {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(99, 102, 241, 0.05)),
    rgba(12, 15, 24, 0.6);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--cavern-border-secondary);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cavern-section-title {
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95em;
  margin-bottom: 12px;
  color: var(--cavern-purple-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.cavern-grid {
  display: grid;
  gap: 8px;
}

.cavern-grid-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, 0.6fr);
  gap: 8px;
  align-items: center;
}

.cavern-label-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cavern-label-text {
  opacity: 0.7;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cavern-icon-label {
  opacity: 0.9;
  font-size: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cavern-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-size: 1em;
}

.cavern-table th {
  background: rgba(138, 92, 246, 0.15);
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cavern-purple-2);
  border-bottom: 2px solid rgba(138, 92, 246, 0.3);
}

.cavern-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(138, 92, 246, 0.1);
}

.cavern-table tr:hover {
  background: rgba(124, 58, 237, 0.12);
  transition: background 0.2s ease;
}

/* === SCROLLBAR STYLING === */
:root[data-theme='cavern'] *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

:root[data-theme='cavern'] *::-webkit-scrollbar-track {
  background: rgba(10, 12, 20, 0.6);
  border-radius: 5px;
}

:root[data-theme='cavern'] *::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--cavern-purple-1), var(--cavern-indigo));
  border-radius: 5px;
  border: 2px solid rgba(10, 12, 20, 0.6);
}

:root[data-theme='cavern'] *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--cavern-purple-2), var(--cavern-gold));
  box-shadow: 0 0 12px var(--cavern-glow-purple);
}

/* === THEME SELECT === */
:root[data-theme='cavern'] .theme-select {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(99, 102, 241, 0.12)),
    rgba(15, 18, 28, 0.9);
  border: 1px solid var(--cavern-border-secondary);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--cavern-purple-2);
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

:root[data-theme='cavern'] .theme-select:hover {
  border-color: var(--cavern-border-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 20px var(--cavern-glow-purple);
}

:root[data-theme='cavern'] .theme-select:focus {
  outline: none;
  border-color: var(--cavern-gold);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.5);
}

/* === CARD GRID === */
:root[data-theme='cavern'] .card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  padding-right: 0;
}

/* === PREMIUM ACCENTS === */
:root[data-theme='cavern'] .highlight-gold {
  color: var(--cavern-gold);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

:root[data-theme='cavern'] .highlight-green {
  color: var(--cavern-green);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

:root[data-theme='cavern'] .highlight-red {
  color: var(--cavern-red);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.cavern-table-cell-icon {
  font-size: 1.3em;
  text-align: center;
}

.cavern-table-cell-number {
  font-size: 1.1em;
  font-weight: 500;
  color: #f8fafc;
}

.cavern-table-cell-subtext {
  font-size: 0.7em;
  opacity: 0.6;
  display: block;
  margin-top: 2px;
}

.cavern-button-primary {
  color: #f8fafc;
  font-family: 'Rajdhani', 'Orbitron', 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 999px;
  background-color: transparent;
  background-image: var(--cavern-btn-normal);
  background-repeat: no-repeat;
  background-size: 100% var(--cavern-btn-crop-size);
  background-position: center var(--cavern-btn-crop-pos);
  box-shadow: 0 8px 18px rgba(8, 9, 16, 0.65), 0 0 18px rgba(106, 76, 255, 0.45);
  text-shadow: 0 2px 6px rgba(7, 9, 16, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 10px 16px;
  min-height: 42px;
  cursor: pointer;
}

.cavern-button-primary:hover {
  background-image: var(--cavern-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(8, 9, 16, 0.7), 0 0 20px rgba(249, 115, 22, 0.45);
}

.cavern-button-primary:active {
  background-image: var(--cavern-btn-active);
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(8, 9, 16, 0.7), 0 0 22px rgba(249, 115, 22, 0.55);
}

.cavern-button-secondary {
  color: #f8fafc;
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid rgba(138, 92, 246, 0.4);
  border-radius: 6px;
  background: rgba(138, 92, 246, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.cavern-button-secondary:hover {
  background: rgba(138, 92, 246, 0.25);
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.cavern-button-secondary:active {
  transform: translateY(1px);
}

.calculator-container {
  font-size: 1.8em;
  padding: 8px;
}

.calc-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.calc-tab-btn {
  border: 1px solid var(--cavern-border-secondary);
  background: rgba(12, 15, 24, 0.7);
  color: var(--cavern-purple-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
}

.calc-tab-btn.active {
  color: var(--cavern-gold);
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.calc-tab-panel {
  display: none;
}

.calc-tab-panel.active {
  display: block;
}

.calc-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.calc-profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  opacity: 0.85;
}

.calc-profile-cards {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.calc-profile-card {
  border: 1px solid var(--cavern-border-secondary);
  background: rgba(12, 15, 24, 0.8);
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.calc-profile-card.active {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.calc-profile-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.calc-profile-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8em;
  opacity: 0.85;
}

.calculator-results {
  padding: 8px;
  font-size: 1rem;
  max-height: 600px;
  overflow-y: auto;
}

.solo-mining-calculator {
  display: grid;
  gap: 10px;
  padding: 4px;
}

.solo-calc-grid {
  display: grid;
  gap: 8px;
}

.solo-calc-main-inputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.solo-calc-settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.solo-calc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.solo-calc-actions .muted {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.solo-calc-results {
  display: grid;
  gap: 10px;
}

.solo-calc-empty {
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(2, 18, 35, 0.72);
  border-radius: 8px;
  padding: 10px;
  color: rgba(226, 232, 240, 0.78);
}

.solo-calc-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(2, 18, 35, 0.72);
}

.solo-calc-summary > div {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid rgba(56, 189, 248, 0.18);
}

.solo-calc-summary > div:last-child {
  border-right: 0;
}

.solo-calc-summary span,
.solo-calc-table th {
  display: block;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.solo-calc-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.solo-calc-summary .good strong,
.solo-calc-net.good td {
  color: #4ade80;
}

.solo-calc-summary .bad strong,
.solo-calc-net.bad td {
  color: #fb7185;
}

.solo-calc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(2, 18, 35, 0.58);
  font-size: 0.88rem;
}

.solo-calc-table th,
.solo-calc-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.13);
  text-align: left;
  vertical-align: top;
}

.solo-calc-table td {
  font-weight: 700;
  color: #e5edf9;
  overflow-wrap: anywhere;
}

.solo-calc-table small {
  display: block;
  margin-top: 2px;
  color: rgba(148, 163, 184, 0.85);
  font-weight: 600;
}

.solo-calc-note {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.76rem;
  line-height: 1.3;
}

#calculatorGrid .calculator-container {
  font-size: 1rem;
  padding: 4px;
  min-width: 0;
}

#calculatorGrid .cavern-header {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

#calculatorGrid .cavern-section {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
}

#calculatorGrid .cavern-section-title {
  margin-bottom: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

#calculatorGrid .cavern-grid-row {
  grid-template-columns: minmax(58px, 0.9fr) repeat(3, minmax(42px, 0.7fr));
  gap: 6px;
}

#calculatorGrid .cavern-icon-label {
  justify-content: flex-start;
  min-width: 0;
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

#calculatorGrid .cavern-table {
  table-layout: fixed;
  font-size: 0.95rem;
}

#calculatorGrid .cavern-table th,
#calculatorGrid .cavern-table td {
  padding: 5px 6px;
}

#calculatorGrid .cavern-table-cell-icon {
  width: 22%;
  font-size: 0.9rem;
}

#calculatorGrid .cavern-table-cell-number {
  font-size: 0.95rem;
  white-space: normal;
}

#calculatorGrid .cavern-table-cell-subtext {
  display: block;
  font-size: 0.72rem;
  opacity: 0.68;
}

@media (max-width: 700px) {
  #calculatorGrid {
    gap: 10px;
    padding-right: 0;
  }

  #calculatorGrid .card {
    padding: 12px;
    border-radius: 12px;
  }

  #calculatorGrid .calc-sections {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #calculatorGrid .calc-sections .cavern-grid[style*="grid-template-columns"] {
    grid-template-columns: minmax(64px, 0.9fr) repeat(2, minmax(46px, 0.55fr)) !important;
    gap: 6px;
  }

  #calculatorGrid .cavern-grid-row {
    grid-template-columns: minmax(58px, 0.85fr) repeat(3, minmax(40px, 0.55fr));
  }

  #calculatorGrid .cavern-icon-label {
    font-size: 0.95rem;
  }

  #calculatorGrid .calculator-results {
    padding: 4px;
    font-size: 0.92rem;
    max-height: none;
  }

  #calculatorGrid .calculator-results > div {
    padding: 4px !important;
  }

  #calculatorGrid .calculator-results > div > div:first-child {
    padding: 8px !important;
    margin-bottom: 10px !important;
    font-size: 0.86rem !important;
    gap: 8px;
  }

  #calculatorGrid .cavern-table {
    font-size: 0.84rem;
  }

  #calculatorGrid .cavern-table th,
  #calculatorGrid .cavern-table td {
    padding: 4px;
  }
}

@media (max-width: 430px) {
  #calculatorGrid .card {
    padding: 10px;
  }

  #calculatorGrid .calculator-container {
    font-size: 0.9rem;
    padding: 0;
  }

  #calculatorGrid .cavern-header {
    font-size: 0.98rem;
  }

  #calculatorGrid .cavern-section {
    padding: 10px;
  }

  #calculatorGrid .cavern-grid-row {
    grid-template-columns: minmax(54px, 0.8fr) repeat(3, minmax(36px, 0.55fr)) !important;
    gap: 5px;
  }

  #calculatorGrid .calc-sections .cavern-grid[style*="grid-template-columns"] {
    grid-template-columns: minmax(60px, 0.8fr) repeat(2, minmax(42px, 0.55fr)) !important;
    gap: 5px;
  }

  #calculatorGrid input {
    height: 22px;
    padding: 2px 5px !important;
    font-size: 0.82rem !important;
  }

  #calculatorGrid label span,
  #calculatorGrid .cavern-label-text {
    font-size: 0.62rem !important;
    letter-spacing: 0.04em;
  }

  #calculatorGrid .cavern-icon-label {
    font-size: 0.84rem;
  }

  #calculatorGrid .cavern-section-title {
    font-size: 0.74rem;
  }

  #calculatorGrid .cavern-table {
    font-size: 0.76rem;
  }

  #calculatorGrid .cavern-table-cell-number {
    font-size: 0.78rem;
  }

  #calculatorGrid .cavern-table-cell-subtext {
    font-size: 0.64rem;
  }

  .solo-calc-main-inputs,
  .solo-calc-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solo-calc-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .solo-calc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solo-calc-summary > div:nth-child(2n) {
    border-right: 0;
  }

  .solo-calc-summary strong {
    font-size: 0.88rem;
  }

  .solo-calc-table {
    font-size: 0.78rem;
  }
}

.live-boost-indicator {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.7rem;
}

.live-boost-indicator.green {
  border-color: rgba(34, 197, 94, 0.6);
}

.live-boost-indicator.orange {
  border-color: rgba(249, 115, 22, 0.6);
}

.live-boost-indicator.red {
  border-color: rgba(239, 68, 68, 0.6);
}

.live-boost-indicator__label {
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.live-boost-indicator__meta,
.live-boost-indicator__boosts,
.live-boost-indicator__budget {
  opacity: 0.8;
}

.live-boost-indicator__boosts div {
  margin-top: 2px;
}

.live-boost-indicator__controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.live-boost-indicator__control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.live-boost-indicator__control select {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: inherit;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
}

.live-boost-indicator__profile {
  font-size: 0.7rem;
  opacity: 0.75;
}

.drop-placeholder {
  height: 80px;
  border: 2px dashed rgba(59, 130, 246, 0.6);
  border-radius: 14px;
  margin: 4px 0;
  background: rgba(59, 130, 246, 0.05);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: rgba(226, 232, 240, 0.8);
}

.card.draggable {
  /* allow vertical panning so scrolling still works while keeping drag gestures */
  touch-action: pan-y;
}

:root[data-theme='pastel'] {
  --bg: #f0ecdf;
  --panel: #fdfaf6;
  --text: #2f2738;
  --accent: #f59e0b;
  --accent-2: #6366f1;
}

:root[data-theme='pastel'] body {
  background: #f0ecdf;
}

:root[data-theme='pastel'] .card {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.2);
}

:root[data-theme='pastel'] .current-round-card {
  background: #fdf9f2;
  border-color: #f59e0b;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.2);
}

:root[data-theme='pastel'] .current-round-card * {
  color: #2f2738;
}

:root[data-theme='pastel'] .current-round-card .boost-icon,
:root[data-theme='pastel'] .current-round-card .pill-icon {
  color: #2f2738;
}

:root[data-theme='pastel'] .current-round-card .boost-type-pill,
:root[data-theme='pastel'] .current-round-card .boost-type-pill.icon-only {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='pastel'] .boost-summary-card {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='pastel'] .boost-summary-card * {
  color: #2f2738;
}

:root[data-theme='pastel'] .tab {
  color: #2f2738;
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='pastel'] .tab.active {
  color: #1b1424;
  background: #ffe9c6;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  transform: none;
}

:root[data-theme='pastel'] .tabnav {
  color: #2f2738;
}

:root[data-theme='pastel'] .add-cards-btn,
:root[data-theme='pastel'] .theme-select {
  color: #2f2738;
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='pastel'] .tab::before {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
}

:root[data-theme='pastel'] .tab-content {
  background: #f9f4ea;
}

:root[data-theme='pastel'] .boost-pill,
:root[data-theme='pastel'] .boost-type-pill,
:root[data-theme='pastel'] .boost-type-pill.icon-only {
  background: #ffffff;
  color: #2f2738;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='pastel'] .boost-pill .boost-value,
:root[data-theme='pastel'] .boost-type-pill,
:root[data-theme='pastel'] .boost-type-pill .pill-icon,
:root[data-theme='pastel'] .boost-type-pill.icon-only .pill-icon,
:root[data-theme='pastel'] .boost-list .boost-pill,
:root[data-theme='pastel'] .boost-list .boost-pill .pill-icon {
  color: #2f2738;
}

:root[data-theme='dark'] {
  --bg: #05070d;
  --panel: #0d111a;
  --text: #f8fafc;
  --accent: #34d399;
  --accent-2: #38bdf8;
}

:root[data-theme='dark'] body {
  background: #05070d;
}

:root[data-theme='dark'] .card {
  background: #111827;
  border-color: #1f2933;
}

.card.dragging {
  opacity: 1;
  transform: none;
  box-shadow: none;
}

/* Current round card - game-style horizontal bar */
.current-round-card {
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid #f59e0b;
  border-radius: 24px;
  padding: 8px 10px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.current-round-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.05) 100%);
  pointer-events: none;
}

.live-loading-status {
  position: relative;
  z-index: 1;
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(113, 63, 18, 0.22);
  color: #f8fafc;
  font-size: 0.72rem;
}

.live-loading-status--compact {
  padding-right: 34px;
}

.live-loading-status--ready {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(6, 78, 59, 0.22);
}

.live-loading-status__toggle {
  position: absolute;
  top: 7px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.58);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.live-loading-status__toggle:hover,
.live-loading-status__toggle:focus-visible {
  border-color: rgba(56, 213, 255, 0.55);
  color: #e0f2fe;
}

.live-loading-status__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.9fr);
  gap: 8px;
  align-items: start;
}

.live-loading-status__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fbbf24;
}

.live-loading-status--ready .live-loading-status__label {
  color: #6ee7b7;
}

.live-loading-status__reason {
  margin-top: 2px;
  color: rgba(248, 250, 252, 0.9);
}

.live-loading-status__next {
  color: rgba(226, 232, 240, 0.82);
  text-align: right;
}

.live-loading-status__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.live-loading-status__chips span {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.36);
  color: rgba(226, 232, 240, 0.86);
  white-space: nowrap;
}

.live-loading-status__signals {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
  align-items: start;
}

.live-loading-status__signals-title {
  padding-top: 6px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-loading-status__signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.live-loading-status__signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.46);
  color: rgba(226, 232, 240, 0.9);
  font-weight: 700;
  cursor: pointer;
}

.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__signals-title,
.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__main,
.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__chips,
.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__signal-panels {
  display: none;
}

.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__signals {
  grid-template-columns: 1fr;
}

.live-loading-status--compact:not(.live-loading-status--expanded) .live-loading-status__signal-list {
  gap: 8px;
}

.live-loading-status--compact .live-loading-status__signal {
  min-height: 10px;
  height: 16px;
  width: 16px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
}

.live-loading-status--compact .live-loading-status__signal .live-loading-status__step,
.live-loading-status--compact .live-loading-status__signal > span:last-child {
  display: none;
}

.live-loading-status--compact .live-loading-status__lamp {
  margin: 0;
}

.live-loading-status__signal.active {
  border-color: rgba(56, 213, 255, 0.55);
  background: rgba(8, 47, 73, 0.54);
  color: #e0f2fe;
}

.live-loading-status__diagnostic > summary::-webkit-details-marker {
  display: none;
}

.live-loading-status__lamp {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5);
}

.live-loading-status__lamp--green {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5), 0 0 10px rgba(34, 197, 94, 0.8);
}

.live-loading-status__lamp--orange {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5), 0 0 10px rgba(245, 158, 11, 0.75);
}

.live-loading-status__lamp--red {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5), 0 0 10px rgba(239, 68, 68, 0.75);
}

.live-loading-status__signal-panels {
  grid-column: 1 / -1;
  min-width: 0;
}

.live-loading-status__panel {
  display: none;
  margin-top: 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.3);
}

.live-loading-status__panel.active {
  display: block;
}

.live-loading-status__panel-heading {
  display: grid;
  grid-template-columns: 10px max-content minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px 0;
  font-weight: 800;
}

.live-loading-status__order {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.live-loading-status__diagnostic {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.3);
}

.live-loading-status__diagnostic > summary {
  display: grid;
  grid-template-columns: 20px 10px max-content minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  cursor: pointer;
  list-style: none;
}

.live-loading-status__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.64rem;
  font-weight: 800;
}

.live-loading-status__summary {
  min-width: 0;
  color: rgba(226, 232, 240, 0.78);
  overflow-wrap: anywhere;
}

.live-loading-status__details {
  margin: 0 7px 7px;
  padding: 7px;
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.42);
}

.live-loading-status__detail-line {
  padding: 2px 0;
  color: rgba(226, 232, 240, 0.8);
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .live-loading-status__main {
    grid-template-columns: 1fr;
  }

  .live-loading-status__next {
    text-align: left;
  }

  .live-loading-status__signals {
    grid-template-columns: 1fr;
  }

  .live-loading-status__signals-title {
    padding-top: 0;
  }

  .live-loading-status__diagnostic > summary {
    grid-template-columns: 20px 10px minmax(64px, max-content) minmax(0, 1fr);
  }
}

.live-total-score-chart {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
  position: relative;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.live-total-score-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  opacity: 1;
  margin-bottom: 0;
}

.live-total-score-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.live-total-score-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-total-score-label-text {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  opacity: 1;
}

.live-total-score-window-select {
  appearance: none;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.65rem;
  padding: 3px 18px 3px 8px;
  cursor: pointer;
}

.live-total-score-window-select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.live-total-score-live {
  font-size: 0.74rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.live-total-score-ct {
  height: 129px;
  position: relative;
  cursor: crosshair;
  pointer-events: auto;
}

.live-total-score-ct svg {
  overflow: visible;
  shape-rendering: geometricPrecision;
  pointer-events: auto;
}

.live-total-score-ct .ct-label {
  fill: #ffffff !important;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-rendering: geometricPrecision;
}

.live-total-score-ct .ct-label.ct-horizontal,
.live-total-score-ct .ct-label.ct-vertical,
.live-total-score-ct text {
  fill: #ffffff !important;
  color: #ffffff;
}

.live-total-score-ct .ct-grid {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
}

.live-total-score-ct .ct-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: none;
}

.live-total-score-ct .ct-series-a .ct-line {
  stroke: #38bdf8;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.45));
}

.live-total-score-ct .ct-series-a .ct-area {
  fill: rgba(56, 189, 248, 0.22);
  transition: none;
}

.live-total-score-ct .ct-series-a .ct-point {
  stroke: #38bdf8;
  stroke-width: 6px;
  stroke-linecap: round;
  transition: none;
}

.live-total-score-ct .ct-series-a .ct-point.is-hovered {
  stroke: #ffffff;
  stroke-width: 9px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
}

.live-total-score-hover-line {
  position: absolute;
  width: 1px;
  background: rgba(226, 232, 240, 0.35);
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.live-total-score-tooltip {
  position: absolute;
  min-width: 120px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  display: none;
  transform: translate(-50%, -110%);
  z-index: 3;
  text-rendering: geometricPrecision;
}

.live-total-score-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.live-total-score-tooltip-row .label {
  opacity: 0.85;
}

.live-total-score-boost-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.live-total-score-boost-marker {
  position: absolute;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, 0);
  pointer-events: auto;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.001);
  touch-action: manipulation;
}

.live-total-score-boost-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  image-rendering: -webkit-optimize-contrast;
  pointer-events: none;
}

.live-total-score-boost-count {
  font-size: 0.6rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.live-total-score-boost-marker:hover .live-total-score-boost-icon {
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
  transform: scale(1.05);
}

.boost-minute-summary {
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.boost-minute-section {
  margin-top: 10px;
}

.boost-minute-section-title {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}

.boost-minute-list {
  display: grid;
  gap: 6px;
}

.boost-minute-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.boost-minute-type {
  font-weight: 600;
}

.boost-minute-count {
  font-weight: 700;
}

.boost-minute-events {
  display: grid;
  gap: 8px;
}

.boost-minute-event {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.boost-minute-time {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.boost-minute-event-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
}

.boost-minute-event-type {
  font-weight: 700;
}

.boost-minute-event-meta {
  opacity: 0.8;
}

.live-total-score-ct .ct-series-b .ct-line {
  stroke: #fb923c;
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  opacity: 0.9;
}

.live-total-score-ct .ct-series-b .ct-point {
  display: none;
}

.live-total-score-empty {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #ffffff;
  opacity: 0.9;
}

.live-total-score-svg {
  width: 100%;
  height: 70px;
  display: block;
}

.live-total-score-line {
  fill: none;
  stroke: rgba(56, 189, 248, 0.95);
  stroke-width: 1.5;
}

.live-total-score-baseline {
  fill: none;
  stroke: rgba(251, 146, 60, 0.85);
  stroke-width: 1.1;
  stroke-dasharray: 4 3;
}

.live-total-score-point {
  fill: #38bdf8;
  stroke: rgba(15, 23, 42, 0.9);
  stroke-width: 0.6;
}

.live-total-score-point:hover {
  fill: #7dd3fc;
}

.live-total-score-grid {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 0.6;
  shape-rendering: crispEdges;
}

.live-total-score-label {
  fill: rgba(226, 232, 240, 0.7);
  font-size: 3.8px;
  font-weight: 600;
}

.live-total-score-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #ffffff;
  opacity: 0.9;
  margin-top: 4px;
}

.round-info-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.info-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid rgba(251, 146, 60, 0.4);
  border-radius: 16px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  min-width: 0;
}

.info-pill:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(251, 146, 60, 0.6);
  transform: scale(1.02);
}

.round-pill {
  flex: 1.5;
}

.round-time-pill {
  flex: 0.7;
}

.multiplier-pill {
  flex: 1.3;
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(251, 146, 60, 0.5);
}

.info-icon {
  font-size: 0.95rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.2px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-clan-name {
  margin-top: 6px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-round-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Last Finished Round Card */
.last-finished-card {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(148, 163, 184, 0.4);
  border-radius: 20px;
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.last-finished-card:hover {
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.3);
}

.last-finished-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.last-finished-pill {
  background: rgba(148, 163, 184, 0.15);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.last-finished-pill:hover {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.5);
  transform: scale(1.05);
}

.last-finished-pill .pill-icon {
  font-size: 0.9rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.last-finished-pill .pill-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.last-finished-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  font-size: 0.75rem;
}

.info-row .info-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.info-row .info-text {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-row {
  border-left: 3px solid rgba(251, 191, 36, 0.6);
}

.player-row {
  border-left: 3px solid rgba(167, 139, 250, 0.6);
}

/* Boost summary card - light blue theme */
.boost-summary-card {
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid #38bdf8;
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow-x: hidden; /* prevent horizontal scrollbar */
  overflow-y: visible; /* allow dropdown panels to expand vertically */
  transition: all 0.3s ease;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  /* CRITICAL: Ensure no content forces width beyond container */
  min-width: 0;
}

.boost-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(14, 165, 233, 0.05) 100%);
  pointer-events: none;
}

.boost-summary-card:hover {
  border-color: #0ea5e9;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.boost-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  /* CRITICAL: Prevent content from forcing width */
  max-width: 100%;
  min-width: 0;
}

.boost-info-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  /* CRITICAL: Ensure grid respects container width */
  max-width: 100%;
  min-width: 0;
}

.boost-info-bar .info-pill {
  width: 100%;
  flex: none;
}

.boost-info-bar .round-time-pill {
  grid-column: 1 / -1;
}

.boost-stat-pill {
  background: rgba(56, 189, 248, 0.2);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  min-width: 0;
  /* CRITICAL: Ensure pills don't overflow */
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.7rem;
}

.boost-stat-pill:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: rgba(56, 189, 248, 0.6);
  transform: scale(1.02);
}

.boost-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin-bottom: 4px;
}

.boost-pill {
  background: rgba(56, 189, 248, 0.25);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: 10px;
  padding: 2px 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  font-size: 0.65rem;
  overflow-wrap: break-word;
  word-break: break-word;
  /* CRITICAL: Force pills to respect container width */
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.boost-pill:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: rgba(56, 189, 248, 0.7);
  transform: scale(1.05);
}

.boost-pill.empty {
  flex: 1;
  justify-content: center;
  opacity: 0.6;
}

.boost-pill.compact {
  padding: 2px 6px;
  gap: 2px;
  display: inline-flex;
  flex-wrap: nowrap;
}

.boost-pill.compact .boost-key {
  display: none; /* Verberg de boost naam */
}

.boost-pill.compact .pill-icon {
  font-size: 0.75rem;
}

.boost-pill.compact .boost-value {
  font-size: 0.65rem;
  font-weight: 700;
}

.boost-pill.user-boost {
  /* Achtergrond en border worden inline gezet per user (unieke kleuren) */
  color: #fff; /* ensure white text */
}

.boost-pill.user-boost:hover {
  /* Hover effect: maak de kleur iets feller */
  filter: brightness(1.15);
  transform: scale(1.05);
}

.boost-pill.user-boost .boost-value {
  color: #fff; /* white text for values */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.boost-pill.user-boost .pill-icon {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.boost-key {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.boost-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Booster player pills */
.booster-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  /* CRITICAL: Prevent overflow */
  max-width: 100%;
  min-width: 0;
}

.booster-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.booster-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
  flex-shrink: 0;
}

.percentage-pill {
  background: rgba(167, 139, 250, 0.25);
  border: 1.5px solid rgba(167, 139, 250, 0.5);
  border-radius: 10px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.percentage-pill:hover {
  background: rgba(167, 139, 250, 0.35);
  border-color: rgba(167, 139, 250, 0.7);
  transform: scale(1.05);
}

/* Icon-only style for boost pills (tooltip shows name & multiplier) */
.boost-type-pill.icon-only {
  background: rgba(129, 90, 255, 0.14); /* soft purple */
  border: 1px solid rgba(129, 90, 255, 0.22);
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  position: relative; /* allow badge overlay */
}

.boost-type-pill.icon-only .pill-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.boost-type-pill.icon-only:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(129, 90, 255, 0.22);
  border-color: rgba(129, 90, 255, 0.44);
}

/* Numeric badge overlay for amount */
.boost-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #7c3aed; /* stronger purple */
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  line-height: 1;
  /* ensure badges don't cause overflow */
  transform: translateZ(0);
  pointer-events: none; /* avoid accidental hovers */
}

.boost-type-pill {
  background: rgba(129, 90, 255, 0.12); /* soft purple */
  border: 1.25px solid rgba(129, 90, 255, 0.3);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  transition: all 0.12s ease;
}

.boost-type-pill .pill-icon {
  display: inline-block;
  font-size: 0.95rem;
  line-height: 1;
}

.pill-icon,
.boost-icon {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.boost-type-pill:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(129, 90, 255, 0.18);
  border-color: rgba(129, 90, 255, 0.45);
}

/* View switch (Group by clan) */
.view-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  width: 100%;
  padding: 4px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
.view-switch input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.view-switch .switch-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.85);
  flex: 1;
}

/* Limit select dropdown */
.limit-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  width: 100%;
  padding: 4px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}

.limit-label-text {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.85);
}

.limit-select {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: rgba(255,255,255,0.95);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2338bdf8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 22px;
}

.limit-select:hover {
  background-color: rgba(15, 23, 42, 1);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.limit-select:focus {
  border-color: var(--accent);
  background-color: rgba(15, 23, 42, 1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Dropdown options styling */
.limit-select option {
  background: #1f2937;
  color: rgba(255,255,255,0.95);
  padding: 8px;
}

/* Debug recent boosts button */
/* Boost lists: let content expand, no forced scrollbars */
.booster-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-right: 0;
  box-sizing: border-box;
  width: 100%;
} 

/* Toggle section button */
.toggle-section-btn {
  position: absolute;
  top: -4px;
  right: 4px;
  z-index: 10;
  background: rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  line-height: 1;
}

.toggle-section-btn:hover {
  background: rgba(56, 189, 248, 0.5);
  border-color: rgba(56, 189, 248, 0.7);
  transform: scale(1.1);
}

.toggle-section-btn:active {
  transform: scale(0.95);
}

/* Add cards button in header */
.add-cards-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.add-cards-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.add-cards-btn:active {
  transform: translateY(0);
}

/* Card recovery popup */
.card-popup-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
}

.card-popup-overlay.active {
  display: flex;
}

.card-popup {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid var(--accent);
}

.card-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-popup-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.card-popup-close {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f87171;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.card-popup-close:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
  transform: scale(1.1);
}

.card-popup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-popup-item {
  position: relative;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.card-popup-preview {
  pointer-events: none;
  transform: scale(0.9);
  transform-origin: top left;
  width: 111.11%; /* 100 / 0.9 to compensate for scale */
}

.card-popup-plus-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: rgba(34, 197, 94, 0.3);
  border: 2px solid rgba(34, 197, 94, 0.5);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: #4ade80;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.card-popup-plus-btn:hover {
  background: rgba(34, 197, 94, 0.5);
  border-color: rgba(34, 197, 94, 0.8);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.card-popup-plus-btn:active {
  transform: translateY(-50%) scale(1.05);
}

.card-popup-empty {
  text-align: center;
  color: rgba(226, 232, 240, 0.6);
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* Debug Panel */
.debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border-top: 2px solid var(--accent);
  max-height: 250px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(31, 41, 55, 0.9);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  user-select: none;
}

.debug-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}

.debug-controls {
  display: flex;
  gap: 6px;
}

.debug-export-btn {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #4ade80;
  cursor: pointer;
  transition: all 0.2s ease;
}

.debug-export-btn:hover {
  background: rgba(34, 197, 94, 0.4);
  border-color: rgba(34, 197, 94, 0.6);
}

.debug-clear-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #f87171;
  cursor: pointer;
  transition: all 0.2s ease;
}

.debug-clear-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
}

.debug-log {
  overflow-y: auto;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  flex: 1;
}

.debug-entry {
  padding: 4px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  display: flex;
  gap: 8px;
}

.debug-entry.success {
  background: rgba(34, 197, 94, 0.1);
  border-left-color: #22c55e;
  color: #86efac;
}

.debug-entry.error {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
  color: #fca5a5;
}

.debug-entry.info {
  background: rgba(56, 189, 248, 0.1);
  border-left-color: #38bdf8;
  color: #7dd3fc;
}

.debug-entry.warning {
  background: rgba(251, 146, 60, 0.1);
  border-left-color: #fb923c;
  color: #fdba74;
}

.debug-time {
  color: rgba(148, 163, 184, 0.6);
  font-size: 0.7rem;
  min-width: 65px;
}

.debug-message {
  flex: 1;
  word-break: break-word;
}

.debug-panel.collapsed .debug-log {
  display: none;
}

.debug-panel.collapsed {
  max-height: 36px;
}

/* Statistics tabs */
.stats-tabs-card .card-delete-btn {
  top: 8px;
}

.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.stats-tab {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-tab.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
}

.stats-tab-panel {
  display: none;
}

.stats-tab-panel.active {
  display: block;
}

.stats-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stats-metric {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.stats-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}

.stats-metric-meta {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.75);
}

.stats-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.stats-history-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-history-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats-history-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-round-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-win-section {
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 8px;
}

.stats-win-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.stats-win-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.9);
}

.stats-win-table-wrap {
  overflow-x: auto;
}

.stats-win-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.66rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.stats-win-table th,
.stats-win-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 5px 6px;
  text-align: left;
  vertical-align: middle;
  line-height: 1.15;
}

.stats-win-table th {
  color: rgba(148, 227, 255, 0.9);
  text-transform: uppercase;
  font-size: 0.55rem;
  letter-spacing: 0.07em;
  background: rgba(15, 23, 42, 0.65);
  white-space: nowrap;
}

.stats-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.stats-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
}

.stats-filter-select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.9);
  padding: 2px 10px;
  font-size: 0.6rem;
}

.stats-filter-select:focus {
  outline: none;
  border-color: rgba(148, 227, 255, 0.6);
}

#profitLeagueFilterInput {
  min-width: 150px;
}

.stats-filter-input {
  width: 72px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.9);
  padding: 2px 8px;
  font-size: 0.6rem;
  text-align: center;
}

.stats-filter-input:focus {
  outline: none;
  border-color: rgba(148, 227, 255, 0.6);
}

.stats-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  color: rgba(226, 232, 240, 0.75);
}

.stats-filter-toggle input {
  accent-color: rgba(148, 227, 255, 0.8);
}

.stats-win-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.22);
}

.stats-num {
  text-align: left;
}

.stats-percent-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 227, 255, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(226, 232, 240, 0.95);
  font-size: 0.62rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stats-percent-pill:hover {
  border-color: rgba(148, 227, 255, 0.8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.stats-bucket-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  padding: 16px;
  box-sizing: border-box;
}

.stats-bucket-popup {
  width: min(720px, 94vw);
  max-height: 82vh;
  background: rgba(12, 15, 24, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stats-bucket-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.8rem;
  font-weight: 600;
}

.stats-bucket-popup-body {
  padding: 12px;
  overflow: auto;
}

.stats-bucket-popup-close {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
}

.stats-bucket-popup-close:hover {
  border-color: rgba(148, 227, 255, 0.8);
}

.stats-bucket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.stats-bucket-table th,
.stats-bucket-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 6px 6px;
  text-align: left;
  vertical-align: top;
}

.stats-bucket-table th {
  text-transform: uppercase;
  font-size: 0.55rem;
  color: rgba(148, 227, 255, 0.85);
  letter-spacing: 0.06em;
}

.stats-bucket-table .boost-pill {
  margin: 2px 4px 2px 0;
}

.round-history-table-wrap {
  overflow-x: auto;
}

.round-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.round-history-table th,
.round-history-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.75rem;
  color: #f8fafc;
  box-sizing: border-box;
}

.round-history-table th {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.85);
}

.clan-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.clan-selection-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.clan-selection-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clan-selection-toggle {
  white-space: nowrap;
}

.clan-selection-max-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clan-selection-min-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clan-selection-min-avg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clan-selection-boost-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clan-selection-table-wrap {
  overflow: auto;
}

.clan-selection-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.clan-selection-table th,
.clan-selection-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.72rem;
  color: #f8fafc;
  box-sizing: border-box;
}

.clan-selection-table th {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.clan-selection-filter-row th {
  padding: 6px 8px 8px 8px;
  background: rgba(15, 23, 42, 0.6);
}

.clan-selection-filter-empty {
  text-align: center;
}

.clan-selection-filter-row .stats-filter-input {
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

.clan-selection-col-cycle { width: 7%; }
.clan-selection-col-league { width: 10%; }
.clan-selection-col-name { width: 46%; }
.clan-selection-col-power { width: 12%; }
.clan-selection-col-users { width: 10%; }
.clan-selection-col-raw { width: 15%; }

.clan-selection-overview {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clan-selection-overview-title {
  font-weight: 700;
  font-size: 0.75rem;
  color: #f8fafc;
}

.clan-selection-overview-sub,
.clan-selection-overview-line {
  font-size: 0.6rem;
  color: rgba(226, 232, 240, 0.8);
}

.clan-selection-overview-sub {
  color: rgba(148, 163, 184, 0.9);
}

.clan-selection-overview-meta {
  font-size: 0.6rem;
  color: rgba(56, 189, 248, 0.9);
}

.clan-selection-overview-desc {
  font-size: 0.6rem;
  color: rgba(226, 232, 240, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clan-selection-raw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.65);
  background: rgba(76, 29, 149, 0.25);
  color: #e9d5ff;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clan-selection-raw-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(167, 139, 250, 0.25);
}

.clan-selection-members-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.65);
  background: rgba(14, 116, 144, 0.25);
  color: #cffafe;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clan-selection-members-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 211, 238, 0.25);
}

.clan-selection-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.clan-selection-members-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clan-selection-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.clan-selection-members-table th,
.clan-selection-members-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  color: #f8fafc;
}

.clan-selection-members-table th {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.round-history-col-block {
  width: 22%;
}

.round-history-col-clan {
  width: 32%;
  padding-right: 12px;
}

.round-history-col-user {
  width: 46%;
  padding-left: 20px;
}

.round-history-block-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.65);
  background: rgba(14, 116, 144, 0.25);
  color: #bae6fd;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.round-history-block-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(56, 189, 248, 0.2);
}

.live-score-pill {
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.live-score-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.2);
}

.live-score-pill:active {
  transform: translateY(0);
}

.round-history-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  z-index: 2147483647;
  overflow: hidden;
}

.round-history-popup {
  box-sizing: border-box;
  width: min(620px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: min(760px, calc(100vh - 48px));
  max-height: min(760px, calc(100dvh - 48px));
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.98), rgba(7, 12, 27, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), 0 0 24px rgba(124, 58, 237, 0.18);
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  backdrop-filter: blur(8px);
}

.round-history-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  min-width: 0;
  flex: 0 0 auto;
}

.round-history-popup-title {
  display: block;
  flex: 1 1 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.round-history-popup-close {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 38px !important;
  min-height: 38px !important;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border-radius: 10px;
  padding: 0 !important;
  font-size: 0.8rem;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  margin-left: auto;
}

.round-history-popup-close:hover {
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(30, 41, 59, 0.96);
}

.round-history-popup-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  flex: 1 1 auto;
}

.round-history-popup-body img,
.round-history-popup-body svg,
.round-history-popup-body canvas,
.round-history-popup-body pre {
  max-width: 100%;
  box-sizing: border-box;
}

.round-history-popup-body table {
  min-width: 100%;
  max-width: none;
}

@media (max-width: 640px), (max-height: 520px) {
  .round-history-popup-overlay {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .round-history-popup {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .round-history-popup-header {
    gap: 8px;
    padding: 12px 12px 10px;
  }

  .round-history-popup-title {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }

  .round-history-popup-body {
    padding: 12px;
  }
}

.round-history-popup-body .current-round-card {
  border-color: rgba(56, 189, 248, 0.8);
}

.round-history-cell-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.round-history-cell-sub {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 4px;
}

.round-history-cell-power {
  font-size: 0.7rem;
  font-weight: 600;
  color: #f8fafc;
}

.round-history-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.round-history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.round-history-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.round-history-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.round-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.round-history-field {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.round-history-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.9);
}

.round-history-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  word-break: break-word;
}

.round-history-winner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.round-history-winner-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.85);
}

.round-history-winner-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.round-history-boosts {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  grid-auto-flow: row;
  gap: 6px;
  align-items: center;
  justify-content: start;
}

.round-history-win-cell .round-history-cell-title {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

.round-history-win-cell .round-history-cell-sub {
  font-size: 0.55rem;
  margin-bottom: 3px;
}

.round-history-win-cell .round-history-boosts {
  gap: 4px;
}

.round-history-win-cell .boost-pill.compact {
  padding: 2px 6px;
}

.round-history-win-cell .boost-pill.compact .boost-value {
  font-size: 0.6rem;
}

.round-history-win-cell .boost-pill.compact .pill-icon {
  font-size: 0.65rem;
}

.round-history-details summary {
  cursor: pointer;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.85);
}

.round-history-details pre {
  margin: 6px 0 0;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px;
  color: #e2e8f0;
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.round-history-raw-sep {
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
  margin: 6px 0;
}

:root[data-theme='pastel'] .stats-tab {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
  color: #2f2738;
}

:root[data-theme='pastel'] .stats-tab.active {
  background: #ffe9c6;
  border-color: #f59e0b;
  color: #1b1424;
}

:root[data-theme='pastel'] .stats-metric,
:root[data-theme='pastel'] .round-history-card,
:root[data-theme='pastel'] .round-history-field {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.2);
}

:root[data-theme='pastel'] .stats-metric-label,
:root[data-theme='pastel'] .stats-metric-meta,
:root[data-theme='pastel'] .round-history-label,
:root[data-theme='pastel'] .round-history-winner-title,
:root[data-theme='pastel'] .round-history-details summary {
  color: rgba(47, 39, 56, 0.7);
}

:root[data-theme='pastel'] .stats-metric-value,
:root[data-theme='pastel'] .round-history-title,
:root[data-theme='pastel'] .round-history-value {
  color: #2f2738;
}

:root[data-theme='pastel'] .round-history-cell-power {
  color: #2f2738;
}

:root[data-theme='pastel'] .round-history-details pre {
  background: #fdf9f2;
  border-color: rgba(99, 102, 241, 0.2);
  color: #2f2738;
}

:root[data-theme='pastel'] .round-history-table th,
:root[data-theme='pastel'] .round-history-table td {
  color: #2f2738;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

:root[data-theme='pastel'] .round-history-table th,
:root[data-theme='pastel'] .round-history-cell-sub {
  color: rgba(47, 39, 56, 0.7);
}

/* === KORREL TOOLS STYLING === */

.korrel-tools-container {
  height: 100%;
}

.korrel-tabs {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.korrel-tab {
  transition: all 0.2s ease;
}

.korrel-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

:root[data-theme='cavern'] .korrel-tab.active {
  background: rgba(30, 30, 40, 1) !important;
  box-shadow: 0 0 25px currentColor, inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.korrel-panels {
  flex: 1;
  overflow-y: auto;
}

.korrel-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.korrel-panel[style*="display: flex"] {
  display: flex !important;
}

.korrel-inputs {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.korrel-inputs input {
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.korrel-inputs input:focus {
  outline: none;
  border-color: var(--accent);
}

.korrel-inputs label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.korrel-log {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  user-select: text;
  cursor: text;
}

.korrel-log::-webkit-scrollbar {
  width: 8px;
}

.korrel-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.korrel-log::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.korrel-log::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.korrel-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.korrel-popup {
  background: var(--bg-card);
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.korrel-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.korrel-popup-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.korrel-popup-content {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.korrel-popup-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  user-select: text;
}

.korrel-popup-table th {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
  font-weight: 600;
  user-select: text;
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.korrel-popup-table td {
  padding: 8px 12px;
  user-select: text;
  cursor: text;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.korrel-popup-table tr:hover {
  background: rgba(56, 189, 248, 0.1);
}

.korrel-popup-table pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  max-height: 400px;
  user-select: text;
  cursor: text;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.korrel-call-btn {
  margin-top: 8px;
}

/* Cavern theme overrides */
:root[data-theme='cavern'] .korrel-popup {
  background: #1a1626;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

:root[data-theme='cavern'] .korrel-popup-header {
  border-bottom-color: rgba(167, 139, 250, 0.2);
}

:root[data-theme='cavern'] .korrel-inputs input {
  background: rgba(30, 30, 40, 0.6);
  border-color: rgba(167, 139, 250, 0.2);
}

:root[data-theme='cavern'] .korrel-inputs input:focus {
  border-color: #a78bfa;
}

:root[data-theme='cavern'] .korrel-log {
  background: rgba(30, 30, 40, 0.6);
}

/* === KORREL TOOLS INLINE RESULTS TABLE === */

.korrel-results-card {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.korrel-results-table {
  overflow: auto;
  max-height: 500px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.korrel-results-table::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.korrel-results-table::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.korrel-results-table::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.korrel-results-table::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.korrel-results-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.korrel-results-table th {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.korrel-results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.korrel-results-table tr:hover {
  background: rgba(56, 189, 248, 0.1);
}

.korrel-results-table pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  max-height: 300px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
}

/* Cavern theme for results table */
:root[data-theme='cavern'] .korrel-results-table {
  background: rgba(30, 30, 40, 0.4);
}

:root[data-theme='cavern'] .korrel-results-table th {
  background: rgba(30, 30, 40, 0.8);
  border-bottom-color: rgba(167, 139, 250, 0.2);
}

:root[data-theme='cavern'] .korrel-results-table td {
  border-bottom-color: rgba(167, 139, 250, 0.1);
}

:root[data-theme='cavern'] .korrel-results-table tr:hover {
  background: rgba(167, 139, 250, 0.1);
}

/* Admin Tools API Explorer */
.admin-tools-block {
  padding: 16px;
}

.admin-tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tools-tab {
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-tools-tab:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.admin-tools-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.admin-tools-panel {
  display: none;
}

.admin-tools-panel.active {
  display: block;
}

.admin-last-online-panel {
  padding: clamp(14px, 2vw, 22px);
  background:
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.1), transparent 34%),
    rgba(5, 13, 28, 0.76);
}

.admin-last-online-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-last-online-header h3 {
  margin: 2px 0 5px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.admin-last-online-header p {
  margin: 0;
}

.admin-last-online-kicker {
  color: #4ee7ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.admin-last-online-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.admin-last-online-stat {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.66);
}

.admin-last-online-stat span {
  display: block;
  color: #eaf4ff;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1;
}

.admin-last-online-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-last-online-stat.online span {
  color: #45f0ac;
}

.admin-last-online-stat.recent span {
  color: #ffc857;
}

.admin-last-online-load-status {
  min-height: 20px;
  margin: 8px 0;
}

.admin-last-online-list {
  display: grid;
  gap: 8px;
}

.admin-last-online-row {
  display: grid;
  grid-template-columns: 32px 42px minmax(160px, 1.25fr) minmax(145px, 0.8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(80, 119, 163, 0.28);
  border-radius: 12px;
  background: rgba(7, 17, 35, 0.82);
}

.admin-last-online-row:first-child {
  border-color: rgba(69, 240, 172, 0.42);
  box-shadow: inset 3px 0 0 #45f0ac;
}

.admin-last-online-rank {
  color: #70829c;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.admin-last-online-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(78, 231, 255, 0.36);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(22, 78, 114, 0.72), rgba(48, 25, 91, 0.72));
  color: #fff;
  font-weight: 900;
}

.admin-last-online-user,
.admin-last-online-seen {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-last-online-user strong {
  overflow: hidden;
  color: #f4f8ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-last-online-user span,
.admin-last-online-seen span:not(.admin-last-online-badge) {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-last-online-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
}

.admin-last-online-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.admin-last-online-badge.online {
  color: #45f0ac;
}

.admin-last-online-badge.recent {
  color: #ffc857;
}

.admin-last-online-badge.offline {
  color: #8ca0ba;
}

.admin-last-online-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.admin-last-online-meta > span {
  overflow: hidden;
  color: #d8e5f6;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-last-online-meta small {
  display: block;
  margin-bottom: 2px;
  color: #69809d;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .admin-last-online-row {
    grid-template-columns: 24px 38px minmax(0, 1fr) auto;
  }

  .admin-last-online-seen {
    justify-items: end;
    text-align: right;
  }

  .admin-last-online-meta {
    grid-column: 3 / -1;
  }
}

@media (max-width: 520px) {
  .admin-last-online-summary {
    grid-template-columns: 1fr;
  }

  .admin-last-online-row {
    grid-template-columns: 22px 36px minmax(0, 1fr);
  }

  .admin-last-online-seen,
  .admin-last-online-meta {
    grid-column: 3;
    justify-items: start;
    text-align: left;
  }

  .admin-last-online-meta {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-discord-servers-panel {
  padding: clamp(14px, 2vw, 22px);
  background:
    radial-gradient(circle at 100% 0%, rgba(88, 101, 242, 0.2), transparent 36%),
    rgba(5, 13, 28, 0.78);
}

.admin-discord-servers-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-discord-servers-header h3 {
  margin: 2px 0 5px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.admin-discord-servers-header p {
  margin: 0;
}

.admin-discord-servers-kicker {
  color: #8ea1ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.admin-discord-servers-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.admin-discord-server-stat {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
}

.admin-discord-server-stat span {
  display: block;
  color: #eaf4ff;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1;
}

.admin-discord-server-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-discord-server-stat.linked span {
  color: #8ea1ff;
}

.admin-discord-server-stat.push span {
  color: #45f0ac;
}

.admin-discord-servers-status {
  min-height: 20px;
  margin: 8px 0;
}

.admin-discord-servers-list {
  display: grid;
  gap: 9px;
}

.admin-discord-server-row {
  display: grid;
  grid-template-columns: 52px minmax(170px, 1fr) minmax(190px, auto) minmax(310px, 1.4fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(107, 124, 255, 0.27);
  border-radius: 13px;
  background: rgba(7, 17, 35, 0.84);
}

.admin-discord-server-icon {
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(142, 161, 255, 0.42);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.78), rgba(40, 29, 92, 0.82));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
}

.admin-discord-server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-discord-server-identity {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.admin-discord-server-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.admin-discord-server-name strong,
.admin-discord-server-identity > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-discord-server-name strong {
  color: #f4f8ff;
}

.admin-discord-server-identity > span {
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-discord-server-open {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 5px;
  color: #8ea1ff;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-discord-server-open:hover,
.admin-discord-server-open:focus-visible {
  color: #c3ccff;
  text-decoration: underline;
}

.admin-discord-server-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-discord-server-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
}

.admin-discord-server-badge.ready {
  color: #45f0ac;
}

.admin-discord-server-badge.missing {
  color: #8ca0ba;
}

.admin-discord-server-badge.primary {
  color: #ffc857;
}

.admin-discord-server-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-discord-server-meta > span {
  overflow: hidden;
  color: #d8e5f6;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-discord-server-meta small {
  display: block;
  margin-bottom: 2px;
  color: #69809d;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .admin-discord-server-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .admin-discord-server-meta {
    grid-column: 2 / -1;
  }
}

@media (max-width: 620px) {
  .admin-discord-servers-summary {
    grid-template-columns: 1fr 1fr;
  }

  .admin-discord-server-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .admin-discord-server-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .admin-discord-server-badges,
  .admin-discord-server-meta {
    grid-column: 2;
  }

  .admin-discord-server-meta {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-funnel-panel {
  padding: clamp(14px, 2vw, 22px);
  background:
    radial-gradient(circle at 0 0, rgba(147, 51, 234, 0.15), transparent 36%),
    radial-gradient(circle at 100% 0, rgba(34, 211, 238, 0.1), transparent 32%),
    rgba(5, 13, 28, 0.8);
}

.admin-funnel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-funnel-header h3 {
  margin: 2px 0 5px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.admin-funnel-header p {
  margin: 0;
}

.admin-funnel-kicker {
  color: #4ee7ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.admin-funnel-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.admin-funnel-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-funnel-controls select {
  min-width: 110px;
  padding: 7px 28px 7px 10px;
  border: 1px solid rgba(78, 231, 255, 0.26);
  border-radius: 9px;
  background: rgba(7, 17, 35, 0.92);
  color: var(--text);
  font: inherit;
}

.admin-funnel-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.admin-funnel-stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.68);
}

.admin-funnel-stat span {
  display: block;
  color: #f4f8ff;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  line-height: 1;
}

.admin-funnel-stat.paid span {
  color: #45f0ac;
}

.admin-funnel-stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
}

.admin-funnel-note {
  margin: 10px 0;
  padding: 9px 11px;
  border-left: 3px solid #ffc857;
  border-radius: 0 9px 9px 0;
  background: rgba(255, 200, 87, 0.07);
  color: #aebfd4;
  font-size: 0.72rem;
  line-height: 1.45;
}

.admin-funnel-status {
  min-height: 20px;
  margin: 8px 0;
}

.admin-funnel-steps {
  display: grid;
  gap: 8px;
}

.admin-funnel-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(80, 119, 163, 0.3);
  border-radius: 12px;
  background: rgba(7, 17, 35, 0.84);
}

.admin-funnel-step.is-paid {
  border-color: rgba(69, 240, 172, 0.4);
  box-shadow: inset 3px 0 0 #45f0ac;
}

.admin-funnel-step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(78, 231, 255, 0.32);
  border-radius: 10px;
  color: #4ee7ff;
  font-size: 0.7rem;
  font-weight: 900;
}

.admin-funnel-step-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-funnel-step-copy strong {
  overflow: hidden;
  color: #f4f8ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-funnel-step-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-funnel-step-value {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.admin-funnel-bar {
  grid-column: 2 / -1;
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(93, 115, 145, 0.2);
}

.admin-funnel-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6 68%, #f472b6);
  box-shadow: 0 0 12px rgba(78, 231, 255, 0.36);
}

.admin-funnel-breakdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-funnel-breakdowns > section,
.admin-funnel-recent {
  padding: 12px;
  border: 1px solid rgba(80, 119, 163, 0.28);
  border-radius: 12px;
  background: rgba(7, 17, 35, 0.7);
}

.admin-funnel-breakdowns h4,
.admin-funnel-recent h4 {
  margin: 0 0 9px;
  color: #dce8f8;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-funnel-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-funnel-chip-list > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(78, 231, 255, 0.2);
  border-radius: 999px;
  color: #b9cbe0;
  font-size: 0.66rem;
}

.admin-funnel-chip-list b {
  color: #4ee7ff;
}

.admin-funnel-recent {
  margin-top: 10px;
}

.admin-funnel-recent-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.3fr) minmax(130px, auto);
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-funnel-recent-row:first-child {
  border-top: 0;
}

.admin-funnel-recent-row > span,
.admin-funnel-recent-row time {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: #dce8f8;
  font-size: 0.7rem;
  font-style: normal;
}

.admin-funnel-recent-row strong,
.admin-funnel-recent-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-funnel-recent-row small {
  color: var(--muted);
  font-size: 0.62rem;
}

.admin-funnel-recent-row time {
  justify-items: end;
  text-align: right;
}

@media (max-width: 700px) {
  .admin-funnel-header {
    display: grid;
  }

  .admin-funnel-controls {
    justify-content: space-between;
  }

  .admin-funnel-summary,
  .admin-funnel-breakdowns {
    grid-template-columns: 1fr;
  }

  .admin-funnel-recent-row {
    grid-template-columns: 1fr auto;
  }

  .admin-funnel-recent-row > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.admin-api-tab {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-api-tab:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.admin-api-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  border-color: transparent;
}

:root[data-theme='cavern'] .admin-api-tab.active {
  background: rgba(167, 139, 250, 0.3);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
  border-color: rgba(167, 139, 250, 0.6);
}

.admin-api-subtab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(226, 232, 240, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-api-subtab:hover {
  color: var(--text);
  border-bottom-color: rgba(56, 189, 248, 0.3);
}

.admin-api-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

:root[data-theme='cavern'] .admin-api-subtab.active {
  color: #a78bfa;
  border-bottom-color: #a78bfa;
}

.admin-api-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-api-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.admin-api-field input,
.admin-api-field select {
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.admin-api-field input:focus,
.admin-api-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.admin-api-actions {
  display: flex;
  gap: 12px;
}

.admin-history-item {
  animation: slideIn 0.3s ease;
}

.admin-game-tab-warning {
  position: sticky;
  top: 0;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fee2e2;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  z-index: 5;
}

.admin-api-output-view,
.admin-api-output-view * {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}

.admin-api-output-view pre,
.admin-api-output-view table,
#adminRawPre,
#adminPayloadPre,
#adminTableOutput,
#adminTableOutput table {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.leaderboard-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.leaderboard-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.leaderboard-meta {
  font-size: 0.75rem;
}

.leaderboard-submeta {
  font-size: 0.72rem;
}

.leaderboard-actions .btn {
  min-width: 88px;
}

.leaderboard-status {
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.85);
}

.leaderboard-status.is-error {
  color: #fb923c;
}

.leaderboard-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px;
}

.leaderboard-empty {
  padding: 14px;
  text-align: center;
}

.cycle-stats-card {
  gap: 14px;
}

.cycle-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.cycle-stats-summary > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.42);
}

.cycle-stats-summary span {
  color: rgba(203, 213, 225, 0.78);
  font-size: 0.74rem;
}

.cycle-stats-summary strong {
  color: #f8fafc;
  font-size: 1rem;
}

.cycle-stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.cycle-stats-chart {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6), rgba(2, 6, 23, 0.54));
  padding: 12px;
}

.cycle-stats-chart-title {
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cycle-stats-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(203, 213, 225, 0.72);
  border: 1px dashed rgba(148, 163, 184, 0.26);
  border-radius: 10px;
}

.cycle-stats-svg {
  width: 100%;
  height: auto;
  display: block;
}

.cycle-stats-plot-bg {
  fill: rgba(2, 6, 23, 0.34);
  stroke: rgba(148, 163, 184, 0.18);
}

.cycle-stats-grid-line {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.cycle-stats-axis-label {
  fill: rgba(203, 213, 225, 0.75);
  font-size: 12px;
}

.cycle-stats-gap {
  stroke: rgba(248, 113, 113, 0.46);
  stroke-width: 1;
  stroke-dasharray: 5 6;
}

.cycle-stats-line {
  fill: none;
  stroke: var(--cycle-chart-color, #38bdf8);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cycle-chart-color, #38bdf8), transparent 45%));
}

.cycle-stats-point {
  fill: var(--cycle-chart-color, #38bdf8);
  stroke: rgba(2, 6, 23, 0.95);
  stroke-width: 1.5;
}

/* Compact spacing overrides */
:root {
  --compact-card-pad: 12px;
  --compact-grid-gap: 8px;
  --compact-row-gap: 4px;
}

.card {
  padding: var(--compact-card-pad);
}

:root[data-theme='cavern'] .card {
  padding: var(--compact-card-pad) !important;
}

.card-grid {
  gap: var(--compact-grid-gap) !important;
  padding-right: 4px !important;
}

:root[data-theme='cavern'] .card-grid {
  gap: 14px !important;
  padding-right: 0 !important;
}

:root[data-theme='cavern'] .card:has(.current-round-card),
:root[data-theme='cavern'] .card:has(.boost-summary-card),
:root[data-theme='cavern'] .card.special-card-wrapper {
  padding: 12px !important;
}

.current-round-card {
  padding: 6px 8px;
  border-radius: 18px;
}

.round-info-bar {
  gap: 4px;
}

.info-pill {
  padding: 3px 8px;
  border-radius: 12px;
  gap: 4px;
}

.boost-summary-card {
  padding: 4px 6px;
  border-radius: 16px;
}

.boost-controls {
  gap: 3px;
  margin-bottom: 3px;
}

.boost-info-bar {
  gap: 3px;
  margin-bottom: 3px;
}

.round-history-card {
  padding: 8px;
}

.round-history-table th,
.round-history-table td {
  padding: 4px 6px;
}

.round-history-grid {
  gap: 6px;
}

.round-history-field {
  padding: 4px 6px;
}

.live-disclaimer {
  margin: 6px 10px 4px;
  padding: 8px 10px;
}

.boost-use-section {
  margin-top: 12px;
}

.boost-use-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.boost-use-list {
  margin-top: 8px;
}

.boost-use-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.boost-use-label {
  width: 62px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cbd5f5;
  flex-shrink: 0;
}

.boost-use-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.boost-use-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #f97316);
  transition: width 0.25s ease;
}

.boost-use-value {
  min-width: 96px;
  text-align: right;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.boost-use-meta {
  color: #94a3b8;
  font-size: 0.75rem;
}

.boost-use-empty {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
  font-size: 0.85rem;
}

.multiplier-time-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.multiplier-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.multiplier-time-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multiplier-time-label {
  width: 44px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cbd5f5;
  flex-shrink: 0;
}

.multiplier-time-bar {
  flex: 1;
  min-height: 24px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 1px 1px;
  gap: 1px;
  white-space: nowrap;
}

.multiplier-time-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px 2px;
  font-size: 0.58rem;
  letter-spacing: -0.02em;
  color: #0f172a;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.multiplier-time-ratio {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  display: flex;
}

.multiplier-time-ratio-segment {
  height: 100%;
}

.multiplier-time-ratio-segment.hidden {
  background: transparent;
}

.multiplier-time-segment:last-child {
  border-right: none;
}

.multiplier-time-segment span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.multiplier-time-segment.empty {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-weight: 500;
  text-shadow: none;
}

.boost-use-heatmap-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.35);
  padding: 8px;
}

.boost-use-heatmap {
  display: grid;
  grid-template-rows: repeat(8, auto);
  gap: 4px;
  min-width: 680px;
}

.boost-use-heatmap-row {
  display: grid;
  grid-template-columns: 50px repeat(24, minmax(16px, 1fr));
  gap: 3px;
  align-items: center;
}

.boost-use-heatmap-header {
  margin-bottom: 2px;
}

.boost-use-heatmap-cell {
  height: 18px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.08);
}

.boost-use-heatmap-label {
  height: auto;
  background: transparent;
  font-size: 0.72rem;
  color: #cbd5f5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.boost-use-heatmap-hour {
  height: auto;
  background: transparent;
  font-size: 0.62rem;
  color: #94a3b8;
  text-align: center;
}

.boost-use-heatmap-value {
  transition: background 0.2s ease;
}

.boost-helper-panel .title {
  font-weight: 600;
  margin-bottom: 6px;
}

.boost-helper-rules {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.boost-helper-rule-group {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.boost-helper-rule-group-title {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.boost-helper-rule-group-body {
  display: grid;
  gap: 6px;
}

.boost-helper-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.boost-helper-rule-text {
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.9);
}

.boost-helper-form {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.boost-helper-options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.boost-helper-option {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.boost-helper-option-low {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.5);
}

.boost-helper-option-clan {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.5);
}

.boost-helper-option-multiplier {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.5);
}

/* Mobile visual refresh: calmer app-style live surface without changing data flow. */
:root {
  --app-surface: rgba(10, 15, 29, 0.94);
  --app-surface-2: rgba(15, 23, 42, 0.82);
  --app-border-soft: rgba(125, 146, 178, 0.22);
  --app-cyan: #38d5ff;
  --app-green: #5ee6a8;
  --app-text-soft: rgba(226, 232, 240, 0.72);
}

.current-round-card {
  border: 1px solid rgba(56, 213, 255, 0.24) !important;
  background:
    linear-gradient(180deg, rgba(13, 19, 34, 0.96), rgba(7, 11, 23, 0.96)) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32) !important;
}

.live-loading-status {
  border-radius: 8px;
  border-color: rgba(56, 213, 255, 0.24);
  background: rgba(9, 15, 28, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.live-loading-status--ready {
  border-color: rgba(94, 230, 168, 0.28);
  background: rgba(7, 35, 31, 0.58);
}

.live-loading-status__label {
  color: var(--app-cyan);
  letter-spacing: 0.08em;
}

.live-loading-status--ready .live-loading-status__label {
  color: var(--app-green);
}

.live-loading-status__reason,
.live-loading-status__next {
  color: var(--app-text-soft);
}

.live-loading-status__chips span {
  border-color: rgba(125, 146, 178, 0.2);
  background: rgba(15, 23, 42, 0.54);
}

.live-loading-status__chips span:first-child,
.live-loading-status__chips span:nth-child(2),
.live-loading-status__chips span:nth-child(3) {
  border-color: rgba(94, 230, 168, 0.26);
  background: rgba(10, 72, 57, 0.32);
  color: rgba(220, 252, 231, 0.94);
}

.live-leaderboard-row {
  min-height: 42px;
  padding: 7px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(125, 146, 178, 0.14);
  background: rgba(9, 14, 27, 0.52);
}

.live-leaderboard-row:nth-child(even) {
  background: rgba(15, 23, 42, 0.48);
}

.live-leaderboard-row.is-my-clan {
  border-color: rgba(56, 213, 255, 0.42) !important;
  background: rgba(8, 47, 73, 0.34) !important;
}

.live-leaderboard-rank {
  color: rgba(226, 232, 240, 0.78);
  text-align: center;
}

.live-leaderboard-clan {
  font-weight: 700;
  color: rgba(248, 250, 252, 0.94);
}

.live-leaderboard-score .live-score-pill {
  border-color: rgba(94, 230, 168, 0.36) !important;
  background: rgba(6, 95, 70, 0.38) !important;
  color: #86efac !important;
  box-shadow: none !important;
}

.live-leaderboard-power {
  color: rgba(226, 232, 240, 0.9);
  font-weight: 700;
  text-align: right;
}

.live-total-score-chart {
  border-radius: 8px;
  border-color: rgba(125, 146, 178, 0.18);
  background: rgba(7, 11, 23, 0.62);
}

.live-recent-rounds-table {
  border-spacing: 0;
}

.live-recent-rounds-table th,
.live-recent-rounds-table td {
  border-color: rgba(125, 146, 178, 0.16);
}

/* Best clan magic */
.best-clan-magic-card {
  padding: 0;
  overflow: hidden;
}

.best-clan-magic-card > .card-delete-btn {
  display: none;
}

.best-clan-magic {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.best-clan-magic-title-row,
.best-clan-magic-profile-head,
.best-clan-magic-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.best-clan-magic-title-row h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.best-clan-magic-kicker,
.best-clan-magic-cycle {
  color: #55dcff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.best-clan-magic-cycle {
  border: 1px solid #34576f;
  border-radius: 6px;
  padding: 5px 8px;
}

.best-clan-magic-profile {
  border-top: 1px solid #28465d;
  border-bottom: 1px solid #28465d;
  padding: 10px 0;
}

.best-clan-magic-profile-head strong,
.best-clan-magic-profile-head span {
  display: block;
}

.best-clan-magic-profile-head > div > span {
  margin-top: 2px;
  color: #8fa8ba;
  font-size: 11px;
}

.best-clan-magic-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 9px;
  border: 1px solid #28465d;
}

.best-clan-magic-profile-grid > div {
  min-width: 0;
  padding: 8px;
  border-right: 1px solid #28465d;
}

.best-clan-magic-profile-grid > div:last-child {
  border-right: 0;
}

.best-clan-magic-profile-grid span,
.best-clan-magic-profile-grid small,
.best-clan-magic-controls label > span,
.best-clan-magic-metrics span,
.best-clan-magic-strategies span {
  display: block;
  color: #8fa8ba;
  font-size: 10px;
  line-height: 1.25;
}

.best-clan-magic-profile-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.best-clan-magic-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.best-clan-magic-controls label {
  min-width: 0;
}

.best-clan-magic-controls select,
.best-clan-magic-controls input[type="number"],
.best-clan-magic-controls input[type="search"] {
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #34576f;
  border-radius: 6px;
  background: #071522;
  color: #eef8ff;
  font: inherit;
}

.best-clan-magic-search-field {
  grid-column: 1 / -1;
}

.best-clan-magic-filter-panel {
  border: 1px solid #28465d;
  background: #06131f;
}

.best-clan-magic-filter-panel > summary {
  padding: 9px 10px;
  color: #bcd0dd;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.best-clan-magic-filter-panel[open] > summary {
  border-bottom: 1px solid #28465d;
}

.best-clan-magic-controls.advanced {
  padding: 10px;
}

.best-clan-magic-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.best-clan-magic-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #44dca0;
}

.best-clan-magic-check:has(input:disabled) {
  opacity: 0.5;
}

.best-clan-magic-check > span {
  color: #d7e7f1 !important;
  font-size: 12px !important;
}

.best-clan-magic-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.best-clan-magic-actions .btn {
  min-height: 38px;
}

.best-clan-magic-progress {
  height: 6px;
  overflow: hidden;
  border: 1px solid #27485f;
  border-radius: 3px;
  background: #06111b;
}

.best-clan-magic-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #41d9f5, #50df9c, #ffca58);
  transition: width 180ms ease;
}

.best-clan-magic-status,
.best-clan-magic-model-note {
  color: #8fa8ba;
  font-size: 11px;
  line-height: 1.35;
}

.best-clan-magic-results {
  min-width: 0;
}

.best-clan-magic-recommendation {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-left: 3px solid #50df9c;
  background: #08231f;
}

.best-clan-magic-recommendation span {
  color: #50df9c;
  font-size: 10px;
  font-weight: 800;
}

.best-clan-magic-recommendation strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.best-clan-magic-recommendation small {
  color: #a8c9c1;
}

.best-clan-magic-result-list {
  margin-top: 8px;
  border-top: 1px solid #28465d;
}

.best-clan-magic-result {
  border-bottom: 1px solid #28465d;
}

.best-clan-magic-result.odd {
  background: #071420;
}

.best-clan-magic-result.even {
  background: #0a1926;
}

.best-clan-magic-result summary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px;
  cursor: pointer;
  list-style: none;
}

.best-clan-magic-result summary::-webkit-details-marker {
  display: none;
}

.best-clan-magic-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #3b6078;
  border-radius: 50%;
  color: #55dcff;
  font-size: 12px;
  font-weight: 800;
}

.best-clan-magic-result-name,
.best-clan-magic-result-net {
  min-width: 0;
}

.best-clan-magic-result-name strong,
.best-clan-magic-result-name small,
.best-clan-magic-result-net strong,
.best-clan-magic-result-net small {
  display: block;
}

.best-clan-magic-risk-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 2px 4px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.best-clan-magic-risk-badge.low {
  color: #50df9c;
}

.best-clan-magic-risk-badge.medium {
  color: #ffca58;
}

.best-clan-magic-risk-badge.high {
  color: #ff8292;
}

.best-clan-magic-result-name strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.best-clan-magic-result-name small,
.best-clan-magic-result-net small {
  margin-top: 3px;
  color: #849daf;
  font-size: 10px;
  line-height: 1.25;
}

.best-clan-magic-result-net {
  text-align: right;
}

.best-clan-magic-result-net strong {
  font-size: 13px;
  white-space: nowrap;
}

.best-clan-magic-result-net.positive strong {
  color: #50df9c;
}

.best-clan-magic-result-net.negative strong {
  color: #ff7588;
}

.best-clan-magic-result-body {
  display: grid;
  gap: 8px;
  padding: 0 8px 10px 46px;
}

.best-clan-magic-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #28465d;
}

.best-clan-magic-metrics > div {
  min-width: 0;
  padding: 7px;
  border-right: 1px solid #28465d;
}

.best-clan-magic-metrics > div:last-child {
  border-right: 0;
}

.best-clan-magic-metrics strong {
  display: block;
  margin-top: 3px;
  color: #f2f7fa;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.best-clan-magic-evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.best-clan-magic-evidence-grid section,
.best-clan-magic-rules {
  min-width: 0;
  border: 1px solid #28465d;
  background: #06131f;
}

.best-clan-magic-evidence-grid h4,
.best-clan-magic-rules h4 {
  margin: 0;
  color: #eef7ff;
  font-size: 11px;
}

.best-clan-magic-indicators,
.best-clan-magic-risks,
.best-clan-magic-rules {
  padding: 8px;
}

.best-clan-magic-indicators > div,
.best-clan-magic-rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.best-clan-magic-indicators span,
.best-clan-magic-rule-tags span {
  padding: 3px 5px;
  border: 1px solid #2c6f69;
  border-radius: 5px;
  color: #8cf2c8;
  font-size: 9px;
  line-height: 1.25;
}

.best-clan-magic-indicators span.muted,
.best-clan-magic-rule-tags span.muted {
  border-color: #40576a;
  color: #8fa8ba;
}

.best-clan-magic-risks ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.best-clan-magic-risks li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px;
  color: #b8cad6;
  font-size: 9px;
  line-height: 1.3;
}

.best-clan-magic-risks li b {
  text-transform: uppercase;
}

.best-clan-magic-risks li.low b {
  color: #50df9c;
}

.best-clan-magic-risks li.medium b {
  color: #ffca58;
}

.best-clan-magic-risks li.high b {
  color: #ff8292;
}

.best-clan-magic-rules-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.best-clan-magic-rules-head > span {
  color: #7891a3;
  font-size: 9px;
  text-align: right;
}

.best-clan-magic-rules p {
  margin: 7px 0 0;
  color: #a8bdca;
  font-size: 10px;
  line-height: 1.4;
}

.best-clan-magic-rules a {
  display: inline-block;
  margin-top: 7px;
  color: #55dcff;
  font-size: 10px;
  font-weight: 800;
}

.best-clan-magic-activity {
  border: 1px solid #28465d;
  background: #06131f;
}

.best-clan-magic-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #28465d;
}

.best-clan-magic-activity-head strong {
  font-size: 11px;
}

.best-clan-magic-activity-head span {
  font-size: 10px;
  font-weight: 800;
}

.best-clan-magic-activity-head span.positive {
  color: #50df9c;
}

.best-clan-magic-activity-head span.negative {
  color: #ffca58;
}

.best-clan-magic-activity-head span.neutral {
  color: #9bb3c4;
}

.best-clan-magic-activity-windows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.best-clan-magic-activity-windows > div {
  min-width: 0;
  padding: 7px;
  border-right: 1px solid #28465d;
}

.best-clan-magic-activity-windows > div:last-child {
  border-right: 0;
}

.best-clan-magic-activity-windows span,
.best-clan-magic-activity-windows strong,
.best-clan-magic-activity-windows b,
.best-clan-magic-activity-windows small {
  display: block;
  overflow-wrap: anywhere;
}

.best-clan-magic-activity-windows span {
  color: #55dcff;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.best-clan-magic-activity-windows strong {
  margin-top: 4px;
  color: #f2f7fa;
  font-size: 12px;
}

.best-clan-magic-activity-windows b {
  margin-top: 2px;
  color: #c9d9e3;
  font-size: 10px;
}

.best-clan-magic-activity-windows small {
  margin-top: 3px;
  color: #7891a3;
  font-size: 9px;
  line-height: 1.25;
}

.best-clan-magic-activity-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px 8px;
  padding: 7px 8px;
  border-top: 1px solid #1d384b;
  color: #7891a3;
  font-size: 9px;
}

.best-clan-magic-activity-meta strong {
  display: block;
  margin-top: 2px;
  color: #c9d9e3;
  font-size: 10px;
}

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

.best-clan-magic-strategies > div {
  min-width: 0;
  padding: 8px;
  border-left: 2px solid #3d6075;
  background: #07111d;
}

.best-clan-magic-strategies > div.recommended {
  border-left-color: #50df9c;
  background: #08231f;
}

.best-clan-magic-strategies strong,
.best-clan-magic-strategies small {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.best-clan-magic-strategies strong {
  font-size: 12px;
}

.best-clan-magic-strategies small {
  color: #8fa8ba;
  font-size: 10px;
  line-height: 1.35;
}

.best-clan-magic-source-row {
  align-items: flex-start;
  color: #7891a3;
  font-size: 10px;
}

.best-clan-magic-confidence {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid #536675;
  border-radius: 6px;
  color: #c5d2db;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.best-clan-magic-confidence.high {
  border-color: #2b9b72;
  color: #50df9c;
}

.best-clan-magic-confidence.medium {
  border-color: #9b7c2b;
  color: #ffca58;
}

.best-clan-magic-confidence.low {
  border-color: #a44858;
  color: #ff8292;
}

.best-clan-magic-empty,
.best-clan-magic-error {
  padding: 14px 8px;
  color: #8fa8ba;
  text-align: center;
}

.best-clan-magic-error {
  color: #ff8292;
}

.best-clan-magic-model-note {
  padding: 10px 2px 2px;
}

@media (max-width: 560px) {
  .best-clan-magic-profile-grid,
  .best-clan-magic-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best-clan-magic-profile-grid > div:nth-child(2),
  .best-clan-magic-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .best-clan-magic-profile-grid > div:nth-child(-n + 2),
  .best-clan-magic-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid #28465d;
  }

  .best-clan-magic-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best-clan-magic-controls label:first-child {
    grid-column: 1 / -1;
  }

  .best-clan-magic-result-body {
    padding-left: 8px;
  }

  .best-clan-magic-strategies {
    grid-template-columns: 1fr;
  }

  .best-clan-magic-evidence-grid {
    grid-template-columns: 1fr;
  }

  .best-clan-magic-activity-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best-clan-magic-source-row {
    display: grid;
    justify-content: stretch;
  }
}

/* Strategy Lab */
.strategy-lab-card {
  padding: 0 !important;
  overflow: hidden;
}

.strategy-lab {
  color: #eef7ff;
  background: #061321;
  border: 1px solid #264c64;
}

.strategy-lab-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #24455b;
  background: #0a1c2d;
}

.strategy-lab-title-row h2 {
  margin: 1px 0 2px;
  font-size: 22px;
  line-height: 1.1;
}

.strategy-lab-title-row p {
  margin: 0;
  color: #9eb4c6;
  font-size: 12px;
}

.strategy-lab-kicker {
  color: #55e6b2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.strategy-lab-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: #24455b;
  border-bottom: 1px solid #24455b;
}

.strategy-lab-tabs button {
  min-width: 0;
  min-height: 40px;
  padding: 7px 5px;
  border: 0;
  border-radius: 0;
  background: #081725;
  color: #9fb4c5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.strategy-lab-tabs button.active {
  color: #071420;
  background: #55d9f5;
}

.strategy-lab-status {
  min-height: 28px;
  padding: 7px 14px;
  color: #8eacbf;
  background: #07111d;
  border-bottom: 1px solid #173348;
  font-size: 11px;
}

.strategy-lab-body {
  padding: 14px;
}

.strategy-lab-decision {
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #34536b;
  border-left: 4px solid #6f8da1;
  background: #0a1a2a;
}

.strategy-lab-decision.good {
  border-left-color: #3fe0a5;
  background: #08241f;
}

.strategy-lab-decision.warn {
  border-left-color: #ffc34f;
  background: #241c0d;
}

.strategy-lab-decision.missing {
  border-left-color: #ef7f92;
}

.strategy-lab-decision > span,
.strategy-lab-kpis span,
.strategy-lab-round-grid span,
.strategy-lab-milestone span,
.strategy-lab-reserve span,
.strategy-lab-luck span,
.strategy-lab-player > div > span {
  display: block;
  color: #77cfe8;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-lab-decision strong {
  display: block;
  margin: 3px 0;
  font-size: 15px;
  line-height: 1.3;
}

.strategy-lab-decision small,
.strategy-lab-kpis small,
.strategy-lab-round-grid small,
.strategy-lab-reserve small,
.strategy-lab-player small {
  display: block;
  color: #95aabc;
  font-size: 10px;
  line-height: 1.35;
}

.strategy-lab-kpis,
.strategy-lab-round-grid,
.strategy-lab-reserve,
.strategy-lab-luck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid #294b61;
  background: #071522;
}

.strategy-lab-kpis > div,
.strategy-lab-round-grid > div,
.strategy-lab-reserve > div,
.strategy-lab-luck > div {
  min-width: 0;
  min-height: 66px;
  padding: 10px;
  border-right: 1px solid #294b61;
}

.strategy-lab-kpis > div:last-child,
.strategy-lab-round-grid > div:last-child,
.strategy-lab-reserve > div:last-child,
.strategy-lab-luck > div:last-child {
  border-right: 0;
}

.strategy-lab-kpis strong,
.strategy-lab-round-grid strong,
.strategy-lab-reserve strong,
.strategy-lab-luck strong {
  display: block;
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.strategy-lab-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.strategy-lab-module-grid button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  text-align: left;
  color: #e9f7ff;
  background: #0b2031;
  border: 1px solid #2b5870;
  border-radius: 6px;
  cursor: pointer;
}

.strategy-lab-module-grid button:hover {
  border-color: #55d9f5;
  background: #0d293e;
}

.strategy-lab-module-grid button > span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #061321;
  background: #55d9f5;
  border-radius: 50%;
  font-weight: 900;
}

.strategy-lab-module-grid strong {
  align-self: end;
  font-size: 12px;
}

.strategy-lab-module-grid small {
  min-width: 0;
  color: #91a9bb;
  font-size: 9px;
  line-height: 1.25;
}

.strategy-lab-section-title {
  margin: 15px 0 7px;
  color: #f1f7fb;
  font-size: 14px;
}

.strategy-lab-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.strategy-lab-source {
  display: grid;
  grid-template-columns: 10px minmax(80px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  background: #091b2a;
  border: 1px solid #23475e;
}

.strategy-lab-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef7f92;
  box-shadow: 0 0 0 3px rgba(239, 127, 146, 0.12);
}

.strategy-lab-source-dot.good {
  background: #3fe0a5;
  box-shadow: 0 0 0 3px rgba(63, 224, 165, 0.12);
}

.strategy-lab-source strong {
  font-size: 11px;
}

.strategy-lab-source small {
  min-width: 0;
  overflow: hidden;
  color: #91a6b8;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-lab-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #294b61;
  background: #06121f;
  scrollbar-color: #6b4ee6 #071522;
}

.strategy-lab-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 11px;
}

.strategy-lab-ev-table {
  min-width: 900px;
}

.strategy-lab-table th {
  padding: 8px;
  color: #77cfe8;
  background: #0d2a3c;
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
}

.strategy-lab-table td {
  padding: 8px;
  vertical-align: top;
  border-top: 1px solid #213d51;
}

.strategy-lab-table tr.even td {
  background: #091a28;
}

.strategy-lab-table td small {
  display: block;
  max-width: 250px;
  margin-top: 3px;
  color: #879daf;
  font-size: 9px;
  line-height: 1.25;
}

.strategy-lab-table .positive,
.strategy-lab-mix .positive,
.strategy-lab .positive {
  color: #43e2a9;
}

.strategy-lab-table .negative,
.strategy-lab-mix .negative,
.strategy-lab .negative {
  color: #ff7d91;
}

.strategy-lab-ability {
  white-space: nowrap;
}

.strategy-lab-confidence {
  display: inline-block;
  padding: 2px 5px;
  color: #dce8f0;
  border: 1px solid #5d7281;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-lab-confidence.high {
  color: #65e6b7;
  border-color: #319f7d;
}

.strategy-lab-confidence.medium {
  color: #ffd267;
  border-color: #b9851f;
}

.strategy-lab-confidence.missing,
.strategy-lab-confidence.low {
  color: #ff96a6;
  border-color: #a64c5c;
}

.strategy-lab-note {
  margin: 6px 0 12px;
  color: #8fa6b7;
  font-size: 10px;
  line-height: 1.4;
}

.strategy-lab-mixes {
  display: grid;
  gap: 1px;
  background: #26485e;
  border: 1px solid #26485e;
}

.strategy-lab-mix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  background: #071522;
  font-size: 11px;
}

.strategy-lab-mix.even {
  background: #0a1b29;
}

.strategy-lab-mix em {
  font-style: normal;
  font-weight: 900;
}

.strategy-lab-milestone {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #7256c8;
  background: #15162d;
}

.strategy-lab-milestone > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #7256c8;
}

.strategy-lab-milestone > div:last-child {
  border-right: 0;
}

.strategy-lab-milestone strong {
  display: block;
  margin-top: 4px;
  color: #c9b9ff;
  font-size: 16px;
}

.strategy-lab-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid #2c536b;
  background: #091a29;
}

.strategy-lab-settings label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-width: 0;
}

.strategy-lab-settings label > span {
  grid-column: 1 / -1;
  color: #b7c9d6;
  font-size: 10px;
  font-weight: 800;
}

.strategy-lab-settings input,
.strategy-lab-settings select {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  color: #f0f8ff;
  background: #06111d;
  border: 1px solid #35607a;
  border-radius: 4px;
}

.strategy-lab-settings small {
  align-self: center;
  color: #8299aa;
  font-size: 9px;
}

.strategy-lab-settings .btn {
  align-self: end;
  min-height: 36px;
}

.strategy-lab-player-list {
  display: grid;
  gap: 5px;
}

.strategy-lab-player {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1.5fr) repeat(4, minmax(70px, 0.7fr)) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  background: #081724;
  border: 1px solid #26475c;
}

.strategy-lab-player.even {
  background: #0b1d2c;
}

.strategy-lab-player-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #05131e;
  background: #ffc95d;
  border-radius: 50%;
  font-weight: 900;
}

.strategy-lab-player > div {
  min-width: 0;
}

.strategy-lab-player > div > strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.strategy-lab-warning,
.strategy-lab-empty {
  padding: 12px;
  color: #f5c2ca;
  background: #26131b;
  border: 1px solid #7e3947;
  font-size: 11px;
  line-height: 1.4;
}

.strategy-lab-empty {
  color: #a8bdcc;
  background: #0a1825;
  border-color: #294b61;
}

.strategy-lab-loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
}

.strategy-lab-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid #24485e;
  border-top-color: #55d9f5;
  border-radius: 50%;
  animation: strategy-lab-spin 0.9s linear infinite;
}

.strategy-lab-loading strong {
  margin-top: 8px;
  font-size: 14px;
}

.strategy-lab-loading small {
  color: #8fa5b7;
  font-size: 10px;
}

@keyframes strategy-lab-spin {
  to { transform: rotate(360deg); }
}

.current-round-corner-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.live-boost-advisor-btn,
.strategy-boost-open-btn {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #35c8e8;
  border-radius: 6px;
  color: #eaffff;
  background: #0a3040;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.live-boost-advisor-btn:hover,
.strategy-boost-open-btn:hover {
  border-color: #69e5ff;
  background: #0d4053;
}

.strategy-boost-open-btn {
  display: block;
  margin-top: 9px;
}

.strategy-boost-advisor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow: hidden;
  background: rgba(1, 6, 14, 0.82);
}

.strategy-boost-advisor {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  color: #edf8ff;
  background: #06111d;
  border: 1px solid #35c8e8;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72), 0 0 26px rgba(53, 200, 232, 0.17);
}

.strategy-boost-advisor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-bottom: 1px solid #26485e;
  background: #0b2031;
}

.strategy-boost-advisor > header span {
  display: block;
  color: #55e6b2;
  font-size: 9px;
  font-weight: 900;
}

.strategy-boost-advisor > header h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.strategy-boost-header-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.strategy-boost-header-actions button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #35647d;
  border-radius: 6px;
  color: #f3fbff;
  background: #071522;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.strategy-boost-header-actions button:last-child {
  width: 34px;
  padding: 0;
  font-size: 20px;
}

.strategy-boost-advisor-body {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.strategy-boost-source-warning {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.strategy-boost-source-warning strong,
.strategy-boost-source-warning span,
.strategy-boost-source-warning small {
  display: block;
}

.strategy-boost-source-warning span {
  overflow-wrap: anywhere;
}

.strategy-boost-source-warning small {
  color: #c8a8af;
}

.strategy-boost-roundline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 7px 9px;
  color: #a8bdcb;
  background: #081825;
  border: 1px solid #21465c;
  font-size: 10px;
}

.strategy-boost-roundline strong {
  color: #ffd166;
  font-size: 13px;
}

.strategy-boost-roundline em {
  color: #55e6b2;
  font-style: normal;
}

.strategy-boost-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(110px, 0.7fr);
  gap: 8px;
  margin-bottom: 9px;
}

.strategy-boost-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #294c61;
  background: #091a28;
}

.strategy-boost-controls label > span,
.strategy-boost-kpis span,
.strategy-boost-max-grid span,
.strategy-boost-always-grid span,
.strategy-boost-window-grid span {
  color: #74d8ef;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-boost-controls select,
.strategy-boost-controls input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  color: #f4fbff;
  background: #040d17;
  border: 1px solid #3b667e;
  border-radius: 4px;
}

.strategy-boost-controls small {
  color: #8ba3b3;
  font-size: 8px;
}

.strategy-boost-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
  border-top: 1px solid #294b61;
  border-left: 1px solid #294b61;
}

.strategy-boost-kpis > div {
  min-width: 0;
  min-height: 68px;
  padding: 9px;
  border-right: 1px solid #294b61;
  border-bottom: 1px solid #294b61;
  background: #071522;
}

.strategy-boost-kpis strong,
.strategy-boost-max-grid strong,
.strategy-boost-always-grid strong,
.strategy-boost-window-grid strong {
  display: block;
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.strategy-boost-kpis small,
.strategy-boost-max-grid small,
.strategy-boost-always-grid small,
.strategy-boost-window-grid small {
  display: block;
  color: #8da4b5;
  font-size: 8px;
  line-height: 1.3;
}

.strategy-boost-section {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #294c61;
  background: #081725;
}

.strategy-boost-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.strategy-boost-section-heading > div > span {
  display: block;
  color: #72d9f0;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-boost-section-heading > div > strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.strategy-boost-max-grid,
.strategy-boost-always-grid,
.strategy-boost-window-grid {
  display: grid;
  border-top: 1px solid #31536a;
  border-left: 1px solid #31536a;
}

.strategy-boost-max-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.strategy-boost-always-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-boost-window-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategy-boost-max-grid > div,
.strategy-boost-always-grid > div,
.strategy-boost-window-grid > div {
  min-width: 0;
  padding: 8px;
  border-right: 1px solid #31536a;
  border-bottom: 1px solid #31536a;
  background: #06121f;
}

.strategy-boost-max-grid em {
  display: block;
  margin-top: 5px;
  color: #55e6b2;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.strategy-boost-timing > p {
  margin: 0 0 8px;
  color: #c2d0da;
  font-size: 10px;
  line-height: 1.45;
}

.strategy-boost-random-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  color: #c3d0d9;
  background: #211a0c;
  border-left: 3px solid #ffc34f;
  font-size: 9px;
  line-height: 1.4;
}

.strategy-boost-random-note strong {
  color: #ffd166;
  white-space: nowrap;
}

.strategy-boost-loading {
  display: grid;
  place-items: center;
  min-height: 280px;
  text-align: center;
}

.strategy-boost-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid #24485e;
  border-top-color: #55d9f5;
  border-radius: 50%;
  animation: strategy-lab-spin 0.9s linear infinite;
}

.strategy-boost-loading strong {
  margin-top: 9px;
}

.strategy-boost-loading small {
  color: #8fa5b7;
  font-size: 9px;
}

@media (max-width: 760px) {
  .strategy-lab-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-lab-kpis,
  .strategy-lab-round-grid,
  .strategy-lab-reserve,
  .strategy-lab-luck,
  .strategy-lab-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-lab-kpis > div:nth-child(2),
  .strategy-lab-round-grid > div:nth-child(2),
  .strategy-lab-reserve > div:nth-child(2),
  .strategy-lab-luck > div:nth-child(2) {
    border-right: 0;
  }

  .strategy-lab-kpis > div:nth-child(-n + 2),
  .strategy-lab-round-grid > div:nth-child(-n + 2),
  .strategy-lab-reserve > div:nth-child(-n + 2),
  .strategy-lab-luck > div:nth-child(-n + 2) {
    border-bottom: 1px solid #294b61;
  }

  .strategy-lab-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-lab-sources {
    grid-template-columns: 1fr;
  }

  .strategy-lab-player {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .strategy-lab-player > div:nth-of-type(n + 3) {
    display: none;
  }

  .strategy-boost-kpis,
  .strategy-boost-always-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .strategy-lab-title-row,
  .strategy-lab-body {
    padding: 10px;
  }

  .strategy-lab-title-row h2 {
    font-size: 18px;
  }

  .strategy-lab-settings {
    grid-template-columns: 1fr;
  }

  .strategy-lab-module-grid button {
    min-height: 82px;
    padding: 8px;
  }

  .strategy-lab-mix {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .strategy-lab-mix em {
    grid-column: 1 / -1;
  }

  .current-round-corner-controls {
    gap: 4px;
  }

  .live-boost-advisor-btn {
    min-height: 26px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .strategy-boost-advisor-overlay {
    padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }

  .strategy-boost-advisor {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .strategy-boost-advisor > header,
  .strategy-boost-advisor-body {
    padding: 9px;
  }

  .strategy-boost-controls,
  .strategy-boost-max-grid {
    grid-template-columns: 1fr;
  }

  .strategy-boost-roundline {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .strategy-boost-roundline em {
    display: none;
  }

  .strategy-boost-random-note {
    grid-template-columns: 1fr;
  }
}
/* Watchlist */
.watchlist-board {
  box-sizing: border-box;
  width: min(100%, 940px);
  max-width: 100%;
  margin: 18px auto 28px;
  padding: 18px;
  border: 1px solid rgba(81, 221, 255, 0.26);
  border-radius: 14px;
  background: rgba(3, 11, 34, 0.74);
  box-shadow: 0 0 0 1px rgba(132, 77, 255, 0.18), 0 18px 42px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.watchlist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.watchlist-header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.watchlist-header span,
.watchlist-section-title,
.watchlist-follow-usage {
  color: #56dfff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.watchlist-header h3 {
  margin: 4px 0;
  color: #f5f7ff;
  font-size: 1.45rem;
}

.watchlist-refresh,
.watchlist-tab-actions button,
.watchlist-star {
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 1px solid rgba(88, 224, 255, 0.45);
  border-radius: 8px;
  background: rgba(10, 34, 58, 0.88);
  color: #f7fbff;
  font-weight: 900;
  line-height: 1;
  font-size: 0.9rem;
}

.watchlist-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
}

.watchlist-tab-list,
.watchlist-tab-actions {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.watchlist-tab-list {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.watchlist-tab-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.watchlist-tab,
.watchlist-find-similar,
.watchlist-search button,
.watchlist-search-result {
  min-height: 34px;
  border: 1px solid rgba(84, 216, 255, 0.35);
  border-radius: 8px;
  background: rgba(8, 27, 52, 0.86);
  color: #f3f7ff;
  font-weight: 800;
  font-size: 0.9rem;
}

.watchlist-tab {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 86px;
  max-width: 145px;
  padding: 0 10px;
  white-space: nowrap;
}

.watchlist-tab.active {
  border-color: rgba(255, 203, 70, 0.72);
  background: rgba(43, 34, 72, 0.95);
  color: #ffd566;
}

.watchlist-find-similar {
  width: 100%;
  margin: 4px 0 10px;
  padding: 0 10px;
  text-align: center;
}

.watchlist-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
}

.watchlist-search input {
  min-height: 36px;
  min-width: 0;
  border: 1px solid rgba(84, 216, 255, 0.28);
  border-radius: 8px;
  background: rgba(4, 20, 39, 0.94);
  color: #f5f8ff;
  padding: 0 12px;
}

.watchlist-search input::placeholder {
  color: rgba(226, 236, 255, 0.58);
}

.watchlist-search-results {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.watchlist-strategy-results {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.watchlist-strategy-summary {
  padding: 9px 10px;
  border: 1px solid rgba(84, 216, 255, 0.24);
  border-radius: 8px;
  background: rgba(5, 21, 43, 0.82);
  color: rgba(231, 240, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.28;
}

.watchlist-strategy-summary strong {
  color: #f6fbff;
}

.watchlist-strategy-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(84, 216, 255, 0.2);
  border-radius: 8px;
  background: rgba(10, 18, 41, 0.92);
}

.watchlist-strategy-row:nth-of-type(even) {
  background: rgba(4, 31, 54, 0.9);
}

.watchlist-strategy-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(84, 216, 255, 0.28);
  border-radius: 999px;
  background: rgba(10, 45, 72, 0.84);
  color: #59d9ff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

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

.watchlist-strategy-copy strong,
.watchlist-strategy-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-strategy-copy strong {
  color: #f7f8ff;
  font-size: 0.9rem;
  line-height: 1.15;
}

.watchlist-strategy-copy span {
  color: rgba(224, 233, 255, 0.74);
  font-size: 0.74rem;
  line-height: 1.18;
}

.watchlist-strategy-row button {
  display: inline-grid !important;
  place-items: center;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: 1px solid rgba(84, 216, 255, 0.38);
  border-radius: 8px;
  background: rgba(7, 44, 72, 0.92);
  color: #f4fbff;
  font-size: 1rem;
  font-weight: 900;
}

.watchlist-strategy-row button:active {
  transform: translateY(1px);
}

.watchlist-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
}

.watchlist-user-list {
  display: grid;
  gap: 10px;
}

.watchlist-section-title {
  margin-top: 8px;
  color: #ffd64a;
}

.watchlist-user-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(76, 201, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 18, 41, 0.92);
}

.watchlist-user-row--clickable {
  cursor: pointer;
}

.watchlist-user-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(31, 131, 220, 0.16);
  color: #2d9cff;
  font-size: 1.2rem;
}

.watchlist-user-copy {
  min-width: 0;
}

.watchlist-user-copy > strong,
.watchlist-user-copy > span,
.watchlist-miner-line,
.watchlist-boost-line {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.watchlist-user-copy > strong {
  color: #f7f8ff;
  font-size: 1.02rem;
}

.watchlist-user-copy > span,
.watchlist-miner-line,
.watchlist-boost-line {
  color: rgba(224, 233, 255, 0.74);
  margin-top: 2px;
}

.watchlist-boost-line {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  line-height: 1.25;
}

.watchlist-boost-title,
.watchlist-boost-icons,
.watchlist-boost-cost {
  display: inline-flex !important;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.watchlist-boost-icons {
  flex-wrap: wrap;
  gap: 3px;
}

.watchlist-boost-cost {
  color: #d9f7ff;
}

.watchlist-user-copy .watchlist-ability-icon {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  margin-right: 0;
  color: #eef6ff;
  white-space: nowrap;
}

.watchlist-user-copy .watchlist-ability-icon small,
.watchlist-user-copy .watchlist-ability-icon b {
  font-size: 0.78em;
}

.watchlist-star {
  color: #ffd64a;
}

.watchlist-empty {
  padding: 12px;
  border: 1px solid rgba(84, 216, 255, 0.2);
  border-radius: 10px;
  background: rgba(3, 15, 33, 0.76);
  color: rgba(234, 240, 255, 0.78);
}

.watchlist-empty.error {
  border-color: rgba(255, 112, 141, 0.42);
  color: #ff9bad;
}

.watchlist-detail-modal.hidden {
  display: none !important;
}

.watchlist-detail-modal {
  position: fixed;
  inset: var(--floating-launcher-offset, 96px) 10px 10px;
  z-index: 2147483646;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.56);
}

.watchlist-detail-dialog {
  width: min(100%, 760px);
  max-height: calc(100dvh - var(--floating-launcher-offset, 96px) - 24px);
  overflow-y: auto;
  border: 1px solid rgba(84, 216, 255, 0.34);
  border-radius: 12px;
  background: rgba(5, 12, 32, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
}

.watchlist-detail-dialog > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(84, 216, 255, 0.18);
  background: rgba(6, 18, 42, 0.98);
  backdrop-filter: blur(12px);
}

.watchlist-detail-dialog > header h3 {
  margin: 0;
}

.watchlist-detail-dialog > header button {
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1px solid rgba(84, 216, 255, 0.34);
  border-radius: 9px;
  background: rgba(7, 24, 46, 0.95);
  color: #f7fbff;
  font-weight: 900;
}

.watchlist-detail-body {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px 14px;
  color: #e8f0ff;
  font-size: 0.82rem;
  line-height: 1.35;
}

.watchlist-detail-body > h4,
.watchlist-previous-cycle-title {
  margin: 4px 0 -2px;
  color: #f6f9ff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.watchlist-detail-fetch-status {
  padding: 9px 11px;
  border: 1px solid rgba(255, 199, 78, 0.34);
  border-left: 3px solid #ffc74e;
  border-radius: 8px;
  background: rgba(74, 52, 9, 0.42);
  color: #ffe4a0;
  font-size: 0.75rem;
}

.watchlist-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(84, 216, 255, 0.24);
  border-radius: 10px;
  background: rgba(6, 23, 48, 0.86);
}

.watchlist-detail-summary > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid rgba(84, 216, 255, 0.14);
}

.watchlist-detail-summary > div:last-child {
  border-right: 0;
}

.watchlist-detail-summary span,
.watchlist-strategy-cycle-grid span,
.watchlist-strategy-boosts > span {
  display: block;
  color: rgba(157, 190, 218, 0.82);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.watchlist-detail-summary strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #f7fbff;
  font-size: 0.94rem;
}

.watchlist-detail-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(84, 216, 255, 0.2);
  border-radius: 9px;
  background: rgba(3, 13, 31, 0.78);
}

.watchlist-detail-table-wrap table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.watchlist-detail-table-wrap th,
.watchlist-detail-table-wrap td {
  padding: 8px 9px;
  border-right: 1px solid rgba(84, 216, 255, 0.1);
  border-bottom: 1px solid rgba(84, 216, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}

.watchlist-detail-table-wrap th {
  color: #70dcf6;
  background: rgba(9, 35, 63, 0.92);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.watchlist-detail-table-wrap td {
  color: #dfe9f8;
  font-size: 0.74rem;
}

.watchlist-strategy-cycle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, 0.34fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(84, 216, 255, 0.25);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(8, 28, 58, 0.96), rgba(7, 13, 37, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.watchlist-strategy-cycle-main {
  min-width: 0;
  padding: 12px;
}

.watchlist-strategy-cycle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.watchlist-strategy-cycle-head strong {
  color: #f8fbff;
  font-size: 0.88rem;
}

.watchlist-strategy-cycle-head > span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(84, 216, 255, 0.26);
  border-radius: 999px;
  background: rgba(37, 123, 169, 0.16);
  color: #6ee2ff;
  font-size: 0.68rem;
  font-weight: 850;
}

.watchlist-strategy-cycle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(84, 216, 255, 0.14);
  border-radius: 8px;
  background: rgba(2, 11, 29, 0.52);
}

.watchlist-strategy-cycle-grid > div {
  min-width: 0;
  padding: 8px;
  border-right: 1px solid rgba(84, 216, 255, 0.1);
}

.watchlist-strategy-cycle-grid > div:last-child {
  border-right: 0;
}

.watchlist-strategy-cycle-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #f4f8ff;
  font-size: 0.84rem;
}

.watchlist-strategy-cycle-grid small {
  display: block;
  margin-top: 2px;
  color: rgba(151, 187, 215, 0.8);
  font-size: 0.62rem;
}

.watchlist-cycle-rate {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.watchlist-strategy-cycle-grid .profit strong {
  color: #5ee2a0;
}

.watchlist-strategy-cycle-grid .loss strong {
  color: #ff8ca3;
}

.watchlist-strategy-boosts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border-left: 1px solid rgba(84, 216, 255, 0.16);
  background: rgba(4, 17, 37, 0.72);
}

.watchlist-strategy-boosts > strong {
  margin-top: 5px;
  color: #ffd66b;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.watchlist-strategy-boosts > small {
  color: rgba(170, 194, 219, 0.7);
  font-size: 0.64rem;
}

.watchlist-strategy-untracked {
  color: #aebcd0 !important;
  font-size: 0.78rem !important;
}

.watchlist-strategy-boost-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
}

.watchlist-strategy-boost-row,
.watchlist-detail-body .watchlist-ability-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.watchlist-detail-body .watchlist-ability-icon {
  padding: 3px 5px;
  border: 1px solid rgba(84, 216, 255, 0.16);
  border-radius: 6px;
  background: rgba(10, 38, 64, 0.72);
  color: #edf8ff;
  white-space: nowrap;
}

.watchlist-detail-body .watchlist-ability-icon small,
.watchlist-detail-body .watchlist-ability-icon b {
  font-size: 0.68rem;
}

.watchlist-strategy-no-boosts {
  color: rgba(178, 195, 216, 0.72);
  font-size: 0.68rem;
  line-height: 1.3;
}

.watchlist-winning-activity-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.watchlist-winning-activity-title h4 {
  margin: 0;
  color: #f6f9ff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.watchlist-winning-activity-title span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(46, 224, 158, 0.13);
  color: #62e3ad;
  font-size: 0.68rem;
  font-weight: 850;
}

.watchlist-winning-activity {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.watchlist-winning-activity-row {
  display: grid;
  grid-template-columns: 8px minmax(104px, auto) 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(84, 216, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 20, 43, 0.72);
}

.watchlist-winning-activity-row:nth-child(even) {
  background: rgba(8, 29, 54, 0.82);
}

.watchlist-winning-activity-row > i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4fe1a2;
  box-shadow: 0 0 8px rgba(79, 225, 162, 0.55);
}

.watchlist-winning-activity-row > strong {
  color: #f4f8ff;
  font-size: 0.73rem;
  white-space: nowrap;
}

.watchlist-winning-activity-cycle {
  color: #6edff8;
  font-size: 0.68rem;
  font-weight: 850;
}

.watchlist-winning-activity-boosts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  color: rgba(185, 202, 224, 0.72);
}

.watchlist-winning-activity-cost {
  color: #ffd66b;
  font-size: 0.69rem;
  white-space: nowrap;
}

.watchlist-older-cycles {
  overflow: hidden;
  border: 1px solid rgba(84, 216, 255, 0.18);
  border-radius: 9px;
  background: rgba(4, 16, 36, 0.7);
}

.watchlist-older-cycles > summary {
  padding: 9px 11px;
  color: #72ddf6;
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
}

.watchlist-older-cycles > div {
  display: grid;
  gap: 8px;
  padding: 0 9px 9px;
}

.watchlist-detail-note {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(84, 216, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 13, 29, 0.62);
  color: rgba(183, 200, 222, 0.78);
  font-size: 0.69rem;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .watchlist-board {
    margin: 10px 6px 22px;
    padding: 12px;
  }

  .watchlist-tabs {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .watchlist-tab-list,
  .watchlist-tab-actions {
    gap: 6px;
  }

  .watchlist-tab {
    min-width: 78px;
    max-width: 118px;
    padding: 0 8px;
  }

  .watchlist-strategy-row {
    grid-template-columns: 28px minmax(0, 1fr) 30px;
    gap: 7px;
    padding: 8px;
  }

  .watchlist-strategy-rank {
    width: 26px;
    height: 26px;
  }

  .watchlist-strategy-row button {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
  }

  .watchlist-search {
    grid-template-columns: 1fr;
  }

  .watchlist-user-row {
    grid-template-columns: 32px minmax(0, 1fr) 30px;
  }

  .watchlist-detail-modal {
    right: 4px;
    bottom: 4px;
    left: 4px;
    padding: 4px;
  }

  .watchlist-detail-dialog {
    border-radius: 10px;
  }

  .watchlist-detail-dialog > header,
  .watchlist-detail-body {
    padding-right: 10px;
    padding-left: 10px;
  }

  .watchlist-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watchlist-detail-summary > div:nth-child(2) {
    border-right: 0;
  }

  .watchlist-detail-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(84, 216, 255, 0.14);
  }

  .watchlist-strategy-cycle-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .watchlist-strategy-cycle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watchlist-strategy-cycle-grid > div:nth-child(2) {
    border-right: 0;
  }

  .watchlist-strategy-cycle-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(84, 216, 255, 0.1);
  }

  .watchlist-strategy-boosts {
    border-top: 1px solid rgba(84, 216, 255, 0.16);
    border-left: 0;
  }

  .watchlist-strategy-boost-list {
    margin-top: 0;
  }

  .watchlist-winning-activity-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 6px 8px;
  }

  .watchlist-winning-activity-cycle {
    text-align: right;
  }

  .watchlist-winning-activity-boosts {
    grid-column: 2;
  }

  .watchlist-winning-activity-cost {
    grid-column: 3;
    grid-row: 2;
  }
}

/* License Content Studio */
.admin-license-studio {
  --studio-cyan: #43ddff;
  --studio-purple: #8b5dff;
  --studio-green: #3be8a5;
  color: #e9f0ff;
  width: 100%;
  min-width: 0;
}

.admin-license-studio-toolbar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(67, 221, 255, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(67, 221, 255, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(12, 27, 49, 0.96), rgba(13, 12, 36, 0.97));
  box-shadow: 0 18px 48px rgba(1, 4, 16, 0.32);
}

.admin-license-studio-toolbar::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(139, 93, 255, 0.12);
  filter: blur(3px);
  pointer-events: none;
}

.admin-license-studio-heading,
.admin-license-studio-actions {
  position: relative;
  z-index: 1;
}

.admin-license-studio-kicker,
.admin-license-preview-heading > div:first-child > span {
  display: block;
  margin-bottom: 5px;
  color: var(--studio-cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.admin-license-studio-heading h3 {
  margin: 0;
  font-size: clamp(21px, 2vw, 30px);
}

.admin-license-studio-heading p {
  max-width: 620px;
  margin: 7px 0 0;
  color: #9caac2;
  line-height: 1.5;
}

.admin-license-studio-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-license-studio-note {
  width: min(230px, 100%);
  min-height: 38px;
  border: 1px solid rgba(114, 141, 181, 0.33);
  border-radius: 10px;
  background: rgba(3, 10, 25, 0.66);
  color: #edf5ff;
  padding: 8px 11px;
}

.admin-license-studio-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(59, 232, 165, 0.28);
  border-radius: 999px;
  color: var(--studio-green);
  background: rgba(20, 109, 77, 0.16);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-license-studio-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.admin-license-studio-state.is-dirty {
  color: #ffbd3f;
  border-color: rgba(255, 189, 63, 0.32);
  background: rgba(142, 88, 10, 0.18);
}

.admin-license-content-status {
  min-height: 22px;
  margin: 10px 4px 4px;
  font-size: 12px;
}

.admin-license-content-status.success { color: var(--studio-green); }
.admin-license-content-status.error { color: #ff8393; }

.admin-license-studio-auth {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.72fr) minmax(170px, 0.62fr) auto;
  align-items: end;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 189, 63, 0.34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(76, 45, 8, 0.22), rgba(11, 17, 34, 0.96));
}

.admin-license-studio-auth[hidden] { display: none; }

.admin-license-studio-auth-copy {
  display: grid;
  gap: 3px;
  align-self: center;
}

.admin-license-studio-auth-copy strong { color: #fff0c4; }
.admin-license-studio-auth-copy span { color: #9caac2; font-size: 11px; }

.admin-license-studio-auth label {
  display: grid;
  gap: 5px;
  color: #9caac2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-license-studio-auth input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(114, 141, 181, 0.33);
  border-radius: 10px;
  background: rgba(3, 10, 25, 0.8);
  color: #edf5ff;
  padding: 8px 11px;
  text-transform: none;
}

.admin-license-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  align-items: start;
  gap: 16px;
  width: 100%;
}

.admin-license-studio-editor {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-license-editor-section,
.admin-license-studio-preview {
  border: 1px solid rgba(87, 116, 164, 0.25);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(12, 22, 42, 0.96), rgba(8, 12, 30, 0.96));
  box-shadow: 0 16px 36px rgba(1, 4, 16, 0.23);
}

.admin-license-editor-section { padding: 16px; }

.admin-license-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-license-editor-title > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 9px;
}

.admin-license-editor-title strong { font-size: 15px; }
.admin-license-editor-title > div > span:last-child {
  grid-column: 2;
  color: #8190aa;
  font-size: 11px;
}

.admin-license-section-number {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(67, 221, 255, 0.28);
  border-radius: 10px;
  color: var(--studio-cyan);
  background: rgba(24, 120, 151, 0.12);
  font-size: 10px;
  font-weight: 900;
}

.admin-license-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 10px;
}

.admin-license-pricing-card,
.admin-license-discount-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(73, 119, 167, 0.3);
  border-radius: 13px;
  background: rgba(5, 13, 31, 0.72);
  padding: 12px;
}

.admin-license-pricing-card:focus-within,
.admin-license-discount-card:focus-within,
.admin-license-feature-row:focus-within {
  border-color: rgba(67, 221, 255, 0.62);
  box-shadow: 0 0 0 2px rgba(67, 221, 255, 0.08);
}

.admin-license-pricing-card.is-inactive,
.admin-license-discount-card.is-inactive,
.admin-license-feature-row.is-inactive { opacity: 0.58; }

.admin-license-editor-row-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.admin-license-editor-row-head > div {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.admin-license-editor-row-head strong,
.admin-license-editor-row-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-license-editor-row-head small { color: #6f819e; }

.admin-license-pricing-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #06111e;
  background: linear-gradient(135deg, var(--studio-cyan), #8bd5ff);
  font-weight: 900;
}

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

.admin-license-fields label,
.admin-license-discount-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #8796af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-license-fields input,
.admin-license-fields textarea,
.admin-license-fields select,
.admin-license-discount-fields input,
.admin-license-feature-main > input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(93, 122, 165, 0.28);
  border-radius: 9px;
  outline: none;
  background: rgba(2, 8, 22, 0.78);
  color: #ecf4ff;
  padding: 9px 10px;
  font: inherit;
  text-transform: none;
}

.admin-license-fields textarea { resize: vertical; }
.admin-license-fields input:focus,
.admin-license-fields textarea:focus,
.admin-license-fields select:focus,
.admin-license-discount-fields input:focus,
.admin-license-feature-main > input:focus { border-color: var(--studio-cyan); }
.admin-license-wide { grid-column: 1 / -1; }

.admin-license-page-copy-section {
  border-color: rgba(67, 221, 255, 0.34);
  background:
    radial-gradient(circle at 100% 0, rgba(67, 221, 255, 0.09), transparent 34%),
    linear-gradient(145deg, rgba(12, 22, 42, 0.98), rgba(8, 12, 30, 0.98));
}

.admin-license-page-copy-grid textarea {
  min-height: 82px;
  line-height: 1.5;
}

.admin-license-page-copy-hint {
  margin: 10px 0 0;
  color: #7587a4;
  font-size: 10px;
  line-height: 1.45;
}

.admin-license-switch {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  color: #aebbd0 !important;
  font-size: 11px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.admin-license-switch input { position: absolute; opacity: 0; pointer-events: none; }
.admin-license-switch > span {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #26344d;
  transition: 0.2s ease;
}
.admin-license-switch > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9aa9bf;
  transition: 0.2s ease;
}
.admin-license-switch input:checked + span { background: rgba(59, 232, 165, 0.38); }
.admin-license-switch input:checked + span::after { transform: translateX(14px); background: var(--studio-green); }

.admin-license-discount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.admin-license-discount-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.admin-license-discount-value {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 70px;
  border-radius: 11px;
  color: var(--studio-green);
  background: linear-gradient(145deg, rgba(31, 151, 106, 0.2), rgba(21, 75, 77, 0.11));
}
.admin-license-discount-value strong { font-size: 21px; }
.admin-license-discount-value span { color: #7b938e; font-size: 9px; text-transform: uppercase; }
.admin-license-discount-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.admin-license-discount-fields label:not(.admin-license-wide) { grid-template-columns: 1fr auto; align-items: center; }
.admin-license-discount-fields label:not(.admin-license-wide) input { grid-column: 1 / -1; }
.admin-license-discount-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(84, 112, 151, 0.18);
}

.admin-license-feature-section { overflow: hidden; }
.admin-license-editor-title > .admin-license-editor-title-actions {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.admin-license-tier-manager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 8px;
  margin-bottom: 13px;
}

.admin-license-tier-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 58px;
  align-items: end;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(82, 216, 243, 0.22);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(11, 31, 55, 0.9), rgba(6, 13, 29, 0.88));
}

.admin-license-tier-card > .btn {
  grid-column: 2 / -1;
  justify-self: end;
}

.admin-license-tier-index {
  align-self: center;
  color: var(--studio-cyan);
  font-size: 10px;
  font-weight: 900;
}

.admin-license-tier-card label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #788ba8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-license-tier-card input {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(93, 122, 165, 0.28);
  border-radius: 8px;
  outline: none;
  color: #eef6ff;
  background: rgba(2, 8, 22, 0.78);
}

.admin-license-tier-card input:focus { border-color: var(--studio-cyan); }
.admin-license-feature-table-head,
.admin-license-feature-main {
  display: grid;
  grid-template-columns: minmax(180px, 1.55fr) repeat(3, minmax(80px, 0.72fr)) minmax(105px, 0.65fr) 32px;
  gap: 7px;
  align-items: center;
}
.admin-license-feature-table-head {
  min-width: 690px;
  padding: 0 11px 7px;
  color: #647792;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-license-feature-table {
  display: grid;
  gap: 7px;
  min-width: 690px;
}
.admin-license-feature-section { overflow-x: auto; }
.admin-license-feature-row {
  border: 1px solid rgba(73, 119, 167, 0.24);
  border-radius: 11px;
  background: rgba(4, 11, 27, 0.72);
}
.admin-license-feature-main { padding: 8px; }
.admin-license-feature-name {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}
.admin-license-feature-name > span {
  color: var(--studio-cyan);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}
.admin-license-feature-name input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #f2f6ff;
  font-weight: 750;
}
.admin-license-feature-visibility {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.admin-license-feature-visibility label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #8696ae;
  font-size: 9px;
}
.admin-license-feature-visibility input { accent-color: var(--studio-cyan); }
.admin-license-feature-expand {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(86, 120, 165, 0.3);
  border-radius: 9px;
  color: #aab8ce;
  background: rgba(21, 34, 58, 0.65);
  transition: 0.2s ease;
}
.admin-license-feature-expand.active { transform: rotate(180deg); color: var(--studio-cyan); }
.admin-license-feature-details {
  padding: 12px;
  border-top: 1px solid rgba(82, 115, 162, 0.22);
  background: rgba(11, 21, 41, 0.78);
}
.admin-license-feature-details > .btn { margin-top: 10px; }

.admin-license-revision-list { display: grid; gap: 7px; }
.admin-license-revision-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(78, 108, 151, 0.22);
  border-radius: 10px;
  background: rgba(5, 12, 28, 0.68);
}
.admin-license-revision-row > div { display: grid; min-width: 0; }
.admin-license-revision-row strong,
.admin-license-revision-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-license-revision-row small { color: #74859e; }
.admin-license-revision-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b6cff; box-shadow: 0 0 10px rgba(139, 108, 255, 0.7); }
.admin-license-revision-row.is-published .admin-license-revision-dot { background: var(--studio-green); box-shadow: 0 0 10px rgba(59, 232, 165, 0.7); }
.admin-license-empty {
  padding: 18px;
  border: 1px dashed rgba(104, 131, 172, 0.3);
  border-radius: 11px;
  color: #7888a1;
  text-align: center;
}

.admin-license-studio-preview {
  position: sticky;
  top: 10px;
  min-width: 0;
  padding: 13px;
  overflow: hidden;
}
.admin-license-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.admin-license-preview-heading > div:first-child { display: grid; }
.admin-license-preview-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(82, 115, 160, 0.26);
  border-radius: 10px;
  background: rgba(2, 8, 22, 0.58);
}
.admin-license-preview-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7f8da4;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
}
.admin-license-preview-tabs button.active { color: #06121e; background: var(--studio-cyan); }
.admin-license-preview-canvas {
  max-height: min(72vh, 760px);
  overflow: auto;
  border: 1px solid rgba(111, 76, 224, 0.44);
  border-radius: 13px;
  background: #080d1d;
  padding: 10px;
  box-shadow: inset 0 0 32px rgba(57, 30, 135, 0.13);
}
.admin-license-preview-canvas .home-tier-matrix { min-width: 470px; }
.admin-license-preview-canvas--features { min-width: 0; }
.admin-license-preview-canvas--features .home-license-features-page { min-width: 520px; }
.admin-license-preview-note {
  margin: 9px 3px 0;
  color: #687993;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .admin-license-studio-layout { grid-template-columns: 1fr; }
  .admin-license-studio-preview { position: static; }
  .admin-license-preview-canvas { max-height: 620px; }
}

@media (max-width: 760px) {
  .admin-license-studio-toolbar { align-items: stretch; flex-direction: column; padding: 15px; }
  .admin-license-studio-actions { justify-content: flex-start; }
  .admin-license-studio-auth { grid-template-columns: 1fr 1fr; }
  .admin-license-studio-auth-copy { grid-column: 1 / -1; }
  .admin-license-studio-note { width: 100%; order: -1; }
  .admin-license-editor-section { padding: 12px; }
  .admin-license-editor-title { align-items: flex-start; }
  .admin-license-pricing-grid,
  .admin-license-discount-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .admin-license-studio-auth { grid-template-columns: 1fr; }
  .admin-license-studio-auth-copy { grid-column: auto; }
  .admin-license-fields { grid-template-columns: 1fr; }
  .admin-license-wide { grid-column: auto; }
  .admin-license-editor-title { flex-direction: column; }
  .admin-license-editor-title > .btn,
  .admin-license-editor-title-actions { width: 100%; }
  .admin-license-editor-title-actions > .btn { flex: 1; }
  .admin-license-tier-card { grid-template-columns: auto minmax(0, 1fr) 54px; }
  .admin-license-discount-card { grid-template-columns: 58px minmax(0, 1fr); }
  .admin-license-discount-value { width: 58px; }
  .admin-license-preview-heading { align-items: flex-start; flex-direction: column; }
}

/* Calculator sideapp: content-sized rows must never be clipped by cavern cards. */
[data-panel="calculator"].tab-panel.active {
  align-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable;
}

#calculatorGrid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  align-items: start !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 8px;
}

#calculatorGrid > .card,
:root[data-theme='cavern'] #calculatorGrid > .card {
  align-self: start !important;
  height: auto !important;
  min-height: max-content !important;
  max-height: none !important;
  overflow: visible !important;
}

#calculatorGrid .calculator-inputs-card,
#calculatorGrid .calculator-container,
#calculatorGrid .calc-tab-panel.active,
#calculatorGrid .calc-sections,
#calculatorGrid .solo-mining-calculator,
#calculatorGrid .solo-calc-results {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

#calculatorGrid .calculator-results {
  height: auto !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  overscroll-behavior-x: contain;
}

@media (max-width: 900px) {
  #calculatorGrid .solo-calc-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #calculatorGrid .solo-calc-main-inputs,
  #calculatorGrid .solo-calc-settings {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Shared language selector: one preference for sidebar and Android. */
.smart-language-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 42px;
  padding: 0 7px;
  border: 1px solid #1d708e;
  border-radius: 10px;
  background: #071426;
  color: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(53, 208, 255, .04);
}

.smart-language-picker-icon {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
}

.smart-language-select {
  width: 80px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 800 11px/1.1 inherit;
  cursor: pointer;
}

.smart-language-select option {
  background: #081426;
  color: #eef6ff;
}

@media (max-width: 820px) {
  .smart-language-picker-app {
    height: 36px;
    padding-inline: 6px;
  }

  .smart-language-picker-app .smart-language-picker-icon { display: none; }
  .smart-language-picker-app .smart-language-select { width: 51px; }
}
