.database-page {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(6, 19, 33, 0.92), rgba(12, 35, 56, 0.86) 330px, #f4f8fb 330px),
    url("./assets/hero-hanabi.png") center top / cover no-repeat;
}

.database-main {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 118px 0 56px;
}

.database-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  color: #fff;
}

.database-hero h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 48px;
  line-height: 1.15;
}

.database-hero p {
  max-width: 740px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.database-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(142px, 1fr));
  gap: 12px;
  margin-top: 42px;
  padding: 18px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(6, 19, 33, 0.12);
}

.database-controls label {
  display: grid;
  gap: 7px;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 700;
}

.database-controls input,
.database-controls select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid rgba(6, 19, 33, 0.12);
  border-radius: 8px;
  font: inherit;
}

.database-table-section,
.database-board-section {
  margin-top: 18px;
  padding: 22px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(6, 19, 33, 0.1);
}

.table-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.table-heading h2 {
  margin: 0;
  font-size: 24px;
}

.table-heading p {
  margin: 0;
  color: var(--body-muted);
  font-size: 13px;
}

.board-heading {
  align-items: start;
}

.board-heading p {
  max-width: 680px;
  margin-top: 5px;
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid rgba(6, 19, 33, 0.08);
  border-radius: 8px;
}

.view-switch button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--body-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
}

.view-switch button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(6, 19, 33, 0.08);
}

.event-groups {
  display: grid;
  gap: 26px;
}

.event-group {
  display: grid;
  gap: 14px;
}

.event-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(6, 19, 33, 0.1);
}

.event-group-title h3 {
  margin: 0;
  font-size: 20px;
}

.event-group-title span {
  color: var(--body-muted);
  font-size: 13px;
  font-weight: 800;
}

.hanabi-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hanabi-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 253, 0.98)),
    radial-gradient(circle at 88% 12%, rgba(238, 109, 95, 0.16), transparent 16rem);
  border: 1px solid rgba(6, 19, 33, 0.1);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(6, 19, 33, 0.08);
  cursor: pointer;
}

.hanabi-card:hover {
  border-color: rgba(238, 109, 95, 0.36);
  transform: translateY(-1px);
}

.hanabi-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.card-date {
  margin: 0;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 900;
}

.hanabi-card h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.28;
}

.card-ja {
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--body-muted);
  font-size: 12px;
}

.card-intro {
  margin: 0;
  color: var(--body);
  font-size: 14px;
}

.priority-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(132px, 0.82fr);
  gap: 10px;
}

.priority-fact {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(6, 19, 33, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(6, 19, 33, 0.06);
}

.priority-fact span {
  display: block;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 900;
}

.priority-fact strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.priority-fact small {
  display: block;
  margin-top: 6px;
  color: var(--body-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.location-priority {
  border-color: rgba(101, 210, 223, 0.38);
  background: linear-gradient(180deg, rgba(236, 251, 253, 0.96), #fff);
}

.count-priority {
  border-color: rgba(238, 109, 95, 0.28);
  background: linear-gradient(180deg, rgba(255, 243, 240, 0.98), #fff);
}

.ticket-alert {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(6, 19, 33, 0.1);
  background: var(--surface-soft);
}

.ticket-alert strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.ticket-alert span {
  color: var(--body-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ticket-alert.ended {
  border-color: rgba(217, 85, 73, 0.32);
  background: rgba(238, 109, 95, 0.1);
}

.ticket-alert.ended strong,
.ticket-alert.ended span {
  color: var(--coral-dark);
}

.ticket-alert.onsale {
  border-color: rgba(65, 151, 103, 0.3);
  background: rgba(140, 207, 166, 0.16);
}

.ticket-alert.onsale strong {
  color: #145538;
}

.ticket-alert.upcoming {
  border-color: rgba(196, 132, 28, 0.28);
  background: rgba(248, 199, 108, 0.18);
}

.ticket-alert.upcoming strong {
  color: #7c4b07;
}

.card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-facts div,
.traffic-box {
  min-width: 0;
  padding: 10px;
  background: rgba(244, 248, 251, 0.92);
  border: 1px solid rgba(6, 19, 33, 0.08);
  border-radius: 8px;
}

.card-facts span,
.traffic-box span {
  display: block;
  color: var(--body-muted);
  font-size: 11px;
  font-weight: 900;
}

.card-facts strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.traffic-box p {
  margin: 4px 0 0;
  color: var(--body);
  font-size: 13px;
}

.highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.highlight-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: #174a54;
  background: rgba(101, 210, 223, 0.16);
  border: 1px solid rgba(101, 210, 223, 0.28);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.card-actions button,
.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(6, 19, 33, 0.12);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.card-actions button {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.table-scroll {
  overflow-x: auto;
}

.database-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 14px;
}

.database-table th,
.database-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(6, 19, 33, 0.08);
  text-align: left;
  vertical-align: top;
}

.database-table th {
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 800;
}

.database-table tbody tr {
  cursor: pointer;
}

.database-table tbody tr:hover {
  background: rgba(101, 210, 223, 0.08);
}

.event-name-cell strong {
  display: block;
  color: var(--ink);
}

.event-name-cell span,
.muted-cell {
  display: block;
  margin-top: 4px;
  color: var(--body-muted);
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.verified {
  color: #145538;
  background: rgba(140, 207, 166, 0.22);
}

.status-chip.pending {
  color: #8a4d14;
  background: rgba(248, 199, 108, 0.26);
}

.event-drawer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
}

.event-drawer.is-open {
  display: block;
}

.db-drawer-panel {
  top: 5vh;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(920px, calc(100% - 36px));
  max-height: 90vh;
  padding: 48px 24px 24px;
  border-radius: 8px;
  transform: translateX(-50%);
}

.db-detail h2 {
  margin: 0;
  padding-right: 48px;
  font-size: 28px;
  line-height: 1.25;
}

.db-detail .ja-name {
  margin: 8px 0 0;
  color: var(--body-muted);
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-intro {
  margin: 16px 0 0;
  color: var(--body);
}

.source-link-strip {
  margin-top: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(6, 19, 33, 0.04), rgba(101, 210, 223, 0.12));
  border: 1px solid rgba(6, 19, 33, 0.1);
  border-radius: 8px;
}

.source-link-strip h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.source-link-strip > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-link-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(6, 19, 33, 0.12);
  border-radius: 8px;
}

.source-link-card.primary {
  color: #fff;
  background: var(--night-2);
  border-color: var(--night-2);
}

.source-link-card span {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  opacity: 0.78;
}

.source-link-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.source-link-card em {
  color: var(--coral-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.source-link-card.primary em {
  color: var(--moon);
}

.db-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.db-fact {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid rgba(6, 19, 33, 0.08);
  border-radius: 8px;
}

.db-fact span {
  display: block;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 800;
}

.db-fact strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.db-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(6, 19, 33, 0.1);
}

.db-section h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.db-section p {
  margin: 0;
  color: var(--body);
}

.detail-tags {
  margin-bottom: 10px;
}

.db-links {
  display: grid;
  gap: 8px;
}

.db-links a {
  display: block;
  overflow-wrap: anywhere;
  color: var(--coral-dark);
  font-weight: 800;
}

.bundle-list {
  display: grid;
  gap: 8px;
}

.bundle-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid rgba(6, 19, 33, 0.08);
  border-radius: 8px;
}

.bundle-item strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.bundle-item span {
  color: var(--body-muted);
  font-size: 13px;
  line-height: 1.55;
}

.ticket-bundle-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.ticket-bundle-item em {
  display: block;
  margin-top: 5px;
  color: var(--body-muted);
  font-style: normal;
  font-size: 12px;
}

.ticket-bundle-item a,
.ticket-bundle-item button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  color: #fff;
  background: var(--coral);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

.ticket-platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ticket-platform-links a {
  min-height: 38px;
  color: var(--coral);
  background: #fff;
  border: 1px solid rgba(238, 109, 95, 0.35);
}

.bundle-item.compact strong {
  color: var(--coral-dark);
  font-size: 12px;
  text-transform: uppercase;
}

.backend-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.backend-review div {
  padding: 12px;
  background: rgba(13, 41, 64, 0.06);
  border: 1px solid rgba(13, 41, 64, 0.1);
  border-radius: 8px;
}

.backend-review span {
  display: block;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 900;
}

.backend-review strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .database-page {
    background:
      linear-gradient(180deg, rgba(6, 19, 33, 0.94), rgba(12, 35, 56, 0.9) 500px, #f4f8fb 500px),
      url("./assets/hero-hanabi.png") center top / cover no-repeat;
  }

  .database-main {
    width: calc(100% - 28px);
    padding-top: 92px;
  }

  .database-hero {
    grid-template-columns: 1fr;
  }

  .database-hero h1 {
    font-size: 36px;
  }

  .database-controls {
    grid-template-columns: 1fr;
  }

  .database-table-section {
    padding: 16px;
  }

  .database-board-section {
    padding: 14px;
  }

  .table-heading {
    align-items: start;
    flex-direction: column;
  }

  .view-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hanabi-card-grid,
  .card-facts,
  .priority-facts,
  .source-link-strip > div {
    grid-template-columns: 1fr;
  }

  .ticket-bundle-item {
    grid-template-columns: 1fr;
  }

  .ticket-platform-links {
    justify-content: stretch;
  }

  .ticket-platform-links a {
    flex: 1 1 130px;
  }

  .hanabi-card {
    padding: 15px;
  }

  .hanabi-card-top {
    flex-direction: column;
  }

  .hanabi-card h3 {
    font-size: 20px;
  }

  .db-detail-grid {
    grid-template-columns: 1fr;
  }

  .backend-review {
    grid-template-columns: 1fr;
  }

  .db-drawer-panel {
    inset: 0;
    width: 100%;
    max-height: none;
    padding: 58px 18px 24px;
    border-radius: 0;
    transform: none;
  }
}
