:root {
  --bg: #060607;
  --card: #12151b;
  --card-soft: #171a22;
  --input: #1b1f29;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --muted-strong: rgba(255, 255, 255, 0.82);
  --blue: #132b62;
  --pink: #be3287;
  --danger: #ffb3ca;
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(820px 460px at 14% -8%, rgba(19, 43, 98, 0.32), transparent 70%),
    radial-gradient(620px 360px at 88% 0%, rgba(190, 50, 135, 0.20), transparent 76%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.events-page {
  min-height: 100vh;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.events-header,
.events-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding-right: 16px;
  padding-left: 16px;
}

.events-header {
  padding-top: max(18px, env(safe-area-inset-top));
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark__logo {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 22px rgba(19, 43, 98, 0.22),
    0 0 32px rgba(190, 50, 135, 0.14);
}

.brand-mark__text {
  font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 750;
}

.events-title {
  margin-top: 26px;
}

.events-title__kicker {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.events-title h1 {
  max-width: 13ch;
  margin: 0;
  font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(36px, 12vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.events-shell {
  padding-top: 20px;
}

.events-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 12px;
}

.zip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.zip-button i {
  width: 15px;
  height: 15px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  padding: 10px 0;
}

.mode-toggle__button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.mode-toggle__button.is-active {
  color: var(--pink);
}

.search-origin {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.events-list {
  display: grid;
  gap: 12px;
}

.event-card,
.state-card {
  border: 1px solid var(--stroke);
  background: var(--card);
  box-shadow: var(--shadow);
}

.event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
}

.event-card:focus-visible {
  outline: 2px solid rgba(190, 50, 135, 0.85);
  outline-offset: 3px;
}

.event-card__cover {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1.9 / 1;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(19, 43, 98, 0.26), rgba(190, 50, 135, 0.24)),
    var(--card-soft);
}

.event-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-card__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--pink);
}

.event-card__fallback i {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 18px rgba(190, 50, 135, 0.25));
}

.event-card__distance {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.54);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.event-card__body {
  display: grid;
  gap: 9px;
}

.event-card__title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}

.event-meta {
  display: grid;
  gap: 6px;
}

.event-meta__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.35;
}

.event-meta__row i {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--blue);
}

.state-card {
  display: grid;
  gap: 10px;
  padding: 22px 18px;
  border-radius: 24px;
}

.state-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
}

.state-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.state-card__button {
  justify-self: start;
  margin-top: 4px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(190, 50, 135, 0.92);
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.state-card__spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--text);
  border-radius: 999px;
  animation: spin 850ms linear infinite;
}

.zip-modal[hidden] {
  display: none;
}

.zip-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: start;
  overflow-y: auto;
  padding: max(56px, calc(env(safe-area-inset-top) + 48px)) 16px 24px;
}

.zip-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.zip-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--stroke-strong);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.46);
}

.zip-sheet h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.zip-sheet p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.zip-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.zip-field {
  display: grid;
  gap: 8px;
}

.zip-field span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zip-field input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--input);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.zip-field input:focus {
  box-shadow: 0 0 0 2px rgba(190, 50, 135, 0.75);
}

.zip-error {
  color: var(--danger) !important;
  font-size: 13px !important;
  font-weight: 650;
}

.zip-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.zip-actions__button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: var(--text);
  font-weight: 750;
}

.zip-actions__button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.zip-actions__button--primary {
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.zip-actions__button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .events-header,
  .events-shell {
    width: min(100%, 720px);
  }

  .events-title h1 {
    max-width: 15ch;
  }
}

@media (max-width: 380px) {
  .events-toolbar {
    gap: 8px;
  }

  .zip-button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .mode-toggle {
    gap: 10px;
  }
}
