@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

@font-face {
    font-family: 'Formula1-Black';
    src: url('fonts/Formula1-Black.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Bold';
    src: url('fonts/Formula1-Bold_web.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Bold-4';
    src: url('fonts/Formula1-Bold-4.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Italic';
    src: url('fonts/Formula1-Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Regular';
    src: url('fonts/Formula1-Regular-1.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Wide';
    src: url('fonts/Formula1-Wide.ttf') format('truetype');
}

body {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

/* Informational cycle note banner */
.cycle-note {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    background: linear-gradient(90deg, #552266, #771888 60%, #552266);
    color: #ffffff;
    padding: 8px 16px;
    font-size: 0.85rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: 2px solid #331133;
}

.cycle-note strong {
    font-family: 'Formula1-Bold', Arial, sans-serif;
    margin-right: 4px;
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  /* Sidebar width + flexible content */
  gap: 16px;
  padding: 0 16px 24px;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  background: #1a1a1a;
  padding: 16px;
  margin-top: 10px;
}

.content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}
h1, h2 {
    font-family: 'Formula1-Black', Arial, sans-serif;
    text-align: center;
    margin: 20px 0;
    color: #ffffff;
}

.header-title {
    font-size: 1.5em; /* Make the header-title text larger than the rest */
    color: #a0a0a0; /* Slightly lighter gray for non-bold text */
}

.header-title b {
    color: #ffffff; /* Keep bold text the same as the rest of the text */
}

table {
    margin: 12px auto;
    border-collapse: collapse;
    background-color: #1e1e1e;
    color: #ffffff;
    border: none; /* Remove the outer border of the table */
    font-size: 0.7em;
    text-align: left;
}

.panel {
  margin: 10px;
}
table td {
    padding: 1px; /* Reduced from 4px to minimize spacing */
    border-bottom: none; /* Remove the border between rows */
}

table td.top-score {
    background-color: #771888; /* Set the background color for the top-score cell */
    color: #ffffff; /* Ensure text is readable */
}

table tr {
    background-color: #1e1e1e; /* Set all rows to the darker color */
    justify-content: space-between;
    align-items: left;
    margin: 0; /* Remove any additional margin between rows */
}

table tr:nth-child(even) {
    background-color: #1e1e1e; /* Remove alternating colors */
}

/* table tr:nth-child(odd) {
    background-color: #1e1e1e;
} */

table td:nth-child(1) {
    text-align: center;
    width: 34px; /* Slightly wider to accommodate larger chevrons */
    vertical-align: middle;
}

table td:nth-child(2) {
    width: auto; /* Allow column 2 to auto size to fit the text */
    text-align: left;
    padding-left: 0; /* Remove left padding */
    padding-right: 6px; /* Add spacing between icon column and name column */
}

table td:nth-child(4) {
    text-align: right; /* Right justify column 3 */
    padding-left: 4px; /* Reduced from 8px */
    padding-right: 4px; /* Reduced from 8px */
}

table td:nth-child(5) {
    text-align: right; /* Right justify column 4 */
    padding-left: 4px; /* Reduced from 8px */
    padding-right: 4px; /* Reduced from 8px */
}

table td:nth-child(6) { /* Style for the new 6th column */
    text-align: center;
    padding: 0; /* Remove padding to allow background to fill */
    width: 24px; /* Fixed width for the icon cell */
}

.top-change-cell {
    background-color: #771888; /* Purple square */
    /* Ensure the cell is square-like if possible, or adjust padding/width/height */
}

.empty-change-cell {
    background-color: #121212; /* Match body background */
    border: none; /* Ensure no borders are visible */
}

img.top-change-icon {
    width: 16px; /* Adjust to match row text size */
    height: auto; /* Maintain aspect ratio */
    vertical-align: middle;
    filter: brightness(0) invert(1); /* Makes the SVG white */
}

span.last-name {
    text-transform: uppercase;
    font-weight: bold;
}
span.short-name {
    text-transform: uppercase;
    font-weight: bold;
}

span.score {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-style: normal;
    font-size: 1.1em; /* Increase font size slightly */
    letter-spacing: 0.07em; /* Increase kerning for better readability */
}

span.change {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-style: normal;
    font-size: 1.1em; /* Increase font size slightly */
    letter-spacing: 0.07em; /* Increase kerning for better readability */
}

img.elite-top-score, img.ald-logo, img.aisling-logo, img.edmund-logo, img.rui-logo, img.grom-logo, img.archer-logo, img.antal-logo, img.kaine-logo, img.archon-logo, img.winters-logo, img.denton-logo, img.zemina-logo {
    width: 18px; /* Slightly smaller size */
    height: auto; /* Maintain aspect ratio */
    vertical-align: middle; /* Align vertically with text */
}

img.aisling-logo {
    /* filter: drop-shadow(0 0 5px #0099ff); */
    color: #01B2FD;
    /* filter: invert(50%) sepia(53%) saturate(5061%) hue-rotate(177deg) brightness(106%) contrast(102%); */
}

img.ald-logo {
    color: #9E01FC;
    /* filter: drop-shadow(0 0 5px #8000ff); */
    /* filter: invert(9%) sepia(97%) saturate(7434%) hue-rotate(276deg) brightness(104%) contrast(118%); */
}

img.edmund-logo {
    /* filter: drop-shadow(0 0 5px #00ff00); */
    color: #00960C;
    /* filter: invert(28%) sepia(97%) saturate(1106%) hue-rotate(97deg) brightness(96%) contrast(106%); */
}

img.rui-logo {
    /* filter: drop-shadow(0 0 5px #bfff00); */
    color: #00FE77;
    /* filter: invert(60%) sepia(91%) saturate(1014%) hue-rotate(90deg) brightness(110%) contrast(109%);} */
}

img.grom-logo {
    /* filter: drop-shadow(0 0 5px #ff4000); */
    color: #ff6301;
    /* filter: invert(37%) sepia(50%) saturate(2993%) hue-rotate(358deg) brightness(98%) contrast(112%); */
}

img.archer-logo {
    /* filter: drop-shadow(0 0 5px #ff0000); */
    color: #ff01fe;
    /* filter: invert(17%) sepia(100%) saturate(2941%) hue-rotate(292deg) brightness(123%) contrast(134%); */
}

img.antal-logo {
    /* filter: drop-shadow(0 0 5px #ffff00); */
    color: #fff600;
    /* filter: invert(90%) sepia(26%) saturate(4121%) hue-rotate(4deg) brightness(110%) contrast(104%); */
}

img.kaine-logo {
    color: #9CFF01;
    /* filter: invert(17%) sepia(100%) saturate(2941%) hue-rotate(292deg) brightness(123%) contrast(134%); */
}

img.archon-logo {
    /* filter: drop-shadow(0 0 5px #80ff00); */
    color: #FF0000;
    /* filter: invert(26%) sepia(80%) saturate(4238%) hue-rotate(346deg) brightness(78%) contrast(114%); */
}

img.winters-logo {
    /* filter: drop-shadow(0 0 5px #ff8000); */
    color: #ff9e00;
    /* filter: invert(60%) sepia(33%) saturate(4524%) hue-rotate(360deg) brightness(102%) contrast(106%); */
}

img.denton-logo {
    /* filter: drop-shadow(0 0 5px #00ffff); */
    color: #1DD3D4;
    /* filter: invert(79%) sepia(55%) saturate(4516%) hue-rotate(132deg) brightness(96%) contrast(87%); */
}

img.zemina-logo {
    /* filter: drop-shadow(0 0 5px #0040ff); */
    color: #0062fe;
    /* filter: invert(17%) sepia(100%) saturate(3314%) hue-rotate(223deg) brightness(103%) contrast(113%); */
}

img.elite-top-score {
    color: #ffffff;
}

.scoring-method {
    font-family: 'Formula1-Bold';
    display: grid;
      grid-template-columns: 110px 1fr;
    align-items: center;
    column-gap: 10px;
}

.scoring-method select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
    justify-self: start;
}

.scoring-method select:hover {
    border-color: #444;
}

.scoring-method select:focus {
    border-color: #666;
}

.scoring-method label {
    color: #fff;
    text-align: right;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
}

.cycle-select {
    font-family: 'Formula1-Bold';
    display: grid;
      grid-template-columns: 110px 1fr;
    align-items: center;
    column-gap: 10px;
}

.cycle-select select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
    justify-self: start;
}

.cycle-select select:hover {
    border-color: #444;
}

.cycle-select select:focus {
    border-color: #666;
}

.cycle-select label {
    color: #fff;
    text-align: right;
}

.table-type {
    font-family: 'Formula1-Bold';
    display: grid;
      grid-template-columns: 110px 1fr;
    align-items: center;
    column-gap: 10px;
}

.table-type select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
    justify-self: start;
}

.table-type select:hover {
    border-color: #444;
}

.table-type select:focus {
    border-color: #666;
}

.table-type label {
    color: #fff;
    text-align: right;
}

.scoring-description {
    margin-top: 20px;
    padding: 12px;
    background-color: #2a2a2a;
    border-radius: 4px;
    border-left: 4px solid #666;
}

.scoring-description p {
    margin: 0;
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-size: 0.9em;
    color: #d0d0d0;
    line-height: 1.4;
}

.scoring-description strong {
    color: #ffffff;
    font-family: 'Formula1-Bold', Arial, sans-serif;
}

.scoring-description em {
    color: #4CAF50;
    font-style: normal;
    font-weight: bold;
}

.scoring-description a {
    color: #01B2FD;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.scoring-description a:hover {
    color: #4CAF50;
    text-decoration: underline;
}

.scoring-description a:visited {
    color: #9E01FC;
}

.scoring-description a:visited:hover {
    color: #4CAF50;
}

/* Rank cell with chevron support */
.rank-cell {
    text-align: center !important;
    padding: 0px !important; /* Reduced from 2px to minimize spacing */
    vertical-align: middle;
}

.rank-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
}

.rank-number {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-size: 1.1em; /* Match the size of score and change text */
    line-height: 0.8; /* Reduced from 1 to tighten vertical spacing */
    color: #ffffff;
    margin: 0;
    padding: 0;
}

.chevron {
    width: 12px; /* Wider for better visibility */
    height: 9px; /* Slightly taller */
    margin: 0;
    padding: 0;
    /* Color filters are applied in specific chevron-up and chevron-down classes */
}

.chevron-up {
    margin-bottom: 0px; /* Reduced from 1px to tighten spacing */
    filter: invert(28%) sepia(97%) saturate(1106%) hue-rotate(97deg) brightness(96%) contrast(106%); /* Mahon green color */
}

.chevron-down {
    margin-top: 0px; /* Reduced from 1px to tighten spacing */
    filter: invert(26%) sepia(80%) saturate(4238%) hue-rotate(346deg) brightness(78%) contrast(114%); /* Delaine red color */
}

.chevron-placeholder {
    width: 12px; /* Match new chevron width */
    height: 9px; /* Match new chevron height */
    margin: 0;
    padding: 0;
    /* Empty space to maintain consistent spacing */
}

#dynamicRankingsTable {
  margin: 0px;
}
/* Styles for the Systems Change Table */
#systemsChangeTable {
    margin: 0px;
    border-collapse: collapse;
    background-color: #1e1e1e;
    color: #ffffff;
    border: none; /* Remove the outer border of the table */
    font-size: 0.7em;
    text-align: left;
    width: auto; /* Allow table to size based on content or be controlled by a wrapper */
}

#systemsChangeTable th {
    font-family: 'Formula1-Bold', Arial, sans-serif;
    padding: 8px;
    text-align: center;
    background-color: #333; /* Darker background for headers */
}

#systemsChangeTable td {
    padding: 4px 8px;
    border-bottom: none; /* Remove the border between rows */
    text-align: center; /* Center align numbers */
}

#systemsChangeTable td:first-child { /* Power icon column */
    text-align: center;
    width: 20px; /* Fixed width for icon */
}

#systemsChangeTable td:nth-child(2) { /* Power name column */
    text-align: left;
    padding-left: 8px;
}

.positive-change {
    color: #4CAF50; /* Green */
}

.negative-change {
    color: #F44336; /* Red */
}

.no-change {
    color: #a0a0a0; /* Light gray */
}

/* Chart container sizing for readability (tall and narrow) */
.chart-container {
  position: relative;
  height: 580px;
    width: 400px;
  padding: 8px 12px;
  background-color: #1a1a1a;
}

.chart-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
/* Responsive tweaks */
@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    /* Stack sidebar over content */
  }

  .sidebar {
    position: static;
  }

  .content {
    flex-direction: column;
  }
}