:root {
  color-scheme: dark;
  --bg: #0a1015;
  --bg-2: #0e1b22;
  --bg-3: #14232c;
  --surface: rgba(16, 27, 33, 0.78);
  --surface-strong: rgba(18, 32, 40, 0.92);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #ecf2f6;
  --muted: #96a7b3;
  --accent: #75e39e;
  --accent-strong: #34c27b;
  --good: #62e58b;
  --bad: #ff6565;
  --warn: #f3c067;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(1100px 700px at 15% 0%, #163040 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #1a2c36 0%, transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

.noise {
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 2px,
    transparent 2px,
    transparent 12px
  );
  opacity: 0.12;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.shell {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0a1218;
  font-family: "Bebas Neue", sans-serif;
  font-size: 26px;
  letter-spacing: 0.06em;
}

.brand-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 28px;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: 0.08em;
  margin: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(117, 227, 158, 0.14);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  padding: 18px 20px;
  min-height: 150px;
  display: grid;
  gap: 12px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  animation: rise 0.5s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(117, 227, 158, 0.4);
}

.card h3 {
  margin: 0;
  font-size: 20px;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.card .card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--surface-strong);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  padding: 24px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3);
  animation: fade 0.4s ease;
}

.access-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.access-panel .cross {
  margin: 18px auto;
}

.access-actions {
  margin-top: auto;
}

.panel + .panel {
  margin-top: 16px;
}

.btn,
.btn-outline,
.btn-ghost,
.btn-danger {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #091318;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
.btn-outline:hover,
.btn-ghost:hover,
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(117, 227, 158, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--stroke);
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ff8b8b, #ff5d5d);
  color: #2b0f0f;
  border-color: rgba(255, 101, 101, 0.4);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.notice {
  margin-top: 14px;
  color: var(--warn);
}

.progress {
  color: var(--muted);
  font-size: 14px;
}

.question-text {
  margin: 14px 0 16px;
  font-size: 18px;
  white-space: pre-wrap;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: border-color 0.2s ease;
}

.choice input {
  margin-top: 2px;
}

.choice.selected {
  border-color: rgba(117, 227, 158, 0.4);
}

.choice.correct {
  border-color: rgba(98, 229, 139, 0.5);
  background: rgba(98, 229, 139, 0.12);
}

.choice.incorrect {
  border-color: rgba(255, 101, 101, 0.5);
  background: rgba(255, 101, 101, 0.12);
}

.result-title {
  font-size: 24px;
  margin: 0 0 8px;
}

.result-line {
  color: var(--warn);
  font-size: 14px;
  margin-top: 8px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 20px;
}

.admin-nav a,
.admin-nav button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.admin-nav .active {
  color: var(--text);
  border-color: rgba(117, 227, 158, 0.4);
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table th {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.tag.good {
  background: rgba(98, 229, 139, 0.2);
  color: var(--good);
}

.tag.bad {
  background: rgba(255, 101, 101, 0.2);
  color: var(--bad);
}

.tag.warning {
  background: rgba(243, 192, 103, 0.2);
  color: var(--warn);
}

.form {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(8, 14, 18, 0.8);
  color: var(--text);
}

.blocked {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.cross {
  width: 120px;
  height: 120px;
  margin: 20px auto 0;
  position: relative;
}

.cross::before,
.cross::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--bad);
  transform-origin: center;
  animation: cross 2.6s ease-in-out infinite;
}

.cross::before {
  --rot: 45deg;
  transform: translateY(-50%) rotate(var(--rot)) scaleX(0.2);
}

.cross::after {
  --rot: -45deg;
  transform: translateY(-50%) rotate(var(--rot)) scaleX(0.2);
  animation-delay: 0.2s;
}

.empty {
  padding: 24px 0;
  color: var(--muted);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cross {
  0% {
    opacity: 0.4;
    transform: translateY(-50%) rotate(var(--rot)) scaleX(0.25);
  }
  45% {
    opacity: 1;
    transform: translateY(-50%) rotate(var(--rot)) scaleX(1);
  }
  100% {
    opacity: 0.4;
    transform: translateY(-50%) rotate(var(--rot)) scaleX(0.25);
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 22px 16px 60px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .card {
    min-height: 0;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 10, 0.72);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.modal-card {
  width: min(420px, 90vw);
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  animation: fade 0.3s ease;
}

.modal-card .result-title {
  margin-top: 8px;
}

.modal-card .form {
  margin-top: 16px;
}

.modal-card .notice {
  margin-top: 10px;
}
