/* --- Page --- */
[hidden] { display: none !important; }

.events-page { min-height: 100svh; }

.events-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 0% 0%, rgb(49 72 163 / 0.3), transparent 70%),
    radial-gradient(ellipse 80% 55% at 100% 100%, rgb(108 42 29 / 0.34), transparent 70%),
    var(--ink);
  pointer-events: none;
}

.events-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px clamp(18px, 3vw, 36px);
  min-height: 76px;
  padding: 14px var(--margin) 14px calc(var(--margin) + 64px);
}

.account { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.account__avatar { width: 34px; height: 34px; border: 2px solid var(--sticker); }
.account__note { font-size: var(--step-small); opacity: 0.8; }
.button--small { padding: 0.62em 0.9em 0.54em; font-size: var(--step-body); }

.events {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  max-width: 980px;
  margin-inline: auto;
  padding: clamp(18px, 4vw, 56px) var(--margin) clamp(80px, 10vw, 140px);
}

.events__head h1 {
  font-size: var(--step-mega);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.84;
  text-transform: uppercase;
}

.events__head p { max-width: 34em; margin-top: 16px; font-size: var(--step-lead); line-height: 1.3; }
.events__subhead { margin-bottom: clamp(16px, 2.4vw, 26px); font-size: var(--step-head); line-height: 0.92; }
.events__empty { font-size: var(--step-lead); }

.notice {
  padding: 12px 16px;
  border: var(--stroke) solid var(--sticker);
  background: var(--ink);
  font-weight: 600;
}

/* --- Cards --- */
.event-list { display: grid; gap: clamp(20px, 3vw, 32px); }

.event {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 36px);
  border: var(--stroke) solid var(--sticker);
  background: var(--paper);
  color: var(--ink);
  filter: drop-shadow(7px 7px 0 #000);
}

.event__head { display: grid; gap: 10px; }

.event__kind {
  justify-self: start;
  padding: 5px 10px 4px;
  background: var(--ink);
  color: var(--sticker);
  font-size: var(--step-small);
  font-weight: 800;
  font-stretch: 72%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.event--peek .event__kind { background: var(--cobalt); }
.event--poll .event__kind { background: #6c2a1d; }
.event__title { font-size: var(--step-head); line-height: 0.92; }
.event__body { max-width: 62ch; white-space: pre-line; }
.event__when { font-size: var(--step-small); font-weight: 600; }
.event__image { width: 100%; max-height: 540px; object-fit: contain; background: var(--ink); }
.event__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.event__foot .button { font-size: var(--step-body); }
.event__remove { margin-left: auto; color: #8a1c10; }

/* --- Countdown --- */
.clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.4vw, 14px); }

.clock__unit {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: clamp(12px, 2vw, 22px) 4px clamp(10px, 1.6vw, 16px);
  background: var(--ink);
  color: var(--sticker);
  transition: background-color 400ms linear;
}

.clock__value {
  font-size: clamp(2.5rem, 1rem + 6.4vw, 6rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.clock__label { font-size: var(--step-small); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.event--countdown.is-done .clock__unit { background: var(--cobalt); }

/* --- Sneak peek --- */
.peek { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }

.peek__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.peek__image:not([src]) { visibility: hidden; }
.peek__image--next { opacity: 0; transition: opacity 700ms ease; }
.peek__image--next.is-in { opacity: 1; }

.peek__wall {
  position: absolute;
  inset: 0;
  display: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='80'%3E%3Cpath d='M0 38h96M0 78h96M2 0v38M50 40v38' stroke='%23090608' stroke-width='4' fill='none'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #3a1d16, #24140f 60%, #161c3a);
}

.peek.is-walled .peek__wall { display: block; }

.peek__timer {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 12px 6px;
  background: var(--ink);
  color: var(--sticker);
  font-size: var(--step-lead);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.peek.is-walled .peek__timer {
  left: 50%;
  top: 50%;
  bottom: auto;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 0.3em 0.5em 0.22em;
  border: var(--stroke) solid var(--sticker);
  font-size: clamp(1.8rem, 0.8rem + 4.4vw, 4.4rem);
  text-align: center;
  transform: translate(-50%, -50%);
}

.event--peek.is-revealed .peek__timer { display: none; }

/* --- Poll --- */
.poll { display: grid; gap: 10px; }

.poll__option {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 14px 16px 13px;
  border: 3px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.poll__fill {
  position: absolute;
  inset: 0;
  background: rgb(49 72 163 / 0.2);
  transform: scaleX(var(--share, 0));
  transform-origin: left;
  transition: transform 600ms var(--ease-out);
}

.poll__label, .poll__share { position: relative; }
.poll__share { font-variant-numeric: tabular-nums; }
.poll__option.is-mine { border-color: var(--cobalt); }
.poll__option.is-mine .poll__fill { background: rgb(49 72 163 / 0.42); }
.poll__option.is-mine .poll__label::after { content: " (your vote)"; font-weight: 500; }
.poll__option:disabled { cursor: default; }
.poll__message { font-size: var(--step-small); font-weight: 600; }
.poll__message:empty { display: none; }

@media (hover: hover) {
  .poll__option:not(:disabled):hover { background: rgb(9 6 8 / 0.07); }
}

/* --- Admin studio --- */
.studio {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 36px);
  border: var(--stroke) dashed var(--sticker);
  color-scheme: dark;
}

.studio__title { font-size: var(--step-head); line-height: 0.92; }
.studio__form, .studio__part { display: grid; gap: 16px; }

.studio__kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.studio__kinds legend { width: 100%; margin-bottom: 8px; font-weight: 600; }

.studio__kinds label {
  position: relative;
  padding: 10px 14px 9px;
  border: 2px solid var(--sticker);
  font-weight: 700;
  cursor: pointer;
}

.studio__kinds input { position: absolute; opacity: 0; pointer-events: none; }
.studio__kinds label:has(input:checked) { background: var(--sticker); color: var(--ink); }
.studio__kinds label:has(input:focus-visible) { outline: 3px solid var(--sticker); outline-offset: 3px; }

.field { display: grid; gap: 6px; font-weight: 600; }

.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--sticker);
  border-radius: 0;
  background: var(--ink);
  color: var(--sticker);
  font: inherit;
  font-weight: 500;
}

.field textarea { resize: vertical; }
.field input[type="file"] { padding: 8px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

.studio__options { display: grid; gap: 8px; }
.studio__option { display: flex; gap: 10px; align-items: center; }
.studio__option .field { flex: 1; }

.studio__preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.studio__preview:empty { display: none; }
.studio__preview figure { display: grid; gap: 4px; margin: 0; font-size: var(--step-small); }
.studio__preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }

.studio__send { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.studio__message { font-weight: 600; }

/* --- Footer --- */
.events-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  padding: 0 var(--margin) 48px;
}

@media (max-width: 640px) {
  .clock__label { font-size: 0.7rem; letter-spacing: 0.04em; }
  .events-bar .bar__links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .peek__image--next, .poll__fill, .clock__unit { transition: none; }
}