:root {
  --bg: #090d12;
  --bg-2: #0f1720;
  --surface: #151d28;
  --surface-2: #1b2532;
  --surface-3: #111926;
  --ink: #e8eef5;
  --muted: #9fb1c3;
  --line: #2b3747;
  --line-soft: #223041;
  --brand: #22d3ee;
  --brand-2: #0891b2;
  --accent: #ef4444;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.15), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(8, 145, 178, 0.2), transparent 34%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.1px;
}

a { color: var(--brand); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(9, 14, 22, 0.9), rgba(9, 14, 22, 0.76));
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.left-brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 42px; height: 42px; object-fit: cover; border-radius: 999px; border: 1px solid #2a3a4d; }
.site-name { font-size: 1.3rem; font-weight: 700; text-decoration: none; text-shadow: 0 0 14px rgba(34, 211, 238, 0.35); }

.user-menu { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; border: 2px solid var(--line); }
.dropdown {
  position: absolute;
  right: 0;
  top: 48px;
  display: none;
  flex-direction: column;
  min-width: 180px;
  background: linear-gradient(180deg, #131d29, #0f1823);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}
.user-menu.open .dropdown { display: flex; }
.dropdown a, .dropdown button {
  padding: 9px;
  text-align: left;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(34, 211, 238, 0.12); }

.auth-wrap, .dashboard {
  width: min(1150px, 94vw);
  margin: 20px auto 80px;
}

.auth-shell {
  width: min(980px, 94vw);
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  min-height: calc(100vh - 120px);
  align-items: center;
  align-content: center;
}

.auth-shell .auth-wrap {
  width: auto;
  margin: 0;
}

.login-shell {
  width: min(760px, 94vw);
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: calc(100vh - 120px);
  align-items: stretch;
  align-content: center;
  margin: 0 auto 80px;
}

.login-shell .auth-side {
  min-height: auto;
  padding: 22px;
}

.login-shell .auth-wrap {
  width: 100%;
}

.auth-side {
  background: linear-gradient(165deg, rgba(8, 145, 178, 0.26), rgba(11, 20, 35, 0.84));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 300px;
}

.auth-side h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.auth-side p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-title {
  margin: 0;
  font-size: 1.5rem;
}

.auth-card {
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
}

.auth-actions {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.auth-actions p { margin: 0; }

.center-wrap {
  width: min(700px, 94vw);
  margin: 20px auto 90px;
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
}

.center-card {
  background: linear-gradient(180deg, #1a2534, #121b28);
  width: min(560px, 94vw);
  padding: 24px;
  border-radius: 16px;
}

.form-card {
  background: linear-gradient(180deg, #1a2534, #121b28);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 14px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
}

input, textarea, button {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-2);
  border-radius: 8px;
}

input::placeholder, textarea::placeholder { color: #7f95ad; }

input:focus, textarea:focus {
  outline: 2px solid rgba(34, 211, 238, 0.35);
  border-color: var(--brand);
}

label {
  color: #c6d5e4;
  font-size: 0.92rem;
}

button {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #03131a;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
button:hover { filter: brightness(1.05); box-shadow: 0 8px 18px rgba(34, 211, 238, 0.2); }
button:active { transform: translateY(1px); }
button.danger { background: var(--accent); color: #fff; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-btn { border-radius: 10px; padding: 10px 14px; }
.tab-btn.active { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: #03131a; }
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 12px; }

.panel-title {
  margin: 0;
  font-size: 1.28rem;
}

.panel-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(19, 28, 40, 0.96), rgba(16, 23, 33, 0.96));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.info-hero p { margin: 6px 0 0; color: var(--muted); }

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(22, 33, 47, 0.86);
}

.info-label { margin: 0; color: var(--muted); font-size: 0.86rem; }
.info-card h3 { margin: 6px 0 0; font-size: 1.35rem; }

.dashboard h1,
.dashboard h2 {
  margin-top: 0;
}

.page-main {
  width: min(1180px, 94vw);
  margin: 20px auto 90px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(20, 29, 40, 0.9), rgba(14, 21, 31, 0.92)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 40%);
  box-shadow: var(--shadow);
}

.dashboard-content {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
  transition: transform .18s ease, border-color .18s ease;
  display: grid;
  align-content: start;
  gap: 8px;
}
.media-card:hover { transform: translateY(-3px); border-color: #3b4f67; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3); }

.media-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.media-top h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  font-family: 'Trebuchet MS', 'Segoe UI', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.media-type-badge {
  font-size: 0.72rem;
  letter-spacing: 0.4px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #85efff;
  white-space: nowrap;
}

.media-card img,
.media-card video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #27364a;
  margin: 0 auto;
  display: block;
}

.media-body {
  display: grid;
  gap: 5px;
}
.media-description {
  margin: 0;
  color: #c7d6e8;
  line-height: 1.45;
}
.video-views {
  margin: 0;
  color: #9eb1c7;
  font-size: 0.88rem;
}
.upload-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.media-card .tags {
  color: var(--muted);
  font-size: 0.9rem;
}

.reacts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.react-btn.active,
.video-react.active { background: #16a34a; }

.upload-form {
  gap: 12px;
  background: linear-gradient(180deg, rgba(22, 33, 47, 0.92), rgba(16, 24, 35, 0.92));
  border-radius: 14px;
}

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

.upload-field {
  display: grid;
  gap: 6px;
}
.upload-field textarea {
  min-height: 48px;
  resize: vertical;
}
.upload-field-wide { grid-column: 1 / -1; }

.upload-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.upload-file-wrap {
  display: grid;
  gap: 6px;
  flex: 1 1 260px;
}
.upload-file-wrap input[type='file'] { width: 100%; }
.upload-actions button {
  min-width: 150px;
  align-self: stretch;
}

.search-wrap { display: grid; gap: 6px; }
.search-wrap input { max-width: 460px; }

.global-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #162131;
  color: #c7d7e8;
  font-size: 0.84rem;
}

.tag-chip:hover {
  border-color: #3f5771;
}

.tag-chip.active {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #03131a;
  border-color: transparent;
}

.media-card.is-hidden {
  display: none;
}

.pagination-controls {
  display: none;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.pagination-controls.is-visible {
  display: flex;
}

.pagination-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 72px;
  text-align: center;
}

.progress-wrap {
  width: 100%;
  background: #243243;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width .2s ease;
}

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 70px;
  z-index: 70;
  display: grid;
  gap: 8px;
  max-width: 320px;
}
.toast {
  background: #111827;
  color: #fff;
  border: 1px solid #263346;
  border-radius: 10px;
  padding: 10px;
  animation: slide-in .3s ease;
}
.flash-toast {
  border-color: #5a4b1f;
  background: linear-gradient(180deg, #3a310f, #2a220d);
  color: #ffec99;
}
.upload-toast { min-width: 260px; }
.upload-toast-status {
  margin: 8px 0 0;
  color: #9fb1c3;
  font-size: 0.82rem;
}
.upload-toast-progress-wrap {
  width: 100%;
  height: 8px;
  background: #223145;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.upload-toast-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
  transition: width .15s linear;
}
.upload-toast.upload-complete { border-color: #1f9d63; }
.upload-toast.upload-complete .upload-toast-progress { background: linear-gradient(90deg, #22c55e, #16a34a); }
.upload-toast.upload-failed { border-color: #dc2626; }
.upload-toast.upload-failed .upload-toast-progress { background: linear-gradient(90deg, #f43f5e, #dc2626); }

@keyframes slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.flash {
  display: none;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  text-align: center;
  padding: 10px;
  background: rgba(9, 13, 18, 0.95);
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

.dashboard-content.is-locked {
  filter: blur(10px);
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}

.age-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 12, 0.5);
  backdrop-filter: blur(10px);
}

.age-modal-card {
  width: min(500px, 92vw);
  background: linear-gradient(180deg, #17202d 0%, #101821 100%);
  border: 1px solid #2b3a4d;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  border-radius: 16px;
  padding: 20px;
}
.age-modal-card p { color: var(--muted); }
.age-form { display: grid; gap: 10px; }

.underage-card {
  text-align: center;
  display: grid;
  gap: 10px;
}

.underage-card form {
  display: grid;
  place-items: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.settings-grid .form-card { background: linear-gradient(180deg, #182334, #111a27); }
.settings-grid h2 { margin-bottom: 2px; }
.profile-preview { width: 98px; height: 98px; border-radius: 999px; object-fit: cover; border: 2px solid #2a3a4d; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: 10px; vertical-align: top; }
.admin-table th { background: #131c28; color: #d2e2f1; }
.inline-form { display: inline-flex; gap: 6px; margin: 2px 0; }
.inline-form .action-input-placeholder {
  visibility: hidden;
  pointer-events: none;
}
.mini-avatar { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; }

.instant-restriction-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 12, 0.82);
  backdrop-filter: blur(6px);
}

.instant-restriction-card {
  width: min(520px, 92vw);
  background: linear-gradient(180deg, #17202d 0%, #101821 100%);
  border: 1px solid #2b3a4d;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.player-wrap {
  background: linear-gradient(180deg, #1a2534, #121b28);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.player-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.player-stage {
  border-radius: 14px;
  border: 1px solid #31455f;
  overflow: hidden;
  background: #060a10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 20px 42px rgba(0, 0, 0, 0.45);
  width: 100%;
}

.player-wrap video {
  width: 100%;
  display: block;
  background: #000;
}
.player-header h1 { margin-bottom: 8px; }
.player-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: #111b28;
  font-size: 0.86rem;
}
.player-actions {
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.player-actions button {
  border-radius: 10px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(180deg, #172131, #131d2b);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.comments {
  margin-top: 20px;
  background: rgba(18, 27, 38, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.comments-form {
  margin-bottom: 12px;
}

.comments-list {
  display: grid;
  gap: 10px;
}

.dashboard p,
.comments p,
.panel-card p {
  line-height: 1.55;
}

@media (max-width: 700px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 120px);
    align-items: center;
    align-content: center;
  }
  .auth-side { min-height: auto; }
  .page-main { padding: 12px; border-radius: 12px; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-actions { align-items: stretch; }
  .upload-actions button { width: 100%; min-width: 0; }
  .grid { grid-template-columns: 1fr; }
  .media-card img, .media-card video { height: 210px; }
  .inline-form { width: 100%; display: grid; grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .site-name { font-size: 1rem; }
  .username { display: none; }
}
