html:has(#site-admin[open]) { overflow: hidden; }
#site-admin[open] {
  position: fixed;
  box-sizing: border-box;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: radial-gradient(ellipse at top, #331b17, #151116 55%);
  color: #fff3e7;
  overflow: auto;
}
#site-admin [hidden], #giveaway-enter[hidden] { display: none !important; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(18px, 4vw, 64px);
  background: #1d1518f5;
  border-bottom: 1px solid #ffbb6e38;
}
#site-admin .admin-topbar form, .admin-topbar h2 { margin: 0; }
.admin-body { padding: 18px clamp(18px, 4vw, 64px) 40px; }
.admin-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 1942 / 809;
  max-height: 42dvh;
  overflow: hidden;
  background: #050509;
  border-radius: 16px;
  border: 1px solid #8974ab;
}
.admin-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.admin-banner img:not(:first-child) { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  #site-admin[open] .admin-banner img:nth-child(2) { animation: admin-banner-website 32s ease-in-out infinite; }
  #site-admin[open] .admin-banner img:nth-child(3) { animation: admin-banner-staff 32s ease-in-out infinite; }
  #site-admin[open] .admin-banner img:nth-child(4) { animation: admin-banner-management 32s ease-in-out infinite; }
}
@keyframes admin-banner-website {
  0%, 23%, 55%, 100% { opacity: 0; }
  27%, 52% { opacity: 1; }
}
@keyframes admin-banner-staff {
  0%, 48%, 80%, 100% { opacity: 0; }
  52%, 77% { opacity: 1; }
}
@keyframes admin-banner-management {
  0%, 73%, 100% { opacity: 0; }
  77%, 96% { opacity: 1; }
}
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.admin-heading h3 { margin: 4px 0; font-size: clamp(22px, 4vw, 34px); }
.admin-kicker { color: #f7b376; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.admin-live { color: #a7f6cb; white-space: nowrap; font-size: 13px; }
.admin-muted, .admin-service p { color: #d8c2b8; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.admin-service, #site-admin-form, #site-admin-grant {
  padding: 16px;
  background: #25191c;
  border: 1px solid #ffb87442;
  border-radius: 12px;
}
.admin-service h4 { margin: 5px 0; font-size: 20px; }
.admin-service p { margin: 6px 0; }
#site-admin-tournament { margin-top: 14px; }
#site-admin .admin-control { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-weight: 750; }
#site-admin .admin-switch {
  appearance: none;
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 52px;
  height: 27px;
  padding: 0;
  margin: 0;
  border: 1px solid #493333;
  border-radius: 99px;
  background: #251717;
  cursor: pointer;
}
#site-admin .admin-switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform .16s ease;
}
#site-admin .admin-switch:checked { background: #214736; border-color: #3e6352; }
#site-admin .admin-switch:checked::before { transform: translate(24px, -50%); }
#site-admin .admin-switch:disabled { opacity: .6; cursor: wait; }
#site-admin .admin-switch:focus-visible { outline: 2px solid #ffc681; outline-offset: 3px; }
#site-admin-status { min-height: 1.5em; color: #ffd2a5; }
[data-site-section][aria-disabled="true"] { opacity: .56; cursor: not-allowed; }

.admin-menu { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:16px; margin-bottom:24px; }
#site-admin .admin-menu-card { display:grid; gap:8px; align-content:center; min-height:124px; padding:18px 24px; text-align:left; color:#fff3e7; background:linear-gradient(145deg,#392425,#25191c); border:1px solid #ffb87455; border-radius:14px; cursor:pointer; }
#site-admin .admin-menu-card[aria-expanded="true"] { border-color:#ffc681; background:linear-gradient(145deg,#543326,#322023); }
#site-admin .admin-menu-card:focus-visible { outline:2px solid #ffc681; outline-offset:3px; }
.admin-menu-card strong { font-size:clamp(21px,3vw,30px); }
.admin-menu-card > span:last-child { color:#e4c5b4; }

.admin-staff-list { list-style:none; padding:0; display:grid; gap:10px; }
.admin-staff-list li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border:1px solid #ffb87442; border-radius:12px; background:#25191c; }
.admin-staff-list p { margin:4px 0 0; color:#e4c5b4; }
#site-admin .admin-staff-remove { min-width:40px; min-height:40px; padding:6px 12px; border:1px solid #f78383; border-radius:8px; background:#601f2a; color:#fff0ed; font-weight:800; cursor:pointer; }
.admin-staff-confirm { flex:1 0 100%; display:flex; flex-wrap:wrap; align-items:center; gap:10px; }

.admin-log-controls { display:flex; flex-wrap:wrap; gap:8px; }
.admin-log-controls [aria-pressed="true"] { outline:1px solid #ffc681; }
#admin-logs-list { display:grid; gap:8px; list-style:none; padding:0; }
#admin-logs-list li { display:grid; gap:4px; padding:12px 16px; border:1px solid #ffb87445; border-radius:9px; overflow-wrap:anywhere; }
#admin-logs-list span { color:#e4c5b4; font-size:.88rem; }
