body.home-page {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  isolation: isolate;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  --home-surface: rgba(14, 19, 22, 0.94);
  --home-surface-hover: rgba(21, 27, 30, 0.98);
  --home-surface-soft: rgba(13, 18, 21, 0.84);
  --home-line: rgba(247, 243, 234, 0.24);
  --home-line-strong: rgba(228, 189, 112, 0.76);
  --home-muted: #c7c1b6;
  color: #f7f3ea;
  background:
    radial-gradient(880px 620px at 8% -22%, rgba(228, 189, 112, 0.12), transparent 68%),
    radial-gradient(820px 620px at 104% 12%, rgba(80, 169, 189, 0.12), transparent 70%),
    #0b0f12;
}

body.home-page input,
body.home-page textarea,
body.home-page [contenteditable="true"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, rgba(8, 11, 14, 0.28) 0%, rgba(10, 14, 19, 0.54) 54%, rgba(7, 10, 14, 0.3) 100%);
  pointer-events: none;
}

.home-dot-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.home-dot-field .dot-field-canvas {
  display: block;
}

.home-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 72px;
}

.home-header,
.home-actions,
.home-intro,
.search-heading {
  display: flex;
}

.home-header {
  position: relative;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
}

.home-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #e4bd70 0 94px, rgba(247, 243, 234, 0.36) 94px 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: block;
  width: 94px;
  height: 56px;
  -webkit-user-drag: none;
  object-fit: contain;
}

.eyebrow,
.section-kicker,
.action-number {
  margin: 0;
  color: #e4bd70;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-header h1,
.home-intro h2,
.home-search h2 {
  margin: 0;
}

.home-header h1 {
  margin-top: 1px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: 0;
}

.home-editor-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(228, 189, 112, 0.52);
  border-radius: 8px;
  color: #f7f3ea;
  background: rgba(14, 19, 22, 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.home-editor-link:hover {
  transform: translateY(-2px);
  border-color: #f0ce87;
  color: #171208;
  background: #e4bd70;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.home-intro {
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 62px 0 34px;
}

.home-intro h2 {
  margin-top: 9px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  max-width: 9ch;
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.home-intro > p {
  max-width: 390px;
  margin: 0 0 4px;
  color: var(--home-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.home-actions {
  align-items: stretch;
  gap: 18px;
}

.home-action {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 268px;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--home-line);
  border-radius: 14px;
  color: #f7f3ea;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 32%),
    var(--home-surface);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.home-action:hover,
.home-action:focus-within {
  transform: translateY(-3px);
  border-color: var(--home-line-strong);
  background:
    linear-gradient(180deg, rgba(228, 189, 112, 0.07), transparent 36%),
    var(--home-surface-hover);
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.38);
}

.home-action-primary {
  flex: 1.16 1 0;
  border-color: rgba(228, 189, 112, 0.9);
  background:
    linear-gradient(145deg, rgba(56, 54, 42, 0.98), rgba(18, 26, 28, 0.98));
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.36), 0 8px 22px rgba(228, 189, 112, 0.08);
}

.home-action-primary::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -31px;
  width: 146px;
  height: 146px;
  border: 1px solid rgba(228, 189, 112, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(228, 189, 112, 0.035), 0 0 0 41px rgba(228, 189, 112, 0.025);
  pointer-events: none;
}

.action-number {
  color: rgba(247, 243, 234, 0.62);
}

.home-action-label,
.home-action-form label {
  color: #f0ce87;
  font-size: 1.02rem;
  font-weight: 800;
}

.home-action strong {
  max-width: 250px;
  margin-top: auto;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.62rem;
  line-height: 1.24;
}

.action-detail,
.home-action-form p {
  margin: 0;
  color: var(--home-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.action-arrow {
  position: absolute;
  right: 25px;
  bottom: 20px;
  color: #f0ce87;
  font-family: Georgia, serif;
  font-size: 1.8rem;
  line-height: 1;
}

.event-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.event-code-row input,
.event-code-row select {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  border-color: rgba(247, 243, 234, 0.3);
  border-radius: 8px;
  color: #f7f3ea;
  background: rgba(3, 6, 8, 0.72);
}

.event-code-row input::placeholder {
  color: #aaa69e;
}

body.home-page .event-code-row button {
  min-height: 48px;
  border-radius: 8px;
  border-color: rgba(228, 189, 112, 0.72);
  color: #171208;
  background: #e4bd70;
  font-weight: 800;
}

body.home-page .event-code-row button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #f7dfa8;
  background: #f0ce87;
  box-shadow: 0 10px 24px rgba(228, 189, 112, 0.16);
}

.home-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 28px 40px;
  margin-top: 64px;
  padding: 30px;
  border: 1px solid rgba(247, 243, 234, 0.24);
  border-top-color: rgba(228, 189, 112, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(228, 189, 112, 0.065), transparent 34%),
    var(--home-surface);
}

.search-heading {
  display: grid;
  align-self: stretch;
  align-content: center;
  gap: 14px;
}

.home-search h2 {
  margin-top: 7px;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.78rem;
  line-height: 1.2;
}

.search-heading > p {
  margin: 0;
  color: var(--home-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.event-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.event-search-form input {
  min-width: 0;
  min-height: 56px;
  padding-inline: 17px;
  border-color: rgba(247, 243, 234, 0.34);
  border-radius: 8px;
  background: rgba(3, 6, 8, 0.88);
  font-size: 0.96rem;
}

body.home-page .event-search-form button {
  min-height: 56px;
  border-radius: 8px;
  border-color: rgba(228, 189, 112, 0.66);
  color: #171208;
  background: #e4bd70;
  font-weight: 800;
}

body.home-page .event-search-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #f7dfa8;
  background: #f0ce87;
  box-shadow: 0 10px 24px rgba(228, 189, 112, 0.16);
}

.event-search-results {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: none;
  padding-top: 20px;
  border-top: 1px solid rgba(247, 243, 234, 0.16);
}

.event-search-results.is-message {
  display: block;
  color: var(--home-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.event-search-results.is-loading {
  color: #f0ce87;
}

.event-search-results.is-error {
  color: #f2aaa6;
}

.event-search-result {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  padding: 13px 15px;
  border-color: rgba(247, 243, 234, 0.24);
  border-radius: 10px;
  background: rgba(3, 6, 8, 0.58);
  text-align: left;
}

.event-search-result:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--home-line-strong);
  background: var(--home-surface-hover);
}

.event-search-result strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-search-result span {
  overflow: hidden;
  color: var(--home-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-history {
  display: grid;
  gap: 17px;
  margin-top: 56px;
  padding-top: 30px;
  border-top: 0;
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.home-history h2 {
  margin: 7px 0 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.66rem;
}

.history-count {
  color: #a8a59d;
  font-size: 0.82rem;
  font-weight: 700;
}

.recent-events {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.recent-event {
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border-color: rgba(247, 243, 234, 0.24);
  border-radius: 10px;
  background: var(--home-surface-soft);
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.recent-event:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(228, 189, 112, 0.65);
  background: var(--home-surface-hover);
}

.home-action:focus-visible,
.home-editor-link:focus-visible,
.event-search-result:focus-visible,
.recent-event:focus-visible {
  outline: 2px solid #f0ce87;
  outline-offset: 3px;
}

.recent-event-code {
  color: #f2d596;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.recent-event-label,
.recent-events-empty {
  color: var(--home-muted);
  font-size: 0.78rem;
}

.recent-events-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(247, 243, 234, 0.18);
  border-radius: 10px;
  background: var(--home-surface-soft);
}

@media (max-width: 780px) {
  .home-shell {
    width: min(100% - 28px, 1160px);
    padding: 20px 0 48px;
  }

  .home-header {
    padding-bottom: 28px;
  }

  .home-intro {
    align-items: start;
    flex-direction: column;
    gap: 18px;
    padding: 42px 0 28px;
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .recent-events {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-action-primary {
    grid-column: 1 / -1;
  }

  .home-action {
    min-height: 232px;
    padding: 24px;
  }

  .home-search {
    grid-template-columns: 1fr;
    gap: 22px;
  }

}

@media (max-width: 560px) {
  .home-header,
  .search-heading,
  .history-heading {
    align-items: start;
    flex-direction: column;
  }

  .home-editor-link {
    width: 100%;
    justify-content: center;
  }

  .history-heading {
    align-items: end;
    flex-direction: row;
  }

  .home-intro h2 {
    font-size: 2.4rem;
  }

  .home-actions,
  .event-search-results,
  .recent-events {
    grid-template-columns: 1fr;
  }

  .home-action {
    min-height: 226px;
  }

  .home-search {
    margin-top: 48px;
    padding: 24px;
  }

  .home-action-primary {
    grid-column: auto;
  }

  .event-search-form {
    grid-template-columns: 1fr;
  }
}
