:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --paper: #ffffff;
  --ink: #202124;
  --muted: #686b72;
  --line: #d8d5cc;
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --gold: #c58a12;
  --brick: #b64b3d;
  --blue: #3867c8;
  --shadow: 0 18px 45px rgba(22, 28, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 32rem),
    linear-gradient(315deg, rgba(182, 75, 61, 0.1), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family:
    "Yu Gothic UI",
    "Hiragino Kaku Gothic ProN",
    Meiryo,
    system-ui,
    sans-serif;
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
}

.header-inner,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.site-title {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  min-width: min(360px, 100%);
}

.search-box {
  display: grid;
  gap: 8px;
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  outline: none;
  box-shadow: 0 8px 20px rgba(22, 28, 36, 0.06);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16);
}

main {
  padding: 24px 0 54px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--accent-strong);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.tool-band {
  margin-bottom: 18px;
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.category-tab:hover {
  border-color: var(--accent);
}

.category-tab[aria-pressed="true"] {
  border-color: var(--accent-strong);
  color: #fff;
  background: var(--accent-strong);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.summary-strip div {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.summary-strip span {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.summary-strip small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.sections {
  display: grid;
  gap: 20px;
}

.app-section {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 30px rgba(22, 28, 36, 0.08);
}

.section-heading {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}

.section-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 1.45rem;
  font-weight: 900;
}

.app-section:nth-child(2n) .section-mark {
  background: var(--brick);
}

.app-section:nth-child(3n) .section-mark {
  background: var(--blue);
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

.section-page-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: var(--paper);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

.section-page-link:hover {
  border-color: var(--accent);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.app-card {
  display: flex;
  min-height: 214px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 14px 26px rgba(22, 28, 36, 0.1);
}

.app-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--accent-strong);
  background: #e4f1ef;
  font-size: 1.25rem;
  font-weight: 900;
}

.app-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-card h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.app-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-top: auto;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.app-link:hover {
  background: var(--accent);
}

.app-link.is-disabled {
  pointer-events: none;
  color: var(--muted);
  background: #eceae3;
}

.empty-state {
  margin: 34px 0 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  text-align: center;
}

.page-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 5vw, 40px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  max-width: 820px;
}

.page-hero p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.listing-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.app-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.app-collection-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(22, 28, 36, 0.07);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.app-collection-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 16px 30px rgba(22, 28, 36, 0.13);
}

.app-collection-card:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 3px;
}

.app-collection-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #eeeae0;
}

.app-collection-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
}

.app-collection-title {
  margin-bottom: 7px;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.35;
}

.app-collection-copy {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.app-collection-meta {
  margin-bottom: 16px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.app-collection-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: auto;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 900;
}

.app-collection-link::after {
  content: "→";
  margin-left: 8px;
}

.app-collection-card:hover .app-collection-link {
  background: var(--accent);
}

.video-card {
  display: grid;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.video-card:hover .video-title {
  color: var(--accent-strong);
}

.video-card:hover .video-thumb {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(22, 28, 36, 0.16);
}

.video-thumb {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(21, 78, 145, 0.34);
  border-radius: 8px;
  background: #1e6cc7;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.video-thumb::before {
  content: "";
  position: absolute;
  inset: 12%;
  display: grid;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 24%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 38% 24%, #f0c929 0 5.5%, transparent 6%),
    radial-gradient(circle at 58% 24%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 78% 24%, #f0c929 0 5.5%, transparent 6%),
    radial-gradient(circle at 18% 50%, #f0c929 0 5.5%, transparent 6%),
    radial-gradient(circle at 38% 50%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 58% 50%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 78% 50%, #f4f2ec 0 5.5%, transparent 6%),
    radial-gradient(circle at 18% 76%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 38% 76%, #f0c929 0 5.5%, transparent 6%),
    radial-gradient(circle at 58% 76%, #d83b36 0 5.5%, transparent 6%),
    radial-gradient(circle at 78% 76%, #f0c929 0 5.5%, transparent 6%);
}

.hex-thumb {
  border-color: rgba(15, 78, 74, 0.28);
  background:
    linear-gradient(90deg, rgba(56, 103, 200, 0.22), transparent 36%, transparent 64%, rgba(56, 103, 200, 0.22)),
    linear-gradient(180deg, rgba(216, 59, 54, 0.22), transparent 35%, transparent 65%, rgba(216, 59, 54, 0.22)),
    #e7efe9;
}

.hex-thumb::before {
  inset: 15%;
  background:
    radial-gradient(circle at 20% 26%, #d83b36 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 38% 26%, #ffffff 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 56% 26%, #3867c8 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 74% 26%, #ffffff 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 29% 48%, #3867c8 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 47% 48%, #d83b36 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 65% 48%, #ffffff 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 83% 48%, #3867c8 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 20% 70%, #ffffff 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 38% 70%, #d83b36 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 56% 70%, #3867c8 0 4.6%, transparent 4.9%),
    radial-gradient(circle at 74% 70%, #d83b36 0 4.6%, transparent 4.9%);
  filter: drop-shadow(0 10px 12px rgba(22, 28, 36, 0.16));
}

.shikaku-thumb {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  border-color: rgba(15, 78, 74, 0.32);
  background:
    linear-gradient(to right, rgba(19, 78, 74, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19, 78, 74, 0.18) 1px, transparent 1px),
    #f9fbf7;
  background-size: calc(100% / 6) calc(100% / 4);
}

.shikaku-thumb::before {
  inset: 8%;
  border: 3px solid var(--accent-strong);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 32%, var(--brick) 32% 34%, transparent 34% 66%, var(--gold) 66% 68%, transparent 68%),
    linear-gradient(180deg, transparent 48%, var(--blue) 48% 51%, transparent 51%);
}

.shikaku-thumb::after {
  content: "PUZZLE";
}

.shikaku-thumb-number {
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: clamp(0.85rem, 2.8vw, 1.35rem);
  font-weight: 900;
}

.shikaku-thumb-number-4 {
  grid-column: 2;
  grid-row: 2;
}

.shikaku-thumb-number-6 {
  grid-column: 4;
  grid-row: 3;
}

.shikaku-thumb-number-3 {
  grid-column: 5;
  grid-row: 1;
}

.video-thumb::after {
  content: "PLAY";
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 6px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  font-size: 0.74rem;
  font-weight: 900;
}

.video-body {
  display: grid;
  gap: 6px;
}

.video-title {
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.35;
}

.video-copy,
.video-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.video-meta {
  font-size: 0.82rem;
  font-weight: 800;
}

.video-card-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 38px;
  margin-top: 6px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
}

.video-card:hover .video-card-link {
  background: var(--accent);
}

.category-card,
.content-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(22, 28, 36, 0.07);
}

.category-card:hover,
.content-card:hover {
  border-color: rgba(15, 118, 110, 0.45);
}

.category-card h2,
.content-card h2,
.content-card h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.35;
}

.category-card p,
.content-card p,
.content-card li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.category-card p,
.content-card p {
  margin-bottom: 16px;
}

.category-card span,
.content-card span {
  margin-top: auto;
  color: var(--accent-strong);
  font-weight: 900;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 20px;
  align-items: start;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.content-card ul,
.content-card ol {
  margin: 0;
  padding-left: 1.3rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  color: #fff;
  background: var(--accent-strong);
}

.primary-button:hover {
  background: var(--accent);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
}

.game-detail {
  display: grid;
  gap: 24px;
}

.game-hero {
  margin-bottom: 0;
}

.game-hero h1 {
  font-size: clamp(1.75rem, 4vw, 3.1rem);
  line-height: 1.16;
}

.detail-app-image-link {
  display: block;
  width: min(760px, 100%);
  margin-top: 4px;
  border-radius: 8px;
  outline: none;
}

.detail-app-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  object-fit: cover;
  box-shadow: 0 14px 32px rgba(22, 28, 36, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.detail-app-image-link:hover .detail-app-image {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(22, 28, 36, 0.16);
}

.detail-app-image-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 3px;
}

.game-kicker {
  color: var(--accent-strong) !important;
  font-size: 0.9rem !important;
  font-weight: 900;
}

.game-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.game-feature-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
  font-weight: 900;
}

.game-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 20px;
  align-items: start;
}

.game-content-layout .content-card {
  min-height: auto;
}

.game-content-layout .content-card strong {
  color: var(--ink);
}

.game-content-layout .content-card p:last-child {
  margin-bottom: 0;
}

.rule-steps,
.strategy-list {
  display: grid;
  gap: 14px;
}

.rule-steps li,
.strategy-list li {
  padding-left: 4px;
}

.section-cta {
  margin-top: 18px;
  font-weight: 900;
}

.section-cta a {
  color: var(--accent-strong);
}

.goal-grid,
.feature-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.goal-grid > div,
.feature-detail-grid > div {
  padding: 16px;
  background: #fbfbf9;
}

.goal-grid .goal-red {
  border-top: 4px solid #d83b36;
}

.goal-grid .goal-blue {
  border-top: 4px solid #3867c8;
}

.goal-grid h3,
.feature-detail-grid h3,
.faq-list h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.goal-grid p,
.feature-detail-grid p,
.faq-list p {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
}

.faq-list > div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.faq-list > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.faq-list > div:last-child {
  padding-bottom: 0;
}

.game-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
}

.quick-facts dl {
  margin: 0 0 18px;
}

.quick-facts dl > div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.quick-facts dt {
  color: var(--muted);
  font-weight: 700;
}

.quick-facts dd {
  margin: 0;
  font-weight: 900;
}

.quick-facts .primary-button {
  width: 100%;
}

.page-toc ol {
  display: grid;
  gap: 10px;
}

.page-toc a {
  color: var(--accent-strong);
  font-weight: 800;
}

.related-game {
  border-left: 4px solid var(--blue);
}

.final-play-band {
  display: grid;
  justify-items: start;
  border-radius: 8px;
  padding: 24px;
  color: #fff;
  background: var(--accent-strong);
}

.final-play-band h2 {
  margin-bottom: 8px;
}

.final-play-band p {
  margin-bottom: 18px;
  line-height: 1.7;
}

.final-play-band .primary-button {
  color: var(--accent-strong);
  background: #fff;
}

.shikaku-hero h1 {
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1.12;
}

.shikaku-article h2 {
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.shikaku-article h3 {
  margin-top: 8px;
}

.shikaku-rules {
  list-style: none;
  padding: 0 !important;
}

.shikaku-rules li {
  position: relative;
  min-height: 52px;
  padding-left: 62px;
}

.rule-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-strong);
  background: #e9f5f2;
  font-weight: 900;
}

.shikaku-example-section + .shikaku-example-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.shape-example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.shape-example {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-top-width: 4px;
  border-radius: 8px;
  padding: 18px 12px 14px;
  background: #fbfbf9;
}

.shape-example.is-correct {
  border-top-color: var(--accent);
}

.shape-example.is-wrong {
  border-top-color: var(--brick);
}

.shape-example figcaption {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.shape-cells {
  display: grid;
  width: 104px;
  height: 104px;
}

.shape-cells > span,
.shape-cells > i {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border: 1px solid rgba(19, 78, 74, 0.35);
  color: var(--accent-strong);
  background: #edf7f4;
  font-style: normal;
  font-weight: 900;
}

.shape-1 {
  width: 52px;
  height: 52px;
}

.shape-1 > span {
  border: 3px solid var(--accent-strong);
}

.shape-4,
.shape-double,
.shape-l {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.shape-4,
.shape-double {
  border: 3px solid var(--accent-strong);
}

.shape-6 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 132px;
  height: 88px;
  border: 3px solid var(--accent-strong);
}

.shape-example.is-correct .shape-4,
.shape-example.is-correct .shape-6 {
  background: #dff1ec;
}

.shape-example.is-correct .shape-4 > span,
.shape-example.is-correct .shape-4 > i,
.shape-example.is-correct .shape-6 > span,
.shape-example.is-correct .shape-6 > i {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(19, 78, 74, 0.35);
}

.shape-l {
  position: relative;
}

.shape-l > span:first-child {
  grid-column: 1;
  grid-row: 1;
}

.shape-l > i:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.shape-l > i:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.shape-l::after {
  content: "";
  grid-column: 2;
  grid-row: 2;
  background: #fff;
}

.shape-l > span,
.shape-l > i {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f6dcd8;
  box-shadow: inset 0 0 0 2px var(--brick);
}

.shape-double {
  border-color: var(--brick);
  background: #f6dcd8;
}

.shape-double > span,
.shape-double > i {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(182, 75, 61, 0.48);
}

.shape-gap-example {
  align-content: start;
}

.shape-gap {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--brick);
  color: var(--brick);
  background:
    linear-gradient(135deg, transparent 45%, var(--brick) 46% 49%, #fff 50% 58%, var(--brick) 59% 62%, transparent 63%),
    #fbecea;
  font-weight: 900;
}

.shikaku-tips {
  counter-reset: none;
}

.accuracy-note {
  margin: 16px 0 0 !important;
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #fff9e8;
  font-size: 0.85rem !important;
}

.faq-accordion details {
  border-top: 1px solid var(--line);
}

.faq-accordion details:first-child {
  border-top: 0;
}

.faq-accordion summary {
  position: relative;
  padding: 16px 36px 16px 0;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-accordion summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--accent-strong);
  font-size: 1.35rem;
  transform: translateY(-50%);
}

.faq-accordion details[open] summary::after {
  content: "−";
}

.faq-accordion p {
  margin: 0;
  padding: 0 36px 16px 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.final-play-label {
  margin-bottom: 6px !important;
  font-size: 0.8rem;
  font-weight: 900;
}

.shikaku-play-band .light-button {
  border-color: rgba(255, 255, 255, 0.68);
  color: #fff;
  background: transparent;
}

.shikaku-play-band .light-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.noscript-note {
  margin-top: 20px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.app-placeholder {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 6vw, 44px);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.app-placeholder p {
  color: var(--muted);
  line-height: 1.8;
}

.language-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(56, 103, 200, 0.12), transparent 34rem),
    linear-gradient(315deg, rgba(15, 118, 110, 0.13), transparent 32rem),
    var(--bg);
}

.language-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.language-brand {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
}

.language-header-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.language-shell {
  display: grid;
  min-height: calc(100vh - 76px);
  place-items: center;
  padding-top: 42px;
  padding-bottom: 54px;
}

.language-panel {
  width: min(780px, 100%);
}

.language-intro {
  margin-bottom: 28px;
}

.language-intro h1 {
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  line-height: 1;
}

.language-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.language-detection {
  min-height: 1.7em;
  margin: 22px 0 0;
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.7;
}

.language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.language-option {
  width: 100%;
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(22, 28, 36, 0.06);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.language-option:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 28px rgba(22, 28, 36, 0.1);
}

.language-option:focus-visible,
.language-option.is-detected {
  border-color: var(--accent-strong);
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

.language-option[aria-disabled="true"] {
  cursor: default;
}

.language-option[aria-disabled="true"]:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(22, 28, 36, 0.06);
}

.language-option[aria-disabled="true"].is-detected,
.language-option[aria-disabled="true"]:focus-visible {
  border-color: var(--blue);
  outline-color: rgba(56, 103, 200, 0.18);
}

.language-code {
  display: grid;
  grid-row: 1 / 3;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
}

.language-option[aria-disabled="true"] .language-code {
  background: var(--blue);
}

.language-name {
  display: grid;
  grid-row: 1 / 3;
  min-width: 0;
  gap: 4px;
}

.language-name strong {
  font-size: 1.1rem;
  line-height: 1.3;
}

.language-name small {
  color: var(--muted);
  font-size: 0.86rem;
}

.language-status {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.language-status-ready {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.08);
}

.language-arrow {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 900;
}

.language-status + .language-arrow {
  margin-top: -10px;
}

.language-noscript,
.language-future {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.language-noscript {
  margin: 18px 0 0;
}

.language-future {
  margin: 24px 0 0;
  text-align: center;
}

@media (max-width: 760px) {
  .header-inner {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 0;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .app-section {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .game-content-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    position: static;
  }

  .language-list {
    grid-template-columns: 1fr;
  }

  .section-heading {
    position: static;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .section-heading p {
    grid-column: 1 / -1;
  }

  .app-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .app-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .app-collection-body {
    padding: 11px;
  }

  .app-collection-title {
    font-size: 0.98rem;
  }

  .app-collection-copy {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .app-collection-meta {
    margin-bottom: 12px;
    font-size: 0.72rem;
  }

  .app-collection-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
}

@media (max-width: 460px) {
  .header-inner,
  main {
    width: min(100% - 20px, 1120px);
  }

  .language-header {
    width: min(100% - 20px, 1120px);
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .language-list {
    grid-template-columns: 1fr;
  }

  .goal-grid,
  .feature-detail-grid {
    grid-template-columns: 1fr;
  }

  .shape-example-grid {
    grid-template-columns: 1fr;
  }
}
