.semi-shell {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2rem);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(7, 19, 50, 0.82), rgba(7, 19, 50, 0.98)),
    url("assets/game/admin-background.jpg") center / cover fixed;
}

.semi-page {
  display: grid;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.semi-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.semi-header h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  line-height: 0.95;
}

.semi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.semi-actions a,
.semi-actions button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 950;
  text-decoration: none;
}

.semi-card,
.semi-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.semi-card h2,
.semi-panel h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.semi-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.semi-selector a {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  min-height: 430px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.semi-selector strong {
  color: var(--gold);
  font-size: 2rem;
}

.semi-selector a em {
  align-self: end;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  color: #11172d;
  background: var(--gold);
  font-style: normal;
  font-weight: 950;
}

.semi-status {
  display: inline-grid;
  width: fit-content;
  min-height: 2rem;
  place-items: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 950;
}

.semi-status.open {
  color: #11172d;
  background: #59e989;
}

.semi-status.locked {
  color: #11172d;
  background: var(--gold);
}

.semi-card-country-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.8rem;
  margin: 0.25rem 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

@media (max-width: 1060px) {
  .semi-card-country-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.semi-card-country-list li {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.semi-country-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.semi-pick-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 76px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.semi-pick-row.selected {
  border-color: rgba(247, 201, 75, 0.8);
  background: rgba(247, 201, 75, 0.12);
}

.semi-pick-row.qualified {
  box-shadow: inset 4px 0 0 #59e989;
}

.semi-pick-row.not-qualified {
  opacity: 0.72;
}

.semi-pick-row > span:first-child {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: #11172d;
  background: var(--gold);
  font-weight: 950;
}

.semi-pick-row strong {
  display: block;
  font-size: 1.35rem;
}

.semi-pick-row small {
  display: block;
  color: var(--muted);
}

.semi-pick-row input {
  width: 1.45rem;
  height: 1.45rem;
  accent-color: var(--gold);
}

.semi-submit-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 19, 50, 0.96);
}

.semi-submit-bar strong {
  color: var(--blue);
}

.semi-limit-error {
  display: none;
  margin: 0.25rem 0 0;
  color: #ff8faf;
  font-weight: 950;
}

.semi-limit-error.show {
  display: block;
}

.semi-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.semi-table-shell {
  overflow-x: auto;
}

.semi-results-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.semi-results-table th,
.semi-results-table td {
  padding: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  text-align: center;
  vertical-align: middle;
}

.semi-results-table th {
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.semi-results-table th:first-child,
.semi-results-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 260px;
  text-align: left;
  background: rgba(7, 19, 50, 0.98);
}

.semi-results-table td:first-child small {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.25;
}

.semi-results-table tr.qualified td:first-child strong::after {
  content: " Q";
  color: #59e989;
}

.semi-mark {
  font-size: 1.35rem;
  font-weight: 950;
}

.semi-mark.correct {
  color: #59e989;
}

.semi-mark.selected {
  color: var(--gold);
}

.semi-mark.wrong {
  color: #ff8faf;
}

.semi-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.semi-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 950;
}

.semi-score-pill img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.semi-winner {
  color: var(--gold);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 950;
}

@media (max-width: 780px) {
  .semi-header {
    display: grid;
  }

  .semi-actions {
    justify-content: flex-start;
  }

  .semi-selector {
    grid-template-columns: 1fr;
  }

  .semi-submit-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .semi-table-shell {
    overflow-x: visible;
  }

  .semi-results-table,
  .semi-results-table thead,
  .semi-results-table tbody,
  .semi-results-table tr,
  .semi-results-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .semi-results-table thead {
    display: none;
  }

  .semi-results-table {
    border-collapse: separate;
    border-spacing: 0 0.85rem;
  }

  .semi-results-table tr {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
  }

  .semi-results-table tr.qualified {
    border-color: rgba(89, 233, 137, 0.7);
  }

  .semi-results-table th:first-child,
  .semi-results-table td:first-child {
    position: static;
    min-width: 0;
    padding: 0 0 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    background: transparent;
  }

  .semi-results-table td:not(:first-child) {
    display: inline-grid;
    width: auto;
    min-width: 4.65rem;
    margin: 0.55rem 0.35rem 0 0;
    padding: 0.4rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    text-align: center;
    vertical-align: top;
  }

  .semi-results-table td:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 950;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .semi-mark {
    min-height: 1.75rem;
  }
}
