* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --bg: #f4f6fb;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.96);
  --text: #131822;
  --muted: #4d5a70;
  --line: rgba(17, 24, 38, 0.2);
  --focus: #0a63ff;
  --shadow: 0 6px 18px rgba(20, 27, 42, 0.08);
  --button-bg: #ffffff;
  --button-hover-bg: color-mix(in srgb, var(--card-strong) 90%, black 10%);
  --outer-radius: 24px;
  --panel-padding: 14px;
  --inner-radius: calc(var(--outer-radius) - var(--panel-padding));
  --page-width: 1200px;
  --page-gutter: 24px;
  --sidebar-gap: 12px;
  --gap: 24px;
  --tint-hue: 210;
  --shot-bg: #ffffff;
  --bg-tint-top: color-mix(in srgb, hsl(var(--tint-hue) 44% 56%) 14%, #f4f6fb 86%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --card: rgba(24, 29, 39, 0.8);
    --card-strong: rgba(28, 34, 45, 0.92);
    --text: #f2f5fa;
    --muted: #c8d1e3;
    --line: rgba(199, 210, 228, 0.3);
    --focus: #7fb2ff;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    --button-bg: color-mix(in srgb, var(--card-strong) 88%, black 12%);
    --button-hover-bg: color-mix(in srgb, var(--card-strong) 80%, white 20%);
    --shot-bg: #000000;
    --bg-tint-top: color-mix(in srgb, hsl(var(--tint-hue) 44% 56%) 14%, #0f1116 86%);
  }

  .feature-title {
    color: #f6f9ff;
  }

  .feature-description {
    color: #f0f5ff;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  background:
    linear-gradient(
      180deg,
      var(--bg-tint-top) 0%,
      color-mix(in srgb, hsl(var(--tint-hue) 44% 56%) 10%, var(--bg) 90%) 28%,
      var(--bg) 100%
    ),
    var(--bg);
}

.layout {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin: 18px auto 58px;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: var(--gap);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--outer-radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: var(--panel-padding);
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: fit-content;
  display: grid;
  gap: var(--sidebar-gap);
}

.panel-heading {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.back-panel {
  padding: 0;
  overflow: hidden;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  flex: 1;
  padding: 8px 12px;
  border-radius: calc(var(--outer-radius) - 6px);
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.lang-btn.is-active {
  border-width: 2px;
  border-color: hsl(var(--tint-hue) 64% 54% / 0.95);
  box-shadow: 0 0 0 2px hsl(var(--tint-hue) 64% 54% / 0.55) inset;
}

.app-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.app-links-group {
  width: 100%;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.app-socials {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.app-social-link {
  justify-content: space-between;
}

.social-handle {
  font-size: 0.74rem;
  color: var(--muted);
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--inner-radius);
  object-fit: cover;
  display: block;
}

.themed-icon {
  display: inline-flex;
  overflow: hidden;
}

.themed-icon img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.themed-icon .icon-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .themed-icon .icon-light {
    display: none;
  }

  .themed-icon .icon-dark {
    display: block;
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.15;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-strong) 86%, white 14%);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  width: 100%;
  padding: 8px 12px;
  border-radius: calc(var(--outer-radius) - 6px);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: var(--button-bg);
}

.main {
  display: grid;
  gap: var(--gap);
  min-width: 0;
}

.main h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.main p {
  margin: 0;
  color: var(--muted);
}

.app-description {
  margin-bottom: 12px;
}

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

.feature-card {
  min-height: 84px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: color-mix(in srgb, var(--card-strong) 88%, white 4%);
}

.feature-title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--text);
}

.feature-description {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.platform-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.platform-btn {
  min-height: 38px;
  padding: 7px 11px;
  border-radius: calc(var(--outer-radius) - 6px);
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.platform-btn.is-active {
  border-width: 2px;
  border-color: hsl(var(--tint-hue) 64% 54% / 0.95);
  box-shadow: 0 0 0 2px hsl(var(--tint-hue) 64% 54% / 0.55) inset;
}

.shot-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--shot-width, clamp(240px, 72vw, 340px));
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
  scroll-snap-type: x proximity;
  scrollbar-gutter: stable both-edges;
}

.shot {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  overflow: hidden;
  background: var(--card-strong);
  scroll-snap-align: start;
}

.shot img {
  width: 100%;
  height: var(--shot-height, auto);
  aspect-ratio: var(--shot-ratio, 4 / 3);
  object-fit: contain;
  display: block;
  background: var(--shot-bg);
}

.shot figcaption {
  padding: 8px 10px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.back-link,
.action-link,
.lang-btn,
.platform-btn {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible,
.action-link:hover,
.action-link:focus-visible,
.lang-btn:hover,
.lang-btn:focus-visible,
.platform-btn:hover,
.platform-btn:focus-visible {
  transform: translateY(-1px);
  background: var(--button-hover-bg);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
    margin: 16px auto 58px;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  :root {
    --outer-radius: 22px;
    --panel-padding: 12px;
    --inner-radius: calc(var(--outer-radius) - var(--panel-padding));
    --page-gutter: 20px;
  }

  .layout {
    width: min(var(--page-width), calc(100% - var(--page-gutter)));
    margin-bottom: 66px;
  }

  .app-icon {
    width: 58px;
    height: 58px;
  }

  .themed-icon img {
    width: 58px;
    height: 58px;
  }

  .shot-strip {
    grid-auto-columns: min(var(--shot-width, 86vw), 86vw);
  }
}

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