:root {
  --ink: #1c2430;
  --ink-soft: #5a6573;
  --paper: #ffffff;
  --paper-soft: #f7fafc;
  --line: rgba(28, 36, 48, 0.08);
  --habby: #e60012;
  --habby-hover: #ff1f2f;
  --sky-a: #dff3ff;
  --sky-b: #fff1e6;
  --mint: #e8fff4;
  --shadow-sm: 0 8px 24px rgba(40, 70, 110, 0.08);
  --shadow-md: 0 20px 50px rgba(40, 70, 110, 0.12);
  --shadow-lg: 0 32px 80px rgba(40, 70, 110, 0.16);
  --radius: 24px;
  --radius-sm: 14px;
  --font: "Nunito", "PingFang SC", "Microsoft JhengHei", "Apple SD Gothic Neo",
    "Hiragino Sans", system-ui, sans-serif;
  --max: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #eaf6ff;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* Soft ambient wash — not heavy blur art */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(120, 200, 255, 0.45), transparent 60%),
    radial-gradient(700px 480px at 88% 12%, rgba(255, 180, 160, 0.35), transparent 55%),
    radial-gradient(800px 500px at 70% 90%, rgba(160, 240, 200, 0.28), transparent 55%),
    linear-gradient(160deg, var(--sky-a) 0%, #f4fbff 42%, var(--sky-b) 100%);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 0 28px;
  gap: 20px;
}

/* —— Top bar —— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--habby);
  line-height: 1.1;
}

.lang {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.lang-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  transition: 0.15s ease;
}

.lang-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.lang-btn[aria-pressed="true"] {
  color: #fff;
  background: var(--habby);
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.25);
}

/* —— Main split —— */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 22px;
  align-items: stretch;
  min-height: 0;
}

/* Visual card */
.visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.visual-frame {
  position: relative;
  flex: 1;
  min-height: min(58vh, 560px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #d4ecfa;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.visual-track {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.65s ease;
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Thumbnail row under art */
.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.thumb {
  appearance: none;
  border: 2px solid transparent;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 10;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-sm);
  transition: 0.15s ease;
  opacity: 0.72;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.thumb.is-active {
  opacity: 1;
  border-color: var(--habby);
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.15), var(--shadow-sm);
}

/* Info card */
.info {
  min-width: 0;
  display: flex;
}

.info-inner {
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  padding: clamp(28px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.game {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0f9ff 0%, #fff7f0 100%);
  border: 1px solid var(--line);
}

.game-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(40, 70, 110, 0.12);
}

.game-meta {
  min-width: 0;
}

.game-name {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}

.game-platform {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* Download — primary, balanced, not edge strip */
.download-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 22px;
  border-radius: 18px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #ff4a4a 0%, var(--habby) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 14px 32px rgba(230, 0, 18, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 18px 40px rgba(230, 0, 18, 0.35);
}

.download-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.download-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.download-text {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.download-label {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

/* Japanese: keep download CTA on one line */
html[lang="ja"] .download-label {
  font-size: 1.02rem;
  letter-spacing: 0;
}

html[lang="ja"] .download-btn {
  gap: 12px;
  padding-inline: 18px;
}

html[lang="ja"] .download-icon {
  width: 44px;
  height: 44px;
}

/* —— Responsive —— */
@media (max-width: 980px) {
  .app {
    width: min(var(--max), calc(100% - 28px));
  }

  .main {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .visual-frame {
    min-height: 42vh;
    aspect-ratio: 16 / 9;
    flex: none;
  }

  .info-inner {
    padding: 24px 22px;
    gap: 22px;
  }
}

@media (max-width: 560px) {
  .app {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .lang {
    width: 100%;
    justify-content: stretch;
  }

  .lang-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 11px;
  }

  .thumbs {
    gap: 6px;
  }

  .thumb {
    border-radius: 8px;
  }

  .game-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .download-btn {
    padding: 16px 18px;
  }

  .download-label {
    font-size: 1rem;
  }

  html[lang="ja"] .download-label {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    transition: none;
  }
}
