:root {
  --bg-0: #07050f;
  --bg-1: #0f0a1a;
  --bg-2: #16102a;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;
  --lilac: #e9d5ff;
  --pink: #f0abfc;
  --accent: var(--purple-500);
  --accent-light: var(--purple-400);
  --accent-dark: var(--purple-700);
  --accent-glow: rgba(168, 85, 247, 0.45);
  --accent-soft: rgba(168, 85, 247, 0.14);
  --success: #34d399;
  --text: #faf5ff;
  --muted: #a78bfa;
  --muted-dim: #7c6a9e;
  --border: rgba(196, 181, 253, 0.12);
  --border-bright: rgba(216, 180, 254, 0.22);
  --panel: rgba(139, 92, 246, 0.06);
  --panel-solid: rgba(22, 16, 42, 0.72);
  --glass: rgba(255, 255, 255, 0.03);
  --item-h: 52px;
  --viewport-h: 200px;
  --name-item-h: 30px;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 15% -5%, rgba(147, 51, 234, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 10%, rgba(192, 132, 252, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(126, 34, 206, 0.22), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  height: 100vh;
  margin: 0 auto;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-header,
.page-header {
  position: relative;
  text-align: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.page-header-btn {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 20;
}

.site-logo {
  display: inline-block;
  height: 48px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 24px rgba(192, 132, 252, 0.35));
  transition: transform 0.2s ease, filter 0.2s ease;
}

a.site-logo-link {
  display: inline-block;
  line-height: 0;
}

a.site-logo-link:hover .site-logo {
  transform: scale(1.03);
  filter: drop-shadow(0 0 32px rgba(192, 132, 252, 0.5));
}

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

.topbar-compact .topbar-title h1 {
  font-size: 1.15rem;
}

.topbar-title h1 {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, var(--lilac) 45%, var(--purple-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-title p {
  color: var(--muted-dim);
  font-size: 0.9rem;
  margin-top: 4px;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--lilac);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.topbar-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--border-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.topbar-btn.primary {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(147, 51, 234, 0.35) 100%);
  border-color: rgba(192, 132, 252, 0.35);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.25);
}

.topbar-btn.primary:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(147, 51, 234, 0.45) 100%);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35);
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.layout-fit {
  max-height: 100%;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  body { height: auto; min-height: 100vh; overflow: auto; }
  .app { height: auto; overflow: visible; }
  .participants-panel { min-height: 280px; }
}

.card, .panel {
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.08) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card,
.participants-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.draw-card {
  padding: 16px;
}

.card { padding: 16px; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-shrink: 0;
}

.card-head h2 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--lilac);
  letter-spacing: -0.01em;
}

.status-pill {
  font-size: 0.68rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.status-pill.drawing {
  background: rgba(240, 171, 252, 0.12);
  color: var(--pink);
  border-color: rgba(240, 171, 252, 0.3);
  animation: pulse 1.5s ease infinite;
}

.status-pill.waiting {
  background: rgba(167, 139, 250, 0.08);
  color: var(--muted-dim);
  border-color: rgba(167, 139, 250, 0.15);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.reel-frame {
  position: relative;
  height: var(--viewport-h);
  background: linear-gradient(180deg, rgba(15, 10, 26, 0.95) 0%, rgba(22, 16, 42, 0.98) 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 60px rgba(124, 58, 237, 0.12),
    0 20px 50px rgba(0,0,0,0.4);
}

.reel-frame::before,
.reel-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 110px;
  z-index: 3;
  pointer-events: none;
}

.reel-frame::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(7, 5, 15, 0.98) 25%, transparent);
}

.reel-frame::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(7, 5, 15, 0.98) 25%, transparent);
}

.highlight-bar {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  height: var(--item-h);
  transform: translateY(-50%);
  border: 2px solid var(--purple-400);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(168,85,247,0.08), rgba(192,132,252,0.12), rgba(168,85,247,0.08));
  box-shadow:
    0 0 0 1px rgba(192,132,252,0.15),
    0 0 50px var(--accent-glow),
    inset 0 0 30px rgba(168, 85, 247, 0.06);
  z-index: 2;
  pointer-events: none;
}

.highlight-bar::before,
.highlight-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.highlight-bar::before {
  left: 8px;
  border-left: 10px solid var(--purple-400);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.highlight-bar::after {
  right: 8px;
  border-right: 10px solid var(--purple-400);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.reel-viewport {
  height: 100%;
  overflow: hidden;
  position: relative;
}

.reel-strip {
  position: relative;
  z-index: 0;
  will-change: transform;
}

.reel-item {
  height: var(--item-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: rgba(233, 213, 255, 0.45);
  padding: 0 56px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.reel-item.is-winner {
  color: #fff;
  text-shadow: 0 0 30px var(--accent-glow);
}

.reel-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted-dim);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px;
  z-index: 1;
}

.reel-placeholder.visible { display: flex; }

.reel-placeholder svg {
  opacity: 0.4;
  color: var(--purple-400);
}

.reel-placeholder strong { color: var(--purple-300); }

.draw-actions {
  margin-top: 12px;
  flex-shrink: 0;
}

.draw-btn {
  width: 100%;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 50%, #7e22ce 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(124, 58, 237, 0.45),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  letter-spacing: 0.06em;
  position: relative;
  overflow: hidden;
}

.draw-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.draw-btn:hover:not(:disabled)::before {
  transform: translateX(100%);
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}

.draw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.panel { padding: 14px; }

.participants-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.names-scroll {
  flex: 1;
  min-height: 0;
  position: relative;
}

.names-ticker {
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.names-ticker.is-empty .names-ticker-track {
  display: none;
}

.names-ticker-track {
  --ticker-duration: 120s;
  animation: namesTicker var(--ticker-duration) linear infinite;
  will-change: transform;
}

.names-ticker-track.paused {
  animation-play-state: paused;
}

@keyframes namesTicker {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.names-scroll .empty-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 0.82rem;
  pointer-events: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.panel-head h2 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--lilac);
}

.count-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  color: var(--purple-300);
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.text-input,
.search-input,
.bulk-area textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7, 5, 15, 0.5);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.text-input::placeholder,
.search-input::placeholder,
.bulk-area textarea::placeholder {
  color: var(--muted-dim);
}

.text-input:focus,
.search-input:focus,
.bulk-area textarea:focus {
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
  background: rgba(15, 10, 26, 0.8);
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--purple-400), var(--purple-600));
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-add:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.4);
}

.btn-add:disabled { opacity: 0.45; cursor: not-allowed; }

.bulk-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--muted-dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 12px;
  transition: color 0.15s;
}

.bulk-toggle:hover { color: var(--purple-300); }

.bulk-area {
  display: none;
  margin-bottom: 14px;
}

.bulk-area.open { display: block; }

.bulk-area textarea {
  height: 120px;
  resize: vertical;
  margin-bottom: 8px;
}

.bulk-area .hint {
  font-size: 0.78rem;
  color: var(--muted-dim);
  margin-bottom: 10px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  background: rgba(168, 85, 247, 0.1);
  color: var(--lilac);
  border: 1px solid var(--border);
}

.btn-block:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--border-bright);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.18) !important;
}

.search-wrap {
  margin-bottom: 12px;
  display: none;
}

.search-wrap.visible { display: block; }

.search-wrap.search-bottom {
  display: block;
  margin-bottom: 0;
  margin-top: 8px;
  flex-shrink: 0;
}

.search-input-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.participants-panel .names-list li {
  padding: 5px 9px;
  margin-bottom: 3px;
  font-size: 0.78rem;
  border-radius: 8px;
  min-height: var(--name-item-h);
}

.participants-panel .names-list li .index {
  font-size: 0.65rem;
  min-width: 24px;
}

.names-list {
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}

.names-scroll .names-list {
  max-height: none;
  overflow: visible;
}

.names-list.compact { max-height: 520px; }

.names-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 5px;
  background: rgba(7, 5, 15, 0.35);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  transition: all 0.15s ease;
}

.names-list li:hover {
  border-color: var(--border-bright);
  background: rgba(168, 85, 247, 0.08);
}

.names-list li .index {
  color: var(--purple-500);
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 28px;
  opacity: 0.8;
}

.names-list li .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--lilac);
}

.names-list li .remove {
  background: none;
  border: none;
  color: var(--purple-400);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 8px;
  flex-shrink: 0;
  margin-left: auto;
  transition: all 0.15s;
}

.names-list li .remove:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #fff;
}

.empty-msg {
  color: var(--muted-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 28px 12px;
}

.names-scroll .empty-msg {
  padding: 40px 12px;
}

.panel-footer {
  margin-top: 14px;
  display: none;
}

.panel-footer.visible { display: block; }

.panel-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple-400);
  text-decoration: none;
  transition: color 0.15s;
}

.panel-link:hover { color: var(--lilac); }

.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 5, 15, 0.88);
  backdrop-filter: blur(12px);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.result-overlay.show { display: flex; }

.result-box {
  background: linear-gradient(160deg, rgba(30, 20, 55, 0.95) 0%, rgba(15, 10, 26, 0.98) 100%);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 24px;
  padding: 48px 52px;
  text-align: center;
  max-width: 520px;
  width: 100%;
  box-shadow:
    0 32px 90px rgba(0,0,0,0.55),
    0 0 80px rgba(124, 58, 237, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.08);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-box .label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-400);
  margin-bottom: 14px;
}

.result-box .winner {
  font-size: clamp(1.85rem, 5vw, 2.6rem);
  font-weight: 800;
  word-break: break-word;
  letter-spacing: -0.03em;
}

.result-box .winner span {
  background: linear-gradient(135deg, #fff 0%, var(--lilac) 40%, var(--purple-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-box button {
  margin-top: 30px;
  padding: 13px 40px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.result-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.5);
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(22, 16, 42, 0.95);
  border: 1px solid var(--border-bright);
  color: var(--lilac);
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(124, 58, 237, 0.15);
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 250;
}

@keyframes popIn {
  from { transform: scale(0.88) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Admin page */
.admin-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.admin-login .site-header {
  margin-bottom: 0;
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px;
}

.admin-login-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #fff, var(--lilac));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-login-form .admin-label {
  margin-bottom: 0;
}

.admin-login-form .search-input {
  width: 100%;
  margin-bottom: 4px;
}

.admin-login-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 50%, #7e22ce 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(124, 58, 237, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-login-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.admin-login-submit:hover::before {
  transform: translateX(100%);
}

.admin-login-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 32px rgba(124, 58, 237, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.admin-login-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.admin-login-hint {
  font-size: 0.88rem;
  color: var(--muted-dim);
  margin-bottom: 22px;
  line-height: 1.5;
}

.admin-login-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.admin-login-error.show {
  display: block;
}

.admin-login[hidden],
.admin-page[hidden] {
  display: none !important;
}

.admin-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.admin-page .site-header {
  margin-bottom: 0;
}

.admin-card {
  width: 100%;
  max-width: 460px;
  padding: 36px;
}

.admin-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-300);
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.admin-card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, var(--lilac));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-hint {
  font-size: 0.88rem;
  color: var(--muted-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}

.admin-status {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.admin-status.active {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: var(--purple-300);
}

.admin-status.random {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--muted-dim);
}

.admin-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--lilac);
}

.names-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.name-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.name-option:last-child { border-bottom: none; }
.name-option:hover { background: rgba(168, 85, 247, 0.08); }
.name-option.selected { background: rgba(168, 85, 247, 0.15); }

.name-option input {
  accent-color: var(--purple-500);
  width: 16px;
  height: 16px;
}

.name-option span {
  font-size: 0.92rem;
  color: var(--lilac);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-list {
  padding: 28px;
  text-align: center;
  color: var(--muted-dim);
  font-size: 0.88rem;
}

.admin-buttons {
  display: flex;
  gap: 10px;
}

.admin-buttons button {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-save {
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.btn-clear {
  background: rgba(255,255,255,0.05);
  color: var(--lilac);
  border: 1px solid var(--border);
}

.btn-clear:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--border-bright);
}

.admin-back {
  display: block;
  text-align: center;
  margin-top: 24px;
  color: var(--muted-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

.admin-back:hover { color: var(--purple-300); }

.names-page .layout {
  grid-template-columns: 1fr;
  max-width: 560px;
  margin: 0 auto;
}
