/* Terminal, toned down: a worn green CRT in the basement, easy on the eyes. Always dark. */
@import url("https://fonts.googleapis.com/css2?family=VT323&display=swap");

:root {
  --bg: #101411;
  --panel: #131814;
  --text: #8fc79c;
  --bright: #c3e3ca;
  --muted: #5f8a69;
  --dim: #34503b;
  --line: #2a3d2f;
  --stripe: rgb(143 199 156 / 0.035);
  --accent: #d4a24c;
  --up: #8fc79c;
  --down: #d98b7e;
  --glow: 0 0 6px rgb(143 199 156 / 0.18);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #141b16 0%, var(--bg) 80%);
  color: var(--text);
  font: 20px/1.2 VT323, "Cascadia Mono", Consolas, "MS Gothic", "NSimSun", monospace;
  text-shadow: var(--glow);
}
/* faint scanlines over everything; clicks pass through */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0) 0 2px, rgb(0 0 0 / 0.12) 2px 3px);
}
::selection {
  background: var(--text);
  color: var(--bg);
  text-shadow: none;
}
.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* header: [ menu ] items, then a prompt */
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
}
.top nav a::before {
  content: "[ ";
}
.top nav a::after {
  content: " ]";
}
.top nav a:hover {
  color: var(--bright);
}
.top nav a.current {
  background: rgb(143 199 156 / 0.16);
  color: var(--bright);
}
h1 {
  margin: 14px 0 16px;
  font-size: 34px;
  font-weight: normal;
  color: var(--bright);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h1::before {
  content: "C:\\MFF> ";
  color: var(--muted);
}
h1::after {
  content: "█";
  margin-left: 4px;
  animation: blink 1.06s infinite steps(1);
}
@keyframes blink {
  50% { opacity: 0; }
}

p {
  color: var(--muted);
}
.cards {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.cards li {
  border: 1px solid var(--line);
  container-type: inline-size;
}
.cards li:hover {
  border-color: var(--text);
  background: rgb(143 199 156 / 0.06);
}
/* the whole card is the link; the name grows with the card's width, up to 48px */
.cards a {
  display: block;
  padding: 0.5em 0.5em;
  font-size: clamp(24px, 6cqi, 48px);
  line-height: 1;
  color: var(--bright);
  text-decoration: none;
  text-transform: uppercase;
}
.cards a::before {
  content: "> ";
  color: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.picker span,
.count {
  color: var(--muted);
  text-transform: uppercase;
}
.picker span::after {
  content: ":";
}
select,
input,
button {
  font: inherit;
  color: inherit;
  text-shadow: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1px 8px;
  outline: none;
}
select:focus,
input:focus {
  border-color: var(--text);
  box-shadow: 0 0 6px rgb(143 199 156 / 0.15);
}
input::placeholder {
  color: var(--dim);
  text-shadow: none;
  text-transform: uppercase;
}
.search {
  min-width: 280px;
  caret-color: var(--text);
}
button {
  cursor: pointer;
  text-transform: uppercase;
}
button:hover {
  background: rgb(143 199 156 / 0.14);
  color: var(--bright);
}

/* the download button: alone (.download) or split with a menu (.split) */
.download,
.split .main {
  color: var(--accent);
  border-color: var(--accent);
  text-shadow: none;
}
.download:hover,
.split .main:hover,
.split .toggle:hover,
.split .menu button:hover {
  background: rgb(212 162 76 / 0.14);
  color: var(--accent);
}
.download {
  margin-left: auto;
}
.split {
  position: relative;
  display: inline-flex;
  margin-left: auto;
}
.split .toggle {
  color: var(--accent);
  border-color: var(--accent);
  border-left: none;
}
.split .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 2;
  background: var(--bg);
  border: 1px solid var(--accent);
}
.split .menu button {
  border: none;
  white-space: nowrap;
  width: 100%;
  text-align: left;
  color: var(--accent);
}
.split .menu button::before {
  content: "> ";
}

.message {
  color: var(--muted);
  text-transform: uppercase;
}
.message::after {
  content: "_";
  animation: blink 1.06s infinite steps(1);
}
.message.error {
  color: var(--down);
}
.message.error::before {
  content: "ERROR: ";
}

/* tables */
.scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}
.grid {
  border-collapse: collapse;
  width: 100%;
}
.grid th,
.grid td {
  padding: 2px 12px;
  text-align: left;
  white-space: nowrap;
}
.grid thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--bright);
  font-weight: normal;
  text-transform: uppercase;
  border-bottom: 1px dashed var(--line);
}
.grid .filters th {
  padding: 3px 6px 5px;
}
.grid tbody tr:nth-child(even) {
  background: var(--stripe);
}
.grid tbody tr:hover {
  background: rgb(143 199 156 / 0.08);
}
.grid tbody tr:hover td {
  color: var(--bright);
}
.grid .sortable {
  cursor: pointer;
  user-select: none;
}
.grid .sortable:hover {
  background: rgb(143 199 156 / 0.1);
}
.grid .filters input {
  width: 100%;
  min-width: 70px;
  font-size: 18px;
  padding: 0 6px;
}
.number {
  text-align: right;
}
/* numeric columns take only the width they need; the table's spare width goes to the text columns */
.grid th.number,
.grid td.number {
  width: 1%;
}
.grid .filters th.number input {
  min-width: 0;
  width: 4em;
}
td.victory {
  color: var(--up);
}
td.victory::before {
  content: "+ ";
}
td.failed {
  color: var(--down);
  text-shadow: none;
}
td.failed::before {
  content: "x ";
}
td.draw {
  color: var(--muted);
}
td.draw::before {
  content: "= ";
}

/* alliance battle: pts over the day's gain */
.battle .day {
  text-align: right;
}
.battle .none {
  color: var(--dim);
  text-align: center;
}
/* a gain under 1m (not .up) is a little brighter than --down, with a faint glow, so weak days catch the eye */
.battle .gain {
  font-size: 17px;
  color: #f2665c;
  text-shadow: 0 0 6px rgb(242 102 92 / 0.45);
}
.battle .gain.up {
  color: var(--accent);
  text-shadow: none;
}
