:root {
  --bg: #07070a;
  --bg-2: #0d0d12;
  --bg-3: #14141c;
  --bg-4: #1a1a24;
  --red: #ff2d3d;
  --red-deep: #e11d2e;
  --red-dim: rgba(255, 45, 61, 0.14);
  --cyan: #22e1ff;
  --gold: #ffb800;
  --violet: #b44cff;
  --lime: #3dff8a;
  --silver: #c5c8d0;
  --bronze: #c47a3a;
  --text: #f3f3f8;
  --muted: #8b8b9a;
  --line: #23232f;
  --line-hot: rgba(255, 45, 61, 0.45);
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1200px;
  --chamfer: 14px;
  --gap: 1rem;
  --header-h: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255, 45, 61, 0.09), transparent 55%),
    radial-gradient(900px 420px at 0% 100%, rgba(34, 225, 255, 0.05), transparent 50%),
    var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #ff6d78;
}

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

::selection {
  background: var(--red);
  color: #fff;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

p {
  margin: 0 0 0.85rem;
}

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

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 1.5rem 0 3rem;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}

.page {
  animation: none;
}

.page-enter {
  animation: page-in 0.4s ease both;
}

.site-header,
.site-footer,
.toast-host,
.modal-backdrop,
.lightbox {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 7, 10, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 8px,
    #1a080b 8px 16px
  );
  background-size: 22px 22px;
  animation: hazard-slide 2.4s linear infinite;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

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

.brand img {
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.tagline {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-top: 0.28rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.2rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active {
  position: relative;
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.1rem;
  height: 2px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 6px,
    #1a080b 6px 12px
  );
  background-size: 16px 16px;
  animation: hazard-slide 1.4s linear infinite;
}

.account-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.account-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name:hover {
  color: var(--red);
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.22rem auto;
  background: var(--text);
}

.site-footer {
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 1.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.page-head {
  margin: 0 0 1.8rem;
}

.page-head h1 {
  margin-bottom: 0.55rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.section {
  margin-block: 2.4rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
}

.grid {
  display: grid;
  gap: 1.15rem;
}

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

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

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

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, 1rem);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, 0.75rem);
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1.15rem 1.2rem;
  clip-path: polygon(
    var(--chamfer) 0,
    100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%,
    0 var(--chamfer)
  );
  transition: border-color 0.2s ease, filter 0.2s ease;
}

.card:hover,
.card-link:hover {
  border-color: var(--line-hot);
  filter: drop-shadow(0 0 16px rgba(255, 45, 61, 0.16));
}

a.card,
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.stat-value,
.stat .num {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.btn:hover {
  color: var(--text);
  border-color: var(--red);
}

.btn-primary {
  background: var(--red-deep);
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(255, 45, 61, 0.22);
}

.btn-primary:hover {
  background: var(--red);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: #ff8a93;
}

.btn-danger:hover {
  background: var(--red-dim);
  color: #fff;
}

.btn-small {
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.tab {
  flex: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

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

.tab.is-active {
  color: var(--text);
  border-color: var(--red);
  box-shadow: inset 0 -3px 0 var(--red);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 10px,
    rgba(255, 45, 61, 0.08) 10px 20px
  );
  background-size: 28px 28px;
  animation: hazard-slide 3s linear infinite;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chip-fairyweight {
  color: #e3c2ff;
  border-color: var(--violet);
  background: rgba(180, 76, 255, 0.12);
}

.chip-antweight {
  color: #bff6ff;
  border-color: var(--cyan);
  background: rgba(34, 225, 255, 0.1);
}

.chip-beetleweight {
  color: #c8ffdf;
  border-color: var(--lime);
  background: rgba(61, 255, 138, 0.1);
}

.chip-hobbyweight {
  color: #ffe7a3;
  border-color: var(--gold);
  background: rgba(255, 184, 0, 0.1);
}

.chip-featherweight {
  color: #ffc1c6;
  border-color: var(--red);
  background: var(--red-dim);
}

.chip-type {
  color: var(--cyan);
  border-color: rgba(34, 225, 255, 0.35);
}

.table {
  width: 100%;
  overflow-x: auto;
}

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

.table th,
.table td,
table.table th,
table.table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th,
table.table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.board {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.board-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto auto minmax(5rem, 8rem);
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.board-row.rank-1 {
  border-color: rgba(255, 184, 0, 0.45);
  box-shadow: 0 0 22px rgba(255, 184, 0, 0.12);
  animation: pulse-gold 2.8s ease-in-out infinite;
}

.board-row.rank-2 {
  border-color: rgba(197, 200, 208, 0.35);
}

.board-row.rank-3 {
  border-color: rgba(196, 122, 58, 0.4);
}

.rank {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--muted);
}

.rank-1 {
  color: var(--gold);
}

.rank-2 {
  color: var(--silver);
}

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

.board-bot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.board-bot img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: var(--bg-4);
  flex: none;
}

.board-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.board-name:hover {
  color: var(--red);
}

.board-uni {
  color: var(--muted);
  font-size: 0.85rem;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.record {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.record .w {
  color: var(--lime);
}

.record .l {
  color: #ff6d78;
}

.record .d {
  color: var(--gold);
}

.bar {
  display: block;
  height: 6px;
  width: 100%;
  background: #1b1b24;
  overflow: hidden;
}

.bar::after {
  content: "";
  display: block;
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  max-width: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--gold));
}

.bot-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  clip-path: polygon(
    var(--chamfer) 0,
    100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%,
    0 var(--chamfer)
  );
  transition: border-color 0.2s ease, filter 0.2s ease;
}

.bot-card:hover {
  color: inherit;
  border-color: var(--line-hot);
  filter: drop-shadow(0 0 16px rgba(255, 45, 61, 0.16));
}

.bot-card-cover,
.bot-card-empty {
  aspect-ratio: 4 / 3;
  background: #101018;
}

.bot-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-card-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(255, 45, 61, 0.04) 18px 19px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 18px,
      rgba(255, 45, 61, 0.04) 18px 19px
    ),
    #101018;
}

.bot-card-body {
  padding: 0.9rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bot-card-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.bot-card-meta,
.bot-card-team {
  color: var(--muted);
  font-size: 0.88rem;
}

.photo-gallery {
  display: grid;
  gap: 0.85rem;
}

.photo-main {
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.photo-main img {
  width: 100%;
  height: auto;
}

.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-thumbs img,
.photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--bg-3);
}

.photo-thumbs img.is-active,
.photo-thumb.is-active {
  border-color: var(--red);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 86vh;
  width: auto;
  height: auto;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 40rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  background: #0a0a10;
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  outline: none;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-error {
  margin: 0;
  color: #ff8a93;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

input[type="file"] {
  width: 100%;
  padding: 0.6rem 0;
  color: var(--muted);
}

.dropzone {
  border: 1px dashed var(--line);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  background: rgba(13, 13, 18, 0.7);
}

.dropzone.is-over {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 225, 255, 0.06);
}

.alert {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--bg-2);
}

.alert-error {
  border-left-color: var(--red);
  background: rgba(255, 45, 61, 0.08);
}

.alert-ok {
  border-left-color: var(--lime);
  background: rgba(61, 255, 138, 0.08);
}

.alert-info {
  border-left-color: var(--cyan);
  background: rgba(34, 225, 255, 0.08);
}

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100% - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 0.9rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  animation: toast-in 0.25s ease;
}

.toast-ok {
  border-left-color: var(--lime);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-info {
  border-left-color: var(--cyan);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  width: min(32rem, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1.25rem 1.3rem 1.4rem;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  position: relative;
}

.modal-title {
  margin: 0 2.5rem 0.85rem 0;
  font-size: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.modal-close:hover {
  color: var(--text);
}

.skeleton,
.skeleton-list .skeleton {
  min-height: 4.5rem;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-4) 50%, var(--bg-2) 100%);
  background-size: 160% 100%;
  animation: shimmer 1.4s linear infinite;
  border: 1px solid var(--line);
}

.skeleton-list {
  display: grid;
  gap: 0.7rem;
}

.empty {
  text-align: center;
  padding: 2.4rem 1.2rem;
  border: 1px dashed var(--line);
  background: rgba(13, 13, 18, 0.6);
  color: var(--muted);
}

.empty h2 {
  color: var(--text);
}

.pill-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.pill-nav a,
.pill-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.pill-nav a.is-active,
.pill-nav button.is-active,
.pill-nav a:hover,
.pill-nav button:hover {
  background: var(--bg-4);
  color: var(--text);
}

.kv {
  display: grid;
  gap: 0.55rem 1.25rem;
  margin: 0;
}

.kv > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.6rem;
}

.kv dt {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kv dd {
  margin: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fight-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
}

.fight-win {
  border-left-color: var(--lime);
}

.fight-loss {
  border-left-color: var(--red);
}

.fight-draw {
  border-left-color: var(--gold);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.8rem, 5vw, 3.4rem) clamp(1.1rem, 3vw, 2rem);
  background:
    radial-gradient(600px 220px at 20% 20%, rgba(255, 45, 61, 0.2), transparent 60%),
    radial-gradient(500px 240px at 90% 80%, rgba(34, 225, 255, 0.1), transparent 55%),
    var(--bg-2);
  border: 1px solid var(--line);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: conic-gradient(from 180deg, transparent, rgba(255, 45, 61, 0.16), transparent 40%, rgba(34, 225, 255, 0.1), transparent 70%);
  animation: hero-glow 14s linear infinite;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: scan 7.5s linear infinite;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-ornament {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.spin-blade {
  animation: spin 18s linear infinite;
}

.hero-ornament.spin-blade {
  animation: spin-hero 18s linear infinite;
}

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}

.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  padding: 0.55rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  animation: marquee 36s linear infinite;
}

.photo-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-3);
  border: 1px solid var(--line);
  overflow: hidden;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.35rem;
  background: rgba(7, 7, 10, 0.78);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.4rem;
  align-items: start;
}

.hazard-edge {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 8px,
    #1a080b 8px 16px
  );
  background-size: 22px 22px;
  animation: hazard-slide 1.6s linear infinite;
}

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

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.notfound,
.forbidden {
  text-align: left;
}

noscript .alert {
  margin: 1rem auto;
  width: min(var(--wrap), calc(100% - 2rem));
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-glow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0% {
    top: -30%;
  }
  100% {
    top: 110%;
  }
}

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

@keyframes spin-hero {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes hazard-slide {
  to {
    background-position: 22px 0;
  }
}

@keyframes pulse-gold {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 28px rgba(255, 184, 0, 0.28);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  to {
    background-position: -160% 0;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 960px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .board-row {
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  }
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .site-nav,
  .account-slot {
    display: none;
    grid-column: 1 / -1;
  }

  .site-header.is-open .site-nav,
  .site-header.is-open .account-slot {
    display: flex;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.4rem;
  }

  .account-slot {
    justify-content: flex-start;
    padding-bottom: 0.9rem;
  }

  .hero-ornament {
    width: 96px;
    height: 96px;
    opacity: 0.18;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(var(--wrap), calc(100% - 1.25rem));
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .kv > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

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

  .tagline {
    max-width: 11.5rem;
  }

  .footer-inner {
    flex-direction: column;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.auth-page {
  display: flex;
  justify-content: center;
  padding-top: 1.25rem;
}

.auth-card {
  width: min(28rem, 100%);
}

.auth-card .form {
  max-width: none;
}

.pw-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

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

.photo-tile.is-pending {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.photo-tile .chip {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 1;
}

.join-code {
  font-family: var(--mono);
  letter-spacing: 0.12em;
  font-size: 1.05rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.choice input {
  width: auto;
}

.auth-wrap,
.auth-page {
  display: grid;
  place-items: center;
  min-height: min(68vh, 38rem);
  padding: 1rem 0 2rem;
}

.auth-card {
  width: min(28rem, 100%);
}

.pw-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.photo-tile > .chip {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 1;
}

.auth-card .form {
  max-width: none;
}

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

.field .row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.photo-tile.is-pending {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.photo-tile-label {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 1;
}

.card.is-selected {
  border-color: var(--red);
}

.join-code {
  font-family: var(--mono);
  letter-spacing: 0.1em;
  font-weight: 600;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0.3rem;
}

.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.picker-item:hover,
.picker-item.is-active {
  background: var(--bg-4);
}

.hero-copy {
  max-width: 40rem;
}

.board-secondary {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 960px) {
  .board-secondary {
    display: none;
  }
}
