:root {
  --bg: #050505;
  --text: #f5f5f5;
  --accent: #7522ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", Montserrat, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(117, 34, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #090909 0%, #020202 100%);
  color: var(--text);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card-shell {
  width: min(100%, 720px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.brand-tag {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
}

.input-label {
  display: block;
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.field-note {
  margin: -8px 0 2px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.62);
}

.check-form {
  display: grid;
  gap: 18px;
}

.text-input,
.code-input {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  padding: 18px 22px;
  color: var(--text);
  font: inherit;
  outline: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.text-input::placeholder,
.code-input::placeholder {
  color: rgba(255, 255, 255, 0.34);
  letter-spacing: 0.08em;
}

.text-input:focus,
.code-input:focus {
  border-color: rgba(117, 34, 255, 0.72);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 0 8px rgba(117, 34, 255, 0.16);
}

.code-input {
  border-radius: 999px;
  padding: 30px 36px;
  text-align: center;
  font-size: clamp(2rem, 6vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.check-button {
  border: 0;
  border-radius: 999px;
  padding: 18px 26px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, #8c4dff 0%, var(--accent) 100%);
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(117, 34, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.check-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(117, 34, 255, 0.34);
}

.result-message {
  min-height: 1.6em;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

.result-message.is-win {
  color: #8cffb5;
}

.result-message.is-lose {
  color: rgba(255, 255, 255, 0.76);
}

.result-message.is-error {
  color: #ff9292;
}

.admin-page {
  place-items: start center;
}

.admin-login-shell,
.admin-shell {
  width: min(100%, 1100px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.admin-login-shell {
  width: min(100%, 520px);
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-copy {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.74);
}

.admin-actions {
  display: flex;
  gap: 12px;
}

.admin-logout {
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.stat-value {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.admin-section + .admin-section {
  margin-top: 24px;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

.table-wrap {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px 18px;
  text-align: left;
}

.admin-table th {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  margin: 0;
  padding: 18px;
  color: rgba(255, 255, 255, 0.62);
}

@media (max-width: 640px) {
  .card-shell {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .code-input {
    padding: 22px 20px;
    font-size: clamp(1.4rem, 9vw, 2.4rem);
    letter-spacing: 0.12em;
  }

  .check-button {
    width: 100%;
  }

  .admin-shell {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .admin-login-shell {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .admin-header {
    flex-direction: column;
    align-items: start;
  }

  .admin-actions {
    width: 100%;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

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