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

:root {
  --bg: #111;
  --bg2: #1e1e1e;
  --bg3: #2a2a2a;
  --accent: #ff6b00;
  --accent2: #ff8c33;
  --text: #f0f0f0;
  --text2: #aaa;
  --green: #4caf50;
  --red: #f44336;
  --radius: 12px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0;
}

/* ─── Views ──────────────────────────────────────────────────────────────── */
.view {
  padding: 24px 16px;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.header h1 { font-size: 1.4rem; font-weight: 700; }
.header .back-btn {
  background: var(--bg3);
  border: none;
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ─── Login ───────────────────────────────────────────────────────────────── */
.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 20px;
}
.login-box .logo {
  width: 80px; height: 80px;
  border-radius: 20px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.login-box h2 { font-size: 1.5rem; text-align: center; }
.login-box p { color: var(--text2); font-size: 0.9rem; text-align: center; }

/* ─── Form elements ───────────────────────────────────────────────────────── */
.field {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label { font-size: 0.85rem; color: var(--text2); }
.field input {
  background: var(--bg3);
  border: 2px solid var(--bg3);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  padding: 14px 16px;
  width: 100%;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field input::placeholder { color: var(--text2); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  min-height: 48px;
  transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { opacity: .8; transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; width: 100%; max-width: 340px; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text); }
.btn-big {
  width: 100%;
  padding: 20px;
  font-size: 1.2rem;
  border-radius: 16px;
  margin-bottom: 12px;
}
.btn-photo { background: #1565c0; color: #fff; }
.btn-video { background: #b71c1c; color: #fff; }
.btn-view  { background: var(--bg3); color: var(--text); }
.btn-new   { background: var(--accent); color: #fff; }

/* ─── Stand card ─────────────────────────────────────────────────────────── */
.stand-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stand-card:hover, .stand-card:active { background: var(--bg3); }
.stand-card .snum {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.stand-card .snombre {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 2px;
}
.stand-card .sbadge {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── Capture view ────────────────────────────────────────────────────────── */
.stand-info {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stand-info .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.stand-info .label { font-size: 0.8rem; color: var(--text2); }

.capture-actions { margin-bottom: 20px; }

/* Hidden file inputs */
.file-input-hidden { display: none !important; }

/* ─── Upload queue ────────────────────────────────────────────────────────── */
.upload-queue {
  margin-top: 8px;
}
.upload-item {
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.upload-item .thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}
.upload-item .thumb.video-thumb {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: var(--text2);
}
.upload-item .info { flex: 1; min-width: 0; }
.upload-item .fname {
  font-size: 0.8rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-item .status {
  font-size: 0.8rem;
  font-weight: 600;
}
.status-uploading { color: #ffc107; }
.status-done      { color: var(--green); }
.status-error     { color: var(--red); }

/* ─── Media grid ──────────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.media-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg2);
  cursor: pointer;
  position: relative;
}
.media-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.media-cell .vid-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  font-size: 1.8rem;
}

/* ─── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
}
.lightbox .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
}
.empty .icon { font-size: 3rem; margin-bottom: 12px; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 0.9rem;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: opacity .3s;
}

/* ─── Nav bar ─────────────────────────────────────────────────────────────── */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: var(--bg2);
  display: flex;
  border-top: 1px solid var(--bg3);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  border: none;
  background: none;
  color: var(--text2);
  padding: 12px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s;
}
.nav-btn .ni { font-size: 1.3rem; }
.nav-btn.active { color: var(--accent); }

.with-nav { padding-bottom: 72px; }

/* ─── Misc ────────────────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
  margin-top: 20px;
}
.badge {
  display: inline-block;
  background: var(--bg3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.8rem;
  color: var(--text2);
}
