:root {
  --bg: #f7f2e8;
  --bg-accent: #fcd29f;
  --ink: #1b1a17;
  --muted: #5d5a55;
  --primary: #ff7a4c;
  --primary-dark: #e4572e;
  --card: #ffffff;
  --shadow: 0 20px 60px rgba(30, 30, 30, 0.15);
  --radius: 22px;
  --font: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffe9c8 0%, var(--bg) 45%, #f7efe1 100%);
  min-height: 100vh;
}

.page {
  position: relative;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 15%, rgba(255, 122, 76, 0.25), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(252, 210, 159, 0.5), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(255, 195, 0, 0.25), transparent 50%);
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: grid;
  gap: 24px;
}

.page.participant {
  min-height: 100vh;
  overflow-y: auto;
}

.page.participant .shell {
  min-height: 100vh;
  padding: 16px 16px 24px;
  gap: 16px;
}

.page.participant #results .results {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 6px;
}

.page.participant .brand h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
}

.page.participant .brand p {
  font-size: 1rem;
}

.page.participant .card {
  padding: 16px;
}

.brand h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 0.2rem;
}

.brand p {
  font-size: 1.2rem;
  color: var(--muted);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field input,
.row input,
.row select,
.pin-row input {
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #f0d9b5;
  font-size: 1rem;
}

.btn {
  padding: 12px 18px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.ghost {
  background: #fff2e4;
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.list {
  display: grid;
  gap: 16px;
}

.list-item {
  padding: 16px;
  border-radius: 16px;
  background: #fff6ea;
  display: grid;
  gap: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff2e4;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.tag-x {
  border: none;
  background: #ff7a4c;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

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

.tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  border: 2px solid #f0d9b5;
  background: white;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: #ffeed6;
}

.gallery {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
}

.page.participant .gallery {
  margin-top: 12px;
}

.image-wrap {
  width: 100%;
  height: clamp(240px, 40vw, 520px);
  border-radius: 18px;
  overflow: hidden;
  background: #fdf3e4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page.participant .image-wrap {
  height: min(45vh, 420px);
}

.image-wrap img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.3s ease;
}

.image-wrap img.zoomed {
  transform: scale(1.6);
  cursor: zoom-out;
}

.pin-row {
  position: sticky;
  top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: #fffaf1;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(30, 30, 30, 0.08);
}

.page.participant .pin-row {
  top: 8px;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.reveal {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffe2c2;
  font-weight: 700;
  text-align: center;
}

.countdown {
  margin-top: 16px;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  background: #ffe2c2;
}

.page.participant .countdown {
  margin-top: 12px;
  font-size: 1.6rem;
  padding: 12px;
}

.results {
  display: grid;
  gap: 14px;
}

.result-item {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 16px;
  align-items: center;
  background: #fff6ea;
  border-radius: 14px;
  padding: 12px;
}

.result-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
}

.moderation {
  background: #fff6ea;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}

.dropzone {
  padding: 14px;
  border-radius: 14px;
  border: 2px dashed #f0d9b5;
  background: #fffaf1;
  text-align: center;
  font-weight: 600;
}

.upload-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.image-card {
  background: #fff6ea;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.image-actions {
  display: grid;
  gap: 8px;
}

@media (max-width: 700px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .pin-row {
    grid-template-columns: 1fr;
  }

  .result-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
  }
}
