:root {
  --bg: #18233f;
  --bg-2: #1e2c52;
  --ink: #f6f3e8;
  --muted: #b7c0d4;
  --line: rgba(246, 243, 232, 0.12);
  --lime: #e0f479;
  --blue: #3669e5;
  --purple: #443bf1;
  --gold: #e4c07a;
  --silver: #cfd4dc;
  --bronze: #d4925a;
  --danger: #c2410c;
  --header: 88px;
  --header-bg: #18233f;
  --pad: 32px;
}

@font-face {
  font-family: "Wotfard";
  src: url("./fonts/wotfard-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Wotfard";
  src: url("./fonts/wotfard-medium.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Barlow", sans-serif;
  color-scheme: dark;
}

.kiosk {
  position: relative;
  min-height: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  user-select: none;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px var(--pad) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  position: relative;
}

.lockup {
  display: block;
  height: 36px;
  width: auto;
}

.brand {
  display: none;
}

.title {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.2;
  max-width: 22ch;
}

.live {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
}

@media (prefers-reduced-motion: no-preference) {
  .dot {
    animation: pulse 1.8s ease-in-out infinite;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.podium {
  width: 100%;
  flex: 0 0 auto;
  padding: 20px var(--pad) 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.podium-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.podium-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
}

.podium-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  min-height: 0;
}

.first,
.second,
.third {
  background: transparent;
  border: 1px solid rgba(246, 243, 232, 0.28);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px;
  min-height: 140px;
  min-width: 0;
}

.first {
  background: var(--lime);
  border-color: var(--lime);
  color: #18233f;
}

.second,
.third {
  background: color-mix(in srgb, var(--bg-2) 80%, black);
}

.place {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  color: inherit;
  margin: 0 0 8px;
}

.first .place {
  color: #18233f;
}

.who {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.first .who,
.second .who,
.third .who {
  font-size: clamp(28px, 3.2vw, 48px);
}

.first .who {
  color: #18233f;
}

.clock {
  margin: 10px 0 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 28px;
}

.first .clock {
  color: #18233f;
}

.board {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px var(--pad) 20px;
}

.table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #252e4a;
  border-radius: 20px;
  overflow: hidden;
  font-family: "Wotfard", sans-serif;
}

.cols,
.row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 8.5rem;
  gap: 0;
  align-items: stretch;
}

.cols {
  color: var(--lime);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
}

.cols span,
.row > * {
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-right: 1px solid var(--bg);
}

.cols span {
  padding-top: 14px;
  padding-bottom: 14px;
}

.cols span:first-child,
.rank {
  justify-content: center;
}

.cols span:last-child,
.row > *:last-child {
  border-right: 0;
  justify-content: flex-end;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.row {
  padding: 0;
  flex: 1;
  min-width: 0;
  border-top: 1px solid var(--bg);
  font-size: 20px;
  font-weight: 600;
}

.row.is-empty {
  opacity: 0.28;
}

.rank,
.time {
  font-family: "Wotfard", sans-serif;
  font-variant-numeric: tabular-nums;
}

.time {
  text-align: right;
  color: var(--ink);
}

.name {
  font-weight: 400;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--danger);
  text-align: center;
}

.hidden {
  display: none;
}

@media (max-width: 900px), (orientation: portrait) {
  .kiosk {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .stage {
    display: flex;
    flex-direction: column;
  }

  .podium {
    border-right: 0;
    border-bottom: 0;
    grid-template-rows: unset;
  }

  .first,
  .second,
  .third {
    justify-content: flex-start;
    overflow: visible;
    min-height: 0;
  }

  .podium-row {
    grid-template-columns: 1fr;
  }

  .who {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.1;
    max-width: 100%;
  }

  .first .who,
  .second .who,
  .third .who {
    font-size: clamp(28px, 8vw, 40px);
  }

  .name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  header {
    padding: 16px;
    height: auto;
  }

  .lockup {
    height: 28px;
  }
}
