@charset "UTF-8";
:root {
  /* ------------------------- */
  /* Theme Colors              */
  /* ------------------------- */
  --primary-rgb: 0, 131, 143; /* Added RGB version */
  --primary: #00838f;
  --primary-hover: #00545c;
  --primary-light: var(--primary); /* Alias for light mode */
  --primary-light-hover: var(--primary-hover); /* Alias for light mode */
  --accent: #4fb3be;
  --secondary: #008ba3;
  --action-button: var(--primary);
  --action-button-hover: #006872; /* Kept specific hover */
  /* ------------------------- */
  /* Backgrounds               */
  /* ------------------------- */
  --background: #fff;
  --color-success: #28a745; /* Standard success green */
  --background-secondary: #F5F5F6;
  --background-subtle: rgba(0, 0, 0, 0.03);
  --hover-background: #eee; /* Added generic hover */
  --hover-background-subtle: rgba(0, 131, 143, 0.08);
  --header: #00838f; /* Same as primary */
  /* ------------------------- */
  /* Text                      */
  /* ------------------------- */
  --text: inherit; /* Default text color */
  --text-dark: #005661; /* Darker text variant */
  --text-light: #fff; /* Light text (on dark backgrounds) */
  --text-muted: #6c757d; /* Muted text */
  --text-dim: #868e96; /* Dimmer text */
  --text-link: var(--primary);
  --text-link-hover: var(--primary-hover);
  /* ------------------------- */
  /* Borders                   */
  /* ------------------------- */
  --border-color: #dee2e6; /* Bootstrap default */
  --border-color-light: rgba(0, 0, 0, 0.15);
  --border-color-lighter: rgba(0, 0, 0, 0.05);
  /* ------------------------- */
  /* Shadows                   */
  /* ------------------------- */
  --shadow: 0 3px 4px 0 rgba(65, 69, 88, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 5px 15px rgba(0,0,0,0.2);
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lighter: 0 2px 5px rgba(0, 0, 0, 0.05);
  --shadow-hover-light: 0 4px 6px rgba(0, 0, 0, 0.12);
  --text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  /* ------------------------- */
  /* Gradients                 */
  /* ------------------------- */
  --gradient-start-color: rgba(0, 0, 0, 0.05);
  /* ------------------------- */
  /* Forms                     */
  /* ------------------------- */
  --input-background: #fff;
  --input-background-focus: #fff; /* No change needed for light */
  --input-border-color: #ced4da;
  --disabled-background: #ccc;
  --disabled-text: #6c757d;
  --disabled-background-hover: #b3b3b3;
  --disabled-border-hover: #a6a6a6;
  --focus-shadow: 0 0 0 2px rgba(0, 131, 143, 0.2);
  --form-error-text: #f44336; /* Use icon color */
  --form-error-background: rgba(244, 67, 54, 0.1); /* Use icon color */
  --form-error-border: #f44336; /* Use icon color */
  /* ------------------------- */
  /* Components                */
  /* ------------------------- */
  /* Badges */
  --badge-info-background: #17a2b8;
  --badge-info-text: var(--text-light);
  --badge-danger-background: #dc3545;
  --badge-danger-text: var(--text-light);
  --badge-danger-background-hover: #c82333;
  --badge-danger-border-hover: #bd2130;
  --badge-admin-background: var(--badge-danger-background);
  --badge-admin-text: var(--badge-danger-text);
  --badge-moderator-background: #2196f3;
  --badge-moderator-text: var(--text-light);
  --badge-superuser-background: #ff9800;
  --badge-superuser-text: var(--text-light);
  --badge-superuser-background-hover: #e0a800;
  --badge-superuser-border-hover: #d39e00;
  /* Buttons (Header) */
  --header-button-background: #333;
  --header-button-hover: #000;
  /* Country Selection */
  --country-image-bg: #f0f0f0;
  --country-selected-bg: #e0f0ff;
  --country-unavailable-bg: rgba(0, 0, 0, 0.6);
  --country-unavailable-span-bg: rgba(255, 0, 0, 0.7);
  /* Footer */
  --footer-background: #3c3c3c;
  --footer-text: #c3c3c3;
  /* Forum Specific */
  --icon-background: rgba(255, 255, 255, 0.8);
  --icon-pinned-color: #ff9800;
  --icon-pinned-background: rgba(255, 152, 0, 0.1);
  --icon-locked-color: #f44336;
  --icon-locked-background: rgba(244, 67, 54, 0.1);
  --icon-closed-color: #9e9e9e;
  --icon-closed-background: rgba(158, 158, 158, 0.1);
  --op-post-background: rgba(0, 131, 143, 0.03);
  --op-avatar-background: rgba(0, 131, 143, 0.05);
  --avatar-border-color: #fff;
  --quote-border-color: var(--primary);
  --quote-background: rgba(0, 131, 143, 0.05);
  --quote-text-color: rgba(0, 0, 0, 0.7);
  --code-background: rgba(0, 0, 0, 0.05);
  --code-border-color: rgba(0, 0, 0, 0.1);
  /* Manual Specific */
  --manual-header-background: #1a2a3a;
  --manual-header-text: var(--text-light);
  --manual-nav-background: #f0f0f0;
  --manual-nav-h2-color: #333;
  --manual-nav-link-color: #0066cc;
  --manual-nav-link-hover-color: #004080;
  --manual-section-h2-color: #1a2a3a;
  --manual-section-h2-border: #1a2a3a;
  --manual-content-section-border: #eee;
  --manual-content-section-h3-color: #0066cc;
  --manual-content-section-h4-color: #333;
  --manual-table-border-color: #ddd;
  --manual-table-th-background: #f2f2f2;
  --manual-table-th-color: #333;
  --manual-table-even-row-background: #f9f9f9;
  --manual-card-border-color: #ddd;
  --manual-card-image-background: #f0f0f0;
  --manual-card-title-color: #0066cc;
  --manual-country-label-background: #f9f9f9;
  --manual-country-label-border: #ddd;
  --manual-country-label-hover-background: #f0f0f0;
  --manual-country-label-checked-background: #e6f7ff;
  --manual-country-label-checked-border: #0066cc;
  --manual-country-info-h3-color: #0066cc;
  --manual-bonus-tag-background: #e6f7ff;
  --manual-bonus-tag-color: #0066cc;
  --manual-resource-card-border: #ddd;
  --manual-resource-card-background: #f9f9f9;
  --manual-resource-card-h5-color: #0066cc;
  --manual-note-box-background: #f0f7ff;
  --manual-note-box-border: #0066cc;
  --manual-footer-border: #eee;
  /* Tooltips */
  --tooltip-background: #212529; /* Default dark for light theme */
  --tooltip-text: #fff; /* Default light for light theme */
  /* News Feed Event Borders (Light Mode) */
  --news-pvp-attack-outgoing-border-light: #ffc107; /* Warning */
  --news-pvp-attack-incoming-win-border-light: #198754; /* Success */
  --news-pvp-attack-incoming-loss-border-light: #dc3545; /* Danger */
  --news-pve-attack-win-border-light: #0dcaf0; /* Info */
  --news-pve-attack-loss-border-light: #6c757d; /* Secondary */
  --news-pvp-kill-outgoing-border-light: #b02a37; /* Darker Danger */
  --news-pvp-kill-incoming-border-light: #b02a37; /* Darker Danger */
  --news-pve-kill-border-light: #fd7e14; /* Orange */
  --news-research-border-light: #0d6efd; /* Primary */
  --news-clan-border-light: #6c757d; /* Secondary */
}

body[data-theme=dark] {
  /* ------------------------- */
  /* Theme Colors              */
  /* ------------------------- */
  --primary-rgb: 129, 201, 254; /* Added RGB version */
  --primary: #81c9fe;
  --color-success: #4CAF50; /* Brighter green for dark mode */
  --primary-hover: #68B0E5;
  --primary-light: #a1d9ff; /* Lighter primary for links */
  --primary-light-hover: #c1e7ff; /* Lighter hover for primary-light */
  --accent: #4fb3be; /* Keep or adjust */
  --secondary: #008ba3; /* Keep or adjust */
  --action-button: #004F59;
  --action-button-hover: #00353F;
  /* ------------------------- */
  /* Backgrounds               */
  /* ------------------------- */
  --background: #212529;
  --background-secondary: #343a40;
  --background-subtle: rgba(0, 0, 0, 0.2);
  --hover-background: #495057;
  --hover-background-subtle: rgba(0, 131, 143, 0.2);
  --header: #23292c;
  /* ------------------------- */
  /* Text                      */
  /* ------------------------- */
  --text: #f8f9fa;
  --text-dark: var(--text); /* Use main text */
  --text-light: var(--text); /* Use main text */
  --text-muted: #adb5bd;
  --text-dim: #ced4da;
  --text-link: #6cb2eb;
  --text-link-hover: #8bc3f0;
  /* ------------------------- */
  /* Borders                   */
  /* ------------------------- */
  --border-color: #495057;
  --border-color-light: rgba(255, 255, 255, 0.1);
  --border-color-lighter: rgba(255, 255, 255, 0.05);
  /* ------------------------- */
  /* Shadows                   */
  /* ------------------------- */
  --shadow: 0 3px 4px 0 rgba(0,0,0,0.2), 0 3px 3px 0 rgba(0,0,0,0.15); /* Darker base shadow */
  --shadow-hover: 0 5px 15px rgba(0,0,0,0.4);
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-lighter: 0 2px 5px rgba(0, 0, 0, 0.15);
  --shadow-hover-light: 0 4px 8px rgba(0, 0, 0, 0.25);
  --text-shadow: none; /* Remove text shadow */
  /* ------------------------- */
  /* Gradients                 */
  /* ------------------------- */
  --gradient-start-color: rgba(255, 255, 255, 0.03);
  /* ------------------------- */
  /* Forms                     */
  /* ------------------------- */
  --input-background: #363f44;
  --input-background-focus: #31393e;
  --input-border-color: var(--border-color);
  --disabled-background: #495057;
  --disabled-text: #adb5bd;
  --disabled-background-hover: #5a6268;
  --disabled-border-hover: #545b62;
  --focus-shadow: 0 0 0 2px rgba(129, 201, 254, 0.25); /* Use primary-rgb */
  --form-error-text: #ff8a80;
  --form-error-background: rgba(244, 67, 54, 0.2);
  --form-error-border: #ff8a80;
  /* ------------------------- */
  /* Components                */
  /* ------------------------- */
  /* Badges */
  --badge-info-background: #17a2b8; /* Keep original or adjust */
  --badge-info-text: #fff;
  --badge-danger-background: #dc3545; /* Keep original or adjust */
  --badge-danger-text: var(--text-light); /* Use light text for contrast */
  --badge-danger-background-hover: #c82333; /* Keep original or adjust */
  --badge-danger-border-hover: #bd2130;
  --badge-admin-background: #e57373;
  --badge-admin-text: #121212;
  --badge-moderator-background: #64b5f6;
  --badge-moderator-text: #121212;
  --badge-superuser-background: #ffb74d;
  --badge-superuser-text: #121212;
  --badge-superuser-background-hover: #e0a800; /* Keep original or adjust */
  --badge-superuser-border-hover: #d39e00;
  /* Buttons (Header) */
  --header-button-background: var(--background-secondary);
  --header-button-hover: var(--hover-background);
  /* Country Selection */
  --country-image-bg: var(--background-secondary);
  --country-selected-bg: #004f59;
  --country-unavailable-bg: rgba(255, 255, 255, 0.2);
  --country-unavailable-span-bg: rgba(255, 80, 80, 0.7);
  /* Footer */
  --footer-background: var(--background); /* Match darkest */
  --footer-text: var(--text-muted);
  /* Forum Specific */
  --icon-background: rgba(0, 0, 0, 0.3);
  --icon-pinned-color: #ff9800;
  --icon-pinned-background: rgba(255, 152, 0, 0.2);
  --icon-locked-color: #f44336;
  --icon-locked-background: rgba(244, 67, 54, 0.2);
  --icon-closed-color: #9e9e9e;
  --icon-closed-background: rgba(158, 158, 158, 0.2);
  --op-post-background: rgba(129, 201, 254, 0.1); /* Use primary-rgb */
  --op-avatar-background: rgba(129, 201, 254, 0.15); /* Use primary-rgb */
  --avatar-border-color: var(--border-color);
  --quote-border-color: var(--primary);
  --quote-background: rgba(129, 201, 254, 0.1); /* Use primary-rgb */
  --quote-text-color: var(--text-dim);
  --code-background: rgba(255, 255, 255, 0.08);
  --code-border-color: rgba(255, 255, 255, 0.15);
  /* Manual Specific */
  --manual-header-background: var(--header);
  --manual-header-text: var(--text-light);
  --manual-nav-background: var(--background-secondary);
  --manual-nav-h2-color: var(--text);
  --manual-nav-link-color: var(--text-link);
  --manual-nav-link-hover-color: var(--text-link-hover);
  --manual-section-h2-color: var(--primary-light);
  --manual-section-h2-border: var(--primary-light);
  --manual-content-section-border: var(--border-color-light);
  --manual-content-section-h3-color: var(--primary-light);
  --manual-content-section-h4-color: var(--text);
  --manual-table-border-color: var(--border-color);
  --manual-table-th-background: var(--background-secondary);
  --manual-table-th-color: var(--text);
  --manual-table-even-row-background: var(--background);
  --manual-card-border-color: var(--border-color);
  --manual-card-image-background: var(--background-secondary);
  --manual-card-title-color: var(--primary-light);
  --manual-country-label-background: var(--background-secondary);
  --manual-country-label-border: var(--border-color);
  --manual-country-label-hover-background: var(--hover-background);
  --manual-country-label-checked-background: var(--country-selected-bg);
  --manual-country-label-checked-border: var(--primary);
  --manual-country-info-h3-color: var(--primary-light);
  --manual-bonus-tag-background: var(--country-selected-bg);
  --manual-bonus-tag-color: var(--text-light);
  --manual-resource-card-border: var(--border-color);
  --manual-resource-card-background: var(--background-secondary);
  --manual-resource-card-h5-color: var(--primary-light);
  --manual-note-box-background: rgba(129, 201, 254, 0.1); /* Use primary-rgb */
  --manual-note-box-border: var(--primary);
  --manual-footer-border: var(--border-color-light);
  /* Tooltips */
  --tooltip-background: #212529;
  --tooltip-text: #f8f9fa;
  /* News Feed Event Borders (Dark Mode) */
  --news-pvp-attack-outgoing-border-dark: #ffca2c; /* Lighter Warning */
  --news-pvp-attack-incoming-win-border-dark: #20c997; /* Lighter Success */
  --news-pvp-attack-incoming-loss-border-dark: #f17c70; /* Lighter Danger */
  --news-pve-attack-win-border-dark: #6edff6; /* Lighter Info */
  --news-pve-attack-loss-border-dark: #adb5bd; /* Lighter Secondary */
  --news-pvp-kill-outgoing-border-dark: #f17c70; /* Lighter Danger (Strong) */
  --news-pvp-kill-incoming-border-dark: #f17c70; /* Lighter Danger (Strong) */
  --news-pve-kill-border-dark: #fd9a4a; /* Lighter Orange */
  --news-research-border-dark: #6ea8fe; /* Lighter Primary */
  --news-clan-border-dark: #adb5bd; /* Lighter Secondary */
}

/* ------------------------- */
/* Sass Map & Functions      */
/* ------------------------- */
html,
body {
  font-family: "Montserrat", sans-serif;
  color: var(--text);
}

body {
  font-size: 16px;
}

h1 {
  font-size: 2.5rem;
}
@media (max-width: 767.98px) {
  h1 {
    font-size: 1.8rem;
  }
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1rem;
}

h5,
h6 {
  font-size: 0.8rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-dark);
}

a {
  font-size: 1rem;
  color: var(--primary);
}
a:hover {
  color: var(--primary-hover);
}

header a {
  font-size: 1rem;
  color: var(--text-light);
}
header a:hover {
  color: var(--text-link-hover);
}

p {
  x-color: var(--text);
}

html {
  height: 100%;
}

body {
  background-color: var(--background);
  position: relative;
  min-height: 100%;
  padding-bottom: 80px;
}
@media (max-width: 767.98px) {
  body {
    padding-bottom: 0;
  }
}

header {
  position: fixed;
  padding: 10px 40px;
  background-color: var(--header);
  color: var(--text-light);
  z-index: 1050;
  top: 0;
  right: 0;
  left: 0;
}

main {
  margin-left: 200px;
  padding: 83px 40px;
}
@media (max-width: 767.98px) {
  main {
    margin-left: 0;
    padding: 83px 20px;
  }
}

footer {
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
  height: 40px;
}

h1 {
  margin-bottom: 40px;
}
@media (max-width: 767.98px) {
  h1 {
    margin-bottom: 20px;
  }
}

.alert h1,
.alert h2,
.alert h3,
.alert h4,
.alert h5,
.alert h6 {
  color: inherit;
}

.opponent-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.opponent-card__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.opponent-card__label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.opponent-card__name {
  font-size: 1.25rem;
  font-weight: 600;
}
.opponent-card__meta {
  color: var(--text-muted);
}
.opponent-card__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.opponent-card__stats b {
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 0.25rem;
}
.opponent-card__action {
  margin-left: auto;
}

.attack-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}
.attack-chips__label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-right: 0.5rem;
  flex-basis: 100%;
}
.attack-chips__chip {
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.attack-chips__chip:hover {
  background: var(--hover-background-subtle);
}
.attack-chips__chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-light);
}
.attack-chips__chip--clear {
  margin-left: auto;
  color: var(--text-muted);
}

.unit-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-light);
}
.unit-card__header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.unit-card__name {
  font-size: 1.05rem;
  font-weight: 600;
}
.unit-card__types-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.unit-card__badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--hover-background-subtle);
  color: var(--text-dark);
  transition: background 0.1s, color 0.1s;
}
.unit-card__badge.is-matched {
  background: var(--primary);
  color: var(--text-light);
  font-weight: 600;
}
.unit-card__stats {
  color: var(--text-muted);
}
.unit-card__owned b {
  color: var(--text);
}
.unit-card__action {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.unit-card__action input[type=number], .unit-card__action input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  background: var(--input-background);
  color: var(--text);
  font-size: 1rem;
}
.unit-card__state {
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.unit-card__state.is-filled {
  color: var(--primary);
}
.unit-card__state.is-modified {
  color: var(--text-dark);
}
.unit-card__state a {
  color: var(--text-link);
  margin-left: 0.5rem;
  cursor: pointer;
}

.unit-group {
  margin-top: 1.5rem;
}
.unit-group:first-of-type {
  margin-top: 1rem;
}
.unit-group__heading {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color-light);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.unit-group__count {
  color: var(--text-dim);
  font-weight: normal;
  font-size: 0.85rem;
}

.unit-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .unit-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1200px) {
  .unit-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.attack-submit-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12);
}
.attack-submit-bar__total {
  flex: 1;
  color: var(--text-muted);
}
.attack-submit-bar__total b {
  color: var(--text);
}
.attack-submit-bar__btn {
  min-width: 8rem;
}
@media (max-width: 640px) {
  .attack-submit-bar {
    margin: 1rem -1rem 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

.battle-card {
  display: block;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  border-radius: 6px;
  box-shadow: var(--shadow-light);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.battle-card--victory {
  border-left-color: var(--color-success);
}
.battle-card--defeat, .battle-card--killed_by {
  border-left-color: var(--badge-danger-background);
}
.battle-card--killed {
  border-left-color: var(--news-pvp-kill-outgoing-border-light);
}
.battle-card__summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
}
.battle-card__summary::-webkit-details-marker {
  display: none;
}
.battle-card__heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-weight: 600;
}
.battle-card__icon {
  font-size: 1.1rem;
}
.battle-card__status {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.battle-card__meta {
  color: var(--text-muted);
  font-weight: normal;
}
.battle-card__time {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.9rem;
}
.battle-card__rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.battle-card__reward {
  color: var(--text);
}
.battle-card__reward--special {
  color: var(--primary);
  font-weight: 600;
}
.battle-card__chevron {
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  transition: transform 0.15s;
}
.battle-card[open] .battle-card__chevron {
  transform: rotate(180deg);
}
.battle-card__details {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-color-lighter);
}
.battle-card__details h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.battle-card__col {
  min-width: 0;
}
@media (max-width: 640px) {
  .battle-card__details {
    grid-template-columns: 1fr;
  }
  .battle-card__time {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* Sticky submit strip for /buildings/<type>/. Mirrors .attack-submit-bar
   so the build flow and the attack flow share the same bottom-of-form
   visual language: a thin bar with a "X units · $Y" summary and the
   primary Build button. */
.build-submit-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12);
  /* Edge-to-edge on phone so the bar feels grounded. */
}
.build-submit-bar__total {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.3;
}
.build-submit-bar__total b {
  color: var(--text);
  font-weight: 600;
}
.build-submit-bar__total.is-over {
  color: var(--badge-danger-background);
}
.build-submit-bar__total.is-over b {
  color: var(--badge-danger-background);
}
.build-submit-bar__btn {
  min-width: 8rem;
}
@media (max-width: 640px) {
  .build-submit-bar {
    margin: 1rem -0.75rem 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

body[data-theme=dark] .build-submit-bar {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
}

/* Mobile card tightening: let the +N / +Max action buttons wrap onto their
   own row above the quantity input so neither gets squeezed on narrow
   screens, and keep the input a sensible size. */
.card-build .card-input {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.card-build .card-input > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.card-build .card-input p {
  margin: 0;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-build .card-input p label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.card-build .card-input p input {
  max-width: 5rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  background: var(--input-background);
  color: var(--text);
}
.card-build .action-btn {
  flex: 0 0 auto;
}

.btn-main {
  background-color: var(--action-button);
  color: var(--text-light);
  padding: 4px 30px;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}
.btn-main:hover {
  color: var(--text-light);
}
.btn-main:disabled, .btn-main.disabled {
  background: var(--disabled-background);
  color: var(--disabled-text);
  opacity: 1;
  cursor: not-allowed;
}
.btn-main:hover {
  text-decoration: none;
}
.btn-main:hover:before {
  top: 0;
}
.btn-main:before {
  content: "";
  background: var(--action-button-hover);
  border-radius: 4px;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 100%;
  -webkit-transition: top 0.15s ease-in-out;
  transition: top 0.15s ease-in-out;
  z-index: -1;
}

.action-btn {
  display: inline-block;
  background-color: var(--action-button);
  color: var(--text-light);
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
  /* "+Max" variant — emphasise it as the headline quick-add. */
}
.action-btn:hover {
  color: var(--text-light);
}
.action-btn:hover {
  text-decoration: none;
}
.action-btn:hover:before {
  top: 0;
}
.action-btn:before {
  content: "";
  background: var(--action-button-hover);
  border-radius: 4px;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 100%;
  -webkit-transition: top 0.15s ease-in-out;
  transition: top 0.15s ease-in-out;
  z-index: -1;
}
.action-btn--max {
  font-weight: 600;
}
.action-btn--max:hover {
  background-color: var(--primary);
  filter: brightness(1.1);
}

.card-build {
  background: var(--background-secondary);
  border-radius: 4px;
  padding: 15px;
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--text);
}
.card-build dd, .card-build dt {
  color: var(--text);
}
.card-build .card-input p {
  display: inline-block;
}
.card-build .card-input input {
  max-width: 50px;
}
.card-build .card-subtext {
  position: relative;
  font-size: 12px;
  font-style: italic;
  padding-left: 13px;
}
.card-build .card-subtext img {
  width: 12px;
  position: absolute;
  bottom: 2px;
  left: 0;
}
.card-build .card-btn {
  border: none;
  color: var(--action-button);
  padding: 20px 0 10px 0;
  margin-top: -20px;
  width: 100%;
  text-align: left;
}

body[data-theme=dark] .card-build {
  background-color: var(--background-secondary);
  box-shadow: var(--shadow);
}

/* Bootstrap stock .card dark-mode coverage. Bootstrap 4's utilities
   .bg-light and .bg-white are hard-coded white, which keep clan cards
   looking blown out in dark mode. Scope overrides to dark theme only. */
body[data-theme=dark] {
  /* Header strip used when a clan has no banner image */
  /* Footer strip with action buttons */
  /* Outline buttons inside cards — keep their accent border but pick up
     text color from the theme when not hovered. */
}
body[data-theme=dark] .card {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
  color: var(--text);
}
body[data-theme=dark] .card .card-title,
body[data-theme=dark] .card .card-body h1,
body[data-theme=dark] .card .card-body h2,
body[data-theme=dark] .card .card-body h3,
body[data-theme=dark] .card .card-body h4,
body[data-theme=dark] .card .card-body h5,
body[data-theme=dark] .card .card-body h6 {
  color: var(--text-dark);
}
body[data-theme=dark] .card .card-text,
body[data-theme=dark] .card .card-body p {
  color: var(--text);
}
body[data-theme=dark] .card .text-muted {
  color: var(--text-muted) !important;
}
body[data-theme=dark] .card .card-img-top.bg-light {
  background-color: var(--background-subtle) !important;
  color: var(--text);
  border-bottom: 1px solid var(--border-color);
}
body[data-theme=dark] .card .card-footer {
  background-color: var(--background-secondary);
  border-top-color: var(--border-color);
}
body[data-theme=dark] .card .card-footer.bg-white {
  background-color: var(--background-secondary) !important;
}
body[data-theme=dark] .card .btn-outline-primary,
body[data-theme=dark] .card .btn-outline-info,
body[data-theme=dark] .card .btn-outline-success,
body[data-theme=dark] .card .btn-outline-danger {
  background-color: transparent;
}

/* Country Selection Styles - Corrected Image Top Design */
.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* Changed for testing */
  gap: 15px;
  margin-top: 15px;
}

.country-selection {
  height: auto;
  align-self: flex-start;
}

.country-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color, #dee2e6);
  background-color: var(--background);
}

.country-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.country-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.country-label {
  display: block;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

.country-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background-color: var(--country-image-bg, #eee);
  overflow: hidden;
}
.country-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.country-card:hover .country-image img {
  transform: scale(1.05);
}

.country-info {
  padding: 12px;
  text-align: center;
}

.country-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-color);
}

.country-bonus-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 8px;
  background-color: var(--primary-light, #cfe2ff);
  border-radius: 10px;
  color: var(--primary-dark, #0a58ca);
  margin-bottom: 8px;
  font-weight: 500;
}

.country-strategy-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 0;
}

/* Styles for disabled/unavailable countries */
.country-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}
.country-card.disabled .country-label {
  cursor: not-allowed;
}

.country-unavailable {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--country-unavailable-bg, rgba(50, 50, 50, 0.7));
  color: var(--text-light, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  z-index: 5;
}
.country-unavailable span {
  background-color: var(--country-unavailable-span-bg, rgba(0, 0, 0, 0.6));
  padding: 3px 8px;
  border-radius: 4px;
  transform: rotate(-15deg);
}

/* Selected state - Outline the whole card */
.country-radio:checked + .country-label .country-card {
  outline: 3px solid var(--primary);
  outline-offset: -1px;
}

/* Add checkmark to selected card */
.country-radio:checked + .country-label::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: var(--primary);
  color: var(--text-light, #fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Focus state for accessibility */
.country-radio:focus + .country-label .country-card {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
}

/* Allow natural panel height, rely on row alignment */
.dashboard-panel {
  height: auto;
  justify-content: flex-start;
  /* Game Speed Selection Styles */
  /* Selected state - Outline the whole card using the .selected class added by JS */
  /* Add checkmark to selected speed card's label */
  /* Focus state for accessibility (optional, applied to label) */
  /* Ensure other necessary panel styles are defined elsewhere */
}
.dashboard-panel .speed-selection-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr;
}
.dashboard-panel .speed-card {
  position: relative;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color, #dee2e6);
  background-color: var(--background);
  overflow: hidden;
}
.dashboard-panel .speed-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.dashboard-panel .speed-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.dashboard-panel .speed-label {
  display: block;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 12px;
  margin: 0;
}
.dashboard-panel .speed-card.selected {
  outline: 3px solid var(--primary);
  outline-offset: -1px;
}
.dashboard-panel .speed-radio:checked + .speed-label::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: var(--primary);
  color: var(--text-light, #fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dashboard-panel .speed-radio:focus + .speed-label {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   LEGACY .dashboard-panel — still used by country.html,
   edit_profile.html, detail.html, game_speed_overview.html.
   Kept intact while the home page migrates to its own BEM.
   ============================================================ */
.dashboard-panel {
  background-color: var(--background-secondary);
  box-shadow: var(--shadow);
  border-radius: 4px;
  padding: 16px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
}
.dashboard-panel.dashboard-action {
  flex-direction: row;
  align-items: center;
}
.dashboard-panel.dashboard-action:hover {
  text-decoration: none;
}
.dashboard-panel span {
  color: var(--color-success);
  font-size: 1.8rem;
}
.dashboard-panel span svg:first-child {
  position: absolute;
  left: -26px;
  top: 8px;
  width: 28px;
  height: 28px;
}
.dashboard-panel span svg:last-child {
  position: absolute;
  right: -24px;
  top: 11px;
}

body[data-theme=dark] .dashboard-panel {
  background-color: var(--background-secondary);
  border: 1px solid var(--border-color);
  color: var(--text);
}
body[data-theme=dark] .dashboard-panel h2 {
  color: var(--text);
}

/* Game-speed overview widget — still used by /game-speed/ admin page */
.game-speed-panel {
  border: 1px solid var(--border-color-light);
  padding: 1rem 1.25rem;
}
.game-speed-panel .badge.game-speed-badge.badge-danger {
  color: var(--badge-danger-text);
  background-color: var(--badge-danger-background);
}
.game-speed-panel .badge.game-speed-badge.badge-info {
  color: var(--badge-info-text);
  background-color: var(--badge-info-background);
}
.game-speed-panel .timer-info .d-flex {
  align-items: center;
  margin-bottom: 0.5rem;
}
.game-speed-panel .timer-info .d-flex:last-child {
  margin-bottom: 0;
}
.game-speed-panel .timer-info .d-flex > span:first-child {
  font-size: 0.85rem;
}
.game-speed-panel .timer-info [data-feather] {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  margin-right: 0.35em;
  color: var(--text-muted);
}
.game-speed-panel .timer-info .next-turn-timer,
.game-speed-panel .timer-info .next-income-timer,
.game-speed-panel .timer-info .next-morale-timer {
  display: inline-flex;
  align-items: center;
}
.game-speed-panel .timer-info .next-turn-timer span[id$=Countdown],
.game-speed-panel .timer-info .next-income-timer span[id$=Countdown],
.game-speed-panel .timer-info .next-morale-timer span[id$=Countdown] {
  font-weight: 500;
  color: var(--text);
  font-size: 1rem;
}
.game-speed-panel hr {
  border: 0;
  border-top: 1px solid var(--border-color-light);
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.game-speed-panel .game-speed-stats .row {
  margin-bottom: 0;
}
.game-speed-panel .game-speed-stats .col-6 > div {
  margin-bottom: 0.75rem;
}
.game-speed-panel .game-speed-stats .col-6 > div:last-child {
  margin-bottom: 0;
}
.game-speed-panel .game-speed-stats .text-muted {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.game-speed-panel .game-speed-stats div[id$=Display] {
  font-weight: normal;
  color: var(--text);
  font-size: 1rem;
}

/* ============================================================
   HOME PAGE — Command Center
   ============================================================ */
.home {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

/* ---------- Status hero ---------- */
.home-status {
  background: linear-gradient(135deg, var(--background-secondary), var(--background-subtle));
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-light);
  margin-bottom: 1.25rem;
}
.home-status__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}
.home-status__welcome {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
  flex: 1 1 auto;
  min-width: 0;
}
.home-status__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.home-status__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--background);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.home-status__chip b {
  font-weight: 700;
  color: var(--color-success);
}
.home-status__chip [data-feather] {
  width: 14px;
  height: 14px;
}
.home-status__chip--speed {
  background: var(--hover-background-subtle);
  /* The site header has its own .game-speed-indicator on desktop;
     the chip is redundant there. Keep it on mobile where the header
     indicator is hidden / compressed. */
}
.home-status__chip--speed.is-fast {
  background: var(--badge-danger-background);
  color: var(--badge-danger-text);
  border-color: var(--badge-danger-background);
}
@media (min-width: 768px) {
  .home-status__chip--speed {
    display: none;
  }
}
.home-status__protection {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  background: rgba(40, 167, 69, 0.08);
  border: 1px solid var(--color-success);
  color: var(--text);
  font-size: 0.9rem;
}
.home-status__protection [data-feather] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-success);
  margin-top: 0.1rem;
}
.home-status__protection b {
  color: var(--color-success);
}
.home-status__protection a {
  color: var(--text-link);
}
.home-status__tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .home-status__tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}
@media (max-width: 480px) {
  .home-status__tiles {
    grid-template-columns: 1fr;
  }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-light);
}
.stat-tile__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-tile__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
}
.stat-tile__value small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.25rem;
}
@media (max-width: 768px) {
  .stat-tile__value {
    font-size: 1.2rem;
  }
}
.stat-tile__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.stat-tile__sub [data-feather] {
  width: 12px;
  height: 12px;
}
.stat-tile--money .stat-tile__sub [data-feather] {
  color: var(--color-success);
}
.stat-tile--strength .stat-tile__sub [data-feather] {
  color: var(--primary);
}
.stat-tile--combat .stat-tile__sub [data-feather] {
  color: var(--badge-danger-background);
}

/* ---------- Two-column body grid ---------- */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 992px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Activity feed ---------- */
.home-feed {
  background: var(--background-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-light);
  /* Pagination */
}
.home-feed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.5rem;
}
.home-feed__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}
.home-feed__tabs {
  border: none;
  margin: 0;
  margin-left: auto;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.home-feed__tabs .nav-item {
  margin: 0;
}
.home-feed__tabs .nav-link {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.2;
}
.home-feed__tabs .nav-link:hover {
  background: var(--hover-background-subtle);
  color: var(--text);
}
.home-feed__tabs .nav-link.active {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}
.home-feed__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none;
  padding: 0;
}
.home-feed__item {
  display: block;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-color);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  transition: background 0.12s, transform 0.12s;
  /* color-coded left border (uses existing filter-* classes from views.py) */
}
.home-feed__item:hover {
  background: var(--hover-background-subtle);
}
.home-feed__item.filter-pvp-attack-outgoing {
  border-left-color: var(--news-pvp-attack-outgoing-border-light);
}
.home-feed__item.filter-pvp-attack-incoming-win {
  border-left-color: var(--news-pvp-attack-incoming-win-border-light);
}
.home-feed__item.filter-pvp-attack-incoming-loss {
  border-left-color: var(--news-pvp-attack-incoming-loss-border-light);
}
.home-feed__item.filter-pve-attack-win {
  border-left-color: var(--news-pve-attack-win-border-light);
}
.home-feed__item.filter-pve-attack-loss {
  border-left-color: var(--news-pve-attack-loss-border-light);
}
.home-feed__item.filter-pvp-kill-outgoing {
  border-left-color: var(--news-pvp-kill-outgoing-border-light);
}
.home-feed__item.filter-pvp-kill-incoming {
  border-left-color: var(--news-pvp-kill-incoming-border-light);
}
.home-feed__item.filter-pve-kill {
  border-left-color: var(--news-pve-kill-border-light);
}
.home-feed__item.filter-research {
  border-left-color: var(--news-research-border-light);
}
.home-feed__item.filter-clan {
  border-left-color: var(--news-clan-border-light);
}
.home-feed__item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.home-feed__item-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}
.home-feed__item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.home-feed__item-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}
.home-feed__item-body a {
  color: var(--text-link);
}
.home-feed__item-body a:hover {
  color: var(--text-link-hover);
}
.home-feed__empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}
.home-feed .pagination {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* JS still drives this — hide items by default; JS will reveal via display:'' */
.news-feed-item {
  display: none;
}

/* feather icon helper kept from before */
.feather-sm {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  margin-right: 0.25em;
}

/* ---------- Side rail ---------- */
.home-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.home-rail > section {
  background: var(--background-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-light);
}

/* Shared header style for side-rail sections — kept at top level so each
   block's title rule actually matches (was previously nested inside
   .home-research and silently failed for the timers/round titles, which fell
   back to the global h2 { 2rem }). */
.home-research__title,
.home-timers__title,
.home-round__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.home-research__name {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dark);
}
.home-research__name [data-feather] {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.home-research__progress {
  height: 1.25rem;
  background: var(--background-subtle);
  border: 1px solid var(--border-color-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.home-research__bar {
  background: linear-gradient(90deg, var(--badge-info-background), var(--secondary));
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 600;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
  min-width: 2.5rem;
}
.home-research__eta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.home-research__eta b {
  color: var(--text);
  font-weight: 600;
}
.home-research__done {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.home-research__empty p {
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.home-research__link, .home-research__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-link);
  text-decoration: none;
}
.home-research__link:hover, .home-research__cta:hover {
  color: var(--text-link-hover);
}
.home-research__link [data-feather], .home-research__cta [data-feather] {
  width: 14px;
  height: 14px;
}
.home-research__cta {
  font-weight: 600;
  color: var(--primary);
}

.home-timers__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.home-timers__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.home-timers__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}
.home-timers__label [data-feather] {
  width: 14px;
  height: 14px;
}
.home-timers__value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.home-timers__details {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border-color-light);
  padding-top: 0.5rem;
  font-size: 0.8rem;
}
.home-timers__details summary {
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0;
}
.home-timers__details summary:hover {
  color: var(--text);
}
.home-timers__stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  margin: 0.5rem 0 0;
}
.home-timers__stats dt {
  color: var(--text-muted);
  font-weight: normal;
}
.home-timers__stats dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.home-round__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}
.home-round__meta dt {
  color: var(--text-muted);
  font-weight: normal;
}
.home-round__meta dd {
  margin: 0;
  color: var(--text);
}
.home-round__changelog {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.85rem;
}
.home-round__changelog summary {
  color: var(--text-muted);
  cursor: pointer;
}
.home-round__changelog summary:hover {
  color: var(--text);
}
.home-round__changelog div {
  margin-top: 0.4rem;
  color: var(--text);
  line-height: 1.45;
}
.home-round__link {
  font-size: 0.85rem;
  color: var(--text-link);
}
.home-round__link:hover {
  color: var(--text-link-hover);
}

.home-rogue-nudge {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(121, 85, 72, 0.05)) !important;
  border-color: rgba(255, 152, 0, 0.4) !important;
}
.home-rogue-nudge__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #b26500;
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.home-rogue-nudge__title [data-feather] {
  width: 16px;
  height: 16px;
}
.home-rogue-nudge__body {
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 0.6rem;
  line-height: 1.45;
}
.home-rogue-nudge__body b {
  color: var(--text-dark);
}
.home-rogue-nudge__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-link);
  text-decoration: none;
}
.home-rogue-nudge__cta:hover {
  color: var(--text-link-hover);
}
.home-rogue-nudge__cta [data-feather] {
  width: 14px;
  height: 14px;
}

body[data-theme=dark] .home-rogue-nudge {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(121, 85, 72, 0.08)) !important;
}
body[data-theme=dark] .home-rogue-nudge__title {
  color: #ffb74d;
}

.home-prefs-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  text-decoration: none;
}
.home-prefs-link:hover {
  color: var(--text);
}
.home-prefs-link [data-feather] {
  width: 14px;
  height: 14px;
}

/* ---------- Dark mode tweaks ---------- */
body[data-theme=dark] {
  /* Pagination */
}
body[data-theme=dark] .home-status,
body[data-theme=dark] .home-feed,
body[data-theme=dark] .home-rail > section {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
}
body[data-theme=dark] .stat-tile {
  background-color: var(--background);
  border-color: var(--border-color);
}
body[data-theme=dark] .home-feed__item {
  background-color: var(--background);
  border-color: var(--border-color);
}
body[data-theme=dark] .home-feed__item.filter-pvp-attack-outgoing {
  border-left-color: var(--news-pvp-attack-outgoing-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pvp-attack-incoming-win {
  border-left-color: var(--news-pvp-attack-incoming-win-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pvp-attack-incoming-loss {
  border-left-color: var(--news-pvp-attack-incoming-loss-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pve-attack-win {
  border-left-color: var(--news-pve-attack-win-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pve-attack-loss {
  border-left-color: var(--news-pve-attack-loss-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pvp-kill-outgoing {
  border-left-color: var(--news-pvp-kill-outgoing-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pvp-kill-incoming {
  border-left-color: var(--news-pvp-kill-incoming-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-pve-kill {
  border-left-color: var(--news-pve-kill-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-research {
  border-left-color: var(--news-research-border-dark);
}
body[data-theme=dark] .home-feed__item.filter-clan {
  border-left-color: var(--news-clan-border-dark);
}
body[data-theme=dark] .home-feed__tabs .nav-link {
  color: var(--text-muted);
}
body[data-theme=dark] .home-feed__tabs .nav-link:hover {
  background: var(--hover-background);
  color: var(--text);
}
body[data-theme=dark] .home-feed__tabs .nav-link.active {
  background: var(--primary);
  color: var(--text-light);
}
body[data-theme=dark] .pagination .page-item .page-link {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
  color: var(--text-link);
}
body[data-theme=dark] .pagination .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
body[data-theme=dark] .pagination .page-item.disabled .page-link {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
}
body[data-theme=dark] .pagination .page-item .page-link:hover {
  background-color: var(--hover-background);
  color: var(--text-link-hover);
}

footer {
  background: var(--footer-background);
  color: var(--footer-text);
  padding: 5px 10px;
  text-align: center;
  z-index: 200;
}

.login-form label,
.register-form label {
  width: 120px;
}
.login-form input,
.register-form input {
  padding: 5px 12px;
  font-size: 14px;
  line-height: 1;
}
.login-form .btn-main,
.register-form .btn-main {
  box-shadow: var(--shadow);
  min-width: 200px;
  margin-bottom: 20px;
}
.login-form .helptext,
.register-form .helptext {
  display: block;
  text-shadow: var(--text-shadow);
  font-size: 14px;
}

.invert-labels label {
  color: var(--text-light);
  text-shadow: var(--text-shadow);
}

.login-link {
  text-decoration: underline;
  color: var(--text-light);
  text-shadow: var(--text-shadow);
  margin-right: 20px;
}

body[data-theme=dark] input:not(.btn),
body[data-theme=dark] textarea {
  background: var(--input-background);
  border: 1px solid var(--input-border-color);
  color: var(--text);
}

header .logo-img {
  max-height: 33px;
}

.header-btn {
  display: block;
  position: relative;
  background: var(--header-button-background);
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 1;
}
.header-btn:hover {
  text-decoration: none;
}
.header-btn:hover:before {
  top: 0;
}
.header-btn:before {
  content: "";
  background: var(--header-button-hover);
  border-radius: 4px;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 100%;
  -webkit-transition: top 0.15s ease-in-out;
  transition: top 0.15s ease-in-out;
  z-index: -1;
}

/* Reusable wrapper that applies the themed badge sizing + colors to a
   "Normal Mode" / "Fast Mode" badge. Used in the site header and on the
   user profile page. Layout spacing is provided by the parent container
   (e.g. the header's px-2 list items), not by this wrapper. */
.game-speed-indicator {
  display: inline-block;
}
.game-speed-indicator .badge {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 4px;
}
.game-speed-indicator .badge-info {
  background-color: var(--badge-info-background);
  color: var(--badge-info-text);
}
.game-speed-indicator .badge-danger {
  background-color: var(--badge-danger-background);
  color: var(--badge-danger-text);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
/* Add this to make space for game speed indicator in header */
header .list-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.landing-logo {
  max-height: 120px;
}

.landing-main {
  padding: 53px 0 0 0;
  margin-left: 0px;
}

.mobile-teaser {
  max-height: 120px;
}

@media (min-width: 768px) {
  .mobile-teaser {
    max-height: 500px;
    margin-left: 120px;
  }
}
.section-background {
  background-size: cover;
  background-position: 50%;
  background-repeat: no-repeat;
  height: calc(100vh - 53px);
}

.slide-top {
  -webkit-animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  color: var(--text-light);
}

.invert-text {
  color: var(--text-light);
  text-shadow: var(--text-shadow);
}

@-webkit-keyframes slide-top {
  0% {
    opacity: 0;
    -webkit-transform: translateY(15px);
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}
@keyframes slide-top {
  0% {
    opacity: 0;
    -webkit-transform: translateY(15px);
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}
.modal-side-right.modal.fade.show .modal-dialog {
  transform: translate(0);
}
.modal-side-right.modal.fade .modal-dialog {
  transform: translate(100%);
  transition-duration: 0.25s;
}
.modal-side-right .modal-dialog {
  margin: 0 0 0 auto;
  max-width: 200px;
  padding: 53px 0 0 0;
}
.modal-side-right .modal-content {
  border-radius: 0px;
  border: none;
}
.modal-side-right .modal-body {
  background-color: var(--background-secondary);
  color: var(--text);
}
.modal-side-right a {
  font-size: 1rem;
  color: var(--text-link);
}

.sidebar-public {
  margin-top: 60px;
}

.sidebar-menu {
  background-color: var(--background-secondary);
  width: 200px;
  padding: 73px 15px 60px;
  height: 100%;
  overflow-y: auto;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  box-shadow: var(--shadow);
  z-index: 1045;
}
@media (max-width: 767.98px) {
  .sidebar-menu {
    transition: transform 0.25s ease-out;
    -webkit-transition: -webkit-transform 0.25s ease-out;
    transform: translateX(-100%);
  }
  .sidebar-menu.open {
    transform: translateX(0);
  }
}
.sidebar-menu .nav-item > a {
  display: block;
  position: relative;
  font-size: 16px;
  padding: 10px 0 10px 26px;
  width: 100%;
}
.sidebar-menu .nav-item > a:hover {
  text-decoration: none;
}
.sidebar-menu .nav-item > a.collapsed:not(.shown):after {
  transform: rotate(-90deg);
}
.sidebar-menu .nav-item svg {
  width: 16px;
  height: 16px;
  position: absolute;
  top: 14px;
  left: 0;
}

.sidebar-sub-menu-item {
  display: block;
  font-size: 14px;
  padding: 10px 26px;
}

.table {
  color: var(--text);
}
.table td {
  vertical-align: middle;
}
.table th {
  vertical-align: middle;
}
.table .table-subtext {
  position: relative;
  font-size: 12px;
  font-style: italic;
  padding-left: 13px;
}
.table .table-subtext img {
  width: 12px;
  position: absolute;
  bottom: 2px;
  left: 0;
}

.table-hover tbody tr:hover {
  color: var(--text);
  background-color: var(--background-secondary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transform: scale(1.01);
  transition: all 0.2s ease-in-out;
}

.hover-highlight {
  cursor: pointer;
}

.hover-tooltip {
  position: relative;
  cursor: help;
  text-decoration: underline dotted;
}

.hover-tooltip:hover::after {
  content: attr(data-toggle);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--background-secondary);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

body[data-theme=dark] .table .thead-light th {
  color: var(--text);
  background-color: #191d1f;
}

body[data-theme=dark] .table-striped tbody tr:nth-of-type(even) {
  background-color: var(--header);
}

.table-input p {
  margin: 0;
  padding: 5px;
}
.table-input input {
  max-width: 80px;
  border-radius: 2px;
  border: 1px solid #ccc;
  text-align: right;
}

.table td.creator {
  vertical-align: top;
}

.table-nostriped tbody tr:nth-of-type(odd) {
  background-color: transparent;
}

/* --- PvE Report Table Styling --- */
/* Ensure tooltips are styled correctly if using Bootstrap */
/* (Bootstrap's default CSS should handle most of this) */
.tooltip-inner {
  white-space: pre-wrap; /* Allow line breaks in tooltip */
  max-width: 300px; /* Adjust max width as needed */
  text-align: left;
}

/* Optional: Add slight visual cue for cells with tooltips */
[data-bs-toggle=tooltip] {
  cursor: help;
  /* border-bottom: 1px dotted #6c757d; */ /* Uncomment for dotted underline */
}

/* Center text in specific PvE columns */
.table th.text-center,
.table td.text-center {
  text-align: center;
  /* Dark mode tooltip styling */
}
.table th.text-center body[data-theme=dark],
.table td.text-center body[data-theme=dark] {
  /* Adjust arrow color if using Bootstrap's default */
}
.table th.text-center body[data-theme=dark] .tooltip-inner,
.table td.text-center body[data-theme=dark] .tooltip-inner {
  background-color: var(--tooltip-background);
  color: var(--tooltip-text);
  border: 1px solid var(--border-color);
}
.table th.text-center body[data-theme=dark] .tooltip .tooltip-arrow::before,
.table td.text-center body[data-theme=dark] .tooltip .tooltip-arrow::before {
  border-top-color: var(--border-color);
  border-bottom-color: var(--border-color);
  border-left-color: var(--border-color);
  border-right-color: var(--border-color);
}

/* Optional: Adjust spacing or alignment */
.table td, .table th {
  vertical-align: middle;
}

/* Forum Styles - Simplified to work with Bootstrap */
/* Thread hover effect */
.table-hover tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

/* Post content styling */
.post-content {
  line-height: 1.6;
  word-wrap: break-word;
}
.post-content p {
  margin-bottom: 1rem;
}
.post-content blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
  color: var(--text-muted);
  font-style: italic;
}

/* Avatar styling */
.rounded-circle {
  object-fit: cover;
  border: 2px solid var(--border-color-light);
}

/* Badge adjustments for forum */
.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}
.badge.badge-warning {
  color: #000;
}

/* Feather icon inline styling */
i[data-feather] {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
}

/* Thread status icons */
.text-warning {
  color: #ffc107 !important;
}

.text-danger {
  color: #dc3545 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .col-md-2 {
    margin-bottom: 1rem;
  }
  .table-responsive {
    font-size: 0.9rem;
  }
  .badge {
    font-size: 0.7rem;
  }
}
/* Dark mode support */
body[data-theme=dark] .card {
  background-color: var(--background-secondary);
  border-color: var(--border-color-light);
}
body[data-theme=dark] .table {
  color: var(--text);
}
body[data-theme=dark] .table thead.thead-light {
  background-color: var(--background);
  color: var(--text-light);
}
body[data-theme=dark] .table tbody tr:hover {
  background-color: var(--hover-background);
}
body[data-theme=dark] .breadcrumb {
  background-color: var(--background-secondary);
}
body[data-theme=dark] .page-link {
  background-color: var(--background-secondary);
  border-color: var(--border-color-light);
  color: var(--text-link);
}
body[data-theme=dark] .page-link:hover {
  background-color: var(--primary);
  color: var(--text-light);
}
body[data-theme=dark] .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}
body[data-theme=dark] .form-control, body[data-theme=dark] .form-select {
  background-color: var(--input-background);
  border-color: var(--input-border-color);
  color: var(--text);
}

/* Manual layout */
.manual-header {
  text-align: center;
  padding: 10px;
  background-color: var(--manual-header-background);
  color: var(--manual-header-text);
  margin-bottom: 10px;
  border-radius: 8px;
}
.manual-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.manual-nav {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--manual-nav-background);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}
.manual-nav .nav-section {
  flex: 1;
  min-width: 200px;
  padding: 5px;
}
.manual-nav .nav-section h2 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--manual-nav-h2-color);
}
.manual-nav .nav-section ul {
  list-style: none;
  padding: 0;
  column-count: 2;
  column-gap: 10px;
}
.manual-nav .nav-section li {
  margin-bottom: 3px;
  break-inside: avoid;
}
.manual-nav .nav-section a {
  text-decoration: none;
  color: var(--manual-nav-link-color);
  transition: color 0.2s;
  font-size: 0.85rem;
}
.manual-nav .nav-section a:hover {
  color: var(--manual-nav-link-hover-color);
  text-decoration: underline;
}

.manual-content {
  padding: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.manual-section {
  margin-bottom: 30px;
}
.manual-section > h2 {
  font-size: 1.5rem;
  color: var(--manual-section-h2-color);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--manual-section-h2-border);
  margin-bottom: 15px;
}

.content-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--manual-content-section-border);
}
.content-section h3 {
  font-size: 1.3rem;
  color: var(--manual-nav-link-color);
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.content-section h3::after {
  content: "+";
  font-size: 1rem;
}
.content-section h3.active::after {
  content: "-";
}
.content-section h4 {
  font-size: 1.1rem;
  color: var(--manual-nav-h2-color);
  margin-top: 15px;
  margin-bottom: 8px;
}
.content-section p, .content-section ul, .content-section ol {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 10px;
}
.content-section ul, .content-section ol {
  padding-left: 20px;
}

.section-content {
  display: none;
  padding: 0 5px;
}
.section-content.active {
  display: block;
}

/* Tables */
.game-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 0.9rem;
}
.game-table th, .game-table td {
  border: 1px solid var(--manual-table-border-color);
  padding: 6px;
  text-align: left;
}
.game-table th {
  background-color: var(--manual-table-th-background);
  color: var(--manual-nav-h2-color);
  font-size: 0.95rem;
}
.game-table tr:nth-child(even) {
  background-color: var(--manual-table-even-row-background);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 15px 0;
}

.game-card {
  border: 1px solid var(--manual-table-border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: transform 0.3s, box-shadow 0.3s;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.game-card .card-image {
  height: 120px;
  overflow: hidden;
  background-color: var(--manual-nav-background);
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card .card-content {
  padding: 10px;
}
.game-card .card-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--manual-nav-link-color);
}

/* Country selection */
.country-selection {
  margin: 15px 0;
  /* Commenting out manual-specific grid layout to avoid conflicts */
  /*
  .country-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 10px;
  }
  */
  /* Commenting out manual-specific flex layout for country label to avoid conflicts */
  /*
  .country-label {
      display: flex;
      padding: 8px;
      background-color: var(--manual-table-even-row-background);
      border-radius: 8px;
      border: 1px solid var(--manual-table-border-color);
      cursor: pointer;
      transition: all 0.2s;

      &:hover {
          background-color: var(--manual-nav-background);
      }
  }
  */
}
.country-selection .country-card {
  position: relative;
}
.country-selection .country-radio {
  position: absolute;
  opacity: 0;
}
.country-selection .country-radio:checked + .country-label {
  background-color: var(--manual-country-label-checked-background);
  border-color: var(--manual-nav-link-color);
}
.country-selection .country-image {
  flex: 0 0 60px;
  margin-right: 10px;
}
.country-selection .country-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.country-selection .country-info {
  flex: 1;
}
.country-selection .country-info h3 {
  font-size: 1rem;
  margin: 0 0 5px 0;
  color: var(--manual-nav-link-color);
}
.country-selection .country-info .country-description {
  font-size: 0.85rem;
  margin-bottom: 5px;
}
.country-selection .country-info .country-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.country-selection .country-info .country-details .bonus-tag {
  font-size: 0.75rem;
  padding: 2px 5px;
  background-color: var(--manual-country-label-checked-background);
  border-radius: 3px;
  color: var(--manual-nav-link-color);
}

/* Resource cards */
.resource-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
}

.resource-card {
  flex: 1;
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--manual-table-border-color);
  border-radius: 8px;
  background-color: var(--manual-table-even-row-background);
}
.resource-card h5 {
  margin-top: 0;
  margin-bottom: 5px;
  color: var(--manual-nav-link-color);
  font-size: 1rem;
}
.resource-card p {
  margin: 0;
  font-size: 0.9rem;
}

/* Images */
.image-container {
  margin: 15px 0;
  text-align: center;
}

.manual-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: var(--shadow-light);
}

.image-caption {
  margin-top: 5px;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Notes */
.note-box {
  background-color: var(--manual-note-box-background);
  border-left: 4px solid var(--manual-note-box-border);
  padding: 10px;
  margin: 15px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

/* Strategy diagram */
.strategy-diagram {
  margin: 15px 0;
  text-align: center;
}

/* Footer */
.manual-footer {
  text-align: center;
  padding: 15px;
  margin-top: 30px;
  border-top: 1px solid var(--manual-footer-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .manual-nav {
    flex-direction: column;
  }
  .manual-nav .nav-section ul {
    column-count: 1;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .country-grid {
    grid-template-columns: 1fr;
  }
  .resource-cards {
    flex-direction: column;
  }
  .resource-cards .resource-card {
    width: 100%;
  }
  .game-table {
    font-size: 0.8rem;
  }
  .game-table th, .game-table td {
    padding: 4px;
  }
}
/* Clan List Card Fixes */
body[data-theme=dark] .card .card-img-top > span {
  color: var(--text);
}

.winner-entry {
  padding-left: 10px;
  margin-bottom: 5px;
  border-left: 3px solid transparent;
}

.winner-entry--pvp {
  border-left-color: var(--badge-danger-background);
}

.winner-entry--pve {
  border-left-color: var(--color-success);
}

.winner-entry--general {
  border-left-color: var(--primary);
}

body[data-theme=dark] .winner-entry--pvp {
  border-left-color: var(--badge-danger-background);
}
body[data-theme=dark] .winner-entry--pve {
  border-left-color: var(--color-success);
}
body[data-theme=dark] .winner-entry--general {
  border-left-color: var(--primary);
}

.message-content.mb-4 .card-body {
  width: 100vh;
}

.special-buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.special-building-card {
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  background-color: var(--background-secondary);
  box-shadow: var(--shadow-lighter);
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.special-building-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
  color: var(--text);
}
.special-building-card .description {
  margin-bottom: 15px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.special-building-card .details p {
  margin-bottom: 5px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.special-building-card .details p strong {
  color: var(--text);
  font-weight: 600;
}

/* Research Page Specific Styles */
.research-current-panel {
  background: linear-gradient(135deg, var(--background-secondary), var(--background-subtle));
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
}
.research-current-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}
.research-current-panel p {
  margin-bottom: 0.75rem;
}
.research-current-panel p strong {
  color: var(--primary);
}
.research-current-panel p.small {
  font-size: 0.875rem;
}
.research-current-panel p.small.text-success {
  color: var(--color-success);
}
.research-current-panel p.small.text-muted {
  color: var(--text-muted);
}
.research-current-panel .progress {
  height: 1.5rem;
  background: var(--background-subtle);
  border: 1px solid var(--border-color-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}
.research-current-panel .progress .progress-bar {
  background: linear-gradient(90deg, var(--badge-info-background), var(--secondary));
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease;
  height: 100%;
}
.research-current-panel .progress .progress-bar.bg-info {
  background: linear-gradient(90deg, var(--badge-info-background), var(--secondary));
}
.research-current-panel .alert-success {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  padding: 1rem;
  border-radius: 4px;
}
.research-current-panel .badge-danger {
  background: var(--badge-danger-background);
  color: var(--badge-danger-text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.research-category {
  margin-bottom: 2.5rem;
  background: var(--background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}
.research-category-header {
  background: linear-gradient(135deg, var(--background-secondary), var(--background-subtle));
  border-bottom: 2px solid var(--border-color-light);
  padding: 1.25rem 1.5rem;
}
.research-category-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.research-category-header-title h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
}
.research-category-header-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}
.research-category-header-stats .research-category-total {
  color: var(--text-muted);
}
.research-category-header-stats .research-category-completed {
  color: var(--color-success);
  font-weight: 500;
}
.research-category-content {
  background: var(--background);
  padding: 0;
}
.research-category-table {
  margin: 0;
  border: none;
}
.research-category-table thead {
  background: var(--background-subtle);
  border-bottom: 1px solid var(--border-color-light);
}
.research-category-table thead th {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border: none;
  text-transform: none;
  letter-spacing: normal;
}
.research-category-table tbody tr {
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-color-lighter);
}
.research-category-table tbody tr:last-child {
  border-bottom: none;
}
.research-category-table tbody tr:hover {
  background: var(--hover-background-subtle);
}
.research-category-table tbody tr.research-completed {
  background: rgba(40, 167, 69, 0.05);
  opacity: 0.85;
}
.research-category-table tbody tr.research-completed .research-name,
.research-category-table tbody tr.research-completed .research-description {
  color: var(--text-muted);
}
.research-category-table tbody tr.research-locked {
  background: rgba(0, 0, 0, 0.02);
  opacity: 0.6;
}
.research-category-table tbody tr.research-locked .research-name {
  color: var(--text-muted);
}
.research-category-table tbody tr.research-locked .research-description {
  color: var(--text-muted);
  opacity: 0.8;
}
.research-category-table tbody tr.research-locked .research-unlock-info {
  color: var(--badge-danger-background);
  opacity: 0.8;
}
.research-category-table tbody tr.research-unlockable {
  background: var(--gradient-start-color);
}
.research-category-table tbody tr.research-unlockable[data-parent] td.research-status {
  position: relative;
}
.research-category-table tbody tr.research-unlockable[data-parent] td.research-status::before {
  content: "└";
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}
.research-category-table tbody tr.research-unlockable .research-name {
  color: var(--text-dark);
  font-weight: 500;
}
.research-category-table tbody tr.research-unlockable .research-unlock-info {
  opacity: 0.7;
}
.research-category-table tbody tr.research-available .research-name {
  color: var(--text-dark);
  font-weight: 500;
}
.research-category-table tbody tr td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border: none;
  color: var(--text);
}
.research-category-table tbody tr td.research-status {
  text-align: center;
  padding: 1rem 0.75rem;
}
.research-category-table tbody tr td.research-status .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
}
.research-category-table tbody tr td.research-status .status-icon.status-complete {
  background: var(--color-success);
  color: var(--text-light);
}
.research-category-table tbody tr td.research-status .status-icon.status-progress {
  background: var(--badge-info-background);
  color: var(--badge-info-text);
  animation: rotate 2s linear infinite;
}
.research-category-table tbody tr td.research-status .status-icon.status-locked {
  background: var(--background-secondary);
  color: var(--text-muted);
  font-size: 12px;
}
.research-category-table tbody tr td.research-status .status-icon.status-locked::before {
  content: "L";
  font-weight: bold;
}
.research-category-table tbody tr td.research-status .status-icon.status-available {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-muted);
}
.research-category-table tbody tr td .research-name-cell .research-name {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.research-category-table tbody tr td .research-name-cell .research-unlock-info {
  display: block;
  font-size: 0.75rem;
  color: var(--badge-superuser-background);
  font-style: italic;
}
.research-category-table tbody tr td .research-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}
.research-category-table tbody tr td.research-cost-cell, .research-category-table tbody tr td.research-time {
  font-weight: 500;
  white-space: nowrap;
}
.research-category-table tbody tr td.research-cost-cell .research-hours, .research-category-table tbody tr td.research-time .research-hours {
  display: block;
}
.research-category-table tbody tr td.research-cost-cell .fast-mode-time, .research-category-table tbody tr td.research-time .fast-mode-time {
  display: block;
  font-size: 0.75rem;
  color: var(--badge-info-background);
  font-weight: normal;
  margin-top: 0.25rem;
}
.research-category-table tbody tr td.research-action {
  text-align: center;
}
.research-category-table tbody tr td.research-action .btn {
  min-width: 100px;
}
.research-category-table tbody tr td.research-action .badge {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.research-category-table tbody tr td.research-action .badge.badge-success {
  background: var(--color-success);
  color: var(--text-light);
}
.research-category-table tbody tr td.research-action .badge.badge-info {
  background: var(--badge-info-background);
  color: var(--badge-info-text);
  animation: pulse 2s ease-in-out infinite;
}
.research-category-table tbody tr td.research-action .text-muted {
  font-style: italic;
  color: var(--text-muted);
}
.research-category.economy .research-category-header {
  border-left: 4px solid var(--icon-pinned-color);
}
.research-category.economy .research-category-header-title h2 {
  color: var(--icon-pinned-color);
}
.research-category.base-development .research-category-header {
  border-left: 4px solid var(--badge-moderator-background);
}
.research-category.base-development .research-category-header-title h2 {
  color: var(--badge-moderator-background);
}
.research-category.missile-technology .research-category-header {
  border-left: 4px solid var(--color-success);
}
.research-category.missile-technology .research-category-header-title h2 {
  color: var(--color-success);
}
.research-category.missile-weapons .research-category-header {
  border-left: 4px solid var(--badge-superuser-background);
}
.research-category.missile-weapons .research-category-header-title h2 {
  color: var(--badge-superuser-background);
}
.research-category.vehicle-units .research-category-header {
  border-left: 4px solid #673ab7;
}
.research-category.vehicle-units .research-category-header-title h2 {
  color: #673ab7;
}
.research-category.air-units .research-category-header {
  border-left: 4px solid var(--badge-info-background);
}
.research-category.air-units .research-category-header-title h2 {
  color: var(--badge-info-background);
}
.research-category.sea-units .research-category-header {
  border-left: 4px solid var(--primary);
}
.research-category.sea-units .research-category-header-title h2 {
  color: var(--primary);
}
.research-category.special-units .research-category-header {
  border-left: 4px solid #9c27b0;
}
.research-category.special-units .research-category-header-title h2 {
  color: #9c27b0;
}
.research-category.pve-rogue-bases .research-category-header {
  border-left: 4px solid #795548;
}
.research-category.pve-rogue-bases .research-category-header-title h2 {
  color: #795548;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}
@media (max-width: 768px) {
  .research-category {
    margin-bottom: 1.5rem;
  }
  .research-category-header {
    padding: 1rem;
  }
  .research-category-table {
    font-size: 0.875rem;
    display: block;
    width: 100%;
  }
  .research-category-table thead {
    display: none;
  }
  .research-category-table tbody {
    display: block;
  }
  .research-category-table tbody tr {
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }
  .research-category-table tbody tr .research-name-cell .research-name::after {
    content: " ▾";
    color: var(--text-muted);
    font-size: 0.75rem;
    display: inline-block;
    transition: transform 0.2s ease;
  }
  .research-category-table tbody tr.expanded .research-name-cell .research-name::after {
    transform: rotate(180deg);
  }
  .research-category-table tbody tr.expanded td:nth-child(3) {
    display: block;
  }
  .research-category-table tbody td {
    padding: 0;
    border: none;
  }
  .research-category-table tbody td.research-status {
    order: 1;
    flex: 0 0 auto;
  }
  .research-category-table tbody td:nth-child(2) {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
  }
  .research-category-table tbody td.research-cost-cell {
    order: 3;
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .research-category-table tbody td.research-time {
    order: 4;
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .research-category-table tbody td:nth-child(3) {
    order: 5;
    display: none;
    flex: 1 1 100%;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color-lighter);
  }
  .research-category-table tbody td.research-action {
    order: 6;
    flex: 1 1 100%;
    text-align: center;
  }
  .research-category-table tbody td.research-action .btn {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  .research-category-table tbody td.research-action .badge {
    display: block;
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}
/* Preferences page — /preferences/ */
.prefs {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.prefs-hero {
  background: linear-gradient(135deg, var(--background-secondary), var(--background-subtle));
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-light);
}
.prefs-hero__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text-dark);
}
.prefs-hero__sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.prefs-group {
  background: var(--background-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-light);
}
.prefs-group__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color-light);
}
.prefs-group__head > [data-feather] {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.prefs-group__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.15rem;
}
.prefs-group__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.prefs-group__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prefs-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color-lighter);
}
.prefs-row:last-child {
  border-bottom: 0;
}
.prefs-row__info {
  flex: 1;
  min-width: 0;
}
.prefs-row__label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}
.prefs-row__help {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.prefs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.prefs-toggle:hover {
  color: var(--text);
}
.prefs-toggle:hover .prefs-toggle__track {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}
.prefs-toggle__track {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-color);
  transition: background 0.15s ease;
}
.prefs-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.prefs-toggle__state {
  min-width: 1.5rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.prefs-row.is-on .prefs-toggle__track {
  background: var(--color-success);
}
.prefs-row.is-on .prefs-toggle__thumb {
  transform: translateX(20px);
}
.prefs-row.is-on .prefs-toggle__state {
  color: var(--color-success);
  font-weight: 600;
}

.prefs-back {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-link);
}
.prefs-back:hover {
  color: var(--text-link-hover);
}

body[data-theme=dark] .prefs-hero,
body[data-theme=dark] .prefs-group {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
}
body[data-theme=dark] .prefs-toggle__track {
  background: var(--border-color);
}

/* User profile (/u/<pk>/) styles. Reuses the home page primitives
   (.home-status, .stat-tile, .home-grid, .home-rail) and layers on
   profile-specific content blocks. */
.profile {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

/* ---------- Hero overlays ---------- */
.profile-status__name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-dark);
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 480px) {
  .profile-status__name {
    font-size: 1.4rem;
  }
}
.profile-status__chip-clan {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--background);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.profile-status__chip-clan:hover {
  background: var(--hover-background-subtle);
  color: var(--text);
  text-decoration: none;
}
.profile-status__edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.profile-status__edit [data-feather] {
  width: 14px;
  height: 14px;
}
.profile-status__sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.profile-status__dot {
  margin: 0 0.4rem;
  color: var(--text-dim);
}

/* ---------- Medals ---------- */
.profile-medals {
  background: var(--background-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-light);
}
.profile-medals__head {
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.profile-medals__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.profile-medals__title [data-feather] {
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.profile-medals__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.profile-medals__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--news-research-border-light);
  border-radius: 6px;
  transition: background 0.12s;
}
.profile-medals__item:hover {
  background: var(--hover-background-subtle);
}
.profile-medals__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--badge-info-background), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}
.profile-medals__icon [data-feather] {
  width: 18px;
  height: 18px;
}
.profile-medals__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.profile-medals__name {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}
.profile-medals__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-medals__meta a {
  color: var(--text-link);
}
.profile-medals__value {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.profile-medals__empty {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  padding: 1rem;
  text-align: center;
}

body[data-theme=dark] .profile-medals {
  background-color: var(--background-secondary);
  border-color: var(--border-color);
}
body[data-theme=dark] .profile-medals__item {
  background-color: var(--background);
  border-color: var(--border-color);
  border-left-color: var(--news-research-border-dark);
}

/* ---------- Rail sections ---------- */
.profile-actions__title,
.profile-actions .profile-stats__title,
.profile-actions .profile-bio__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}
.profile-actions__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.profile-actions__btn:last-child {
  margin-bottom: 0;
}
.profile-actions__btn [data-feather] {
  width: 16px;
  height: 16px;
}
.profile-actions__btn--attack {
  background: var(--badge-danger-background);
  border-color: var(--badge-danger-background);
  color: var(--badge-danger-text);
}
.profile-actions__btn--attack:hover {
  filter: brightness(1.08);
  color: var(--badge-danger-text);
}

/* Title rules for stats + bio also exist as standalone selectors (not nested)
   so they actually match without a `.profile-actions` ancestor. */
.profile-stats__title,
.profile-bio__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.profile-stats__list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.75rem;
  margin: 0;
  font-size: 0.88rem;
}
.profile-stats__list dt {
  color: var(--text-muted);
  font-weight: normal;
}
.profile-stats__list dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.profile-bio__body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}
.profile-bio__body p {
  margin: 0 0 0.5rem;
}
.profile-bio__body p:last-child {
  margin-bottom: 0;
}

.balance-workbench {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: monospace;
  font-size: 0.9rem;
}
.balance-workbench header {
  position: static;
  padding: 0;
  background: transparent;
  color: inherit;
  z-index: auto;
}
.balance-workbench__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.balance-workbench__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.balance-workbench__divider {
  opacity: 0.5;
}
.balance-workbench__meta {
  opacity: 0.65;
  font-size: 0.8rem;
}
.balance-workbench__unsaved {
  color: #ffcc66;
  font-size: 0.85rem;
}
.balance-workbench__actions {
  display: flex;
  gap: 0.4rem;
}
.balance-workbench__actions button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.balance-workbench__body {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(640px, 2fr);
  gap: 1rem;
}
.balance-workbench__left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.balance-workbench__charts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.balance-workbench__charts-status {
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 0;
}
.balance-workbench__rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.balance-workbench__section {
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}
.balance-workbench__section-title {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin: 0 0 0.5rem;
}
.balance-workbench__instance {
  margin-bottom: 0.4rem;
}
.balance-workbench__instance summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.25rem 0;
}
.balance-workbench__row {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  grid-template-rows: auto auto;
  grid-template-areas: "label range number" "label baseline baseline";
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.15rem 0.4rem;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.balance-workbench__row-label {
  grid-area: label;
  opacity: 0.85;
}
.balance-workbench__row input[type=range] {
  grid-area: range;
  width: 100%;
}
.balance-workbench__row input[type=number] {
  grid-area: number;
  width: 100%;
}
.balance-workbench__row-baseline {
  grid-area: baseline;
  font-size: 0.75rem;
  opacity: 0.55;
}
.balance-workbench__row.is-modified {
  border-left-color: #e07b00;
  background: rgba(224, 123, 0, 0.08);
}
.balance-workbench__row.is-modified .balance-workbench__row-label {
  opacity: 1;
  font-weight: 600;
  color: #e07b00;
}
.balance-workbench__row.is-modified .balance-workbench__row-baseline {
  opacity: 0.9;
}
.balance-workbench__changes-badge {
  background: rgba(224, 123, 0, 0.15);
  border: 1px solid rgba(224, 123, 0, 0.5);
  color: inherit;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
}
.balance-workbench__changes-badge span {
  font-weight: 700;
  margin-left: 0.2rem;
}
.balance-workbench__changes-badge:hover {
  background: rgba(224, 123, 0, 0.25);
}
.balance-workbench__changes-badge[data-empty] {
  background: transparent;
  border-color: rgba(128, 128, 128, 0.3);
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.balance-workbench__diff {
  background: rgba(128, 128, 128, 0.08);
  padding: 0.75rem;
  border-radius: 4px;
  align-self: start;
  transition: box-shadow 0.6s ease;
}
.balance-workbench__diff.is-flashing {
  box-shadow: 0 0 0 3px rgba(224, 123, 0, 0.5);
}
.balance-workbench__diff-table {
  width: 100%;
  border-collapse: collapse;
}
.balance-workbench__diff-table th, .balance-workbench__diff-table td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}
.balance-workbench__diff-table th {
  opacity: 0.6;
  font-weight: normal;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.balance-workbench__diff-empty {
  opacity: 0.55;
  font-style: italic;
}
.balance-workbench__modal {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 1rem;
  min-width: 360px;
}
.balance-workbench__modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.balance-workbench__modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.balance-workbench__modal-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 0;
  padding: 0;
}
.balance-workbench__modal-form menu {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 0;
  margin: 0.5rem 0 0;
}

.chart-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 0.75rem;
}
.chart-card header {
  position: static;
  background: transparent;
  color: inherit;
  z-index: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0;
  margin-bottom: 0.5rem;
}
.chart-card header h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.chart-card__hint {
  font-size: 0.75rem;
  opacity: 0.55;
}
.chart-card__toggle {
  font-size: 0.8rem;
  opacity: 0.8;
}
.chart-card__toggle select {
  margin-left: 0.25rem;
}
.chart-card__plot {
  min-height: 360px;
  width: 100%;
}

/*# sourceMappingURL=idlebase.css.e8533f57e238.map */
