:root {
  --ink: #081b34;
  --muted: #657089;
  --line: #dce4ef;
  --soft: #f3f6fb;
  --surface: #ffffff;
  --primary: #0b5cff;
  --primary-dark: #073a9b;
  --green: #12805c;
  --red: #b42318;
  --gold: #d39b2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.staff-screen,
.register-screen {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.toolbar nav,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(38px, 6vw, 86px);
  line-height: .92;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 16px;
  font-size: 22px;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 14px 36px rgb(8 27 52 / .08);
}

.grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 16px;
  align-items: start;
}

.button,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--primary-dark);
  padding: 0 16px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.danger {
  margin-top: 8px;
  border-color: rgb(180 35 24 / .25);
  background: #fff2f0;
  color: var(--red);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.consent-row {
  grid-template-columns: 24px 1fr;
  align-items: start;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-transform: none;
}

.consent-row input {
  min-height: 20px;
  width: 20px;
}

.consent-row a {
  color: var(--primary);
  font-weight: 950;
  text-decoration: underline;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
}

fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.avatar-choice {
  display: block;
}

.avatar-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-choice span {
  cursor: pointer;
}

.avatar-choice input:checked + .avatar-icon,
.avatar-choice input:checked + .avatar-svg {
  border-color: var(--primary);
  background: #e9f0ff;
  box-shadow: 0 0 0 3px rgb(11 92 255 / .15);
}

.avatar-svg {
  width: 68px;
  height: 68px;
  display: block;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #eef4fb;
  cursor: pointer;
}

.avatar-mini.avatar-svg {
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-width: 1px;
  flex: 0 0 auto;
}

.avatar-large.avatar-svg {
  width: 124px;
  height: 124px;
  border-radius: 18px;
}

.avatar-icon {
  --skin: #f0b083;
  --hair: #3b2116;
  --shirt: #0b5cff;
  position: relative;
  width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#e7f5ff 0 55%, #f4f7fb 55% 100%);
  overflow: hidden;
  vertical-align: middle;
}

.avatar-face {
  position: absolute;
  top: 16px;
  left: 17px;
  width: 34px;
  height: 38px;
  border-radius: 46% 46% 48% 48%;
  background: var(--skin);
  z-index: 2;
}

.avatar-hair {
  position: absolute;
  top: 9px;
  left: 15px;
  width: 38px;
  height: 24px;
  border-radius: 18px 18px 10px 10px;
  background: var(--hair);
  z-index: 3;
}

.avatar-shirt {
  position: absolute;
  bottom: -4px;
  left: 13px;
  width: 42px;
  height: 22px;
  border-radius: 18px 18px 0 0;
  background: var(--shirt);
  z-index: 1;
}

.avatar-eyes::before,
.avatar-eyes::after {
  content: "";
  position: absolute;
  top: 15px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #162033;
  z-index: 4;
}

.avatar-eyes::before {
  left: 9px;
}

.avatar-eyes::after {
  right: 9px;
}

.avatar-mouth {
  position: absolute;
  left: 12px;
  bottom: 8px;
  width: 10px;
  height: 5px;
  border-bottom: 2px solid #8d3a2d;
  border-radius: 0 0 12px 12px;
  z-index: 4;
}

.avatar-02 { --skin: #ffd1a6; --hair: #d8582a; --shirt: #ffb000; }
.avatar-03 { --skin: #8f563b; --hair: #24150f; --shirt: #7c5cff; }
.avatar-04 { --skin: #f7c28b; --hair: #f2c94c; --shirt: #00a884; }
.avatar-05 { --skin: #f1bc96; --hair: #5b3927; --shirt: #55a7ff; }
.avatar-06 { --skin: #e4a06f; --hair: #7a3d1d; --shirt: #64c954; }
.avatar-07 { --skin: #a86945; --hair: #1f1714; --shirt: #e6324b; }
.avatar-08 { --skin: #ffd5ba; --hair: #d8d8d8; --shirt: #29a7d8; }
.avatar-09 { --skin: #f4b47e; --hair: #2e1a13; --shirt: #c28b2c; }
.avatar-10 { --skin: #8b573b; --hair: #16110f; --shirt: #ffffff; }
.avatar-11 { --skin: #e9a1b1; --hair: #9b2457; --shirt: #ffc0d8; }
.avatar-12 { --skin: #ffbd82; --hair: #ff7a1a; --shirt: #38bdf8; }
.avatar-13 { --skin: #6f3f2d; --hair: #17100c; --shirt: #facc15; }
.avatar-14 { --skin: #f5bd84; --hair: #f6d365; --shirt: #a855f7; }
.avatar-15 { --skin: #f0ad8c; --hair: #2a1712; --shirt: #ef4444; }
.avatar-16 { --skin: #d69b73; --hair: #513120; --shirt: #334155; }
.avatar-17 { --skin: #c58c6a; --hair: #6d28d9; --shirt: #7dd3fc; }
.avatar-18 { --skin: #f5d0bd; --hair: #e5e7eb; --shirt: #93c5fd; }
.avatar-19 { --skin: #e7a77b; --hair: #4b2619; --shirt: #fb7185; }
.avatar-20 { --skin: #9a6141; --hair: #261611; --shirt: #22c55e; }

.avatar-01 .avatar-hair,
.avatar-09 .avatar-hair,
.avatar-16 .avatar-hair {
  border-radius: 8px 18px 12px 8px;
  transform: rotate(-5deg);
}

.avatar-04 .avatar-hair,
.avatar-14 .avatar-hair,
.avatar-18 .avatar-hair {
  height: 30px;
  border-radius: 20px 20px 14px 14px;
}

.avatar-05 .avatar-eyes,
.avatar-11 .avatar-eyes {
  position: absolute;
  inset: 0;
}

.avatar-05 .avatar-eyes::before,
.avatar-05 .avatar-eyes::after,
.avatar-11 .avatar-eyes::before,
.avatar-11 .avatar-eyes::after {
  top: 14px;
  width: 10px;
  height: 7px;
  border: 2px solid #162033;
  background: transparent;
}

.avatar-07 .avatar-mouth,
.avatar-16 .avatar-mouth {
  width: 14px;
  left: 10px;
  border-bottom-width: 3px;
}

.avatar-mini {
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-width: 1px;
}

.avatar-mini .avatar-face {
  top: 7px;
  left: 8px;
  width: 14px;
  height: 17px;
}

.avatar-mini .avatar-hair {
  top: 4px;
  left: 7px;
  width: 16px;
  height: 10px;
}

.avatar-mini .avatar-shirt {
  left: 6px;
  width: 18px;
  height: 9px;
}

.avatar-mini .avatar-eyes,
.avatar-mini .avatar-mouth {
  display: none;
}

.avatar-large {
  width: 124px;
  height: 124px;
  border-radius: 18px;
  transform: scale(1);
}

.avatar-large .avatar-face {
  top: 28px;
  left: 31px;
  width: 62px;
  height: 70px;
}

.avatar-large .avatar-hair {
  top: 17px;
  left: 27px;
  width: 70px;
  height: 44px;
}

.avatar-large .avatar-shirt {
  left: 23px;
  width: 78px;
  height: 40px;
}

.avatar-large .avatar-eyes::before,
.avatar-large .avatar-eyes::after {
  top: 28px;
  width: 7px;
  height: 7px;
}

.avatar-large .avatar-eyes::before {
  left: 18px;
}

.avatar-large .avatar-eyes::after {
  right: 18px;
}

.avatar-large .avatar-mouth {
  left: 24px;
  bottom: 17px;
  width: 16px;
  height: 8px;
}

.muted-avatar {
  opacity: .35;
}

.login,
.form {
  display: grid;
  gap: 16px;
}

.qr {
  width: 240px;
  max-width: 100%;
  height: auto;
}

.url {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 800;
}

.participant-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 60px;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.participant-line strong,
.ranking-line strong,
.table-row strong {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ranking-line,
.table-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.ranking-line > .row-rank,
.table-row > .row-rank {
  color: var(--primary);
  font-size: 24px;
  font-weight: 950;
}

.ranking-line em,
.table-row em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 950;
}

.register-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: .75fr 1fr;
  gap: 28px;
  align-items: center;
}

.register-screen .form input {
  min-height: 60px;
  font-size: 20px;
}

.register-screen .form button {
  min-height: 66px;
  font-size: 16px;
}

.success {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 520px;
  text-align: center;
}

.bib {
  color: var(--primary-dark);
  font-size: clamp(100px, 18vw, 230px);
  font-weight: 950;
  line-height: .85;
}

.success h2 {
  font-size: clamp(34px, 5vw, 70px);
}

.avatar-confirm {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: #e9f0ff;
  font-size: 70px;
}

.terms-screen {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.terms-card {
  display: grid;
  gap: 16px;
}

.terms-card h1 {
  font-size: clamp(38px, 5vw, 72px);
}

.terms-card p {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.terms-card h2 {
  margin: 18px 0 0;
  color: var(--primary-dark);
  font-size: 22px;
}

.terms-card ul {
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.display-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  overflow: hidden;
  background: #061625;
  color: white;
  padding: clamp(22px, 4vw, 56px);
}

.display-screen .eyebrow {
  color: #8fd5e8;
}

.display-screen h1 {
  font-size: clamp(56px, 8vw, 116px);
}

.podium {
  min-height: 520px;
  display: grid;
  grid-template-columns: .9fr 1.12fr .9fr;
  align-items: end;
  gap: 18px;
  padding-top: 20px;
}

.podium-card {
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: end;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 255 255 / .12), rgb(255 255 255 / .05));
  padding: 30px 24px 0;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 28px 70px rgb(0 0 0 / .22);
}

.rank-1 {
  min-height: 500px;
  background:
    radial-gradient(circle at 50% 22%, rgb(211 155 42 / .34), transparent 36%),
    linear-gradient(180deg, rgb(211 155 42 / .26), rgb(255 255 255 / .07));
  border-color: rgb(211 155 42 / .45);
}

.rank-2 {
  min-height: 420px;
}

.rank-3 {
  min-height: 360px;
}

.podium-card > .rank-number {
  position: absolute;
  top: 16px;
  left: 18px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  color: var(--gold);
  font-size: 52px;
  font-weight: 950;
  line-height: 1;
}

.rank-1 > .rank-number {
  width: 92px;
  height: 92px;
  background: rgb(211 155 42 / .24);
  font-size: 68px;
}

.medal {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  color: #d7edf4;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rank-1 .medal {
  background: rgb(211 155 42 / .24);
  color: #ffe7a8;
}

.podium-avatar {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  padding: 10px;
}

.rank-1 .podium-avatar {
  background: rgb(211 155 42 / .18);
}

.rank-1 .avatar-large {
  width: 156px;
  height: 156px;
  border-radius: 22px;
}

.rank-1 .avatar-large.avatar-svg {
  width: 156px;
  height: 156px;
}

.rank-1 .avatar-large .avatar-face {
  top: 36px;
  left: 39px;
  width: 78px;
  height: 88px;
}

.rank-1 .avatar-large .avatar-hair {
  top: 22px;
  left: 34px;
  width: 88px;
  height: 56px;
}

.rank-1 .avatar-large .avatar-shirt {
  left: 29px;
  width: 98px;
  height: 50px;
}

.rank-1 .avatar-large .avatar-eyes::before,
.rank-1 .avatar-large .avatar-eyes::after {
  top: 35px;
  width: 8px;
  height: 8px;
}

.rank-1 .avatar-large .avatar-eyes::before {
  left: 23px;
}

.rank-1 .avatar-large .avatar-eyes::after {
  right: 23px;
}

.rank-1 .avatar-large .avatar-mouth {
  left: 30px;
  bottom: 21px;
  width: 20px;
}

.podium-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(30px, 4vw, 62px);
  line-height: .94;
  text-transform: uppercase;
}

.rank-1 strong {
  font-size: clamp(42px, 5vw, 86px);
}

.podium-card em {
  color: #8fd5e8;
  font-size: clamp(54px, 6vw, 104px);
  font-style: normal;
  font-weight: 950;
}

.rank-1 em {
  color: #ffe7a8;
  font-size: clamp(74px, 8vw, 136px);
}

.podium-step {
  width: calc(100% + 48px);
  height: 88px;
  margin-top: 8px;
  background: rgb(255 255 255 / .12);
}

.rank-1 .podium-step {
  height: 138px;
  background: linear-gradient(180deg, rgb(211 155 42 / .34), rgb(211 155 42 / .16));
}

.rank-2 .podium-step {
  height: 112px;
}

.rank-3 .podium-step {
  height: 76px;
}

.table {
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 8px;
  background: rgb(255 255 255 / .06);
  padding: 12px 22px;
}

.table-row {
  border-color: rgb(255 255 255 / .12);
}

.table-row > .row-rank,
.table-row em {
  color: #8fd5e8;
}

.actions {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .grid,
  .register-screen,
  .podium {
    grid-template-columns: 1fr;
  }

  .rank-1,
  .rank-2,
  .rank-3 {
    order: initial;
  }

  .podium-card,
  .rank-1 {
    min-height: 260px;
  }

  .rank-1 .podium-step,
  .rank-2 .podium-step,
  .rank-3 .podium-step {
    height: 54px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .participant-line {
    grid-template-columns: 1fr;
  }
}
