:root {
  color-scheme: dark;
  --bg: #07131f;
  --bg-deep: #02070d;
  --bg-gradient-highlight: #123047;
  --bg-card: rgba(8, 24, 38, 0.82);
  --line: rgba(120, 180, 210, 0.18);
  --text: #e8f4ff;
  --muted: #8eb3c9;
  --accent: #d4a853;
  --accent-soft: rgba(212, 168, 83, 0.15);
  --entry-bg: rgba(255, 255, 255, 0.04);
  --entry-fg: #e8f4ff;
  --button-bg: #333333;
  --button-hover: #4d4d4d;
  --button-fg: #ffffff;
  --good: #6fd3a0;
  --danger: #ff8a80;
  --backdrop-glow-1: rgba(212, 168, 83, 0.08);
  --backdrop-glow-2: rgba(80, 160, 220, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --content-max: 1100px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(
    circle at 20% 0%,
    var(--bg-gradient-highlight) 0%,
    var(--bg) 42%,
    var(--bg-deep) 100%
  );
  color: var(--text);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 80% 20%, var(--backdrop-glow-1), transparent 30%),
    radial-gradient(circle at 10% 80%, var(--backdrop-glow-2), transparent 35%);
}

.sprite-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: clamp(80px, 11vw, 128px);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 1.5rem 0.5rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.78;
}

.sprite-rail--left {
  left: max(0.35rem, calc((100vw - var(--content-max)) / 2 - 9.5rem));
}

.sprite-rail--right {
  right: max(0.35rem, calc((100vw - var(--content-max)) / 2 - 9.5rem));
}

.sprite-slot {
  display: block;
  flex: 0 0 auto;
  animation: sprite-float 6s ease-in-out infinite;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.sprite-slot:nth-child(odd) {
  animation-delay: -2s;
}

.sprite-slot:nth-child(3n) {
  animation-delay: -4s;
}

.sprite-slot img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

@media (min-width: 1100px) {
  .sprite-slot img {
    width: 75px;
    height: 75px;
  }
}

@keyframes sprite-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -4px, 0);
  }
}

.shell {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.5rem;
  text-align: center;
}

.game-title {
  display: inline-block;
  margin: 0 0 0.65rem;
  font-size: clamp(2.75rem, 9vw, 5.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.015em;
  color: var(--accent);
  text-decoration: none;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(212, 168, 83, 0.28);
}

.game-title:hover {
  filter: brightness(1.08);
}

.page-title {
  margin: 0.45rem 0 0.75rem;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: 0.04em;
}

.lede {
  margin: 0 auto;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.6;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  width: 100%;
}

.controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
}

.theme-field {
  margin-left: auto;
  min-width: 10rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 12rem;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

.date-field {
  min-width: 14rem;
}

.date-field-label {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.date-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--entry-bg);
  box-shadow: 0 0 0 0 var(--accent-soft);
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.date-picker-wrap:hover {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.date-picker-wrap:focus,
.date-picker-wrap:focus-within {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-color: var(--text);
}

.date-picker-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.75rem;
  margin-left: 0.5rem;
  opacity: 0.9;
  background-color: var(--entry-fg);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E")
    center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E")
    center / contain no-repeat;
  pointer-events: none;
}

input[type="date"],
select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--entry-bg);
  color: var(--entry-fg);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.72rem 0.35rem 0.72rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.date-picker-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

select {
  cursor: pointer;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--button-fg);
  background: linear-gradient(180deg, var(--button-hover), var(--button-bg));
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.status {
  width: 100%;
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  padding: 0.25rem 0.5rem 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:hover {
  background: var(--accent-soft);
}

.rank {
  font-weight: 700;
  color: var(--accent);
}

.hero-cell {
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem !important;
}

.footer {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

.footer a {
  color: var(--good);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--text);
}

@media (max-width: 1280px) {
  .sprite-rail {
    display: none;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-top: 1.5rem;
  }

  .game-title {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }

  .theme-field {
    margin-left: 0;
    width: 100%;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(8),
  td:nth-child(8) {
    display: none;
  }
}
