:root {
  --bg: #fdf6f0;
  --card: #ffffff;
  --primary: #b8895f;
  --primary-dark: #8f6440;
  --text: #333;
  --error: #c0392b;
}

* {
  box-sizing: border-box;
}

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

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

h1 {
  text-align: center;
  font-size: 1.6rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

input,
select {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

button {
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:active {
  background: var(--primary-dark);
}

button.secondary {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 0;
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.nav-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.login-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 8px;
}

nav.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-width: 0;
  flex: 1;
}

nav.tabs a {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid #eee;
}

nav.tabs a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card ul li {
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.9rem;
}

.card label input[type="file"] {
  display: block;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.camera-modal video,
.camera-modal canvas {
  width: min(85vw, 380px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.camera-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 4px 0;
  width: min(85vw, 380px);
}

.filter-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

.camera-controls {
  display: flex;
  gap: 10px;
  padding: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.camera-controls button {
  min-width: 90px;
}

.photo-delete {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-strip {
  background: #fffaf3;
  border-radius: 10px;
  padding: 0 10px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.strip-perforation {
  height: 14px;
  background-image: radial-gradient(circle, var(--bg) 3px, transparent 3.6px);
  background-size: 18px 14px;
  background-position: center;
  background-repeat: repeat-x;
}

.strip-frame {
  padding: 10px 0;
}

.strip-frame + .strip-frame {
  border-top: 2px dashed #ddd0c0;
}

.strip-caption {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
}

.strip-frame-photo {
  position: relative;
  border: 6px solid white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.strip-frame-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.strip-frame-photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}

.strip-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  border: none;
  font-size: 0.8rem;
  line-height: 1;
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

.strip-badge-leader {
  top: 8px;
  left: 8px;
  background: rgba(184, 137, 95, 0.9);
}

.strip-badge-delete {
  top: 8px;
  right: 8px;
}

.strip-badge-vote {
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  min-width: 0;
  height: auto;
  gap: 4px;
}

.strip-badge-vote .heart {
  font-size: 1.1rem;
}

.strip-badge-vote .count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.mesa-corkboard {
  background-color: #b98a5e;
  background-image: radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 14px 14px, 10px 10px;
  background-position: 0 0, 5px 5px;
  border-radius: 10px;
  padding: 22px 16px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.cork-photo {
  position: relative;
  background: white;
  padding: 6px 6px 10px;
  border: none;
  border-radius: 3px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
  margin: 8px -8px 16px;
  cursor: pointer;
}

.cork-photo::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a80, #b71c1c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cork-photo img {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 2px;
}

.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 12px;
}

.lightbox-modal img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
}

.lightbox-caption {
  color: white;
  margin: 0;
  font-size: 1rem;
  text-align: center;
}

