:root {
  --bg: #0f172a;
  --panel: #1f2937;
  --text: #e2e8f0;
  --accent: #38bdf8;
  --accent-2: #fb7185;
  --shadow: 0 20px 35px rgba(15, 23, 42, 0.45);
}

.app-shell {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  width: 650px;
  padding: 16px;
  background: var(--panel);
  box-shadow: -16px 0 32px rgba(12, 15, 25, 0.65);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2147483647;
  overflow-y: auto; /* allow scrolling if content exceeds viewport */
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.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(100%, 650px);
  background: rgba(10, 14, 25, 0.95);
  border-left: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: -12px 0 24px rgba(2, 6, 23, 0.6);
  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.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%;
  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(15, 23, 42, 0.9);
  border-radius: 22px;
  padding: 8px 16px 16px;
  box-shadow: var(--shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* allow children to shrink and scroll */
  position: relative;
}

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

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

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

.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 {
  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-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-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-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;
}

.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,
.subscription-suggestions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.subscription-license-table th,
.subscription-license-table td,
.subscription-suggestions-table th,
.subscription-suggestions-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,
.subscription-suggestions-table th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.85);
}

.subscription-suggest-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscription-suggest-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.9);
}

.subscription-suggest-form input,
.subscription-suggest-form textarea,
.subscription-suggest-form select {
  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;
}

.subscription-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.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;
}

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

/* Calculator cards should use full width and stack vertically */
#calculatorGrid {
  grid-template-columns: 1fr;
}

.calculator-inputs-card {
  max-height: 50vh;
  overflow: auto;
}

#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);
}

.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-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  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 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;
}

.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 {
  font-size: 0.65em;
}

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

#calculatorGrid input {
  padding: 1px !important;
  height: 16px;
  font-size: 1em !important;
  line-height: 1.1;
}

#calculatorGrid label span {
  font-size: 0.8em !important;
}

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

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

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

.sidebar-resizer {
  width: 6px;
  background: rgba(255, 255, 255, 0.08);
  position: fixed;
  left: calc(100% - 6px);
  top: 0;
  bottom: 0;
  cursor: ew-resize;
  border-radius: 3px 0 0 3px;
}

.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: 4px 8px 8px;
}

: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: 20px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding-right: 12px;
}

/* === 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: 1.8em;
  max-height: 600px;
  overflow-y: auto;
}

.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-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.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2147483647;
}

.round-history-popup {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.55);
  padding: 14px;
}

.round-history-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.round-history-popup-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.round-history-popup-close {
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.feature-overview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  padding: 24px;
}

.feature-overview-card {
  width: min(980px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.feature-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.feature-overview-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.feature-overview-close {
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.feature-overview-body {
  padding: 16px 20px 20px;
  overflow: auto;
}

.feature-overview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.feature-overview-tab {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}

.feature-overview-tab.active {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(88, 28, 135, 0.55);
}

.feature-overview-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-overview-panel {
  display: none;
  gap: 18px;
  align-items: stretch;
}

.feature-overview-panel.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.feature-overview-screenshot {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  height: 280px;
  padding: 10px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  overflow: hidden;
}

.feature-overview-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  border-radius: 8px;
}

.feature-overview-shot-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.feature-overview-shot-label {
  color: #94a3b8;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px 12px;
  border-radius: 999px;
}

.feature-overview-screenshot[data-feature-shot="live"] {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
}

.feature-overview-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  padding: 24px;
}

.feature-overview-lightbox-card {
  width: min(1100px, 95vw);
  max-height: 92vh;
  background: rgba(12, 18, 32, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.feature-overview-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.feature-overview-lightbox-title {
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
}

.feature-overview-lightbox-close {
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.feature-overview-lightbox-body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-overview-lightbox-image {
  width: 100%;
  max-height: 70vh;
  aspect-ratio: 4 / 3;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.feature-overview-lightbox-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.9rem;
  min-height: 200px;
  padding: 20px;
}

.feature-overview-details h4 {
  margin: 0 0 8px 0;
  color: #e2e8f0;
  font-size: 1rem;
}

.feature-overview-details ul {
  margin: 0;
  padding-left: 18px;
  color: #cbd5f5;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 800px) {
  .feature-overview-panel.active {
    grid-template-columns: 1fr;
  }
  .feature-overview-screenshot {
    height: 180px;
  }
}

.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-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;
}

/* 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: 10px !important;
  padding-right: 6px !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);
}
