:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7f3ea;
  --muted: #b8b1a4;
  --accent: #ffcf5a;
  --accent-2: #2fd4a7;
  --danger: #ff6b6b;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 207, 90, 0.18), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(47, 212, 167, 0.14), transparent 28%),
    linear-gradient(135deg, #111217 0%, #17110d 50%, #111419 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.shell {
  width: min(1220px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

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

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #17120a;
  font-weight: 900;
  background: linear-gradient(135deg, #ffe7a2, #ffb339 52%, #2fd4a7);
  box-shadow: 0 10px 34px rgba(255, 179, 57, 0.25);
}

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.user-chip strong {
  display: block;
  font-size: 13px;
}

.user-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: 22px;
  align-items: stretch;
}

.hero-panel,
.side-panel,
.login-panel,
.admin-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  min-height: 640px;
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 207, 90, 0.42);
  border-radius: 8px;
  color: #ffe7a2;
  background: rgba(255, 207, 90, 0.1);
  font-size: 13px;
}

.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #2fd4a7;
  box-shadow: 0 0 18px rgba(47, 212, 167, 0.9);
}

h1 {
  margin: 20px 0 10px;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy {
  width: min(660px, 100%);
  margin: 0;
  color: #d8d0c2;
  font-size: 17px;
  line-height: 1.8;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.stat {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.stat strong {
  display: block;
  font-size: 24px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.wheel-zone {
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: min(520px, 76%);
  aspect-ratio: 1;
  opacity: 0.24;
  filter: blur(1px);
  pointer-events: none;
}

.side-panel {
  padding: 24px;
}

.wheel-wrap {
  position: relative;
  width: min(420px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pointer {
  position: absolute;
  top: -3px;
  z-index: 5;
  width: 34px;
  height: 54px;
  background: linear-gradient(180deg, #fff7d9, #ffb23d);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.35));
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(#ffcf5a 0 30deg, #2fd4a7 30deg 90deg, #6366f1 90deg 160deg, #ec4899 160deg 230deg, #f97316 230deg 300deg, #64748b 300deg 360deg);
  border: 10px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 0 0 10px rgba(0, 0, 0, 0.12),
    0 26px 70px rgba(0, 0, 0, 0.48);
  transition: transform 5.2s cubic-bezier(0.08, 0.78, 0.08, 1);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff5d6 0 0, #ffcf5a 34%, #2c1d0b 35%, #151419 65%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.28);
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  transform-origin: 0 0;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.wheel-center {
  position: absolute;
  z-index: 4;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #21180a;
  font-weight: 900;
  background: linear-gradient(135deg, #fff7d8, #ffbd43);
  border: 8px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.primary-action {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  border-radius: 8px;
  color: #17120a;
  background: linear-gradient(135deg, #ffe9a8, #ffbc3f 54%, #2fd4a7);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(255, 188, 63, 0.24);
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notice {
  min-height: 42px;
  margin-top: 14px;
  color: #f4e5c1;
  font-size: 14px;
  line-height: 1.6;
}

.history-panel,
.admin-panel {
  margin-top: 22px;
  padding: 22px;
}

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

.panel-title h2 {
  margin: 0;
  font-size: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.tab.active {
  color: #18130b;
  background: var(--accent);
}

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

.table th,
.table td {
  padding: 11px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.table th {
  color: #e7dcc8;
  font-weight: 800;
}

.table td {
  color: #d8d0c2;
}

.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

.login-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  overflow: hidden;
}

.login-visual {
  min-height: 620px;
  padding: 42px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 207, 90, 0.26), rgba(47, 212, 167, 0.1)),
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, 0.18), transparent 20%);
}

.login-visual h1 {
  font-size: clamp(48px, 8vw, 92px);
}

.mini-wheel {
  position: absolute;
  right: -100px;
  bottom: -100px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: conic-gradient(#ffcf5a, #2fd4a7, #6366f1, #ec4899, #f97316, #ffcf5a);
  border: 16px solid rgba(255, 255, 255, 0.78);
  animation: idle-spin 18s linear infinite;
}

@keyframes idle-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-form {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  color: #eadfcf;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
}

.field textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: span 2;
}

.admin-prize {
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

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

.admin-prize-head strong {
  font-size: 15px;
}

.secondary-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid var(--line);
  cursor: pointer;
}

.danger-action {
  color: #ffe5e5;
  background: rgba(255, 107, 107, 0.14);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: 8px;
  color: #18130b;
  background: #ffcf5a;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-grid,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 500px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 22px, 1220px);
    padding-top: 16px;
  }

  .topbar,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel,
  .side-panel,
  .history-panel,
  .admin-panel,
  .login-form,
  .login-visual {
    padding: 18px;
  }

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

  .form-grid .wide {
    grid-column: span 1;
  }

  .table {
    min-width: 720px;
  }

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