:root {
  --yellow: #f7c948;
  --yellow-strong: #e4a900;
  --yellow-soft: #fff4c2;
  --white: #ffffff;
  --ink: #19130a;
  --muted: #6a5b33;
  --line: #eadca8;
  --shadow: 0 22px 60px rgba(130, 94, 10, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(247, 201, 72, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(247, 201, 72, 0.08) 1px, transparent 1px),
    var(--white);
  background-size: 54px 54px;
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
}

.page {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.registration-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 44px);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chess-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 31px;
  line-height: 1;
}

.site-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.registration-panel h1 {
  margin-bottom: 8px;
  color: var(--yellow-strong);
  font-family: "Segoe Script", "Marck Script", cursive;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  font-kerning: normal;
  text-rendering: geometricPrecision;
}

.registration-panel h2 {
  margin-bottom: 28px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
}

.register-form {
  display: grid;
  gap: 17px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 18px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 54px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fffdf4;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--yellow-strong);
  box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.24);
}

button {
  min-height: 58px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(228, 169, 0, 0.22);
}

button:hover {
  background: #ffd84f;
}

.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #e47d2b;
  border-radius: 8px;
  background: #fff1e6;
  color: #7d3100;
  font-weight: 700;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.participants-panel {
  padding: clamp(22px, 4vw, 38px);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.participants-panel h1 {
  margin-bottom: 8px;
  color: var(--yellow-strong);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
}

.counter {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 18px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
}

.search-form label span {
  font-size: 14px;
}

.search-form input,
.search-form button {
  min-height: 48px;
}

.search-form button {
  margin: 0;
  padding: 0 18px;
}

.clear-search {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.participants-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.participants-list li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
}

.participants-list li.me {
  border-color: var(--yellow-strong);
  background: linear-gradient(90deg, var(--yellow-soft), #fffdf4);
}

.participants-list li.empty {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.place {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 900;
}

.person {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.person strong,
.person span {
  overflow-wrap: anywhere;
}

.person strong {
  font-size: 18px;
}

.person span,
time {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.admin-page .registration-panel h1 {
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-add-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
}

.admin-add-form label span {
  font-size: 14px;
}

.admin-add-form input,
.admin-add-form button {
  min-height: 48px;
}

.inline-form {
  margin: 0;
}

.inline-form input {
  display: none;
}

button.danger {
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  background: #e34b4b;
  color: #fff;
  box-shadow: none;
}

button.danger:hover {
  background: #c92f2f;
}

@media (max-width: 640px) {
  .page {
    justify-content: flex-start;
    padding-top: 18px;
  }

  .registration-panel {
    padding: 22px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .site-note {
    text-align: right;
  }

  .participants-list li {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .participants-list time {
    grid-column: 2;
  }

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

  .search-form {
    grid-template-columns: 1fr;
  }

  .admin-list .inline-form {
    grid-column: 2;
  }
}

@media (max-width: 380px) {
  .registration-panel h1 {
    font-size: 38px;
  }

  .registration-panel h2 {
    font-size: 26px;
  }

  input,
  button {
    min-height: 52px;
  }
}
