:root {
  --bg: #050810;
  --surface: rgba(12, 18, 31, 0.86);
  --surface-soft: rgba(255, 255, 255, 0.036);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7fd;
  --text-muted: #98a7c0;
  --text-dim: #65758f;
  --accent: #ff5e2b;
  --accent-2: #ff9c38;
  --accent-deep: #b8340c;
  --accent-glow: rgba(255, 94, 43, 0.34);
  --mint: #00e5a3;
  --mint-soft: rgba(0, 229, 163, 0.14);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, 0.14);
  --red: #ff5c6c;
  --red-soft: rgba(255, 92, 108, 0.14);
  --cyan: #38bdf8;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 3D Background Stage */
.bg-3d-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

.bg-perspective-floor {
  position: fixed;
  left: -25%;
  right: -25%;
  bottom: -24vh;
  height: 62vh;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 94, 43, 0.12) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(680px) rotateX(68deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85) 10%, transparent 92%);
  animation: floorDrift 16s linear infinite;
  z-index: 0;
}

@keyframes floorDrift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 0 46px, 0 0;
  }
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -90px;
  background: rgba(255, 94, 43, 0.2);
}

.bg-glow-2 {
  width: 420px;
  height: 420px;
  bottom: -140px;
  right: -70px;
  background: rgba(56, 189, 248, 0.15);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  perspective: 1400px;
}

.app-shell.public-shell {
  max-width: 720px;
  min-height: 100vh;
  justify-content: center;
}

.center-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

.center-stage > .panel {
  width: 100%;
}

.admin-login-card {
  max-width: 460px;
  margin: 24px auto;
}

/* 3D Tilt Surfaces */
.tilt-surface {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
  will-change: transform;
}

.panel-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.09),
    transparent 58%
  );
  transition: opacity 0.24s ease;
  z-index: 0;
}

.tilt-surface:hover .panel-glare {
  opacity: 1;
}

/* Header & 3D Custom Logo */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-color: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 0 rgba(5, 9, 16, 0.45),
    0 22px 46px rgba(0, 0, 0, 0.48);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateZ(14px);
}

.brand-logo-stage {
  perspective: 460px;
  flex-shrink: 0;
}

.brand-logo-3d {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  padding: 3px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px var(--accent-glow);
  animation: logoFloat3D 5.5s ease-in-out infinite;
  overflow: hidden;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  background: #090d14;
  display: block;
}

.brand-logo-fallback {
  width: 26px;
  height: 26px;
  color: #090d14;
}

@keyframes logoFloat3D {
  0%,
  100% {
    transform: rotateY(-10deg) rotateX(6deg) translateY(0);
  }
  50% {
    transform: rotateY(12deg) rotateX(-5deg) translateY(-2px);
  }
}

.brand-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 14px rgba(255, 94, 43, 0.28);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 94, 43, 0.16);
  color: var(--accent-2);
  border: 1px solid rgba(255, 94, 43, 0.38);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateZ(14px);
}

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 5px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.16s ease;
}

.nav-pill-btn svg {
  width: 14px;
  height: 14px;
}

.nav-pill-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.nav-pill-btn.danger:hover {
  color: var(--red);
  border-color: rgba(255, 92, 108, 0.45);
}

.nav-pill-btn.getkey-nav-btn {
  color: var(--accent-2);
  border-color: rgba(255, 94, 43, 0.34);
  background: rgba(255, 94, 43, 0.1);
}

.nav-pill-btn.getkey-nav-btn:hover {
  color: #ffd2a8;
  border-color: rgba(255, 94, 43, 0.6);
  background: rgba(255, 94, 43, 0.18);
}

/* Panels */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr);
  gap: 22px;
  align-items: start;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-color: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 12px 0 rgba(6, 10, 18, 0.55),
    0 26px 56px rgba(0, 0, 0, 0.48);
}

.panel > *:not(.panel-glare) {
  position: relative;
  z-index: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head.compact {
  margin-bottom: 15px;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 94, 43, 0.2), rgba(255, 156, 56, 0.06));
  border: 1px solid rgba(255, 94, 43, 0.36);
  color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px rgba(255, 94, 43, 0.16);
  flex-shrink: 0;
}

.section-icon.subtle {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.04));
  border-color: rgba(56, 189, 248, 0.28);
  color: var(--cyan);
}

.section-icon svg {
  width: 18px;
  height: 18px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 1.07rem;
  font-weight: 700;
}

.panel-head p {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Form */
.field-group {
  margin-bottom: 20px;
}

.field-group.compact-mb {
  margin-bottom: 14px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.field-label-row label,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.mini-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-label-row label svg {
  width: 15px;
  height: 15px;
  color: var(--accent-2);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.uid-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(4, 7, 14, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px 8px 6px 14px;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.uid-input-wrap.slim {
  padding: 4px 12px;
}

.uid-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 94, 43, 0.18);
}

.uid-input-wrap.invalid {
  border-color: var(--red);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 92, 108, 0.18);
}

.uid-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  flex-shrink: 0;
}

.uid-prefix svg {
  width: 17px;
  height: 17px;
}

.uid-input-wrap input,
.clean-select {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 8px 0;
  outline: none;
}

.uid-input-wrap.slim input,
.clean-select {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: normal;
}

.clean-select option {
  background: #0c121f;
  color: var(--text);
}

.uid-input-wrap input::placeholder {
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: normal;
  font-size: 0.9rem;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 7px 11px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(0, 0, 0, 0.28);
  transition: all 0.16s ease;
}

.icon-btn.icon-only {
  padding: 7px;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-right: 2px;
}

.chip-label svg {
  width: 12px;
  height: 12px;
}

.uid-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.uid-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 94, 43, 0.14);
  transform: translateY(-1px);
}

/* 3D Region Selector Grid + Country Flags */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 11px;
  perspective: 900px;
}

.region-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-bottom-color: rgba(255, 255, 255, 0.04);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transform-style: preserve-3d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 5px 0 rgba(4, 7, 13, 0.6),
    0 10px 20px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.region-card:hover {
  transform: translateY(-3px) rotateX(6deg);
  border-color: var(--border-strong);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 0 rgba(4, 7, 13, 0.65),
    0 16px 26px rgba(0, 0, 0, 0.36);
}

.region-card:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(4, 7, 13, 0.65),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.region-card.active {
  border-color: var(--accent);
  background: linear-gradient(150deg, rgba(255, 94, 43, 0.22), rgba(255, 156, 56, 0.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 160, 0.25),
    0 5px 0 rgba(120, 35, 8, 0.72),
    0 12px 26px rgba(255, 94, 43, 0.22);
}

.region-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.region-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
}

/* Country Flag Badges */
.flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 19px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.44);
  flex-shrink: 0;
}

.flag-badge.sm {
  width: 20px;
  height: 14px;
  border-radius: 3px;
}

.flag-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.region-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #090d14;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.16s ease;
}

.region-check svg {
  width: 11px;
  height: 11px;
}

.region-card.active .region-check {
  opacity: 1;
  transform: scale(1);
}

.region-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 3D Tactile Submit CTA */
.submit-btn.btn-3d {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #090d14;
  font-family: var(--font-sans);
  font-size: 0.99rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 6px 0 var(--accent-deep),
    0 14px 32px var(--accent-glow);
  transition: transform 0.12s ease, filter 0.18s ease, box-shadow 0.12s ease;
}

.submit-btn.btn-3d.compact-btn {
  padding: 12px 18px;
  font-size: 0.92rem;
}

.submit-btn.btn-3d:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 8px 0 var(--accent-deep),
    0 18px 38px rgba(255, 94, 43, 0.42);
}

.submit-btn.btn-3d:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 0 var(--accent-deep),
    0 6px 16px rgba(255, 94, 43, 0.25);
}

.submit-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.btn-content svg {
  width: 18px;
  height: 18px;
}

/* Progress banner */
.progress-banner {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-banner[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(56, 189, 248, 0.22);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.progress-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.progress-text strong {
  font-size: 0.88rem;
  color: var(--text);
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan);
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
}

.timer-badge svg {
  width: 13px;
  height: 13px;
}

/* Result card */
.result-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(6, 10, 18, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 32px rgba(0, 0, 0, 0.42);
  animation: slideUp 0.24s ease;
}

.result-card[hidden] {
  display: none;
}

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

.result-card.success {
  border-color: rgba(0, 229, 163, 0.44);
}

.result-card.warn {
  border-color: rgba(245, 185, 66, 0.44);
}

.result-card.error {
  border-color: rgba(255, 92, 108, 0.45);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
}

.result-badge-icon {
  display: inline-flex;
}

.result-badge-icon svg {
  width: 14px;
  height: 14px;
}

.result-card.warn .result-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.result-card.error .result-badge {
  background: var(--red-soft);
  color: var(--red);
}

.result-elapsed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.result-elapsed svg {
  width: 13px;
  height: 13px;
}

.player-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.player-banner[hidden] {
  display: none;
}

.player-avatar {
  width: 46px;
  height: 46px;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: #090d14;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  flex-shrink: 0;
}

.player-meta {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.77rem;
  color: var(--text-muted);
}

.player-sub code {
  font-family: var(--font-mono);
  color: var(--text);
}

.copy-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.copy-mini-btn svg {
  width: 11px;
  height: 11px;
}

.copy-mini-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.srv-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 94, 43, 0.14);
  color: var(--accent-2);
}

.srv-flag {
  display: inline-flex;
}

.likes-delta {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--mint);
  background: var(--mint-soft);
  padding: 7px 12px;
  border-radius: 10px;
  flex-shrink: 0;
}

.result-card.warn .likes-delta {
  color: var(--amber);
  background: var(--amber-soft);
}

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

.stats-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid[hidden] {
  display: none;
}

.stat-box {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stat-label svg {
  width: 12px;
  height: 12px;
  color: var(--text-dim);
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.stat-val.accent {
  color: var(--mint);
}

.result-message {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.result-message[hidden] {
  display: none;
}

/* Modal (Please enter key) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.16s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(13, 19, 33, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 0 rgba(4, 7, 13, 0.6),
    0 28px 64px rgba(0, 0, 0, 0.65);
  animation: slideUp 0.2s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-head p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-head > button {
  margin-left: auto;
}

.modal-error {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 92, 108, 0.35);
  color: #ffd5da;
  font-size: 0.82rem;
}

.modal-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .submit-btn {
  flex: 1;
}

/* Admin Dashboard Components */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  padding: 16px 18px;
}

.kpi-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.kpi-val.accent {
  color: var(--mint);
}

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

.generated-key-box {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 229, 163, 0.42);
  background: rgba(0, 229, 163, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.generated-key-box[hidden] {
  display: none;
}

.generated-key-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.generated-key-meta span {
  font-size: 0.74rem;
  color: var(--mint);
  font-weight: 600;
}

.generated-key-meta code {
  font-family: var(--font-mono);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
}

.keys-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 12px;
}

.keys-toolbar h3 {
  margin: 0;
  font-size: 0.98rem;
}

.search-wrap {
  min-width: 210px;
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.key-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-code-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.key-code-line code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.key-status-pill {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.key-status-pill.active {
  background: var(--mint-soft);
  color: var(--mint);
}

.key-status-pill.revoked {
  background: var(--red-soft);
  color: var(--red);
}

.key-status-pill.expired,
.key-status-pill.exhausted {
  background: var(--amber-soft);
  color: var(--amber);
}

.key-meta-line {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.key-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ghost Buttons & Pool */
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.ghost-btn.lg {
  padding: 11px 16px;
  font-size: 0.86rem;
}

.ghost-btn.full-w {
  width: 100%;
  padding: 10px 14px;
}

.mt-12 {
  margin-top: 12px;
}

.ghost-btn svg {
  width: 13px;
  height: 13px;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ghost-btn.danger:hover {
  color: var(--red);
  border-color: rgba(255, 92, 108, 0.45);
}

.pool-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pool-row {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.pool-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 7px;
}

.pool-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.pool-row-title code {
  font-family: var(--font-mono);
  color: var(--accent-2);
}

.pool-row-counts {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pool-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.pool-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--mint));
  transition: width 0.35s ease;
}

.empty-state,
.pool-skeleton {
  padding: 18px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-dim);
  padding: 2px 4px 0;
}

.footer.minimal-footer {
  justify-content: center;
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 36px);
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  background: #141c2b;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.82rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: slideUp 0.2s ease;
}

.toast svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.toast.error {
  border-color: rgba(255, 92, 108, 0.5);
  color: #ffd3d8;
}

.toast.success {
  border-color: rgba(0, 229, 163, 0.45);
  color: #cbffef;
}

/* 3-Tab Navigation Bar */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 0 rgba(5, 9, 16, 0.42),
    0 18px 38px rgba(0, 0, 0, 0.4);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 14px;
  padding: 11px 12px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.tab-btn.active {
  color: #090d14;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 0 var(--accent-deep),
    0 10px 22px var(--accent-glow);
}

.tab-panel[hidden] {
  display: none;
}

/* Auto Like & Profile Components */
.ist-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.ist-clock-pill svg {
  width: 13px;
  height: 13px;
}

.auth-gate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-soft);
}

.auth-gate-box[hidden] {
  display: none;
}

.auth-gate-box h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.auth-gate-box p {
  margin: 0 0 8px;
  max-width: 340px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.region-grid.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 9px;
}

.region-grid.compact-grid .region-card {
  padding: 9px 10px;
}

.auth-switch-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: rgba(4, 7, 14, 0.78);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.auth-switch-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-switch-btn.active {
  background: rgba(255, 94, 43, 0.2);
  color: var(--accent-2);
  border: 1px solid rgba(255, 94, 43, 0.38);
}

.profile-card-banner {
  margin-bottom: 16px;
}

.mt-16 {
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .bg-perspective-floor,
  .brand-logo-3d {
    animation: none;
  }
  .tilt-surface {
    transition: none;
  }
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px 12px 26px;
  }

  .panel {
    padding: 17px;
  }

  .tab-btn {
    padding: 10px 6px;
    font-size: 0.8rem;
    gap: 5px;
  }

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

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

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

/* =========================================================
   COUNTRY MAINTENANCE · RED 3D LOCK
   ========================================================= */
.maintenance-lock-card {
  position: relative;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 72, 92, 0.5);
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(255, 64, 86, 0.26), transparent 58%),
    radial-gradient(100% 140% at 100% 100%, rgba(120, 8, 28, 0.32), transparent 60%),
    linear-gradient(155deg, rgba(44, 7, 16, 0.96), rgba(13, 5, 11, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 180, 190, 0.2),
    inset 0 -22px 44px rgba(0, 0, 0, 0.5),
    0 16px 38px rgba(130, 0, 24, 0.38),
    0 0 0 1px rgba(255, 60, 80, 0.08);
  overflow: hidden;
  transform-style: preserve-3d;
  animation: maintCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.maintenance-lock-card[hidden] {
  display: none;
}

.maintenance-lock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 90, 110, 0.055) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: screen;
  opacity: 0.55;
}

.maintenance-lock-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 120, 140, 0.85), transparent);
  box-shadow: 0 0 12px rgba(255, 70, 95, 0.8);
  animation: maintScan 4.5s linear infinite;
  pointer-events: none;
}

.maint-glow {
  position: absolute;
  width: 210px;
  height: 210px;
  left: -54px;
  top: -56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 45, 75, 0.38), transparent 66%);
  filter: blur(18px);
  animation: maintGlowPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.maint-lock-scene {
  position: relative;
  width: 118px;
  height: 112px;
  display: grid;
  place-items: center;
  perspective: 620px;
  z-index: 1;
}

.maint-orbit {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 82, 104, 0.36);
  animation: maintSpin 16s linear infinite;
}

.maint-orbit-b {
  inset: 15px;
  border-style: solid;
  border-color: rgba(255, 82, 104, 0.16);
  animation-duration: 10s;
  animation-direction: reverse;
}

.maint-lock-3d {
  position: relative;
  width: 64px;
  height: 78px;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-16deg);
  animation: maintLockFloat 3.4s ease-in-out infinite;
  filter: drop-shadow(0 16px 18px rgba(255, 24, 55, 0.5));
}

.maint-shackle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 34px;
  transform: translateX(-50%);
  border: 7px solid #ff5a70;
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 62%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 0 14px rgba(255, 60, 90, 0.55);
}

.maint-lock-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(255, 190, 200, 0.6);
  background: linear-gradient(145deg, #ff7182 0%, #e11d38 38%, #a10b21 72%, #6d0414 100%);
  box-shadow:
    inset 0 3px 3px rgba(255, 255, 255, 0.42),
    inset 0 -10px 16px rgba(56, 0, 8, 0.75),
    0 8px 0 #4d0410,
    0 16px 22px rgba(0, 0, 0, 0.55);
  transform: translateZ(8px);
}

.maint-keyhole {
  position: relative;
  width: 14px;
  height: 20px;
}

.maint-keyhole::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #2a0209;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.18);
}

.maint-keyhole::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 11px;
  transform: translateX(-50%);
  background: #2a0209;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.8);
}

.maint-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.maint-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #ff8a98;
  background: rgba(255, 60, 80, 0.13);
  border: 1px solid rgba(255, 60, 80, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 190, 200, 0.16), 0 4px 12px rgba(120, 0, 20, 0.28);
}

.maint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b52;
  box-shadow: 0 0 10px #ff3b52;
  animation: maintPulse 1.4s ease-in-out infinite;
}

.maint-copy h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  color: #ffe9ec;
  text-shadow: 0 2px 18px rgba(255, 50, 80, 0.35);
}

.maint-copy p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e6b3bd;
}

.maint-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.73rem;
  color: #b9838f;
}

.maint-region-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #ff9aa6;
  background: rgba(255, 60, 80, 0.13);
  border: 1px solid rgba(255, 60, 80, 0.32);
  border-radius: 6px;
  padding: 2px 7px;
}

.maintenance-lock-card.shake {
  animation: maintShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.region-card.maintenance {
  border-color: rgba(255, 72, 92, 0.45);
  background: linear-gradient(155deg, rgba(255, 60, 80, 0.14), rgba(255, 60, 80, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(255, 160, 170, 0.14),
    0 5px 0 rgba(70, 3, 14, 0.72),
    0 10px 20px rgba(120, 0, 20, 0.26);
}

.region-card.maintenance:hover {
  border-color: rgba(255, 90, 110, 0.72);
  background: linear-gradient(155deg, rgba(255, 60, 80, 0.2), rgba(255, 60, 80, 0.05));
}

.region-lock-badge {
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #ff8b99;
  background: rgba(255, 60, 80, 0.16);
  border: 1px solid rgba(255, 60, 80, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 190, 200, 0.16), 0 3px 8px rgba(0, 0, 0, 0.42);
}

.region-lock-badge svg {
  width: 11px;
  height: 11px;
}

.region-maint-tag {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff8b99;
}

.submit-btn.btn-3d.maintenance {
  background: linear-gradient(135deg, #ff3b52, #a80d24);
  color: #ffe8ec;
  box-shadow:
    inset 0 1px 0 rgba(255, 190, 200, 0.3),
    0 6px 0 #52000d,
    0 16px 30px rgba(255, 40, 70, 0.3);
}

.maint-inline-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  margin-bottom: 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 72, 92, 0.42);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(255, 64, 86, 0.18), transparent 60%),
    linear-gradient(150deg, rgba(44, 7, 16, 0.72), rgba(13, 5, 11, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 180, 190, 0.14), 0 8px 22px rgba(120, 0, 20, 0.22);
  color: #ffb3bd;
  font-size: 0.79rem;
}

.maint-inline-note[hidden] {
  display: none;
}

.maint-inline-note.shake {
  animation: maintShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.maint-inline-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ff8b99;
  background: linear-gradient(145deg, rgba(255, 70, 90, 0.3), rgba(255, 70, 90, 0.06));
  border: 1px solid rgba(255, 70, 90, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 190, 200, 0.2), 0 6px 14px rgba(120, 0, 20, 0.32);
}

.maint-inline-icon svg {
  width: 16px;
  height: 16px;
}

.maint-inline-note strong {
  display: block;
  color: #ffd7dc;
  font-size: 0.83rem;
  margin-bottom: 2px;
}

.maint-inline-note div span {
  display: block;
  line-height: 1.4;
}

/* Admin · Country Maintenance */
.section-icon.danger {
  background: linear-gradient(145deg, rgba(255, 72, 92, 0.24), rgba(255, 72, 92, 0.05));
  border-color: rgba(255, 72, 92, 0.4);
  color: #ff8b99;
  box-shadow: inset 0 1px 0 rgba(255, 190, 200, 0.16), 0 8px 18px rgba(255, 40, 70, 0.18);
}

.maint-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.maint-admin-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.maint-admin-row.locked {
  border-color: rgba(255, 72, 92, 0.42);
  background: linear-gradient(150deg, rgba(255, 60, 80, 0.1), rgba(255, 60, 80, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 180, 190, 0.12), 0 8px 18px rgba(120, 0, 20, 0.18);
}

.maint-admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.maint-admin-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  font-size: 0.79rem;
  font-weight: 600;
}

.maint-admin-title code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-2);
}

.maint-admin-title span {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maint-status-pill {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.maint-status-pill.live {
  background: var(--mint-soft);
  color: var(--mint);
}

.maint-status-pill.locked {
  background: var(--red-soft);
  color: var(--red);
}

.maint-toggle {
  position: relative;
  width: 44px;
  height: 23px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.maint-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #98a7c0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: left 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
}

.maint-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, #ff3b52, #b3122a);
  border-color: rgba(255, 90, 110, 0.65);
  box-shadow: 0 0 14px rgba(255, 50, 80, 0.4), inset 0 1px 0 rgba(255, 190, 200, 0.3);
}

.maint-toggle[aria-pressed="true"]::after {
  left: 24px;
  background: #fff;
}

.maint-message-input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(4, 7, 14, 0.6);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.73rem;
}

.maint-message-input:focus {
  outline: none;
  border-color: rgba(255, 72, 92, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 72, 92, 0.12);
}

@keyframes maintCardIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes maintLockFloat {
  0%,
  100% {
    transform: rotateX(12deg) rotateY(-16deg) translateY(0);
  }
  50% {
    transform: rotateX(14deg) rotateY(-8deg) translateY(-5px);
  }
}

@keyframes maintSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes maintPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.72);
  }
}

@keyframes maintGlowPulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes maintScan {
  0% {
    top: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes maintShake {
  0%,
  100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-7px) rotateZ(-0.6deg);
  }
  36% {
    transform: translateX(6px) rotateZ(0.6deg);
  }
  54% {
    transform: translateX(-4px);
  }
  72% {
    transform: translateX(3px);
  }
  88% {
    transform: translateX(-1px);
  }
}

@media (max-width: 560px) {
  .maintenance-lock-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 16px;
    gap: 10px;
  }

  .maint-lock-scene {
    margin: 0 auto;
  }

  .maint-badge {
    align-self: center;
  }

  .maint-meta {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maintenance-lock-card,
  .maintenance-lock-card::after,
  .maint-lock-3d,
  .maint-orbit,
  .maint-glow,
  .maint-dot {
    animation: none;
  }
}

/* =========================================================
   SMOOTH TOUCH / FAST CLICK / MOBILE PERFORMANCE
   ========================================================= */
html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
.region-card,
.tab-btn,
.uid-chip,
.nav-pill-btn,
.ghost-btn,
.icon-btn,
.copy-mini-btn,
.auth-switch-btn,
.maint-toggle {
  touch-action: manipulation;
}

/* Static grid + radial glows: no giant blur filters or background-position animation. */
.bg-perspective-floor {
  animation: none;
}
.bg-glow {
  filter: none;
}
.bg-glow-1 {
  background: radial-gradient(circle, rgba(255, 94, 43, 0.22) 0%, rgba(255, 94, 43, 0.08) 38%, transparent 70%);
}
.bg-glow-2 {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.17) 0%, rgba(56, 189, 248, 0.06) 38%, transparent 70%);
}

/* Only transform-based transitions; animating box-shadow/filter causes repaints. */
.tilt-surface {
  will-change: auto;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-btn,
.nav-pill-btn,
.icon-btn,
.ghost-btn,
.uid-chip,
.auth-switch-btn,
.copy-mini-btn {
  transition: transform 0.12s ease, color 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.tab-btn:active,
.nav-pill-btn:active,
.icon-btn:active,
.ghost-btn:active,
.uid-chip:active,
.auth-switch-btn:active,
.copy-mini-btn:active,
.maint-toggle:active {
  transform: scale(0.96);
}

.region-card {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.14s ease, background-color 0.14s ease;
}
.region-card:active {
  transform: translateY(2px) scale(0.985);
}
.region-check {
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.submit-btn.btn-3d {
  transition: transform 0.1s ease;
}

/* Toggle knob uses transform instead of animating `left` (no layout). */
.maint-toggle::after {
  left: 3px;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease;
}
.maint-toggle[aria-pressed="true"]::after {
  left: 3px;
  transform: translateX(21px);
}

/* Sweep with transform only, not `top`. */
.maintenance-lock-card::after {
  top: 0;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 120, 140, 0.85) 48%, transparent 56%);
  box-shadow: none;
  animation: maintSweep 4.8s linear infinite;
  will-change: transform, opacity;
}
@keyframes maintSweep {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  88% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

.maint-glow {
  filter: none;
}

/* Auto-like expiry note */
.auto-expiry-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(56, 189, 248, 0.07);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.auto-expiry-note svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
  flex-shrink: 0;
  margin-top: 1px;
}
.auto-expiry-note strong {
  color: var(--text);
}

/* Smooth native scrolling inside lists */
.keys-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Coarse pointer / small screens: drop expensive blur & 3D effects. */
@media (max-width: 760px), (pointer: coarse) {
  .topbar,
  .panel,
  .tab-bar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 18, 31, 0.97);
  }
  .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(3, 6, 12, 0.9);
  }
  .panel-glare {
    display: none;
  }
  .tilt-surface {
    transform: none !important;
    transition: none;
  }
  .brand-logo-3d {
    animation: none;
  }
  .bg-perspective-floor {
    opacity: 0.55;
  }
  .bg-glow {
    opacity: 0.65;
  }
  .maint-orbit,
  .maint-glow,
  .maint-dot {
    animation: none;
  }
  .maintenance-lock-card::after {
    animation-duration: 6s;
  }
  .maint-lock-3d {
    animation-duration: 6s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-perspective-floor,
  .brand-logo-3d,
  .maintenance-lock-card,
  .maintenance-lock-card::after,
  .maint-lock-3d,
  .maint-orbit,
  .maint-glow,
  .maint-dot,
  .spinner {
    animation: none;
  }
  .tilt-surface,
  .tab-btn,
  .region-card,
  .submit-btn,
  .ghost-btn,
  .icon-btn {
    transition: none;
  }
}

/* Touch devices: no sticky hover lift after tapping a card. */
@media (hover: none), (pointer: coarse) {
  .region-card:hover {
    transform: none;
    border-color: var(--border);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 5px 0 rgba(4, 7, 13, 0.6),
      0 10px 20px rgba(0, 0, 0, 0.28);
  }
  .region-card.active:hover {
    border-color: var(--accent);
    background: linear-gradient(150deg, rgba(255, 94, 43, 0.22), rgba(255, 156, 56, 0.07));
  }
  .region-card.maintenance:hover {
    border-color: rgba(255, 72, 92, 0.45);
    background: linear-gradient(155deg, rgba(255, 60, 80, 0.14), rgba(255, 60, 80, 0.025));
  }
  .submit-btn.btn-3d:hover,
  .ghost-btn:hover,
  .icon-btn:hover,
  .tab-btn:hover {
    transform: none;
  }
}
