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

:root {
  --bg: #080808;
  --surface: #111;
  --border: #1e1e1e;
  --border-hover: #333;
  --text: #e0e0e0;
  --muted: #555;
  --accent: #7a9fff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fish { font-size: 2rem; line-height: 1; }

nav { display: flex; gap: 1rem; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.1s;
}
.nav-link:hover { color: var(--text); }

/* ── Gallery ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.5rem 1.5rem 0.75rem;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-divider span {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 0 1.5rem 1.5rem;
}

.card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover { transform: scale(1.025); border-color: var(--border-hover); }

.card video,
.card img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover .card-actions { opacity: 1; }

.btn-copy, .btn-dl {
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.1s;
  text-decoration: none;
  line-height: 1.8;
}
.btn-copy:hover, .btn-dl:hover { background: rgba(255,255,255,0.15); }
.btn-copy.copied { color: #6fca7f; border-color: #6fca7f44; }

.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
}
.badge-mp4  { background: rgba(20,20,60,0.85);  color: #7a9fff; }
.badge-gif  { background: rgba(20,50,20,0.85);  color: #6fca7f; }
.badge-img  { background: rgba(50,20,20,0.85);  color: #d07a60; }

.roblox-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.roblox-badge {
  background: rgba(220,100,60,0.9);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 120px;
}

/* ── Modal ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }

.modal-content {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 10px;
  overflow: hidden;
}
.modal-content video,
.modal-content img {
  display: block;
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 10px;
}

.modal-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #666;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s;
  z-index: 101;
}
.modal-close:hover { color: #fff; }

.modal-info {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0,0,0,0.6);
  color: #e0e0e0;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 60vw;
  z-index: 102;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 102;
}

.modal-controls button {
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e0e0;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.1s, border-color 0.1s;
  backdrop-filter: blur(4px);
}
.modal-controls button:hover {
  background: rgba(0,0,0,0.85);
  border-color: rgba(255,255,255,0.2);
}

.modal-controls span {
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e0e0;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  backdrop-filter: blur(4px);
}

.modal-roblox {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.roblox-badge-modal {
  background: rgba(220,100,60,0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
}

/* ── Auth ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 340px;
}

.auth-card input {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.1s;
}
.auth-card input:focus { border-color: var(--accent); }

.auth-card button {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.1s;
}
.auth-card button:hover { opacity: 0.85; }

.auth-error {
  color: #e07070;
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* ── Upload ── */
.upload-area {
  border: 2px dashed var(--border-hover);
  border-radius: 14px;
  margin: 2rem 1.5rem 1rem;
  padding: 3rem 2rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(122,159,255,0.05);
}
.upload-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; font-style: normal; }
.upload-area p { color: var(--text); margin-bottom: 0.25rem; }
.upload-sub { color: var(--muted); font-size: 0.8rem; margin-bottom: 1.25rem; }

.upload-btn {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.upload-btn:hover { background: var(--surface); border-color: #555; }

.roblox-input-section {
  padding: 0 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 1.5rem 1.5rem;
  padding: 1rem 1.5rem;
}

.roblox-input-section label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.roblox-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  outline: none;
  transition: border-color 0.1s;
}

.roblox-input:focus {
  border-color: var(--accent);
}

.roblox-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.upload-list {
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}
.upload-item .name { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .status { font-size: 0.78rem; white-space: nowrap; }
.status-uploading { color: var(--accent); }
.status-done { color: #6fca7f; }
.status-error { color: #e07070; }

/* ── Media manager (upload page) ── */
.media-manager { padding: 1.5rem; }
.media-manager h2 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

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

.manager-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.manager-card video,
.manager-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.manager-card .del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  border: none;
  color: #e07070;
  border-radius: 4px;
  font-size: 14px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
}
.manager-card:hover .del-btn { opacity: 1; }
.manager-card .fname {
  font-size: 10px;
  color: var(--muted);
  padding: 4px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
