:root {
  --bg: #0b0f14;
  --bg-soft: #131a22;
  --ink: #f5f6f8;
  --ink-soft: #c7ced8;
  --accent: #f5b256;
  --accent-2: #52c7b8;
  --accent-3: #4aa0ff;
  --line: rgba(245, 246, 248, 0.12);
  --card: rgba(14, 20, 28, 0.86);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #1c2634 0%, var(--bg) 50%, #07090d 100%);
  min-height: 100vh;
  -webkit-user-select: none;
  user-select: none;
}

.glow {
  position: fixed;
  inset: -25vmin;
  background:
    radial-gradient(circle at 15% 20%, rgba(245, 178, 86, 0.22), transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(82, 199, 184, 0.2), transparent 55%),
    radial-gradient(circle at 70% 85%, rgba(74, 160, 255, 0.22), transparent 60%),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 2px, transparent 2px, transparent 12px);
  filter: blur(12px);
  z-index: -1;
}

.hero {
  padding: 56px 8vw 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.hero-reader {
  padding-bottom: 10px;
}

.eyebrow {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

h1,
h2,
h3 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0 0 12px;
}

.subtitle {
  margin: 0;
  color: var(--ink-soft);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost,
.cta,
.read-btn,
.tool-btn,
.shelf-pagination button {
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.cta,
.read-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: none;
  color: #0b0f14;
  font-weight: 700;
}

.support-panel {
  margin: 0 8vw 32px;
  background: linear-gradient(120deg, rgba(245, 178, 86, 0.25), rgba(82, 199, 184, 0.25));
  border: 1px solid rgba(245, 246, 248, 0.2);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bmc-cta {
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  border: 1px solid rgba(245, 246, 248, 0.4);
  text-decoration: none;
  color: #0b0f14;
  background: #f5d08e;
  font-weight: 700;
}

.featured {
  margin: 0 8vw 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.featured-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(245, 246, 248, 0.12);
  background: rgba(10, 14, 20, 0.9);
  display: grid;
  grid-template-rows: 160px 1fr;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.6s ease forwards;
  opacity: 0;
  animation-delay: calc(var(--delay, 0) * 0.08s);
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.featured-cover {
  position: relative;
  background: linear-gradient(140deg, rgba(245, 178, 86, 0.24), rgba(74, 160, 255, 0.28));
}

.featured-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-info {
  padding: 12px 14px 16px;
}

.featured-info h3 {
  margin: 6px 0 0;
  font-size: 1.1rem;
}

.shelf {
  margin: 0 8vw 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 24px 28px;
  box-shadow: var(--shadow);
}

.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-row {
  display: grid;
  gap: 12px;
  justify-items: flex-start;
}

.search-wrapper {
  flex-grow: 1;
  max-width: 320px;
}

input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.9);
  color: var(--ink);
}

input[type="search"]::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}


.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.shelf-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.shelf-pagination button {
  background: rgba(10, 14, 20, 0.9);
}

.shelf-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-card {
  background: rgba(10, 14, 20, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(245, 246, 248, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-rows: 190px 1fr;
  animation: rise 0.6s ease forwards;
  opacity: 0;
}

.link-card {
  text-decoration: none;
  color: inherit;
}

.game-cover {
  position: relative;
  padding: 18px;
  background: linear-gradient(140deg, rgba(245, 178, 86, 0.2), rgba(82, 199, 184, 0.24));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.game-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.cover-title h3 {
  margin: 0 0 6px;
}

.cover-title p {
  margin: 0;
  color: var(--ink-soft);
}

.game-meta {
  padding: 16px 18px 20px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.read-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 40px;
  line-height: 1;
  width: 100%;
}

.label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.value {
  margin: 0;
}

.password-btn {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
}

.password-gate {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.reader-shell {
  margin: 0 8vw 40px;
}

.reader {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.reader-title h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.reader-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  background: rgba(10, 14, 20, 0.9);
}

.reader-grid {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 20px;
  margin-top: 20px;
}

.poster {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(245, 246, 248, 0.12);
  background: rgba(10, 14, 20, 0.9);
  min-height: 280px;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-soft);
}

.details {
  display: grid;
  gap: 18px;
}

.detail-block {
  background: rgba(10, 14, 20, 0.9);
  border: 1px solid rgba(245, 246, 248, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
}

.detail-block h3 {
  margin: 0 0 12px;
}

.download-list {
  display: grid;
  gap: 10px;
}

.download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 26, 36, 0.9);
  border: 1px solid rgba(245, 246, 248, 0.1);
  transition: transform 0.2s ease;
}

.download-card:hover {
  transform: translateX(4px);
}

.download-arrow {
  color: var(--accent);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.reader-body {
  margin-top: 24px;
  background: rgba(10, 14, 20, 0.9);
  border: 1px solid rgba(245, 246, 248, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
}

.reader-body h3 {
  margin: 0 0 12px;
}

.description {
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 1rem;
}

.description p {
  margin: 0 0 12px;
}

.empty,
.error {
  margin: 0;
  color: var(--ink-soft);
}

.footer {
  padding: 0 8vw 36px;
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .reader-grid {
    grid-template-columns: 1fr;
  }

  .poster {
    min-height: 220px;
  }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .support-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .shelf-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reader {
    padding: 18px;
  }
}
