:root {
  --bg0: #0f172a;
  --bg1: #1f2937;
  --panel: rgba(12, 20, 36, 0.85);
  --line: rgba(148, 163, 184, 0.25);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #f97316;
  --brand2: #22d3ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 550px at 10% -10%, #334155 0%, transparent 60%),
    radial-gradient(1200px 650px at 100% 0%, #7c2d12 0%, transparent 55%),
    linear-gradient(145deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.32;
  z-index: 0;
}

.shape-a {
  width: 330px;
  height: 330px;
  left: -70px;
  top: 10vh;
  background: #22d3ee;
  animation: floatA 8s ease-in-out infinite;
}

.shape-b {
  width: 400px;
  height: 400px;
  right: -120px;
  bottom: 6vh;
  background: #f97316;
  animation: floatB 9s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
}

@keyframes floatB {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 32px;
  display: grid;
  gap: 16px;
}

.title-row h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  letter-spacing: 0.02em;
}

.title-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-link {
  color: #bae6fd;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(186, 230, 253, 0.35);
}

.admin-link:hover {
  color: #ffffff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 60px rgba(2, 6, 23, 0.35);
}

.controls {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.control-group {
  display: grid;
  gap: 8px;
}

.control-group.buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
}

input[type="file"],
input[type="range"],
button {
  width: 100%;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  background: linear-gradient(120deg, #ea580c, #0891b2);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status {
  margin: 0;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9rem;
  color: #cbd5e1;
}

progress {
  width: 100%;
  height: 10px;
}

.preview-grid {
  padding: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.preview-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
}

.preview-block h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

video,
canvas,
img {
  display: block;
  width: min(100%, 380px);
  aspect-ratio: 0.71875;
  object-fit: cover;
  border-radius: 4%;
  border: 1px solid var(--line);
  background: #020617;
}

#video {
  margin-bottom: 10px;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

#video.active {
  max-height: 520px;
  opacity: 1;
}

.match-meta {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.match-meta p {
  margin: 0;
}

@media (max-width: 860px) {
  .control-group.buttons {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }
}

.admin-shell {
  max-width: 1180px;
}

.set-form {
  display: grid;
  gap: 12px;
}

.set-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.set-form input[type="text"],
.set-form input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  padding: 11px 12px;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.admin-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.admin-list-panel {
  padding: 16px;
}

.admin-list-panel h2 {
  margin: 0 0 12px;
}

.table-wrap {
  overflow-x: auto;
}

.sets-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.sets-table th,
.sets-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}

.sets-table th {
  color: #cbd5e1;
  font-weight: 700;
}

.actions-cell {
  white-space: nowrap;
}

.btn-inline {
  width: auto;
  min-width: 82px;
  margin-right: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.btn-danger {
  background: linear-gradient(120deg, #dc2626, #fb7185);
}

@media (max-width: 860px) {
  .set-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    grid-template-columns: 1fr;
  }
}