:root {
  color-scheme: light;
  --ivory: #fbf7f0;
  --ink: #1c1917;
  --wine: #6b2d3c;
  --wine-deep: #542331;
  --sage: #2f4a3c;
  --line: rgba(28, 25, 23, 0.14);
  --shadow: 0 18px 50px rgba(84, 35, 49, 0.08);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 50% -10%, #fff, transparent 60%),
    var(--ivory);
  color: var(--ink);
}

body {
  min-height: 100dvh;
}

button, input { font: inherit; color: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 20px 0;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.langs { display: flex; gap: 6px; }

.lang {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.lang.is-on {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

.shell {
  width: min(440px, calc(100% - 32px));
  margin: 8vh auto 48px;
  position: relative;
}

.marks {
  width: 28px;
  height: 28px;
  margin-bottom: 22px;
  border: 2px solid var(--wine);
  border-radius: 6px;
  position: relative;
}

.marks::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--wine);
  border-radius: 2px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  margin: 0 0 28px;
  font-size: 1.15rem;
  line-height: 1.45;
  max-width: 28ch;
}

.name {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
}

.name input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  min-height: 52px;
  padding: 0 14px;
  box-shadow: var(--shadow);
}

.actions { display: flex; flex-direction: column; gap: 10px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 16px;
  padding: 0 18px;
  text-align: center;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  cursor: pointer;
}

.btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.btn-primary {
  background: var(--wine);
  color: #fff;
}

.btn-primary:active { background: var(--wine-deep); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--wine);
  color: var(--wine);
}

.notice {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.notice.is-ok {
  background: #eef4ef;
  color: var(--sage);
  border-color: transparent;
}

.queue {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.92rem;
}

.queue li {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 99px;
  background: rgba(107, 45, 60, 0.15);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--wine);
}

body.has-event {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

body.has-event .shell {
  width: min(720px, 100%);
  margin: 18px auto 24px;
}

body.on-gallery .shell {
  width: 100%;
}

body.on-gallery h1,
body.on-gallery .lede {
  padding: 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: #efe8df;
  cursor: pointer;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(28, 25, 23, 0.62);
  color: #fff;
  font-size: 10px;
  line-height: 22px;
  text-align: center;
}

.empty {
  margin: 28px 16px;
  font-size: 1.05rem;
}

.more {
  display: block;
  margin: 16px auto 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  flex: 1;
  min-height: 56px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: rgba(28, 25, 23, 0.42);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.tab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.tab.is-on { color: var(--ink); }

#viewer {
  width: min(960px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 48px 0 0;
  border: 0;
  background: #111;
}

#viewer::backdrop { background: rgba(17, 17, 17, 0.92); }

#viewer img,
#viewer video {
  width: 100%;
  height: calc(100dvh - 48px);
  object-fit: contain;
  background: #111;
}

.viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}
