:root {
  --bg: #07111c;
  --panel: rgba(7, 29, 73, 0.78);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7fafb;
  --muted: rgba(247, 250, 251, 0.68);
  --accent: #f2d34b;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 100%;
  min-height: 100%;
  background: var(--bg);
}

body {
  width: 100%;
  min-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #123052 0, var(--bg) 42%);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

.page-actions {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100vw - 20px);
}

.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 11px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  background: rgba(7, 29, 73, 0.94);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.page-action:hover,
.page-action:focus-visible {
  color: #07111c;
  background: var(--accent);
  outline: none;
}

.ranking-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

header {
  margin-bottom: 16px;
}

header span {
  display: block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 4px 0 8px;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1;
}

p {
  margin: 0;
  color: var(--muted);
}

.ranking-warning {
  max-width: 760px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.ranking-warning span {
  color: #ff3158;
}

.race-card,
.ranking-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.race-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
}

.race-card div {
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.race-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.race-card strong {
  font-size: 18px;
}

.ranking-card {
  overflow: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 15px;
}

td:nth-child(1),
td:nth-child(2),
td:nth-child(4),
td:nth-child(5) {
  font-weight: 800;
}

.updated-at {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
}

@media (max-width: 680px) {
  .page-actions {
    right: 8px;
    gap: 4px;
  }

  .page-action {
    min-height: 34px;
    padding: 7px 8px;
    border-width: 1px;
    font-size: 9px;
  }

  .ranking-shell {
    width: 100%;
    padding: 50px 8px 20px;
  }

  .race-card {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }
}
