* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --input-bg: #ffffff;
  --border: #d8e0ea;
  --text: #172033;
  --muted: #667085;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --success: #15803d;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --pill-bg: #ccfbf1;
  --active-bg: #ecfdf5;
  --toast-success: #15803d;
  --toast-danger: #b42318;
  --shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
  --stat-chart-coin: #d97706;
  --stat-chart-diamond: #2563eb;
  --stat-chart-usd: #16a34a;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1522;
  --surface: #161d2e;
  --surface-2: #1c2438;
  --input-bg: #1c2438;
  --border: #2c3652;
  --text: #e5e9f2;
  --muted: #94a1b8;
  --accent: #14b8a6;
  --accent-strong: #2dd4bf;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --warning-bg: #3b2f14;
  --pill-bg: #134e4a;
  --active-bg: #0f3d38;
  --toast-success: #15803d;
  --toast-danger: #b42318;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  --stat-chart-coin: #fbbf24;
  --stat-chart-diamond: #60a5fa;
  --stat-chart-usd: #4ade80;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--input-bg);
}

input,
select {
  min-height: 38px;
  padding: 0 10px;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-2);
}

.secondary-button:hover {
  background: var(--border);
}

.app-shell {
  min-height: 100vh;
}

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

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1,
.topbar h1,
.sidebar h2,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-panel input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--input-bg);
}

.form-error,
.status-line {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #ffffff;
  background: var(--toast-success);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.error {
  background: var(--toast-danger);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.eyebrow-logo {
  display: block;
  height: 250px;
  width: auto;
  margin: 0 0 10px;
  object-fit: contain;
}

.manager-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.game-list {
  display: grid;
  gap: 10px;
}

.game-button {
  height: auto;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  background: var(--surface-2);
}

.game-button.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--active-bg);
}

.game-button span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.sidebar .secondary-button {
  margin-top: auto;
}

.content {
  min-width: 0;
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 24px;
}

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin: -24px -24px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.quick-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.quick-nav a:hover {
  background: var(--accent);
  color: var(--surface);
}

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

.quick-nav-save {
  min-height: 34px;
  padding: 0 18px;
}

.version-select {
  min-height: 34px;
  max-width: 180px;
  padding: 0 8px;
}

.quick-nav-delete-version {
  min-height: 34px;
  min-width: 34px;
  padding: 0;
}

.topbar,
.panel-header,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span,
.metric-card small,
.panel-header p,
.empty-text {
  color: var(--muted);
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header p {
  margin: 6px 0 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.notes {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
}

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

.segment-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.segment-item span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.editor-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.tab-button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.tab-button:hover,
.tab-button.active {
  color: #ffffff;
  background: var(--accent);
}

.visual-editor {
  display: grid;
  gap: 18px;
}

.editor-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  scroll-margin-top: 70px;
}

.editor-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.editor-section-header h3 {
  margin: 0;
  font-size: 1rem;
}

.editor-section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field strong {
  color: var(--text);
}

.editor-table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.match-reward-tier + .match-reward-tier {
  margin-top: 16px;
}

.match-reward-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.match-reward-tier-header h4 {
  margin: 0;
  font-size: 0.92rem;
}

.editor-table table {
  min-width: 620px;
}

.editor-table th,
.editor-table td {
  padding: 9px;
}

.editor-table input,
.editor-table select {
  width: 100%;
}

.power-grid,
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}

.edit-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.edit-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.edit-card-title strong {
  overflow-wrap: anywhere;
}

.pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--pill-bg);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.full-field {
  grid-column: 1 / -1;
}

.stat-upgrade-block {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.stat-upgrade-block .form-grid {
  grid-template-columns: repeat(2, minmax(90px, 1fr));
}

.stat-upgrade-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.86rem;
}

.slot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.slot-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.8rem;
}

.slot-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Section headers - large and yellow */
#section-economy h3,
#section-power-upgrade-costs h3,
#section-match-rewards h3,
#section-character-levels h3,
#section-xp-rewards h3,
#section-health h3,
#section-return-to-game h3,
#section-ingame-coins h3,
#section-powers h3,
#section-characters h3,
#section-trophy-road h3 {
  font-size: 2rem;
  color: #FFD700;
}

/* Power names styling */
.power-grid .edit-card-title strong {
  color: #90EE90;
}

/* Character names styling - 30% bigger and light blue */
.character-grid .edit-card-title strong {
  color: #87CEEB;
  font-size: 1.3em;
}

#configEditor {
  width: 100%;
  min-height: 520px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
}

.page-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.page-nav-button {
  height: auto;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  background: var(--surface-2);
  font-weight: 600;
  cursor: pointer;
}

.page-nav-button.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--active-bg);
}

.page-nav-button-danger {
  color: var(--danger);
  border-color: var(--danger);
}

.news-editor {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.news-lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.news-lang-select {
  min-width: 200px;
}

.news-lang-select select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.9rem;
}

.news-lang-row #newsTranslateButton {
  margin-bottom: 1px;
}

.loc-search {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 240px;
}

.loc-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
  margin-top: 12px;
  align-items: start;
}

@media (max-width: 760px) {
  .loc-layout {
    grid-template-columns: 1fr;
  }
}

.loc-list {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
}

.loc-key {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.loc-key:hover {
  background: var(--panel-hover, rgba(127, 127, 127, 0.12));
}

.loc-key.active {
  background: var(--accent, #4c8bf5);
  color: #fff;
}

.loc-key strong {
  display: block;
  font-size: 0.82rem;
}

.loc-key small {
  display: block;
  opacity: 0.7;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-key.active small {
  opacity: 0.9;
}

.loc-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 200px;
}

.loc-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.loc-fields {
  display: grid;
  gap: 12px;
}

.loc-field span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.loc-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  resize: vertical;
}

.loc-field.primary textarea {
  border-color: var(--accent, #4c8bf5);
}

.loc-empty {
  opacity: 0.7;
  padding: 24px 8px;
}

.news-editor textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.news-image-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}

.news-image-dropzone:hover {
  border-color: rgba(15, 118, 110, 0.55);
}

.news-image-dropzone img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
}

.news-active-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.news-active-field input {
  width: 18px;
  height: 18px;
}

@media (max-width: 1100px) {
  .manager-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .metric-grid,
  .dashboard-grid,
  .power-grid,
  .character-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .content,
  .sidebar {
    padding: 16px;
  }

  .metric-grid,
  .dashboard-grid,
  .power-grid,
  .character-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-header,
  .button-row,
  .editor-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .card-fields,
  .slot-list {
    grid-template-columns: 1fr;
  }
}

/* ---- Push Notifications page ---- */
.push-lang-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.push-lang-select {
  min-width: 200px;
}

.push-interval-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.push-interval-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.push-interval-row .field {
  margin: 0;
}

.push-interval-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.push-interval-row .push-interval-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.push-interval-hour-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.push-actions {
  margin-top: 16px;
}

.bot-name-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.bot-name-row input {
  margin: 0;
}

.push-send-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 4px;
}

.push-send-row .field {
  margin: 0;
  min-width: 200px;
}

.push-send-button {
  height: 42px;
}

.push-history {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.push-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.push-history-item {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
}

.push-history-item strong {
  display: block;
  margin-bottom: 2px;
}

.push-history-item .push-history-meta {
  color: var(--muted);
  font-size: 12px;
}

.push-empty-text {
  color: var(--muted);
}

/* Scheduled sends (Push + News for a specific day/time) */
.schedule-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.schedule-row .field {
  min-width: 220px;
}

.schedule-row input[type="datetime-local"] {
  min-height: 38px;
  padding: 0 10px;
}

.scheduled-block {
  margin-top: 20px;
}

.push-device-stat {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.push-device-stat:empty {
  display: none;
}

.push-device-stat-warning {
  padding: 10px 12px;
  border: 1px solid var(--warning);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 600;
  line-height: 1.45;
}

.scheduled-block h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

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

.scheduled-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface-2);
}

.scheduled-item-main {
  min-width: 0;
}

.scheduled-item-main strong {
  display: block;
  font-size: 0.9rem;
}

.scheduled-item-main span {
  color: var(--muted);
  font-size: 0.8rem;
}

.scheduled-item-main em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.scheduled-pending {
  border-left-color: var(--accent);
}

.scheduled-sent {
  border-left-color: var(--success);
}

.scheduled-failed {
  border-left-color: var(--danger);
}

/* Fired, but nobody received it - not a success, not an error. */
.scheduled-undelivered {
  border-left-color: var(--warning);
}

.scheduled-undelivered .scheduled-item-main em {
  color: var(--warning);
}

.scheduled-canceled,
.scheduled-running {
  border-left-color: var(--muted);
}

.scheduled-cancel {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
}

@media (max-width: 720px) {
  .push-interval-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Statistic page ---- */
.stat-period-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stat-period-button {
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-period-button:hover {
  background: var(--border);
  color: var(--text);
}

.stat-period-button.active {
  color: #ffffff;
  background: var(--accent);
}

.stat-period-button.active:hover {
  background: var(--accent-strong);
}

/* Calendar navigation (‹ label ›) */
.stat-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-nav-arrow {
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 1.2rem;
  line-height: 1;
}

.stat-nav-arrow:hover:not(:disabled) {
  background: var(--border);
}

.stat-nav-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.stat-nav-label {
  min-width: 130px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.stat-demo-badge {
  padding: 5px 12px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .stat-demo-badge {
  color: #fde68a;
  background: #422006;
  border-color: #78500f;
}

#statisticContent {
  display: grid;
  gap: 20px;
}

.stat-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-kpi-grid .metric-card strong {
  font-size: 1.7rem;
}

.stat-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.85fr);
  gap: 20px;
}

.stat-side {
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.stat-side-title,
.stat-rank-list {
  margin: 0;
}

.stat-side-title {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* Tables */
.stat-table th,
.stat-table td {
  padding: 9px 10px;
}

.stat-table td span {
  font-size: 0.74rem;
}

.stat-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat-rank {
  width: 32px;
  color: var(--muted);
  font-weight: 700;
}

.stat-bar-cell {
  width: 34%;
  min-width: 90px;
}

.stat-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  margin: 0;
}

.stat-bar.stat-bar-accent span {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.stat-coin {
  color: #b45309;
  font-weight: 600;
}

.stat-diamond {
  color: #2563eb;
  font-weight: 600;
}

[data-theme="dark"] .stat-coin {
  color: #fbbf24;
}

[data-theme="dark"] .stat-diamond {
  color: #60a5fa;
}

.stat-zero {
  color: var(--muted);
}

/* Top-skins ranked list */
.stat-rank-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.stat-rank-list-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.84rem;
}

.stat-rank-name em {
  color: var(--muted);
  font-style: normal;
}

.stat-rank-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* In-game buttons */
.stat-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-button-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.stat-button-name {
  font-weight: 700;
}

.stat-button-uses {
  font-size: 1.7rem;
  line-height: 1;
}

.stat-button-card small {
  color: var(--muted);
  font-size: 0.74rem;
}

.stat-button-money {
  margin-top: 8px;
  font-size: 0.9rem;
}

.stat-button-note {
  color: var(--muted);
  font-size: 0.74rem;
}

/* Power-upgrade per-stat (Force / Recharge) summary tiles */
.stat-substat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-substat-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.stat-substat-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.stat-substat-card strong {
  font-size: 1.5rem;
  line-height: 1.1;
}

.stat-substat-card small {
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-substat-money {
  margin-top: 6px;
  font-size: 0.88rem;
}

/* Sales charts (Coin / Elmas / Store revenue) */
.stat-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-chart {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.stat-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-chart-title {
  font-weight: 700;
  font-size: 0.88rem;
}

.stat-chart-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-chart-svg {
  display: block;
  width: 100%;
  height: 120px;
}

.stat-chart-svg rect {
  transition: opacity 0.12s;
}

.stat-chart-svg rect:hover {
  opacity: 0.75;
}

.stat-chart-labels {
  display: flex;
  margin-top: 4px;
}

.stat-chart-labels span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .stat-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Lootbox pill + highlights */
.stat-lootbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.stat-lootbox i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.stat-highlight {
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--active-bg);
  border: 1px solid rgba(15, 118, 110, 0.35);
  font-size: 0.9rem;
}

.stat-row-top {
  background: var(--active-bg);
}

.stat-scroll {
  max-height: 420px;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .stat-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-panel-grid,
  .stat-two-col {
    grid-template-columns: 1fr;
  }

  .stat-side {
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .stat-kpi-grid {
    grid-template-columns: 1fr;
  }

  .stat-button-grid {
    grid-template-columns: 1fr;
  }
}

/* Users page: new-user form laid out as a responsive row, matching the other panels. */
.user-create-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
}

.user-create-form .quick-nav-save {
  height: fit-content;
}

#usersTable input.user-edit-password,
#usersTable select.user-edit-role {
  width: 100%;
  min-width: 120px;
}

@media (max-width: 720px) {
  .user-create-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Players (PlayFab-backed admin/support) page */
.secondary-button.danger {
  border-color: #b3261e;
  color: #b3261e;
}
.secondary-button.danger:hover {
  background: #b3261e;
  color: #fff;
}
.players-actions-header {
  margin-top: 20px;
}
.players-currency-form {
  margin-top: 12px;
}
#playerDetailTable th {
  text-align: left;
  white-space: nowrap;
  padding-right: 16px;
  color: var(--muted, #6b7280);
  font-weight: 600;
}
