:root {
  color-scheme: light;
  --bg: #eef7ff;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d7e5f7;
  --text: #051b4a;
  --muted: #56719b;
  --blue: #2463df;
  --blue-dark: #0b45bc;
  --star: #f6a400;
  --danger: #be2537;
  --shadow: 0 16px 34px rgba(25, 80, 150, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 2%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 23rem),
    linear-gradient(180deg, #eef7ff 0%, #f8fbff 48%, #eef7ff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-dark);
}

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

.site-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.play-shell {
  width: min(100%, 1040px);
}

.app-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(215, 229, 247, 0.95);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.language-switcher {
  margin: 0;
  flex: 0 0 auto;
}

.language-button {
  min-height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--blue);
  padding: 0 12px;
  font-size: 13px;
}

.language-button:hover {
  background: #f2f7ff;
  color: var(--blue-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 188px;
}

.brand-logo {
  width: 100%;
  height: auto;
}

.topbar form:not(.language-switcher) {
  display: flex;
  justify-content: flex-end;
  flex: 1 1 260px;
  min-width: 0;
  margin-left: auto;
}

.search-box {
  width: 100%;
  max-width: 260px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--text);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  margin-bottom: 20px;
  border: 1px solid #cfe2f7;
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 84%, rgba(151, 210, 248, 0.5), transparent 8rem),
    radial-gradient(circle at 92% 78%, rgba(138, 202, 246, 0.48), transparent 7rem),
    linear-gradient(180deg, #f4fbff 0%, #cfeaff 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -38px;
  height: 96px;
  background: rgba(145, 203, 241, 0.42);
  border-radius: 50% 50% 0 0;
}

.hero::after {
  left: 18%;
  right: -16%;
  bottom: -54px;
  height: 112px;
  background: rgba(206, 233, 252, 0.72);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 320px;
  padding: 32px 18px;
  text-align: center;
}

.hero h1,
.page-title {
  margin: 0;
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1.25;
  letter-spacing: 0;
}

.hero p {
  margin: 8px 0 14px;
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.hero-description {
  display: grid;
  gap: 8px;
  max-width: 520px;
  margin: 0 0 18px;
  color: #344e78;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.hero-description p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.feature-section {
  margin-top: 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.feature-card h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.feature-card p {
  margin: 0;
  color: #344e78;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary {
  background: #fff;
  color: var(--blue);
}

button:hover,
.button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}

button:disabled,
input[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button.secondary:hover {
  background: #f2f7ff;
  color: var(--blue-dark);
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.play-underbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 8px 0 12px;
}

.play-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.download-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.section {
  margin-top: 24px;
}

.section-head,
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.page-head {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.page-head .back-link {
  order: 1;
}

.page-head .language-switcher {
  order: 2;
  margin-left: 0;
}

.page-head > strong {
  order: 3;
  margin-left: auto;
  text-align: right;
}

.section-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.more-link,
.back-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-card,
.list-card,
.comment-card,
.form-card,
.notice-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(29, 80, 150, 0.06);
}

.game-card {
  overflow: hidden;
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #d9e8f8;
  object-fit: contain;
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  color: #89a4ca;
  font-size: 24px;
}

.card-body {
  padding: 9px;
}

.card-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.meta,
.description,
.comment-meta {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.description {
  color: #344e78;
}

.detail-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-description {
  overflow-wrap: anywhere;
}

.stars {
  color: var(--star);
  letter-spacing: 0;
  white-space: nowrap;
}

.muted-star {
  color: #b8c7dc;
}

.update-list,
.vertical-list,
.comment-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-row,
.list-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
}

.update-row .thumb,
.list-card .thumb {
  border-radius: 5px;
  aspect-ratio: 16 / 9;
}

.list-card {
  grid-template-columns: 128px 1fr 22px;
}

.catalog-grid {
  margin-top: 14px;
}

.sort-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sort-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sort-tab.is-active {
  background: var(--blue);
  color: #fff;
}

.chevron {
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}

.detail-media {
  overflow: hidden;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #071230;
}

.game-frame {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 320px;
  border: 0;
}

.detail-media:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #071230;
}

.detail-media:fullscreen .game-frame,
.detail-media.is-pseudo-fullscreen .game-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

body.is-frame-fullscreen {
  overflow: hidden;
}

.detail-media.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #071230;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.rating-box {
  margin-top: 14px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
  border: 0;
  margin: 0;
  padding: 0;
}

.star-input legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.star-input input {
  position: absolute;
  opacity: 0;
}

.star-input label {
  color: #b8c7dc;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: var(--star);
}

.form-card {
  padding: 14px;
}

.info-card {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-card h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.info-card p {
  margin: 0 0 8px;
  color: #213d68;
  font-weight: 700;
}

.info-card ul {
  margin: 0;
  padding-left: 1.25em;
  color: #344e78;
}

.info-card li + li {
  margin-top: 4px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label,
.field-label {
  display: grid;
  gap: 6px;
  color: #213d68;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input[type="file"] {
  border-style: dashed;
  background: #fbfdff;
  padding: 18px 12px;
  text-align: center;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.save-code-input {
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.save-code-preview {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.save-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #213d68;
  font-size: 12px;
}

.save-code-preview code,
.prompt-box pre {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.save-code-preview code {
  color: #344e78;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.prompt-tools {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}

.prompt-box {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.prompt-box pre {
  margin: 0;
  padding: 14px;
  color: #12345f;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.error {
  border: 1px solid rgba(190, 37, 55, 0.25);
  background: #fff5f6;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
}

.comment-card {
  padding: 10px 12px;
}

.comment-body {
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.remix-button {
  min-width: 0;
  padding: 0 12px;
}

.utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 8px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  font-weight: 700;
}

.content-page {
  color: #213d68;
}

.content-page h1 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0;
}

.content-page h2 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 0;
}

.content-page h3 {
  margin: 18px 0 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
}

.content-page p {
  margin: 0 0 12px;
}

.content-page ul,
.content-page ol {
  margin: 0 0 14px;
  padding-left: 1.35em;
}

.content-page li + li {
  margin-top: 4px;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

.notice-card {
  padding: 22px;
  text-align: center;
}

@media (min-width: 760px) {
  .site-shell {
    width: min(100%, 760px);
    padding: 20px 18px 34px;
  }

  .play-shell {
    width: min(100%, 1120px);
  }

  .app-panel {
    padding: 24px;
  }

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

  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    min-height: 360px;
  }

  .hero-content {
    min-height: 360px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .play-shell .game-frame {
    height: min(72vh, 760px);
    min-height: 520px;
    aspect-ratio: auto;
  }
}

@media (min-width: 1180px) {
  .play-shell {
    width: min(100%, 1320px);
  }

  .play-shell .game-frame {
    height: min(76vh, 900px);
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .page-head,
  .section-head {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .brand {
    max-width: 172px;
  }

  .topbar form:not(.language-switcher) {
    width: 100%;
    flex-basis: auto;
  }

  .search-box {
    max-width: none;
    width: 100%;
  }

  .update-row,
  .list-card {
    grid-template-columns: 92px 1fr;
  }

  .chevron {
    display: none;
  }

  .game-frame {
    min-height: 260px;
  }
}
