:root {
  color-scheme: light;
  --ink: #1c1917;
  --muted: #6b6258;
  --line: #d9cbb4;
  --surface: #f7efe1;
  --accent: #c45c26;
  --accent-deep: #8f3a12;
  --blue: #c45c26;
  --blue-dark: #8f3a12;
  --orange: #e08a2c;
  --shadow: 0 18px 40px rgba(48, 32, 16, 0.14);
  --card-shadow: 4px 4px 0 #1c1917;
  font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Source Han Serif SC", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(196, 92, 38, 0.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(28, 70, 58, 0.16), transparent 32%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(28, 25, 23, 0.04) 28px),
    #2a231c;
}

button, input, a { font: inherit; }
button { color: inherit; }

.app {
  display: none;
  width: min(1440px, calc(100% - 40px));
  margin: 28px auto 56px;
}

.app.is-open { display: block; }

.shell {
  overflow: hidden;
  background: var(--surface);
  border: 3px solid #1c1917;
  border-radius: 6px;
  box-shadow: 10px 10px 0 #1c1917;
}

.brand-header {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 10px 28px;
  background: #1c1917;
  border-bottom: 3px solid #c45c26;
}

.brand-logo {
  width: 232px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(255,255,255,.12));
}

.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.platform-back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: #f7efe1;
  background: transparent;
  border: 2px solid #cbb79a;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.platform-back-link:hover { background: #c45c26; border-color: #c45c26; }

.brand-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 28px);
}

.brand-nav a {
  color: #d8cbb6;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.brand-nav a:hover,
.brand-nav a[aria-current="page"] {
  color: #f4d27a;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-actions #userInfo { color: #f4d27a !important; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover { transform: translate(-2px, -2px); }

.button-outline {
  color: #1c1917;
  background: #f4d27a;
  border: 2px solid #f4d27a;
}

.button-outline:hover { box-shadow: 3px 3px 0 #c45c26; }

.button-quiet {
  color: #f7efe1;
  background: transparent;
  border: 2px solid #8a7b68;
}

.brand-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(300px, 30vw, 480px);
  margin: 18px 18px 0;
  background: #1c1917 url("./assets/brand/fun-planet/backgrounds/home-hero-pc.webp") center / cover no-repeat;
  border: 3px solid #1c1917;
  border-radius: 4px;
}

.brand-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(28, 25, 23, .88) 0%, rgba(28, 25, 23, .42) 42%, transparent 68%);
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: clamp(28px, 4vw, 72px);
  width: min(46%, 620px);
  color: #f7efe1;
  transform: translateY(-50%);
}

.hero-eyebrow {
  margin: 0 0 12px;
  color: #f4d27a;
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 900;
  letter-spacing: .22em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 3.1vw, 52px);
  line-height: 1.12;
}

.hero-copy > p:not(.hero-eyebrow) {
  margin: 16px 0 22px;
  font-size: clamp(14px, 1.15vw, 18px);
  font-weight: 600;
  line-height: 1.75;
  color: #efe4d0;
}

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

.hero-actions .button {
  min-height: 48px;
  padding: 0 22px;
  color: #1c1917;
  background: #f4d27a;
  border: 2px solid #1c1917;
  box-shadow: 4px 4px 0 #c45c26;
}

.hero-actions .button-secondary {
  color: #f7efe1;
  background: transparent;
  border: 2px solid #f7efe1;
  box-shadow: none;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 36px;
  background: #efe4d0;
  border-bottom: 3px solid #1c1917;
}

.hero-facts div {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-content: center;
  padding: 12px 14px;
  background: #fffaf3;
  border: 2px solid #1c1917;
  border-radius: 4px;
}

.hero-facts div > span {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 22px;
}

.hero-facts strong { font-size: 15px; }
.hero-facts small { color: var(--muted); font-size: 12px; }

.controls,
.filter-bar,
.game-section,
.tip-strip,
.details {
  padding-right: 36px;
  padding-left: 36px;
}

.controls {
  min-height: 68px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: #1c1917;
  background: #efe4d0;
  border-bottom: 2px dashed #cbb79a;
  font-size: 16px;
  font-weight: 800;
}

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

.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid #1c1917;
  border-radius: 2px;
  cursor: pointer;
}

.swatch.is-active {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.filter-bar {
  min-height: 84px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
  border-bottom: 3px solid #1c1917;
}

.filter-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  color: #1c1917;
  background: transparent;
  border: 2px solid #1c1917;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.filter-btn:hover { transform: translate(-1px, -1px); background: #fffaf3; }

.filter-btn.is-active {
  color: #fffaf3;
  background: var(--blue);
  border-color: #1c1917;
  box-shadow: 3px 3px 0 #1c1917;
}

.library-sync-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 18px 36px 0;
  padding: 14px 18px;
  color: #1c1917;
  background: #f4d27a;
  border: 3px solid #1c1917;
  border-radius: 4px;
  box-shadow: 5px 5px 0 #1c1917;
  line-height: 1.6;
  text-align: center;
}

.library-sync-note strong {
  flex: 0 0 auto;
  color: #8f3a12;
  font-size: 16px;
  font-weight: 950;
}

.library-sync-note span {
  font-size: 13px;
  font-weight: 700;
}

.game-section {
  padding-top: 26px;
  padding-bottom: 28px;
  background: var(--surface);
}

.section-heading {
  min-height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.section-heading h2 {
  margin: 0;
  font-size: 26px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 16px;
}

.game-card {
  min-width: 0;
  min-height: 148px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  background: #fffaf3;
  border: 2px solid #1c1917;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:hover, .game-card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--blue);
  outline: none;
}

.game-icon {
  display: block;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 4px;
  background: #efe4d0;
  border: 2px solid #1c1917;
}

.game-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-icon span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fffaf3;
  background: #1c1917;
  font-size: 40px;
  font-weight: 950;
}

.game-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 2px 0;
}

.game-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.library-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.library-badge-single {
  color: #8f3a12;
  background: #f4d27a;
  border: 1px solid #1c1917;
}

.library-badge-sentence {
  color: #1c463c;
  background: #cde7dc;
  border: 1px solid #1c1917;
}

.library-badge-names {
  color: #1c1917;
  background: #efe4d0;
  border: 1px solid #1c1917;
}

.game-no {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fffaf3;
  background: var(--blue);
  border: 2px solid #1c1917;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 900;
}

.game-card h3 {
  min-width: 0;
  margin: 0;
  color: #1c1917;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.game-card p {
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.game-owned-label {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 3px;
  padding: 2px 8px;
  border: 1px solid #1c1917;
  border-radius: 2px;
  background: #cde7dc;
  color: #1c463c;
  font-size: 11px;
  font-weight: 800;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.mini-dots { display: flex; gap: 8px; }

.mini-dots i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid #1c1917;
}

.open-btn {
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: #fffaf3;
  background: var(--blue);
  border: 2px solid #1c1917;
  border-radius: 4px;
  box-shadow: 3px 3px 0 #1c1917;
  font-size: 13px;
  font-weight: 900;
}

.game-card:hover .open-btn {
  background: #1c1917;
}

.tip-strip {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 30px;
  color: #efe4d0;
  background: #1c1917;
  border-top: 3px solid #c45c26;
  font-size: 14px;
}

.tip-strip p { margin: 0; }
.tip-strip a { margin: 0 6px; color: #f4d27a; font-weight: 800; }

.offline-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 22px 36px 8px;
  padding: 18px 20px;
  border: 3px solid #1c1917;
  border-radius: 4px;
  background: #fffaf3;
  box-shadow: 6px 6px 0 #c45c26;
}
.offline-card[hidden] { display: none; }

.offline-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: #f4d27a;
  border: 2px solid #1c1917;
  font-size: 26px;
}

.offline-copy span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 2px;
  color: #fffaf3;
  background: #1c1917;
  font-size: 12px;
  font-weight: 900;
}

.offline-copy h2 { margin: 6px 0 5px; font-size: 20px; }
.offline-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.offline-actions {
  display: flex;
  min-width: 205px;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

.offline-link {
  margin: 0;
  padding: 12px 18px;
  border: 2px solid #1c1917;
  border-radius: 4px;
  background: var(--blue);
  color: #fffaf3;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1c1917;
}

.offline-link:disabled { opacity: .65; cursor: wait; }

.offline-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 36px;
  background: var(--surface);
}

.info-panel {
  min-height: 180px;
  padding: 20px;
  background: #fffaf3;
  border: 2px solid #1c1917;
  border-radius: 4px;
}

.info-panel > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.info-panel h3 { margin: 9px 0 11px; font-size: 18px; line-height: 1.3; }
.info-panel p, .info-panel li { color: var(--muted); font-size: 13px; line-height: 1.7; }
.info-panel p { margin: 0; }
.info-panel ul { margin: 12px 0 0; padding-left: 18px; }
.info-panel li + li { margin-top: 4px; }
.info-panel-half { grid-column: span 2; }
.info-panel-wide { grid-column: 1 / -1; }

.review-benefit-layout,
.copyright-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 28px;
  align-items: center;
}

.community-panel {
  padding: 18px;
  background: #efe4d0;
  border: 2px solid #1c1917;
  border-radius: 4px;
}

.community-panel > span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.community-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 18px;
  color: #fffaf3;
  background: var(--blue);
  border: 2px solid #1c1917;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.certificate-link {
  display: block;
  padding: 10px;
  background: #fffaf3;
  border: 2px solid #1c1917;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
}

.certificate-link img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 2px;
}

.certificate-link strong {
  display: inline-block;
  margin-top: 9px;
  color: var(--blue-dark);
  font-size: 14px;
}

.timeline { display: grid; gap: 10px; margin-top: 4px; }

.timeline-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.date {
  color: var(--blue-dark);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

[hidden] { display: none !important; }

@media (max-width: 1279px) {
  .brand-nav { display: none; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-panel-half { grid-column: span 1; }
}

@media (max-width: 900px) {
  .app { width: calc(100% - 18px); }
  .controls, .filter-bar, .game-section, .tip-strip, .details { padding-right: 18px; padding-left: 18px; }
  .offline-card { margin-right: 18px; margin-left: 18px; }
  .library-sync-note { margin-right: 18px; margin-left: 18px; }
  .hero-facts { padding: 16px 18px; }
}

@media (max-width: 720px) {
  .brand-header { grid-template-columns: auto auto 1fr; padding: 8px 14px; gap: 12px; }
  .brand-logo { width: 176px; height: auto; }
  .brand-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .brand-hero { margin: 12px 10px 0; }
  .hero-facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game-grid { gap: 12px; }
  .game-card { grid-template-columns: 92px minmax(0, 1fr); min-height: 120px; padding: 10px; }
  .game-icon { width: 92px; height: 92px; }
  .details { grid-template-columns: 1fr; }
  .info-panel-half,
  .info-panel-wide { grid-column: 1; }
  .review-benefit-layout,
  .copyright-layout { grid-template-columns: 1fr; }
  .tip-strip { flex-direction: column; align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
  .offline-card { grid-template-columns: 46px 1fr; gap: 12px; padding: 14px; }
  .offline-icon { width: 46px; height: 46px; font-size: 22px; }
  .offline-copy span { padding: 4px 8px; font-size: 12px; }
  .offline-copy h2 { margin: 4px 0; font-size: 18px; }
  .offline-copy p { font-size: 12px; }
  .offline-actions { grid-column: 1 / -1; min-width: 0; gap: 6px; }
  .offline-link { width: 100%; padding: 10px 16px; font-size: 14px; }
  .offline-code { font-size: 10.5px; }
}

@media (max-width: 620px) {
  .brand-header { grid-template-columns: minmax(0, auto) auto 1fr; gap: 10px; }
  .brand-logo { width: min(176px, 58vw); }

  .brand-hero {
    min-height: 560px;
    background-image: url("./assets/brand/fun-planet/backgrounds/home-hero-mobile.webp");
    background-position: center bottom;
  }

  .brand-hero::after {
    background: linear-gradient(180deg, rgba(28, 25, 23, .9) 0%, rgba(28, 25, 23, .5) 42%, transparent 72%);
  }

  .hero-copy {
    top: 36px;
    left: 22px;
    width: calc(100% - 44px);
    transform: none;
  }

  .hero-copy h1 { font-size: 32px; }
  .hero-copy > p:not(.hero-eyebrow) { margin: 12px 0 18px; font-size: 14px; }
}

@media (max-width: 430px) {
  .brand-header { gap: 10px; }
  .brand-logo { width: 142px; }
  .platform-back-link { padding: 0 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.brand-logo {
  width: 300px;
  height: 72px;
  padding: 4px 8px;
  background: #fffdf8;
  border-radius: 10px;
  filter: none;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}
.brand-hero {
  min-height: 0;
  aspect-ratio: 1024 / 409;
  background: #8ec8ea none;
  border: 0;
  border-radius: 22px;
}
.brand-hero::after { display: none; }
.brand-hero .hero-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  z-index: 0;
}
.brand-hero .hero-copy {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  padding: 0;
  z-index: 1;
}
.brand-hero .hero-copy h1,
.brand-hero .hero-copy p {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.brand-hero .hero-actions {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.brand-hero .hero-hotspot {
  position: absolute;
  top: 57.5%;
  height: 13.5%;
  display: block;
  z-index: 3;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font-size: 12px;
  line-height: 13.5%;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: none;
}
.brand-hero .hero-hotspot:hover,
.brand-hero .hero-hotspot:focus-visible {
  background: transparent;
  outline: none;
  transform: none;
}
.brand-hero .hero-hotspot-start { left: 3.6%; width: 18.8%; }
.brand-hero .hero-hotspot-more { left: 22.6%; width: 15.2%; }
@media (max-width: 720px) {
  .brand-logo { width: 240px; height: 58px; }
}
@media (max-width: 620px) {
  .brand-hero {
    min-height: 0;
    aspect-ratio: 1024 / 409;
    background-image: none;
  }
  .brand-hero .hero-copy {
    top: 0;
    left: 0;
    width: 100%;
    transform: none;
  }
}
@media (max-width: 430px) {
  .brand-logo { width: 200px; height: 50px; }
}

