@font-face {
  font-family: "Barlow Condensed";
  src: url("assets/fonts/barlow-condensed-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("assets/fonts/barlow-condensed-800.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("assets/fonts/noto-sans-thai-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("assets/fonts/noto-sans-thai-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07080a;
  --panel: #0d0f13;
  --panel-raised: #12151b;
  --panel-soft: #101218;
  --line: #292d37;
  --line-strong: #383e4a;
  --text: #f4f5f8;
  --muted: #a4a8b3;
  --faint: #858a96;
  --violet: #805bff;
  --violet-bright: #9b82ff;
  --violet-soft: #27203d;
  --gold: #f2bd35;
  --silver: #b9bccc;
  --bronze: #c98b6c;
  --win: #71e7a0;
  --loss: #ff7387;
  --font-ui: "Noto Sans Thai", sans-serif;
  --font-display: "Barlow Condensed", sans-serif;
  --radius: 14px;
  --rail-width: 76px;
  --profile-width: 304px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 55% 6%, rgba(128, 91, 255, 0.07), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

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

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-180%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--violet-bright);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--profile-width);
  min-height: 100vh;
}

.rail {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--rail-width);
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(9, 10, 13, 0.96);
}

.brand-mark {
  display: grid;
  place-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  color: var(--violet-bright);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.6;
}

.brand-mark span {
  display: none;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
}

.rail-link {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.rail-link::before {
  position: absolute;
  inset: 8px auto 8px 0;
  width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--violet-bright);
  content: "";
  opacity: 0;
}

.rail-link:hover:not(:disabled),
.rail-link.is-active {
  background: rgba(128, 91, 255, 0.08);
  color: var(--violet-bright);
}

.rail-link.is-active::before {
  opacity: 1;
}

.summary-strip.is-jump-highlight,
.ranking-panel.is-jump-highlight,
.recent-matches.is-jump-highlight {
  animation: section-jump-lock 760ms var(--ease-out);
}

.summary-strip:focus,
.ranking-panel:focus,
.recent-matches:focus {
  outline: none;
}

.summary-strip:focus-visible,
.ranking-panel:focus-visible,
.recent-matches:focus-visible {
  outline: 2px solid var(--violet-bright);
  outline-offset: 4px;
}

.rail-link:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.rail-link span {
  position: absolute;
  left: calc(100% + 8px);
  z-index: 30;
  width: max-content;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17191f;
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.rail-link:hover span,
.rail-link:focus-visible span {
  opacity: 1;
  transform: translateX(0);
}

.rail-season {
  display: grid;
  gap: 8px;
  margin: auto 14px 18px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.season-meter {
  display: block;
  height: 3px;
  overflow: hidden;
  background: #272a32;
}

.season-meter i {
  display: block;
  width: 62%;
  height: 100%;
  background: var(--violet);
}

.workspace {
  min-width: 0;
  padding: 0 clamp(18px, 2.2vw, 36px) 44px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--violet-bright);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 48vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0f13;
  color: var(--faint);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.search-field:focus-within {
  border-color: var(--violet);
  background: #101218;
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: #858a96;
}

.search-field kbd {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-raised);
  color: var(--muted);
  font: 11px/1 var(--font-ui);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.live-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 10px 2px rgba(128, 91, 255, 0.25);
}

.icon-button,
.user-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms var(--ease-out);
}

.edit-data-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid #5b4b94;
  border-radius: 9px;
  background: rgba(128, 91, 255, 0.1);
  color: #c7baff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms var(--ease-out);
}

.edit-data-button:hover {
  border-color: var(--violet-bright);
  background: rgba(128, 91, 255, 0.18);
  color: var(--text);
  transform: translateY(-1px);
}

.edit-data-button:active {
  transform: translateY(0) scale(0.985);
}

.edit-data-button svg {
  width: 17px;
  height: 17px;
}

[data-admin-only] {
  display: none !important;
}

html.is-admin .rail-link[data-admin-only] {
  display: grid !important;
}

html.is-admin .edit-data-button[data-admin-only] {
  display: inline-flex !important;
}

.icon-button:hover,
.user-chip:hover {
  border-color: var(--violet);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-button.is-spinning svg {
  animation: button-spin 620ms var(--ease-out);
}

.user-chip {
  border-radius: 50%;
  background: #22252d;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 44px 72px 32px;
  text-align: center;
  isolation: isolate;
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  top: 44px;
  width: min(24%, 240px);
  height: 78px;
  border-top: 1px solid rgba(128, 91, 255, 0.2);
  content: "";
  opacity: 0.6;
}

.hero::before {
  left: 0;
  transform: skewY(-24deg);
}

.hero::after {
  right: 0;
  transform: skewY(24deg);
}

.hero h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 6vw, 5.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.9;
  text-wrap: balance;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-subline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(460px, 90%);
  margin-top: 12px;
  color: var(--violet-bright);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hero-subline span {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.hero-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--violet-bright);
}

.hero-sweep {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 15%;
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 130, 255, 0.92), transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-70%) scaleX(0.28);
  transform-origin: center;
}

.app-shell.is-arriving .hero h1 {
  animation: title-arrive 620ms var(--ease-out) both;
}

.app-shell.is-arriving .hero-corner {
  animation: corner-charge 440ms var(--ease-out) both;
}

.app-shell.is-arriving .hero-corner--tr { animation-delay: 34ms; }
.app-shell.is-arriving .hero-corner--bl { animation-delay: 68ms; }
.app-shell.is-arriving .hero-corner--br { animation-delay: 102ms; }

.app-shell.is-arriving .hero-sweep {
  animation: hero-sweep 700ms 120ms var(--ease-out) both;
}

.app-shell.is-arriving .mode-switch {
  animation: mode-arrive 420ms 190ms var(--ease-out) both;
}

.app-shell.is-arriving .summary-item {
  animation: summary-arrive 380ms var(--ease-out) both;
}

.app-shell.is-arriving .summary-item:nth-child(1) { animation-delay: 250ms; }
.app-shell.is-arriving .summary-item:nth-child(2) { animation-delay: 280ms; }
.app-shell.is-arriving .summary-item:nth-child(3) { animation-delay: 310ms; }
.app-shell.is-arriving .summary-item:nth-child(4) { animation-delay: 340ms; }
.app-shell.is-arriving .summary-item:nth-child(5) { animation-delay: 370ms; }

.app-shell.is-arriving .podium-card {
  animation: podium-lock 480ms var(--ease-out) both;
}

.app-shell.is-arriving [data-podium="0"] { animation-delay: 380ms; }
.app-shell.is-arriving [data-podium="1"] { animation-delay: 432ms; }
.app-shell.is-arriving [data-podium="2"] { animation-delay: 484ms; }

.app-shell.is-arriving .ranking-panel {
  animation: panel-arrive 460ms 470ms var(--ease-out) both;
}

.app-shell.is-arriving .profile-panel {
  animation: profile-arrive 480ms 420ms var(--ease-out) both;
}

.app-shell.mode-changing .summary-strip,
.app-shell.mode-changing .podium,
.app-shell.mode-changing .profile-panel {
  animation: mode-swap 280ms var(--ease-out) both;
}

.app-shell.mode-changing .podium { animation-delay: 38ms; }
.app-shell.mode-changing .profile-panel { animation-delay: 76ms; }

.hero-corner--tl,
.hero-corner--tr {
  top: 40px;
  border-top: 3px solid;
}

.hero-corner--bl,
.hero-corner--br {
  bottom: 38px;
  border-bottom: 3px solid;
}

.hero-corner--tl,
.hero-corner--bl {
  left: 27%;
  border-left: 1px solid;
}

.hero-corner--tr,
.hero-corner--br {
  right: 27%;
  border-right: 1px solid;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(490px, 100%);
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.mode-button:last-child {
  border-right: 0;
}

.mode-button:hover {
  color: var(--text);
}

.mode-button:active {
  transform: scale(0.985);
}

.mode-button.is-active {
  background: var(--violet-soft);
  color: #c7baff;
  box-shadow: inset 0 -2px 0 var(--violet);
}

.data-editor[hidden] {
  display: none;
}

.data-editor {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid #5b4b94;
  border-radius: var(--radius);
  background: #0b0d11;
  box-shadow: inset 0 1px 0 rgba(128, 91, 255, 0.14);
  animation: editor-reveal 240ms var(--ease-out) both;
}

.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(128, 91, 255, 0.045);
}

.editor-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.015em;
}

.editor-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.editor-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-mode {
  padding: 5px 10px;
  border: 1px solid #5b4b94;
  border-radius: 999px;
  background: rgba(128, 91, 255, 0.08);
  color: #c7baff;
  font-size: 11px;
  font-weight: 600;
}

.editor-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.editor-close:hover {
  border-color: var(--violet);
  background: var(--panel-raised);
  color: var(--text);
}

.editor-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(106px, 1fr));
  gap: 14px;
  padding: 18px;
}

.editor-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.editor-avatar-preview {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid var(--violet);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(128, 91, 255, 0.28), #17191e);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.editor-avatar-preview img,
.avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-avatar-copy {
  min-width: 0;
}

.editor-avatar-copy > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.editor-avatar-copy p {
  margin: 4px 0 10px;
  color: var(--faint);
  font-size: 11px;
}

.editor-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#editor-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.editor-upload,
#editor-avatar-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.editor-upload:hover,
.editor-upload:focus-within {
  border-color: var(--violet);
}

#editor-avatar-remove {
  color: var(--muted);
}

#editor-avatar-remove:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.editor-history {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.editor-history legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.editor-history > p {
  margin: -2px 0 12px;
  color: var(--faint);
  font-size: 11px;
}

.editor-history-labels,
.editor-history-row {
  display: grid;
  grid-template-columns: 74px minmax(150px, 1.3fr) minmax(140px, 1fr) 100px;
  gap: 8px;
}

.editor-history-labels {
  padding: 0 2px 6px;
  color: var(--faint);
  font-size: 10px;
}

#editor-history-list {
  display: grid;
  gap: 8px;
}

.editor-history-row label {
  min-width: 0;
}

.editor-history-row input,
.editor-history-row select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--panel-raised);
  color: var(--text);
}

.editor-history-row input:focus,
.editor-history-row select:focus {
  border-color: var(--violet);
  background: var(--panel-soft);
}

.editor-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.editor-field > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.editor-field input,
.editor-field select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--panel-raised);
  color: var(--text);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.editor-field input:hover,
.editor-field select:hover {
  border-color: #5b4b94;
}

.editor-field input:focus,
.editor-field select:focus {
  border-color: var(--violet);
  background: var(--panel-soft);
}

.editor-field input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--loss);
}

.editor-number {
  position: relative;
  display: block;
}

.editor-number input {
  padding-right: 32px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.editor-number b {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--violet-bright);
  font-family: var(--font-display);
  font-size: 15px;
  transform: translateY(-50%);
  pointer-events: none;
}

.editor-help,
.editor-message {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
}

.editor-help {
  color: var(--faint);
}

.editor-message {
  min-height: 18px;
  color: var(--muted);
}

.editor-message[data-type="success"] {
  color: var(--win);
}

.editor-message[data-type="error"] {
  color: var(--loss);
}

.editor-message[data-type="info"] {
  color: #c7baff;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.editor-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms var(--ease-out);
}

.editor-actions button:hover {
  transform: translateY(-1px);
}

.editor-save {
  border-color: var(--violet) !important;
  background: var(--violet);
  color: #fff;
}

.editor-save:hover {
  background: var(--violet-bright);
}

.editor-cancel {
  background: var(--panel-raised);
  color: var(--text);
}

.editor-reset {
  margin-left: auto;
  background: transparent;
  color: var(--muted);
}

.editor-reset:hover,
.editor-reset.is-confirming {
  border-color: var(--loss);
  background: rgba(255, 115, 135, 0.08);
  color: #f1aab4;
}

.summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0d11;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(128, 91, 255, 0.09);
  color: var(--violet-bright);
}

.summary-item div:last-child {
  min-width: 0;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-item strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item--primary {
  display: grid;
  place-items: center;
  text-align: center;
}

.summary-item--primary strong {
  font-size: 34px;
}

.summary-item--primary span {
  color: #b5a5ff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pulse-line {
  position: relative;
  width: 72px;
  height: 8px;
  margin-top: 4px;
}

.pulse-line::before {
  position: absolute;
  inset: 3px 0 auto;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.pulse-line i {
  position: absolute;
  inset: 0 auto auto 0;
  width: 48%;
  height: 8px;
  border-bottom: 2px solid var(--violet-bright);
  transform: skewY(-10deg);
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: 12px;
  margin: 28px 0 20px;
  padding-top: 12px;
}

.podium-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 124px;
  padding: 22px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 58%), var(--panel);
  cursor: pointer;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background-color 220ms ease;
}

.podium-card::after {
  position: absolute;
  inset: auto 18px 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: var(--violet-bright);
  content: "";
  opacity: 0;
  transform: scaleX(0.18);
  transform-origin: center;
  transition: opacity 180ms ease, transform 280ms var(--ease-out);
}

.podium-card:hover,
.podium-card:focus-visible,
.podium-card.is-selected {
  transform: translateY(-3px);
}

.podium-card.is-selected::after {
  opacity: 1;
  transform: scaleX(1);
}

.podium-card--gold {
  min-height: 144px;
  border-color: rgba(242, 189, 53, 0.78);
  background: linear-gradient(145deg, rgba(242, 189, 53, 0.08), transparent 58%), var(--panel);
}

.podium-card--silver {
  border-color: rgba(128, 91, 255, 0.75);
}

.podium-card--bronze {
  border-color: rgba(201, 139, 108, 0.65);
}

.podium-rank {
  position: absolute;
  top: -16px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--panel);
  color: var(--silver);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.podium-card--gold .podium-rank {
  left: 50%;
  width: 48px;
  height: 48px;
  color: var(--gold);
  font-size: 28px;
  transform: translateX(-50%);
}

.podium-card--bronze .podium-rank {
  color: var(--bronze);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--avatar-color, var(--violet));
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.22) 0 15%, transparent 16%),
    linear-gradient(140deg, color-mix(in srgb, var(--avatar-color) 34%, #242832), #17191e);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
}

.avatar.has-image,
.profile-avatar.has-image {
  background: #17191e;
}

.podium-copy {
  min-width: 0;
}

.podium-copy strong,
.podium-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-copy strong {
  font-size: 15px;
}

.podium-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.podium-rate {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
}

.podium-rate small {
  display: block;
  color: var(--violet-bright);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.ranking-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.panel-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sample-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #5b4b94;
  border-radius: 999px;
  background: rgba(128, 91, 255, 0.08);
  color: #c6b9ff;
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #20232b;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #101217;
  color: #9297a3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  width: 74px;
  text-align: center;
}

th:nth-child(4),
th:nth-child(5),
td:nth-child(4),
td:nth-child(5) {
  width: 68px;
  text-align: center;
}

th:nth-child(6),
td:nth-child(6) {
  width: 120px;
}

th:last-child,
td:last-child {
  width: 128px;
}

tbody tr {
  cursor: pointer;
  transition: background-color 160ms ease;
}

tbody tr:hover,
tbody tr:focus-visible,
tbody tr.is-selected {
  background: rgba(128, 91, 255, 0.065);
}

tbody tr.is-selected td:first-child {
  position: relative;
  color: var(--violet-bright);
}

tbody tr.is-selected td:first-child::after {
  position: absolute;
  inset: 16% auto 16% 0;
  width: 2px;
  border-radius: 0 3px 3px 0;
  background: var(--violet-bright);
  content: "";
  animation: selection-lock 260ms var(--ease-out) both;
}

tbody tr.row-enter {
  animation: row-enter 360ms var(--ease-out) both;
  animation-delay: min(calc(var(--row-index) * 28ms), 252ms);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.rank-number {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.identity-cell .avatar {
  width: 34px;
  height: 34px;
  border-width: 1px;
  font-size: 13px;
}

.identity-copy {
  min-width: 0;
}

.identity-copy strong,
.identity-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-copy strong {
  font-size: 13px;
}

.identity-copy span,
.team-cell {
  color: var(--muted);
  font-size: 11px;
}

.rate-cell strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.form-dots {
  display: flex;
  gap: 5px;
}

.form-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.form-dot.is-win {
  background: rgba(113, 231, 160, 0.11);
  color: var(--win);
}

.form-dot.is-loss {
  background: rgba(255, 115, 135, 0.11);
  color: var(--loss);
}

.empty-state {
  padding: 52px 24px;
  text-align: center;
}

.empty-state[hidden],
.error-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  color: var(--violet-bright);
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state button,
.error-state button {
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--violet);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.error-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 115, 135, 0.45);
  border-radius: 12px;
  background: rgba(255, 115, 135, 0.08);
}

.error-state strong,
.error-state span {
  display: block;
}

.error-state span {
  color: #f1aab4;
  font-size: 12px;
}

.applicants-panel {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0d11;
}

.applicants-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.applicants-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
}

.applicants-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.applicants-heading code {
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-raised);
  color: #c7baff;
  font-family: var(--font-ui);
  font-size: 11px;
}

.applicants-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.applicants-count {
  padding: 6px 10px;
  border: 1px solid rgba(128, 91, 255, 0.38);
  border-radius: 999px;
  background: rgba(128, 91, 255, 0.08);
  color: #c7baff;
  font-size: 10px;
  white-space: nowrap;
}

.applicants-refresh {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.applicants-refresh:hover:not(:disabled),
.applicants-refresh:focus-visible {
  border-color: var(--violet);
  color: var(--text);
}

.applicants-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.applicants-refresh.is-spinning svg {
  animation: button-spin 620ms linear infinite;
}

.applicants-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 106px;
  padding: 20px 22px;
}

.applicants-state[hidden] {
  display: none;
}

.applicants-state-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(128, 91, 255, 0.09);
  color: var(--violet-bright);
}

.applicants-state[data-state="error"] .applicants-state-icon {
  background: rgba(255, 115, 135, 0.1);
  color: var(--loss);
}

.applicants-state-icon svg {
  width: 18px;
  height: 18px;
}

.applicants-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(155, 130, 255, 0.22);
  border-top-color: var(--violet-bright);
  border-radius: 50%;
  animation: button-spin 680ms linear infinite;
}

.applicants-state strong,
.applicants-state span {
  display: block;
}

.applicants-state strong {
  font-size: 13px;
}

.applicants-state div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.applicants-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.applicants-list[hidden] {
  display: none;
}

.applicants-list li {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1.15fr) minmax(110px, 0.8fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  animation: applicant-enter 300ms var(--ease-out) both;
  animation-delay: min(calc(var(--applicant-index) * 34ms), 204ms);
}

.applicants-list li:last-child {
  border-bottom: 0;
}

.applicant-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--violet);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(128, 91, 255, 0.24), #17191e);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
}

.applicant-identity,
.applicant-team,
.applicant-note {
  min-width: 0;
}

.applicant-identity strong,
.applicant-identity span,
.applicant-team,
.applicant-note,
.applicants-list time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.applicant-identity strong,
.applicant-identity span {
  display: block;
}

.applicant-identity strong {
  font-size: 13px;
}

.applicant-identity span,
.applicant-team small,
.applicants-list time {
  color: var(--faint);
  font-size: 10px;
}

.applicant-team {
  color: var(--muted);
  font-size: 12px;
}

.applicant-team small {
  display: block;
  margin-bottom: 2px;
}

.applicant-note {
  color: var(--muted);
  font-size: 11px;
}

.applicants-list time {
  text-align: right;
}

@keyframes applicant-enter {
  from {
    opacity: 0.35;
    clip-path: inset(0 0 0 8%);
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

.profile-panel {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 26px 20px;
  border-left: 1px solid var(--line);
  background: rgba(10, 11, 15, 0.97);
}

.profile-panel.is-updating::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(128, 91, 255, 0.08), transparent);
  content: "";
  pointer-events: none;
  animation: profile-scan 460ms var(--ease-out);
}

.profile-panel.is-updating .profile-avatar {
  animation: avatar-lock 460ms var(--ease-out);
}

.profile-panel.is-updating .profile-rate strong {
  animation: value-lock 360ms var(--ease-out);
}

.profile-panel.is-updating .recent-matches li {
  animation: match-enter 300ms var(--ease-out) both;
  animation-delay: min(calc(var(--match-index) * 28ms), 112ms);
}

.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-heading span:first-child {
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.profile-heading h2 {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.rank-chip {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--violet-bright);
  font-family: var(--font-display);
  font-weight: 700;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 106px;
  height: 106px;
  margin: 30px auto 14px;
  border: 2px solid var(--avatar-color, var(--violet));
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.23) 0 16%, transparent 17%),
    linear-gradient(145deg, color-mix(in srgb, var(--avatar-color, var(--violet)) 35%, #242832), #13151a);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  overflow: hidden;
}

.profile-handle {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.profile-team {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.profile-rate {
  margin-top: 28px;
}

.rate-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.rate-head span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rate-head strong {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
}

.rate-track {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #262933;
}

.rate-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 540ms var(--ease-out);
}

.profile-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 0;
  border-block: 1px solid var(--line);
}

.profile-numbers div {
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.profile-numbers div:last-child {
  border-right: 0;
}

.profile-numbers dt {
  color: var(--muted);
  font-size: 10px;
}

.profile-numbers dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.recent-matches {
  margin-top: 26px;
}

.recent-matches header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-matches h3 {
  margin: 0;
  font-size: 14px;
}

.recent-matches header span {
  color: var(--faint);
  font-size: 10px;
}

.recent-matches ol {
  display: grid;
  gap: 2px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.recent-matches li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #20232a;
}

.match-result {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.match-result.is-win {
  background: rgba(113, 231, 160, 0.11);
  color: var(--win);
}

.match-result.is-loss {
  background: rgba(255, 115, 135, 0.11);
  color: var(--loss);
}

.match-opponent {
  min-width: 0;
}

.match-opponent strong,
.match-opponent span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-opponent strong {
  font-size: 11px;
}

.match-opponent span {
  color: var(--faint);
  font-size: 9px;
}

.match-score {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.sample-note {
  margin: 24px 0 0;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, calc(100vw - 48px));
  padding: 11px 14px;
  border: 1px solid #5b4b94;
  border-radius: 10px;
  background: #171421;
  color: #ded8ff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-shell[data-loading="true"] .summary-item,
.app-shell[data-loading="true"] .podium-card,
.app-shell[data-loading="true"] tbody {
  opacity: 0.46;
}

.app-shell[data-loading="true"] .ranking-panel {
  position: relative;
}

.app-shell[data-loading="true"] .ranking-panel::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.045) 45%, transparent 65%);
  content: "";
  pointer-events: none;
  animation: loading-sweep 1.1s linear infinite;
}

@keyframes selection-lock {
  from {
    opacity: 0.2;
    transform: scaleY(0.2);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes title-arrive {
  from {
    clip-path: inset(0 50% 0 50%);
    filter: blur(7px);
    opacity: 0.45;
  }
  to {
    clip-path: inset(0 0 0 0);
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes corner-charge {
  from { opacity: 0.2; transform: scale(0.35); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes hero-sweep {
  0% { opacity: 0; transform: translateX(-70%) scaleX(0.28); }
  45% { opacity: 0.9; transform: translateX(0) scaleX(1); }
  100% { opacity: 0; transform: translateX(70%) scaleX(0.28); }
}

@keyframes mode-arrive {
  from { clip-path: inset(0 18% 0 18%); filter: blur(3px); opacity: 0.45; }
  to { clip-path: inset(0 0 0 0); filter: blur(0); opacity: 1; }
}

@keyframes summary-arrive {
  from { opacity: 0.35; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes podium-lock {
  from { opacity: 0.3; filter: blur(4px); transform: translateY(18px) scale(0.985); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes panel-arrive {
  from { opacity: 0.4; clip-path: inset(10% 0 0 0); filter: blur(3px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); }
}

@keyframes profile-arrive {
  from { opacity: 0.45; transform: translateX(14px); filter: blur(4px); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes mode-swap {
  from { opacity: 0.5; clip-path: inset(0 8% 0 8%); filter: blur(3px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); }
}

@keyframes row-enter {
  from {
    opacity: 0.35;
    filter: blur(3px);
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

@keyframes section-jump-lock {
  0% {
    box-shadow: inset 0 0 0 1px rgba(155, 130, 255, 0);
    filter: brightness(1);
  }
  24% {
    box-shadow: inset 0 0 0 1px rgba(155, 130, 255, 0.9);
    filter: brightness(1.16);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(155, 130, 255, 0);
    filter: brightness(1);
  }
}

@keyframes profile-scan {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(100% 0 0 0);
  }
}

@keyframes avatar-lock {
  0% {
    filter: brightness(1.35) blur(2px);
    transform: scale(0.92);
  }
  55% {
    filter: brightness(1.12) blur(0);
    transform: scale(1.035);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes value-lock {
  0% { color: var(--violet-bright); filter: blur(3px); }
  100% { color: var(--text); filter: blur(0); }
}

@keyframes match-enter {
  from {
    opacity: 0.35;
    clip-path: inset(0 0 0 18%);
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

@keyframes loading-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

@keyframes editor-reveal {
  from {
    opacity: 0.45;
    clip-path: inset(0 10% 0 10%);
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .profile-panel {
    position: relative;
    grid-column: 2;
    display: grid;
    grid-template-columns: 240px 1fr 1.1fr;
    gap: 24px;
    min-height: auto;
    margin: 0 clamp(18px, 2.2vw, 36px) 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .profile-heading,
  .profile-avatar,
  .profile-handle,
  .profile-team,
  .profile-rate,
  .profile-numbers {
    grid-column: 1;
  }

  .profile-avatar {
    width: 92px;
    height: 92px;
    margin: 2px auto 0;
  }

  .profile-rate {
    margin-top: 8px;
  }

  .recent-matches {
    grid-column: 2 / -1;
    grid-row: 1 / span 6;
    margin-top: 0;
    padding-left: 22px;
    border-left: 1px solid var(--line);
  }

  .sample-note {
    grid-column: 2 / -1;
    margin: 0;
    text-align: left;
  }
}

@media (max-width: 1040px) {
  .edit-data-button {
    width: 40px;
    padding: 0;
    border-radius: 12px;
  }

  .edit-data-button span {
    display: none;
  }

  .editor-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-item--primary {
    grid-column: 2;
    grid-row: 1;
  }

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

  .podium-card--gold {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .podium-card--silver,
  .podium-card--bronze {
    grid-row: 2;
  }
}

@media (max-width: 760px) {
  :root {
    --rail-width: 0px;
  }

  body {
    padding-bottom: 68px;
  }

  .app-shell {
    display: block;
  }

  .rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    display: block;
    width: auto;
    height: 68px;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(9, 10, 13, 0.98);
  }

  .brand-mark,
  .rail-season {
    display: none;
  }

  .rail-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    height: 100%;
    padding: 0;
  }

  html.is-admin .rail-nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .rail-link {
    min-height: 68px;
  }

  .rail-link::before {
    inset: auto 18px 0;
    width: auto;
    height: 2px;
  }

  .rail-link span {
    display: none;
  }

  .workspace {
    padding-inline: 14px;
  }

  .topbar {
    min-height: 66px;
    gap: 10px;
  }

  .mobile-brand {
    display: flex;
  }

  .mobile-brand span {
    display: none;
  }

  .search-field {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .search-field kbd,
  .live-state,
  .user-chip {
    display: none;
  }

  .hero {
    min-height: 170px;
    padding: 36px 20px 24px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 4.2rem);
  }

  .hero p {
    max-width: 32ch;
  }

  .hero-corner--tl,
  .hero-corner--bl {
    left: 4px;
  }

  .hero-corner--tr,
  .hero-corner--br {
    right: 4px;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .mode-switch {
    margin-bottom: 12px;
  }

  .data-editor {
    margin-bottom: 12px;
  }

  .editor-heading {
    align-items: flex-start;
    padding-inline: 16px;
  }

  .editor-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .editor-history-labels,
  .editor-history-row {
    grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 82px;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-item--primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .summary-item:last-child {
    grid-column: 1 / -1;
  }

  .podium {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    margin-inline: -14px;
    padding: 18px 14px 6px;
    scroll-snap-type: x mandatory;
  }

  .podium-card,
  .podium-card--gold {
    flex: 0 0 min(82vw, 360px);
    min-height: 126px;
    scroll-snap-align: center;
  }

  .podium-card--gold {
    order: -1;
  }

  .panel-heading {
    align-items: flex-start;
    padding-inline: 16px;
  }

  .panel-heading h2 {
    font-size: 24px;
  }

  .sample-badge {
    max-width: 84px;
    text-align: center;
  }

  .applicants-heading {
    padding-inline: 16px;
  }

  .applicants-list li {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding-inline: 16px;
  }

  .applicant-team {
    grid-column: 2;
  }

  .applicant-note {
    grid-column: 2 / -1;
  }

  .applicants-list time {
    grid-column: 3;
    grid-row: 1;
  }

  .profile-panel {
    display: block;
    margin: 0 14px 24px;
    padding: 20px;
  }

  .profile-avatar {
    margin-top: 24px;
  }

  .recent-matches {
    margin-top: 24px;
    padding-left: 0;
    border-left: 0;
  }

  .sample-note {
    margin-top: 18px;
    text-align: center;
  }
}

@media (max-width: 470px) {
  .applicants-heading {
    display: block;
  }

  .applicants-tools {
    justify-content: space-between;
    margin-top: 12px;
  }

  .applicants-list li {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .applicant-team,
  .applicant-note,
  .applicants-list time {
    grid-column: 2;
  }

  .applicants-list time {
    grid-row: auto;
    text-align: left;
  }

  .editor-heading p {
    max-width: 25ch;
  }

  .editor-form {
    display: block;
  }

  .editor-avatar,
  .editor-history {
    margin-top: 12px;
  }

  .editor-avatar {
    align-items: flex-start;
  }

  .editor-history-labels {
    display: none;
  }

  .editor-history-row {
    grid-template-columns: 64px minmax(0, 1fr);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .editor-history-row label:nth-child(3),
  .editor-history-row label:nth-child(4) {
    grid-column: 1 / -1;
  }

  .editor-field input,
  .editor-field select,
  .editor-history-row input,
  .editor-history-row select {
    font-size: 16px;
  }

  .editor-field + .editor-field {
    margin-top: 12px;
  }

  .editor-help,
  .editor-message {
    margin-top: 12px;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }

  .editor-actions button {
    width: 100%;
  }

  .editor-reset {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .summary-strip {
    display: block;
  }

  .summary-item + .summary-item {
    margin-top: 8px;
  }

  .summary-item:nth-child(2),
  .summary-item:nth-child(4) {
    display: none;
  }

  .top-actions {
    margin-left: 0;
  }

  .search-field input::placeholder {
    color: transparent;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
