:root {
  color-scheme: light;
  --ink: #24211d;
  --muted: #6f665c;
  --line: #e2dbd0;
  --paper: #fffdf8;
  --soft: #f5efe5;
  --accent: #8a4f3d;
  --accent-2: #2f6f73;
  --danger: #b23b2e;
  --shadow: 0 18px 50px rgba(67, 48, 30, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at 16% 6%, rgba(138, 79, 61, 0.10), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(47, 111, 115, 0.10), transparent 30rem),
    linear-gradient(140deg, #fffaf1 0%, #f4efe8 52%, #edf4f2 100%);
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.masthead h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.02em;
}
.tagline { margin: 6px 0 0; color: var(--muted); }

.userbar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}
.userbar .who { color: var(--ink); }
.userbar .muted { color: var(--muted); }

/* ---------- grid of events ---------- */
.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(67, 48, 30, 0.08);
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--soft);
}
.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-cover--blank {
  background:
    radial-gradient(circle at 30% 30%, rgba(138, 79, 61, 0.18), transparent 60%),
    linear-gradient(135deg, #efe7d9, #dfe9e6);
}
.card.is-locked .card-cover { filter: saturate(0.75) brightness(0.94); }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
  backdrop-filter: blur(6px);
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.badge.is-open { color: var(--accent-2); }
.badge.is-locked { color: var(--accent); }

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-size: 1.22rem; letter-spacing: -0.01em; }
.card-meta { margin: 0; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.card-desc { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.card-cta { margin-top: auto; padding-top: 10px; font-weight: 650; color: var(--accent-2); }
.card-cta--locked { color: var(--accent); }

.empty { color: var(--muted); }
.foot { margin-top: 42px; color: var(--muted); font-size: 0.82rem; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--soft); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-google { background: #fff; border-color: var(--line); color: var(--ink); width: 100%; }
.btn-google:hover { background: var(--soft); text-decoration: none; }
.btn-google .g {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(from -45deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  color: #fff; font-weight: 800; font-size: 0.7rem;
}

/* ---------- centered auth cards ---------- */
.centerwrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card-auth {
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.card-auth h1 { margin: 0 0 6px; font-size: 1.5rem; }
.muted { color: var(--muted); margin: 0 0 18px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 0.85rem; font-weight: 650; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
}
.field input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.error {
  background: #fdecea; color: var(--danger);
  border: 1px solid #f3c6c0; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 16px; font-size: 0.9rem;
}
.notice {
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; font-size: 0.9rem;
}
.back { margin: 18px 0 0; font-size: 0.9rem; }
