@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #0b0d12;
  --surface: rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.085);
  --line: rgba(255,255,255,.12);
  --line-2: rgba(255,255,255,.2);
  --text: #f7f3ea;
  --muted: #a4a5ad;
  --amber: #ffb000;
  --orange: #ff5d2f;
  --cyan: #58d7ff;
  --red: #ff4d62;
  --green: #a8ff60;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 24px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

i[data-lucide] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  min-height: 17px;
  stroke-width: 2.25;
  display: inline-block;
  vertical-align: middle;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,176,0,.16), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(88,215,255,.1), transparent 32%),
    linear-gradient(150deg, #0b0d12 0%, #11141d 55%, #130f12 100%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: .1;
  background-image:
    linear-gradient(120deg, rgba(255,255,255,.05) 0 1px, transparent 1px 18px),
    linear-gradient(30deg, rgba(255,255,255,.04) 0 1px, transparent 1px 22px);
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .4;
}

.bg-orb-a {
  width: 360px;
  height: 360px;
  left: -120px;
  top: 22%;
  background: var(--orange);
}

.bg-orb-b {
  width: 430px;
  height: 430px;
  right: -160px;
  bottom: 8%;
  background: var(--cyan);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(11,13,18,.74);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 60px rgba(0,0,0,.32);
}

.brand,
.nav-pill,
.session,
.btn,
.discord-btn,
.logout-btn,
.eyebrow,
.field.with-icon,
.permission-card,
.profile-summary,
.profile-actions,
.section-row,
.shot-owner {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #14100a;
  background: linear-gradient(135deg, var(--amber), var(--orange));
}

.brand-icon i {
  width: 22px;
  height: 22px;
  fill: rgba(0,0,0,.18);
}

.brand-copy strong,
.brand-copy small {
  display: block;
  line-height: 1;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -.05em;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.nav-pill {
  justify-content: center;
  gap: 5px;
}

.nav-pill a,
.discord-btn,
.logout-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  transition: .18s ease;
}

.nav-pill a:hover,
.nav-pill a.active,
.logout-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.06);
}

.discord-btn {
  color: white;
  font-weight: 800;
  background: #5865f2;
}

.session {
  justify-content: flex-end;
  gap: 10px;
}

.mini-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-profile img,
.shot-owner img,
.profile-summary img,
.driver-card-mini img {
  border-radius: 999px;
  object-fit: cover;
  background: rgba(255,255,255,.08);
}

.mini-profile img {
  width: 36px;
  height: 36px;
}

.mini-profile strong {
  display: block;
  font-size: 13px;
}

.mini-profile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 74px 0 22px;
}

.hero-copy,
.stats-panel,
.page-links a,
.page-header,
.toolbar-card,
.driver-card-mini,
.upload-panel,
.permission-card,
.profile-top,
.profile-editor,
.profile-uploads,
.shot-card,
.empty,
.shot-dialog {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 58px);
}

.eyebrow {
  gap: 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin: 14px 0 18px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: .9;
  letter-spacing: -.075em;
}

.hero-copy p,
.page-header p,
.profile-editor p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 850;
  cursor: pointer;
  transition: .18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-primary {
  color: #140f08;
  background: linear-gradient(135deg, var(--amber), var(--orange));
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.07);
}

.btn-danger {
  color: white;
  border: 1px solid rgba(255,77,98,.4);
  background: rgba(255,77,98,.18);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

.stats-panel {
  border-radius: var(--radius-xl);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.stats-panel article,
.mini-stats article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,.045);
}

.stats-panel strong,
.mini-stats strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.06em;
}

.stats-panel span,
.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}

.page-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 80px;
}

.page-links a {
  border-radius: 22px;
  padding: 20px;
  transition: .18s ease;
}

.page-links a:hover,
.driver-card-mini:hover,
.shot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,176,0,.34);
}

.page-links i {
  width: 28px;
  height: 28px;
  color: var(--amber);
}

.page-links strong {
  display: block;
  font-size: 22px;
  margin: 14px 0 8px;
  letter-spacing: -.045em;
}

.page-links span {
  color: var(--muted);
  line-height: 1.55;
}

.page-main {
  padding: 58px 0 80px;
}

.page-main.narrow {
  width: min(880px, calc(100% - 32px));
}

.page-header {
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 18px;
}

.page-header.simple {
  text-align: left;
}

.page-header h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-top: 24px;
}

.toolbar-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 170px;
  gap: 10px;
  border-radius: 22px;
  padding: 12px;
  margin-bottom: 18px;
}

.field {
  position: relative;
}

.field.with-icon i {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(255,255,255,.065);
}

.field.with-icon input,
.field.with-icon select {
  padding-left: 42px;
}

input:focus,
select:focus {
  border-color: rgba(255,176,0,.65);
  box-shadow: 0 0 0 4px rgba(255,176,0,.08);
}

.driver-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.driver-card-mini {
  gap: 10px;
  border-radius: 18px;
  padding: 12px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: .18s ease;
}

.driver-card-mini img {
  width: 38px;
  height: 38px;
}

.driver-card-mini strong {
  display: block;
  font-size: 13px;
}

.driver-card-mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.shot-card {
  grid-column: span 4;
  overflow: hidden;
  border-radius: 22px;
  transition: .18s ease;
}

.shot-card:nth-child(7n + 1) {
  grid-column: span 6;
}

.compact-gallery .shot-card {
  grid-column: span 6;
}

.shot-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  padding: 0;
  background: #121722;
  cursor: pointer;
  overflow: hidden;
}

.shot-card:nth-child(7n + 1) .shot-preview {
  aspect-ratio: 16 / 9;
}

.shot-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: .35s ease;
}

.shot-card:hover .shot-preview img {
  transform: scale(1.045);
}

.featured-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  display: none;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px;
  color: #140f08;
  background: linear-gradient(135deg, var(--amber), var(--orange));
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.shot-card.is-featured .featured-badge {
  display: inline-flex;
}

.shot-content {
  padding: 13px;
}

.shot-owner {
  gap: 9px;
  margin-bottom: 11px;
}

.shot-owner img {
  width: 29px;
  height: 29px;
}

.shot-owner strong {
  display: block;
  font-size: 13px;
}

.shot-owner small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.shot-content h3 {
  margin-bottom: 7px;
  font-size: 17px;
  letter-spacing: -.04em;
}

.shot-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.52;
  margin-bottom: 11px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  font-size: 11px;
  font-weight: 800;
}

.permission-card {
  justify-content: space-between;
  gap: 14px;
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 18px;
}

.permission-card strong,
.permission-card span {
  display: block;
}

.permission-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.upload-panel,
.profile-editor,
.profile-uploads,
.profile-top {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.upload-form {
  display: grid;
  gap: 16px;
}

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

.form-grid .wide {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dropzone {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(255,255,255,.28);
  border-radius: 22px;
  background: rgba(255,255,255,.045);
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}

.dropzone:hover,
.dropzone.dragging {
  transform: translateY(-3px);
  border-color: var(--amber);
  background: rgba(255,176,0,.07);
}

.dropzone input {
  display: none;
}

.dropzone i {
  width: 44px;
  height: 44px;
  color: var(--amber);
}

.dropzone small {
  color: var(--muted);
}

.selected-files {
  display: grid;
  gap: 8px;
}

.selected-files p {
  color: var(--muted);
  margin: 0;
}

.file-chip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.045);
}

.file-chip span {
  color: var(--muted);
  font-size: 12px;
}

.profile-top {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-summary {
  gap: 13px;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.profile-summary img,
.avatar-placeholder {
  width: 58px;
  height: 58px;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.065);
}

.avatar-placeholder i {
  width: 26px;
  height: 26px;
  color: var(--amber);
}

.profile-summary strong {
  display: block;
  font-size: 18px;
}

.profile-summary span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.profile-actions {
  gap: 8px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.profile-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.section-row {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-row h2 {
  margin: 8px 0 0;
  font-size: 36px;
  letter-spacing: -.06em;
}

.empty {
  display: none;
  text-align: center;
  border-radius: 22px;
  padding: 54px 20px;
  margin-top: 14px;
}

.empty.show {
  display: block;
}

.empty i {
  width: 46px;
  height: 46px;
  color: var(--amber);
}

.empty h3 {
  margin: 12px 0 7px;
  font-size: 30px;
  letter-spacing: -.055em;
}

.empty p {
  color: var(--muted);
  margin-bottom: 0;
}

.shot-dialog {
  width: min(1050px, calc(100% - 28px));
  border-radius: 28px;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: rgba(11,13,18,.96);
}

.shot-dialog::backdrop {
  background: rgba(0,0,0,.76);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(0,0,0,.55);
  cursor: pointer;
}

.dialog-preview {
  background: #07090d;
}

.dialog-preview img {
  width: 100%;
  max-height: 680px;
  display: block;
  object-fit: contain;
}

.dialog-info {
  padding: 22px;
}

.dialog-info h3 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: .95;
  letter-spacing: -.065em;
}

.dialog-info p {
  color: var(--muted);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .nav-pill {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .session {
    justify-content: flex-start;
  }

  .home-hero,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .page-links,
  .driver-strip,
  .toolbar-card,
  .form-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .shot-card,
  .shot-card:nth-child(7n + 1),
  .compact-gallery .shot-card {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .shell,
  .page-main.narrow {
    width: min(100% - 24px, 1160px);
  }

  .page-main {
    padding-top: 36px;
  }

  h1 {
    font-size: 44px;
  }

  .hero-actions,
  .btn {
    width: 100%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .shot-card,
  .shot-card:nth-child(7n + 1),
  .compact-gallery .shot-card {
    grid-column: auto;
  }

  .nav-pill a {
    width: 42px;
    justify-content: center;
    padding-inline: 0;
  }

  .nav-pill a span {
    display: none;
  }

  .profile-top,
  .permission-card {
    align-items: flex-start;
    flex-direction: column;
  }
}
