:root {
  --bg: #f6f6f4;
  --ink: #101010;
  --muted: #666;
  --line: #e2e2df;
  --card: #fff;
  --dark: #080808;
  --light: #ffffff;
  --accent: #8b7a55;
  --danger: #9b1c1c;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 246, 244, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--dark);
  color: var(--light);
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.nav-links a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-links a[aria-current="page"] {
  background: var(--dark);
  color: var(--light);
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.page-shell {
  max-width: 960px;
}

.home-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  align-content: center;
  gap: 24px;
}

.home-hero {
  max-width: 780px;
}

.home-hero h1,
.event-info h1 {
  font-size: clamp(48px, 11vw, 112px);
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 8vw, 76px);
}

h2 {
  font-size: clamp(24px, 5vw, 38px);
}

h3 {
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy,
.muted,
.refresh-note,
.mode-card p {
  color: var(--muted);
  line-height: 1.7;
}

.mode-grid {
  display: grid;
  gap: 14px;
}

.mode-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 16px;
  padding: clamp(22px, 5vw, 38px);
  box-shadow: var(--shadow);
}

.dark-card {
  background: var(--dark);
  color: var(--light);
}

.dark-card p {
  color: rgba(255, 255, 255, 0.7);
}

.light-card {
  border: 1px solid var(--line);
  background: var(--card);
}

.mode-number,
.mode-action {
  color: var(--accent);
  font-weight: 900;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 16px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.button-dark {
  background: var(--dark);
  color: var(--light);
}

.button-light {
  background: var(--light);
  color: var(--dark);
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.36);
  background: transparent;
  color: var(--light);
}

.dark-text {
  border-color: var(--line);
  color: var(--ink);
}

.full-button {
  width: 100%;
}

.panel,
.empty-state,
.upload-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel,
.empty-state {
  padding: clamp(22px, 5vw, 42px);
}

.split-head,
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  padding: 34px 0 16px;
}

.compact {
  padding-top: 18px;
}

.dashboard-actions,
.form-actions,
.upload-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

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

.simple-shell {
  display: grid;
  gap: 18px;
}

.simple-hero {
  padding: clamp(28px, 5vw, 56px) 0 8px;
}

.simple-hero h1 {
  max-width: 860px;
  font-size: clamp(42px, 8vw, 86px);
}

.simple-hero .muted {
  max-width: 620px;
  margin-bottom: 0;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.action-tile {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.action-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.action-tile strong {
  font-size: 20px;
}

.primary-action {
  background: var(--dark);
  color: var(--light);
}

.primary-action span {
  color: rgba(255, 255, 255, 0.62);
}

.share-board {
  display: grid;
  gap: 14px;
}

.link-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-panel {
  display: grid;
  align-content: center;
}

.small-panel {
  min-height: 220px;
}

.copy-field,
input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

input[type="file"] {
  padding: 11px;
}

input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--dark);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--dark);
}

.settings-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.preview-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.logo-preview {
  width: 150px;
  height: 110px;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}

.copyright {
  color: var(--muted);
  text-align: center;
}

.cloud-box {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.advanced-settings {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 4px;
}

.advanced-settings summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.advanced-settings[open] {
  display: grid;
  gap: 14px;
  padding: 4px 4px 14px;
}

.advanced-settings .cloud-box {
  margin: 0 10px;
}

.advanced-settings .folded-grid,
.advanced-settings > .preview-image {
  margin: 0 10px;
}

.drive-status {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.qr-panel {
  text-align: center;
}

.qr-canvas {
  width: 220px;
  height: 220px;
  margin: 0 auto 18px;
  border: 10px solid #fff;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.qr-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.metric {
  font-size: clamp(58px, 16vw, 120px);
  font-weight: 900;
}

.event-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
  box-shadow: var(--shadow);
}

.guest-hero {
  min-height: 480px;
}

.event-cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 82% 18%, rgba(180, 154, 102, 0.28), transparent 28%),
    linear-gradient(135deg, #0c0c0c, #37322d);
  background-position: center;
  background-size: cover;
}

.event-info {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  max-width: 720px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 6vw, 72px);
  color: var(--light);
}

.event-info .hero-copy {
  color: rgba(255, 255, 255, 0.74);
}

.event-logo {
  width: 86px;
  max-height: 86px;
  margin-bottom: 22px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
}

.gallery-grid {
  columns: 1;
  column-gap: 14px;
}

.photo-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  break-inside: avoid;
}

.photo-card img {
  width: 100%;
  cursor: zoom-in;
}

.photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.photo-meta span {
  color: var(--muted);
  font-size: 13px;
}

.download-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 850;
}

#photoInput,
#cameraInput,
#fallbackCameraInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop {
  width: 100%;
  min-height: 150px;
  justify-content: center;
  border: 1px dashed #a79f92;
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
  cursor: pointer;
}

.file-drop-title {
  color: var(--ink);
  font-size: 22px;
}

.camera-button {
  width: 100%;
}

.privacy-note {
  border-left: 3px solid var(--dark);
  margin: 18px 0 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  line-height: 1.5;
}

.settings-summary {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.upload-list {
  display: grid;
  gap: 12px;
}

.upload-item {
  display: grid;
  grid-template-columns: 82px 82px 1fr;
  gap: 12px;
  padding: 12px;
}

.upload-item img,
.thumb-placeholder {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  object-fit: cover;
}

.thumb-placeholder {
  background: linear-gradient(135deg, #191919, #8d7952);
}

.upload-item h3,
.upload-item p {
  margin: 0;
}

.upload-item p {
  margin-top: 6px;
  color: var(--muted);
}

.camera-stage {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  border-radius: 16px;
  background: #111;
  aspect-ratio: 3 / 4;
}

.camera-controls,
.fallback-upload {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.camera-stage video,
.camera-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.error-text {
  color: var(--danger);
  font-weight: 800;
}

.empty-state {
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 78vh;
  border-radius: 12px;
  object-fit: contain;
}

.lightbox .button {
  margin-top: 14px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

.mobile-dock {
  display: none;
}

@media (min-width: 680px) {
  .mode-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .share-board {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr) minmax(160px, 0.45fr);
    align-items: stretch;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    columns: 2;
  }

  .camera-button {
    width: auto;
  }

  .camera-stage {
    aspect-ratio: 16 / 10;
  }
}

@media (min-width: 980px) {
  main {
    padding: 32px;
  }

  .page-shell {
    max-width: 1180px;
  }

  .topbar {
    padding: 16px 32px;
  }

  .dashboard-hero {
    min-height: 320px;
    display: grid;
    align-content: end;
    background:
      linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.72)),
      linear-gradient(135deg, #111, #3a352e);
    color: var(--light);
  }

  .dashboard-hero .muted {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.72);
  }

  .dashboard-hero .dark-text {
    border-color: rgba(255, 255, 255, 0.34);
    color: var(--light);
  }

  .mode-grid,
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-card:first-child {
    grid-column: span 2;
  }

  .gallery-grid {
    columns: 3;
  }

  .settings-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .settings-form > label:first-child,
  .settings-form > label:nth-child(2),
  .settings-form > .preview-image,
  .settings-form > .advanced-settings,
  .settings-form > .form-actions {
    grid-column: 1 / -1;
  }

  .cloud-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cloud-box .eyebrow,
  .cloud-box .switch-row {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1280px) {
  main {
    width: min(1360px, 100%);
    padding: 40px;
  }

  .gallery-grid {
    columns: 4;
  }

  .event-hero {
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 78px;
  }

  main {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }

  .nav-links {
    width: 100%;
    border-radius: 9px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    font-size: 13px;
    padding: 8px 9px;
  }

  .home-shell {
    min-height: auto;
    align-content: start;
  }

  .home-hero h1,
  .event-info h1 {
    font-size: clamp(42px, 15vw, 64px);
  }

  .mode-card {
    min-height: 210px;
  }

  .panel,
  .empty-state {
    padding: 20px;
  }

  .simple-hero {
    padding-top: 22px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .action-tile {
    min-height: 86px;
  }

  .inline-actions .button {
    width: 100%;
  }

  .event-hero,
  .event-info {
    min-height: 430px;
  }

  .guest-hero {
    min-height: 400px;
  }

  .event-info {
    padding: 24px;
  }

  .event-logo {
    width: 68px;
    max-height: 68px;
    margin-bottom: 16px;
  }

  .dashboard-actions .button,
  .form-actions .button,
  .hero-actions .button {
    width: 100%;
  }

  .split-head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-item {
    grid-template-columns: 1fr 1fr;
  }

  .upload-item img,
  .thumb-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .upload-item > div:last-child {
    grid-column: 1 / -1;
  }

  .camera-stage {
    aspect-ratio: 3 / 4;
    border-radius: 14px;
  }

  .photo-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-link {
    width: 100%;
    text-align: center;
  }

  .mobile-dock {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(8, 8, 8, 0.92);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
  }

  .mobile-dock a,
  .mobile-dock button {
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
  }

  .mobile-dock a[aria-current="page"],
  .mobile-dock button[aria-current="page"] {
    background: var(--light);
    color: var(--dark);
  }

  .guest-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
