:root {
  color-scheme: dark;
  --background: #070b0e;
  --surface: #10191e;
  --surface-raised: #152229;
  --text: #f3f7f8;
  --muted: #91a0a7;
  --accent: #05d8eb;
  --border: rgba(177, 213, 221, 0.13);
  font-family: "Segoe UI", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% -18%, rgba(0, 174, 205, 0.16), transparent 42rem),
    var(--background);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.passed-shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 28px 0;
}

.passed-header,
.brand,
.dashboard-heading,
.dashboard-actions,
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.passed-header {
  gap: 16px;
  margin-bottom: 32px;
}

.brand {
  justify-content: flex-start;
  gap: 12px;
  color: #b7c4c8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.brand strong {
  color: var(--text);
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #75858b;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(5, 216, 235, 0.45);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(5, 216, 235, 0.08);
  font-size: 18px;
}

.private-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #9eafb4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.private-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #43e89e;
  box-shadow: 0 0 10px rgba(67, 232, 158, 0.6);
}

.login-card,
.results-card,
.stat-card {
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 100% 0, rgba(5, 216, 235, 0.055), transparent 24rem),
    var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-card {
  width: min(100%, 460px);
  margin: 8vh auto;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 18px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.035em;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.description {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: #dce5e8;
  font-size: 12px;
  font-weight: 700;
}

.login-card input,
.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(169, 199, 207, 0.2);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #080f13;
}

.login-card input:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 216, 235, 0.1);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  color: #031114;
  background: linear-gradient(110deg, #24e6f0, #00c6dc);
}

.secondary-button {
  border: 1px solid var(--border);
  color: #d5dfe2;
  background: #111d23;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  filter: brightness(1.12);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-message,
.table-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ff9a8d;
  font-size: 12px;
}

.back-link {
  display: inline-block;
  margin-top: 17px;
  color: #9aabb1;
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.dashboard-heading {
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 24px;
}

.dashboard-heading .description {
  margin: 0;
}

.dashboard-actions {
  flex: 0 0 auto;
  gap: 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 12px;
}

.stat-card span {
  color: #89999f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.stat-card strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.stat-card.accepted strong {
  color: #43e89e;
}

.stat-card.failed strong {
  color: #ff8178;
}

.stat-card.in-progress strong {
  color: #f0c46a;
}

.results-card {
  overflow: hidden;
  border-radius: 14px;
}

.results-toolbar {
  gap: 20px;
  padding: 20px 22px 15px;
}

.table-status {
  margin: 5px 0 0;
  color: #84949a;
}

.search-box {
  width: min(100%, 260px);
}

.search-box input {
  height: 42px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 14px 22px;
  border-top: 1px solid rgba(177, 213, 221, 0.08);
  white-space: nowrap;
}

th {
  color: #84949a;
  background: rgba(5, 12, 15, 0.35);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

td {
  color: #c4cfd2;
  font-size: 12px;
}

tbody tr:hover {
  background: rgba(5, 216, 235, 0.035);
}

.nickname-cell {
  color: #f0f5f6;
  font-weight: 700;
}

.result-badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.is-accepted {
  color: #63edb0;
  background: rgba(67, 232, 158, 0.11);
}

.is-failed {
  color: #ff958d;
  background: rgba(255, 112, 95, 0.11);
}

.is-progress {
  color: #f0c46a;
  background: rgba(240, 196, 106, 0.11);
}

.empty-state {
  margin: 0;
  padding: 30px 20px;
  color: #84949a;
  font-size: 12px;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.passed-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  color: #718087;
  font-size: 10px;
}

.passed-footer span:first-child {
  color: #a1b0b5;
  font-weight: 800;
}

@media (max-width: 650px) {
  .passed-shell {
    width: min(100% - 22px, 540px);
    padding: max(14px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
  }

  .passed-header {
    margin-bottom: 22px;
  }

  .private-badge {
    padding: 8px 9px;
    font-size: 8px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions button {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    gap: 7px;
    padding: 13px 11px;
  }

  .stat-card span {
    font-size: 8px;
    line-height: 1.4;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 17px 15px 13px;
  }

  .search-box {
    width: 100%;
  }

  th,
  td {
    padding: 13px 15px;
  }

  .passed-footer {
    flex-direction: column;
    gap: 6px;
  }
}
