:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #202020;
  --text: #ffffff;
  --muted: #aaaaaa;
  --accent: #ff0000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #242424 0%, #0f0f0f 45%);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: rgba(24, 24, 24, 0.96);
  border-bottom: 1px solid #2f2f2f;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.search-bar {
  display: flex;
  flex: 1;
  max-width: 520px;
  margin: 0 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #333;
  border-right: none;
  border-radius: 999px 0 0 999px;
  background: #121212;
  color: var(--text);
}

.search-bar button {
  padding: 0 1rem;
  border: 1px solid #333;
  border-radius: 0 999px 999px 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.icon-btn,
.avatar-btn {
  min-width: 2.7rem;
  height: auto;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 999px;
  background: #262626;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.sidebar {
  background: rgba(24, 24, 24, 0.96);
  border: 1px solid #282828;
  border-radius: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 84px);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: #2a2a2a;
  color: var(--text);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(24, 24, 24, 0.96);
  border: 1px solid #282828;
}

.status-bar {
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  border: 1px solid #282828;
  background: rgba(24, 24, 24, 0.96);
  border-radius: 1rem;
  padding: 1rem;
}

.add-video {
  display: grid;
  gap: 1rem;
}

.input-group {
  display: grid;
  gap: 0.4rem;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.input-group label {
  color: var(--muted);
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #333;
  border-radius: 0.75rem;
  background: #121212;
  color: var(--text);
}

.btn-primary {
  padding: 0.85rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-secondary {
  padding: 0.85rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: #333;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-secondary:hover {
  opacity: 0.9;
}

.btn-secondary.small {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.input-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.admin-card {
  display: grid;
  gap: 1rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--text);
}

.video-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.verified {
  background: #0b6623;
  color: #d8ffda;
}

.badge.unverified {
  background: #4a2f2f;
  color: #ffd7d7;
}

.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-slider {
  overflow: hidden;
  width: 100%;
}

.auth-slides {
  display: flex;
  width: 200%;
  transition: transform 0.3s ease;
}

.auth-panel.slide {
  width: 100%;
  min-width: 100%;
}

.tab {
  flex: 1;
  padding: 0.85rem 1rem;
  background: #212121;
  color: var(--text);
  border-radius: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, border 0.2s ease;
}

.tab.active {
  background: #2a2a2a;
  border-color: #444;
}

.auth-panel {
  display: grid;
  gap: 1rem;
}

.game-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #101010;
  border: 1px solid #2a2a2a;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.game-button {
  background: #202020;
  border: 1px solid #333;
  border-radius: 0.85rem;
  color: var(--text);
  font-size: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.game-button:hover,
.game-button.active {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.game-message,
.auth-message {
  min-height: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.preview-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
  z-index: 20;
  overflow-y: auto;
}

.modal-content {
  position: relative;
  width: min(100%, 380px);
  max-height: calc(100vh - 2rem);
  background: #171717;
  border: 1px solid #2b2b2b;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
}

.auth-slides {
  display: flex;
  width: 200%;
  max-width: 100%;
  transition: transform 0.3s ease;
}

.auth-panel.slide {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}


.close-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
  cursor: pointer;
}

.modal-preview {
  width: min(100%, 900px);
}

.preview-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.preview-player {
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  background: #0d0d0d;
  border: 1px solid #2b2b2b;
}

.preview-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-thumb.large {
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: #3d3d3d;
}

.login-message {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: #f66;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

@media (max-width: 800px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.video-card {
  background: var(--surface);
  border: 1px solid #262626;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: #3d3d3d;
}

.video-thumb {
  position: relative;
  background: linear-gradient(135deg, #444 0%, #111 100%);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
}

.video-thumb span {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
}

.video-details {
  padding: 0.9rem;
}

.video-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.3;
}

.video-meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }
}
