:root {
  --page: #f5f5f5;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6570;
  --line: #ececef;
  --wine: #a42058;
  --wine-press: #861846;
  --star: #f5a623;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

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

button,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.store {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 56px 16px 112px;
}

.lang-switch {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
}

.lang-select {
  min-height: 36px;
  padding: 4px 28px 4px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.app-header-content {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  text-align: left;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}

.app-icon img,
.install-bar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-info h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.2;
  font-weight: 700;
}

.app-publisher,
.rating-note,
.meta-label,
.sample-note,
.card-note,
.legal,
.install-bar-copy span {
  color: var(--muted);
}

.app-publisher,
.rating-row,
.sample-note,
.card-lead,
.card-note {
  margin: 6px 0 0;
}

.platform-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.android-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
}

.platform-line .android-icon {
  color: #3ddc84;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.stars {
  color: var(--star);
  letter-spacing: 1px;
  font-size: 14px;
}

.rating-note {
  font-size: 12px;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  margin-top: 4px;
  padding: 12px 16px;
  white-space: nowrap;
  border: 0;
  border-radius: 8px;
  background: var(--wine);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.install-btn:hover {
  background: var(--wine-press);
}

.install-btn:focus-visible,
.text-btn:focus-visible,
.lang-select:focus-visible,
.legal a:focus-visible,
.screenshot-slider:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}

.app-meta,
.screenshot-section,
.app-card {
  margin-top: 20px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  min-width: 0;
}

.meta-value {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
}

.meta-label {
  font-size: 12px;
}

.screenshot-section h2,
.app-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.3;
}

.screenshot-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.screenshot-slider figure {
  flex: 0 0 180px;
  margin: 0;
  scroll-snap-align: start;
}

.screenshot-slider img {
  width: 180px;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.app-card {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.app-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.app-description.is-open {
  display: block;
  -webkit-line-clamp: unset;
}

.app-description p,
.step-list,
.detail-list,
.card-lead,
.card-note,
.sample-note {
  margin: 0 0 10px;
}

.app-description p:last-child,
.detail-list,
.step-list {
  margin-bottom: 0;
}

.text-btn {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wine);
  font-weight: 700;
  cursor: pointer;
}

.step-list,
.detail-list {
  padding-left: 1.2em;
}

.step-list li,
.detail-list li {
  margin: 0 0 10px;
}

.step-list strong,
.step-list span {
  display: block;
}

.step-list span {
  color: var(--muted);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  margin: 0;
}

.card-head .text-btn {
  margin: 0;
  flex: none;
}

.review-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.review-item[hidden] {
  display: none;
}

.review-item:first-child {
  border-top: 0;
  padding-top: 4px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.review-body h3 {
  margin: 0;
  font-size: 14px;
}

.review-body p:last-child {
  margin: 4px 0 0;
}

.legal {
  margin-top: 24px;
  font-size: 13px;
  text-align: center;
}

.legal p,
.legal nav {
  margin: 0 0 8px;
}

.legal nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
}

.legal a {
  color: var(--muted);
}

.install-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.install-bar-inner {
  width: min(720px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-bar img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.install-bar-copy {
  flex: 1;
  min-width: 0;
}

.install-bar-copy strong,
.install-bar-copy span {
  display: block;
  line-height: 1.3;
}

.install-bar-copy span {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-bar .install-btn {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 10px 16px;
  flex: none;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateX(-50%) translateY(8px);
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: #3b1c29;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .app-header-content {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .app-icon {
    width: 112px;
    height: 112px;
    border-radius: 26px;
  }

  .app-header-content .install-btn {
    grid-column: 2;
    justify-self: start;
    width: auto;
    padding: 8px 28px;
  }

  .meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .screenshot-slider figure,
  .screenshot-slider img {
    width: 192px;
    height: 340px;
  }

  .screenshot-slider figure {
    flex-basis: 192px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #toast {
    transition: none;
  }
}
