:root {
  color-scheme: light;
  --paper: #f7f9f6;
  --white: #fff;
  --ink: #1d343a;
  --muted: #526568;
  --teal: #176b69;
  --mint: #e8f0eb;
  --line: #d5e0db;
  --pink: #f2a496;
  --blue: #8ec7d5;
  --green: #c5d98d;
  --sans: Inter, system-ui, 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.75 var(--sans); }
a { color: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
button, summary { font: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 92px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 12px; padding: 10px 16px; transform: translateY(-170%); background: var(--white); }
.skip-link:focus { transform: translateY(0); }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 22px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 8px; width: max-content; font-size: 1.45rem; font-weight: 720; line-height: 1; letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.primary-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 30px; }
.primary-nav a, .header-menu summary, .menu-panel a { font-size: .875rem; font-weight: 650; text-decoration: none; }
.primary-nav a { padding-block: 9px; }
.primary-nav a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 5px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-menu { position: relative; }
.header-menu summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 11px; list-style: none; border: 1px solid var(--line); border-radius: 8px; }
.header-menu summary::-webkit-details-marker { display: none; }
.header-menu[open] summary, .header-menu summary:hover { background: var(--mint); }
.globe { position: relative; width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid currentColor; border-radius: 50%; }
.globe::before { content: ''; position: absolute; inset: -1px 3px; border: 1px solid currentColor; border-radius: 50%; }
.globe::after { content: ''; position: absolute; top: calc(50% - .5px); left: 0; width: 100%; border-top: 1px solid currentColor; }
.chevron { width: 6px; height: 6px; margin: -3px 1px 0 2px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.compact-nav { display: none; }
.menu-icon { display: block; width: 16px; height: 10px; border-block: 1px solid currentColor; }
.menu-panel { position: absolute; top: calc(100% + 9px); right: 0; min-width: 166px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #1d343a12; }
.menu-panel a { display: block; padding: 8px 10px; border-radius: 5px; }
.menu-panel a:hover, .menu-panel [aria-current] { color: var(--teal); background: var(--mint); }
.language-panel { display: grid; width: min(300px, calc(100vw - 36px)); grid-template-columns: 1fr 1fr; }
.language-panel .language-auto { grid-column: 1 / -1; margin-top: 4px; border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }

.hero { padding-block: 51px 70px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); align-items: center; gap: clamp(38px, 5.2vw, 80px); }
.hero-copy { padding-block: 16px; }
.eyebrow { color: var(--teal); font-size: .9rem; font-weight: 660; letter-spacing: .025em; }
.hero h1 { margin-block: 17px 23px; font-size: clamp(2.7rem, 4.55vw, 4.25rem); font-weight: 750; line-height: 1.14; letter-spacing: -.058em; overflow-wrap: anywhere; }
.hero h1 span { display: block; }
.hero h1 span + span { margin-top: .075em; color: var(--teal); }
:is(:lang(ja), :lang(zh-Hant), :lang(zh-Hans), :lang(ko), :lang(th)) .hero h1 { line-height: 1.28; letter-spacing: -.052em; }
.hero-description { max-width: 30em; color: var(--muted); font-size: clamp(1rem, 1.36vw, 1.14rem); line-height: 1.95; text-wrap: pretty; }
:lang(ja) .hero-description { word-break: auto-phrase; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 29px; }
.play-link { display: inline-block; width: fit-content; border-radius: 8px; }
.play-link img { width: 166px; }
.play-link:hover { opacity: .86; }
.text-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--teal); font-size: .9rem; font-weight: 680; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-link:hover { color: var(--ink); }
.hero-figure { display: grid; align-content: center; justify-items: center; gap: 13px; min-width: 0; padding: 28px 16px 18px; background: var(--mint); border-radius: 19px; }
.hero-screen { width: min(68%, 250px); border: 1px solid #cbd9d1; border-radius: 15px; box-shadow: 0 12px 28px #2946371a; }
.hero-figure figcaption { color: var(--muted); font-size: .77rem; text-align: center; }

.section { padding-block: 80px; border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.75rem, 3.45vw, 2.75rem); line-height: 1.27; letter-spacing: -.04em; font-weight: 740; }
h3 { font-size: 1.15rem; font-weight: 720; line-height: 1.4; }
.how-section, .depth-section { background: var(--white); }
.how-layout, .depth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(35px, 7.2vw, 108px); }
.rule-list { padding: 0; margin: 24px 0 0; list-style: none; }
.rule-list li { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.rule-number { color: var(--teal); padding-top: 3px; font-size: .77rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rule-list p, .mode-panel p, .strategy dd, .depth-note { margin-top: 4px; color: var(--muted); font-size: .94rem; }
.demo-section { padding: 23px 27px 25px; background: #edf3ef; border: 1px solid #e1eae3; border-radius: 16px; }
.demo-section > h3 { max-width: 342px; margin: 0 auto 12px; }
.demo-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; max-width: 342px; margin: 0 auto 10px; font-size: .78rem; font-weight: 650; }
.demo-next, .demo-counter { display: inline-flex; align-items: center; gap: 8px; }
.demo-next-tile { display: grid; place-items: center; width: 27px; aspect-ratio: 1; background: var(--pink); border-radius: 5px; font-size: 18px; }
.demo-counter strong { color: var(--teal); font-size: .93rem; font-variant-numeric: tabular-nums; }
.demo-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; max-width: 342px; margin-inline: auto; }
.demo-cell { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid #bdccc4; border-radius: 8px; color: var(--ink); background: #dde7df; }
.demo-cell:disabled { cursor: default; }
.demo-layer { display: block; flex: 0 0 12%; width: 100%; background: var(--tile-color); border-top: 1px solid #193a332a; }
.demo-layer.is-top { display: grid; flex: 1 1 auto; place-items: center; border-top: 0; }
.demo-layer.is-under .demo-symbol { display: none; }
[data-color="pink"] { --tile-color: var(--pink); }
[data-color="blue"] { --tile-color: var(--blue); }
[data-color="green"] { --tile-color: var(--green); }
.demo-symbol { display: inline-grid; place-items: center; font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1; }
.demo-cell > .demo-symbol { flex: 1; color: var(--teal); }
.demo-cell.is-target { border: 2px dashed var(--teal); background: #fbfdf9; }
.demo-cell.is-target:hover { background: #e6f5e9; }
.demo-cell.is-match { z-index: 1; box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--teal); }
.demo-cell.is-revealed .is-top { animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: .4; } to { opacity: 1; } }
.demo-status { min-height: 3.2em; max-width: 342px; margin: 12px auto 8px; color: var(--muted); font-size: .84rem; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 342px; margin-inline: auto; }
.button-primary, .button-reset { min-height: 40px; padding: 6px 12px; border: 1px solid transparent; border-radius: 6px; font-size: .84rem; font-weight: 670; }
.button-primary { color: var(--white); background: var(--teal); }
.button-primary:not([aria-disabled="true"]):hover { background: #105351; }
.button-primary[aria-disabled="true"] { opacity: .72; cursor: default; }
.button-reset { color: var(--teal); border-color: #a9c3b6; background: transparent; }
.button-reset:hover { background: var(--white); }
.demo:not([data-demo-state]) :is(.demo-header, .demo-board, .demo-status, .demo-actions) { display: none; }

.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-top: 25px; }
.mode-panel { min-width: 0; }
.mode-art { display: grid; place-items: center; padding: 18px 10px; background: var(--mint); border-radius: 12px; }
.mode-art img { width: min(83%, 188px); aspect-ratio: 720 / 1305; object-fit: contain; }
.mode-panel h3 { margin-top: 13px; }
.mode-panel p { margin-top: 6px; }
.strategy { margin-top: 23px; }
.strategy > div { padding-block: 14px; border-top: 1px solid var(--line); }
.strategy dt { font-weight: 730; }
.strategy dd { margin-top: 3px; }
.depth-note { margin-top: 10px; }
.gameplay { padding: 22px 20px 18px; text-align: center; background: var(--mint); border-radius: 16px; }
.gameplay-media { display: grid; justify-items: center; }
.gameplay video { display: block; width: min(76%, 214px); height: auto; aspect-ratio: 9 / 16; border: 1px solid #d1ded3; border-radius: 10px; background: #f0f2e9; }
.gameplay figcaption { max-width: 365px; margin: 11px auto 0; }
#video-title { font-size: .91rem; font-weight: 700; }
#video-description { margin-top: 3px; color: var(--muted); font-size: .78rem; }

.download-section { border-top: 1px solid var(--line); background: var(--mint); }
.download-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-block: 46px; }
.download-inner .play-link { flex-shrink: 0; }
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; padding-block: 23px; }
.footer-brand { display: grid; gap: 3px; }
.footer-brand .brand { font-size: 1.18rem; }
.footer-brand .brand img { width: 29px; height: 29px; }
.maker { width: max-content; color: var(--muted); font-size: .73rem; text-decoration: none; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer nav a { color: var(--muted); font-size: .8rem; text-decoration: none; }
.footer nav a:hover, .maker:hover { text-decoration: underline; }
.footer nav [aria-current="page"] { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.back-top { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; color: var(--teal); text-decoration: none; }
.back-top:hover { background: var(--mint); }

@media (max-width: 930px) {
  .wrap { width: calc(100% - 56px); }
  .hero { padding-block: 40px 56px; }
  .hero-inner { gap: 30px; }
  .hero h1 { font-size: clamp(2.25rem, 5.1vw, 3.5rem); }
  .primary-nav { gap: 18px; }
  .section { padding-block: 60px; }
  .mode-grid { gap: 16px; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 40px); }
  .header-inner { min-height: 62px; }
  .primary-nav { display: none; }
  .compact-nav { display: block; }
  .compact-nav .menu-panel { right: auto; left: -58px; }
  .hero { padding-block: 34px 44px; }
  .hero-inner { grid-template-columns: 1fr; gap: 23px; }
  .hero-copy { padding-block: 0; }
  .hero h1 { margin-block: 12px 16px; font-size: clamp(2.2rem, 7.8vw, 3.6rem); }
  .hero-description { line-height: 1.8; }
  .hero-actions { margin-top: 20px; }
  .hero-figure { padding-block: 20px 13px; }
  .hero-screen { width: min(62%, 224px); }
  .section { padding-block: 48px; }
  .how-layout, .depth-layout { grid-template-columns: 1fr; gap: 24px; }
  .rule-list { margin-top: 17px; }
  .rule-list li { padding-block: 12px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 15px; margin-top: 18px; }
  .mode-art { padding: 10px 7px; }
  .mode-art img { width: min(94%, 188px); }
  .download-inner { padding-block: 34px; }
}

@media (max-width: 480px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .header-menu summary { gap: 6px; padding-inline: 8px; }
  .language-menu summary > span:nth-child(2) { max-width: 61px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero h1 { font-size: clamp(1.95rem, 8.2vw, 2.5rem); }
  .play-link img { width: 145px; }
  .demo-section { padding: 17px; }
  .download-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner { display: grid; grid-template-columns: 1fr auto; }
  .footer nav { grid-row: 2; grid-column: 1 / -1; }
  .back-top { grid-row: 1; grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
