:root {
  --bg: #090505;
  --bg-soft: #130909;
  --panel: rgba(24, 12, 12, 0.88);
  --panel-hover: rgba(34, 15, 15, 0.94);
  --line: rgba(255, 98, 57, 0.18);
  --line-strong: rgba(255, 98, 57, 0.38);
  --text: #f6efec;
  --muted: #c9b3ad;
  --accent: #ff5b30;
  --accent-strong: #ff2f1a;
  --accent-soft: #ffb089;
  --max: 1080px;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 83, 32, 0.18), transparent 28%),
    linear-gradient(180deg, #0d0606 0%, #060303 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 20%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 120px);
  opacity: 0.22;
}

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

.app {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.site-header {
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: 10px 0 24px;
}

.inner-header {
  padding-bottom: 16px;
}

.logo-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.site-logo {
  max-width: min(360px, 78vw);
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(255, 69, 32, 0.28));
}

.logo-wrap.is-fallback .site-logo {
  display: none;
}

.logo-fallback {
  display: none;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.18em;
  color: var(--accent-soft);
}

.logo-wrap.is-fallback .logo-fallback {
  display: inline-block;
}

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.topic-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: 160ms ease;
}

.topic-nav a:hover,
.topic-nav a.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 91, 48, 0.08);
}

.home,
.inner-page {
  display: grid;
  gap: 28px;
}

.search-block,
.page-intro,
.topic-card,
.content-card {
  background: linear-gradient(180deg, rgba(24, 12, 12, 0.92), rgba(12, 7, 7, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-block,
.page-intro {
  padding: 28px;
}

.section-kicker {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

h1,
h2 {
  margin: 0;
  font-family: "Cinzel", serif;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.search-block > p:last-child,
.page-intro > p:last-child,
.topic-card p:last-child,
.content-card p {
  color: var(--muted);
  line-height: 1.7;
}

.search-bar {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.search-bar span {
  color: var(--accent-soft);
  font-weight: 600;
}

.search-bar input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  padding: 16px 18px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 91, 48, 0.12);
}

.topic-grid,
.content-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.topic-card,
.content-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  transition: 180ms ease;
}

.topic-card:hover,
.content-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: linear-gradient(180deg, var(--panel-hover), rgba(14, 7, 7, 0.98));
}

.topic-label {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.search-empty {
  margin: 0;
  padding: 6px 4px 0;
  color: var(--muted);
}

.site-signature {
  display: flex;
  justify-content: center;
  padding: 2px 0 0;
}

.site-signature p {
  margin: 0;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 221, 190, 0.72);
  text-shadow:
    0 0 4px rgba(255, 155, 76, 0.22);
}

.site-signature span {
  display: inline-block;
  color: #10d1b3;
  text-shadow:
    0 0 4px rgba(16, 209, 179, 0.38),
    0 0 8px rgba(0, 170, 145, 0.24),
    0 0 14px rgba(0, 120, 102, 0.18);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.site-signature a:hover span,
.site-signature a:focus-visible span {
  color: #3df5d3;
  text-shadow:
    0 0 5px rgba(61, 245, 211, 0.5),
    0 0 10px rgba(16, 209, 179, 0.32),
    0 0 16px rgba(0, 140, 118, 0.22);
}

.guide-intro {
  text-align: center;
}

.guide-intro p:last-child {
  max-width: 760px;
  margin: 18px auto 0;
}

.character-portrait {
  width: min(100%, 270px);
  aspect-ratio: 1 / 1;
  margin: 24px auto 0;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.character-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.character-portrait.placeholder {
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 91, 48, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.01);
}

.guide-flow {
  width: min(100%, 820px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.guide-step {
  display: grid;
  gap: 20px;
  justify-items: center;
  padding: 28px;
  background: linear-gradient(180deg, rgba(24, 12, 12, 0.92), rgba(12, 7, 7, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-step-text {
  text-align: center;
}

.guide-copy {
  width: min(100%, 680px);
  text-align: center;
}

.step-tag {
  margin: 0 0 10px;
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guide-copy h2 {
  margin-bottom: 12px;
}

.guide-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.text-red {
  color: #ff4b3e;
}

.text-green {
  color: #6bdc8b;
}

.guide-media {
  width: min(100%, 720px);
  margin: 0;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.guide-media img {
  display: block;
  width: 100%;
  height: auto;
}

.guide-media.placeholder {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 91, 48, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.01);
}

.event-table-wrap,
.info-panel,
.boss-card {
  background: linear-gradient(180deg, rgba(24, 12, 12, 0.92), rgba(12, 7, 7, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.event-table-wrap {
  overflow: hidden;
}

.event-table {
  width: 100%;
  border-collapse: collapse;
}

.event-table th,
.event-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.event-table th {
  color: var(--accent-soft);
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.event-table td {
  color: var(--muted);
}

.event-table tr:last-child td {
  border-bottom: 0;
}

.info-panel {
  padding: 22px;
}

.info-panel h2,
.boss-card h2 {
  margin-bottom: 10px;
}

.info-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.boss-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.boss-photo {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.boss-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.boss-photo.placeholder {
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 91, 48, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.01);
}

.reward-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reward-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.day-list {
  width: min(100%, 700px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.day-card {
  text-align: center;
  padding: 22px;
  background: linear-gradient(180deg, rgba(24, 12, 12, 0.92), rgba(12, 7, 7, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.day-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-soft);
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
}

@media (max-width: 720px) {
  .app {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 18px;
  }

  .topic-grid,
  .content-list,
  .boss-grid {
    grid-template-columns: 1fr;
  }

  .search-block,
  .page-intro,
  .topic-card,
  .content-card,
  .guide-step {
    padding: 20px;
  }

  .topic-nav {
    gap: 8px;
  }

  .topic-nav a {
    padding: 9px 13px;
    font-size: 0.95rem;
  }
}
