:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
  --bg: #f6f2e7;
  --surface: #ffffff;
  --ink: #12254a;
  --muted: #56709d;
  --primary: #1f5ed6;
  --primary-dark: #1749aa;
  --accent: #1a9bb3;
  --ok-bg: #d9f5e6;
  --ok-ink: #175d3a;
  --err-bg: #ffe5e7;
  --err-ink: #7d1d2a;
  --border: #d7e3ff;
  --shadow: 0 16px 34px rgba(21, 47, 106, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  position: relative;
  background:
    linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 31px,
      rgba(66, 110, 183, 0.2) 31px,
      rgba(66, 110, 183, 0.2) 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 31px,
      rgba(66, 110, 183, 0.16) 31px,
      rgba(66, 110, 183, 0.16) 32px
    ),
    var(--bg);
  color: var(--ink);
}

.theme-greek {
  min-height: 100vh;
}

.theme-greek::before {
  content: "";
  display: block;
  height: 12px;
  position: relative;
  z-index: 1;
  background:
    repeating-linear-gradient(
      90deg,
      #1f5ed6 0,
      #1f5ed6 14px,
      #dce8ff 14px,
      #dce8ff 28px,
      #1f5ed6 28px,
      #1f5ed6 42px,
      #dce8ff 42px,
      #dce8ff 56px
    );
}

.theme-greek::after {
  content: "";
  position: fixed;
  inset: 12px 0 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='220' viewBox='0 0 360 220' fill='none' stroke='%232f5fa8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26 46h52l-8 10H34z'/%3E%3Cpath d='M46 46V24l10 8'/%3E%3Cpath d='M118 42c10-14 24-14 34 0'/%3E%3Cpath d='M118 56c10-14 24-14 34 0'/%3E%3Cpath d='M196 60h54'/%3E%3Cpath d='M204 60V38h38v22'/%3E%3Cpath d='M223 60V38'/%3E%3Cpath d='M285 52c7-14 19-14 26 0'/%3E%3Cpath d='M298 52v18'/%3E%3Cpath d='M38 158c16-14 34-14 50 0'/%3E%3Cpath d='M34 172h58'/%3E%3Cpath d='M120 140l10 30m0-30l-10 30m22-30v30'/%3E%3Ccircle cx='211' cy='149' r='13'/%3E%3Cpath d='M203 149h16'/%3E%3Cpath d='M211 141v16'/%3E%3Cpath d='M278 152l25-13m-25 13l25 13'/%3E%3Cpath d='M272 176h40'/%3E%3C/svg%3E");
  background-size: 420px 260px;
  background-repeat: repeat;
}

.theme-greek > * {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.card,
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.hero-card {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 255, 0.98)),
    var(--surface);
}

h1,
h2,
p {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="password"],
button {
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font: inherit;
}

input[type="text"],
input[type="password"] {
  border: 1px solid var(--border);
  background: #f9fbff;
  color: var(--ink);
}

input[name="uploader_name"] {
  width: 100%;
}

button,
.button-link {
  background: linear-gradient(135deg, var(--primary), #2d7be8);
  border: none;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
}

button:hover,
.button-link:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1f5ed6);
}

.button-link.danger {
  background: linear-gradient(135deg, #a51937, #c92f4f);
}

.button-link.danger:hover {
  background: linear-gradient(135deg, #8c1630, #ab2541);
}

a {
  color: var(--primary);
}

.muted {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e6eeff;
  padding: 0.6rem;
  font-size: 0.9rem;
  vertical-align: top;
}

.table-preview {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f5f8ff;
}

.couple-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px;
  background: #8a8f9a;
  border-radius: 12px;
  overflow: hidden;
}

.wall-item {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #c6ccd8;
}

.wall-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wall-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #4e5f85;
  background: #dde4f2;
}

.wall-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0.25rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.33rem 0.35rem;
  background: rgba(86, 93, 107, 0.86);
  color: #f2f5ff;
  font-size: 0.66rem;
  line-height: 1;
}

.wall-uploader {
  position: absolute;
  left: 0.42rem;
  right: 1.8rem;
  top: 0.42rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  background: rgba(23, 33, 54, 0.64);
  color: #eef4ff;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall-action {
  border: 1px solid rgba(255, 255, 255, 0.33);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.wall-action:hover {
  background: rgba(255, 255, 255, 0.24);
}

.favorite-btn.is-active {
  background: rgba(223, 41, 78, 0.85);
  border-color: rgba(223, 41, 78, 0.95);
}

.delete-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
}

.delete-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.preview-modal {
  border: none;
  background: rgba(8, 12, 24, 0.9);
  width: min(92vw, 900px);
  padding: 1rem 1rem 0.9rem;
  border-radius: 14px;
}

.preview-modal::backdrop {
  background: rgba(7, 11, 22, 0.68);
}

.preview-close {
  margin-left: auto;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.preview-content {
  display: grid;
  place-items: center;
  margin-top: 0.5rem;
}

.preview-modal-media {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
}

.flash {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
}

.flash.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.flash.error {
  background: var(--err-bg);
  color: var(--err-ink);
}

.qr-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.qr {
  width: 220px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.3rem;
}

.guest-body {
  min-height: 100vh;
}

.guest-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.big-upload-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, #1f5ed6, #1a9bb3);
  color: #fff;
  border-radius: 18px;
  padding: 1.25rem 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
}

.big-upload-btn + #media-input + .muted {
  margin-bottom: 0.2rem;
}

.big-upload-btn:hover {
  filter: brightness(0.95);
}

#media-input {
  display: none;
}

.preview-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  background: #f8fbff;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
}

.preview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem;
}

.preview-card img,
.preview-card video {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #edf4ff;
}

.preview-fallback {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  background: #edf4ff;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
}

.preview-name {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #d9e7ff;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1f5ed6, #1a9bb3);
  transition: width 0.2s ease;
}

.upload-progress-text {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.error-text {
  color: var(--err-ink);
  font-weight: 700;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.challenge-card {
  border-radius: 12px;
  border: 2px solid #d7e3ff;
  padding: 0.8rem;
  text-align: left;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
}

.challenge-card.selected {
  border-color: #1a9bb3;
  background: #ecfbff;
}

.status {
  min-height: 1.5rem;
  font-weight: 700;
}

.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hidden {
  display: none;
}

.site-footer {
  margin-top: 1.5rem;
  border-top: 10px solid transparent;
  border-image: repeating-linear-gradient(
    90deg,
    #1f5ed6 0,
    #1f5ed6 14px,
    #dce8ff 14px,
    #dce8ff 28px
  ) 1;
  background: linear-gradient(180deg, #f4f8ff, #e7f0ff);
}

.site-footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1rem 1.2rem 1.3rem;
}

.footer-title {
  margin: 0 0 0.3rem;
  color: var(--primary);
  font-weight: 800;
}

.footer-text {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .couple-wall {
    grid-template-columns: repeat(2, 1fr);
  }

  .guest-layout {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .hero-card,
  .card {
    padding: 0.85rem;
    border-radius: 14px;
  }

  .big-upload-btn {
    font-size: 1.1rem;
    padding: 1rem 0.85rem;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }

  .preview-card img,
  .preview-card video,
  .preview-fallback {
    height: 56px;
  }
}
