@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-latin.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-cyrillic.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0400-045F;
}

:root {
  color-scheme: dark;
  --background: #121215;
  --surface: #1b1b20;
  --field: #141418;
  --text: #f5f1e8;
  --muted: #bcb8b0;
  --line: #3e3c43;
  --field-line: #65616a;
  --gold: #f1c65d;
  --gold-light: #ffe09a;
  --gold-dark: #79561d;
  --danger: #ffada4;
  --pixel-font: "Press Start 2P", "Courier New", monospace;
  font: 16px/1.55 system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #101012; }

.header-inner {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--gold);
  font: .72rem/1.4 var(--pixel-font);
  text-decoration: none;
  white-space: nowrap;
}

.brand img { display: block; border: 1px solid #49423b; }
.header-actions { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.language-selector { display: flex; border: 1px solid var(--line); }
.language-selector button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 .45rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: 700 .875rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.language-selector button:hover { color: var(--gold-light); }
.language-selector button[aria-pressed="true"] { color: #241908; background: var(--gold); }
.header-link {
  color: var(--muted);
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
  text-underline-offset: .35em;
}
.header-link:hover { color: var(--gold-light); text-decoration: underline; }

.hero {
  background:
    radial-gradient(ellipse at 78% 65%, #302820a6 0%, transparent 67%),
    radial-gradient(#77717c2e 1px, transparent 1px) 0 0 / 12px 12px,
    #151518;
  border-bottom: 1px solid var(--gold-dark);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.4fr);
  align-items: center;
  gap: clamp(24px, 4vw, 70px);
  padding-block: clamp(52px, 6vw, 92px);
}

.hero-copy { min-width: 0; }
.hero-mark {
  width: max-content;
  margin-bottom: 1.55rem;
  border: 1px solid #75624a;
  box-shadow: 4px 4px 0 #332a1c;
}
.hero-mark img { display: block; }
.eyebrow {
  margin: 0 0 .85rem;
  color: var(--gold-light);
  font: 700 .875rem/1.5 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.hero h1 {
  margin: 0 0 1.85rem;
  color: var(--text);
  font: clamp(2rem, 4.1vw, 3.9rem)/1.2 var(--pixel-font);
  text-shadow: 0 4px 0 #463524;
}

.arena {
  --corner: 16px;
  position: relative;
  padding: 8px;
  min-width: 0;
  background:
    linear-gradient(var(--gold), var(--gold)) left top / var(--corner) 2px,
    linear-gradient(var(--gold), var(--gold)) left top / 2px var(--corner),
    linear-gradient(var(--gold), var(--gold)) right bottom / var(--corner) 2px,
    linear-gradient(var(--gold), var(--gold)) right bottom / 2px var(--corner),
    #4d4030;
  background-repeat: no-repeat;
  box-shadow: 8px 8px 0 #09090b;
}

.arena img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #121215;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .65rem 1.25rem;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.primary {
  background: var(--gold);
  color: #241908;
  border-color: #fbe098 #9e7228 #9e7228 #fbe098;
  box-shadow: 4px 4px 0 var(--gold-dark);
}
.primary:hover { background: var(--gold-light); }
.primary:active:not(:disabled) { translate: 2px 2px; box-shadow: 2px 2px 0 var(--gold-dark); }
.secondary { color: var(--text); background: #292830; border-color: #55515d; }
.secondary:hover { background: #36343e; }
.button:disabled { opacity: .58; cursor: default; }

.registration {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.4fr);
  align-items: start;
  gap: clamp(24px, 4vw, 70px);
  padding-block: clamp(48px, 6vw, 90px);
  scroll-margin-top: 1rem;
}
.section-intro h2, .admin-page h1 {
  margin: 0;
  font: clamp(1.05rem, 2.45vw, 2.1rem)/1.6 var(--pixel-font);
}
.section-intro h2::before, .admin-page h1::before {
  content: "";
  display: block;
  width: 26px;
  height: 6px;
  margin-bottom: 1.1rem;
  background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 10px);
}
.section-intro p { color: var(--muted); max-width: 24rem; }

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 5px 5px 0 #0b0b0d;
}
.form {
  padding: clamp(20px, 3vw, 38px);
  border-top: 2px solid #8d713e;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
label { display: grid; gap: .45rem; font-weight: 650; font-size: .94rem; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: .55rem .75rem;
  border: 1px solid var(--field-line);
  border-radius: 0;
  background: var(--field);
  color: var(--text);
  font: 1rem/1.3 system-ui, sans-serif;
}
input::placeholder { color: #9e99a4; }
select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}
.contact-fields { grid-column: 1 / -1; margin: 0; min-width: 0; padding: 0; border: 0; }
.contact-fields legend { padding: 0; margin-bottom: .6rem; font-weight: 800; }
.hint { margin: 1rem 0 1.25rem; color: var(--muted); font-size: .9rem; }
.form-status { margin: 1rem 0 0; }
.form-status:empty { margin: 0; }
.form-status[data-kind="success"] { color: var(--gold-light); }
.form-status[data-kind="error"] { color: var(--danger); }

.site-footer { padding-block: 24px; border-top: 1px solid var(--line); }
.admin-page { padding-block: clamp(42px, 7vw, 88px); }
.admin-page h1 { margin-bottom: 1.4rem; }
.admin-page > .form-status:not(:empty) { margin-block: 1rem; }
.login { width: min(100%, 430px); }
.login .button { margin-top: 1rem; }
.toolbar, .pager { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; }
.toolbar label { min-width: 0; }
.applications { list-style: none; padding: 0; display: grid; gap: 12px; }
.application {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(135px, 210px);
  align-items: start;
  gap: 20px;
}
.application h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.application p { margin: .3rem 0; color: var(--muted); overflow-wrap: anywhere; }
.application a { color: var(--gold-light); text-underline-offset: 4px; }
.application time { color: var(--muted); font-size: .9rem; }

@media (max-width: 940px) {
  .wrap { width: calc(100% - 56px); }
  .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .registration { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}

@media (max-width: 720px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .hero-mark img { width: 70px; height: 70px; }
  .hero h1 { font-size: clamp(2.1rem, 7vw, 3.25rem); }
}

@media (max-width: 640px) {
  .site-nav a[href="#registration"] { display: none; }
}

@media (max-width: 530px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; gap: .75rem; }
  .brand { gap: .5rem; font-size: .7rem; }
  .brand img { width: 34px; height: 34px; }
  .hero-layout { padding-block: 34px; }
  .hero-mark { margin-bottom: 1.15rem; }
  .hero h1 { margin-bottom: 1.5rem; }
  .arena { padding: 5px; box-shadow: 5px 5px 0 #09090b; }
  .form-grid, .application { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .site-header .brand span { display: none; }
}
