:root {
  color-scheme: light;
  --paper: #f7f7fa;
  --ink: #1a1833;
  --muted: #55546a;
  --violet: #542dd6;
  --line: #e6e4ee;
  --white: #fff;
  --radius: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 86px; }
body { margin: 0; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #663eef; outline-offset: 4px; }
svg { width: 19px; height: 19px; flex: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.12; }
p, figcaption { color: var(--muted); overflow-wrap: anywhere; }
.intro p, .section p, figcaption, .legal p, .footer-main p, dialog p {
  text-align: justify;
  text-align-last: start;
  hyphens: auto;
}
.wrap { width: min(1144px, calc(100% - 56px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 3; top: 12px; left: 12px; background: white; padding: 10px 16px; border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.header { background: #ffffffee; border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 68px; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; width: fit-content; line-height: 1.2; font-size: 1.41rem; font-weight: 790; letter-spacing: -.075em; white-space: nowrap; }
.wordmark img { width: 32px; height: 32px; flex: none; }
.brand-period, .intro h1 span { color: #7858ef; }
.header nav, .header-actions { display: flex; align-items: center; gap: 10px; }
.header nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; color: var(--muted); font-size: .91rem; font-weight: 650; }
.header nav a:hover { color: var(--violet); }
.header-actions { justify-self: end; }
.button, .icon-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 44px; border: 1px solid transparent; border-radius: 12px;
  padding: 8px 14px; text-align: center; font-size: .92rem; font-weight: 700; line-height: 1.2;
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s;
}
.button:disabled { cursor: wait; opacity: .62; }
.primary, .header-play { background: var(--violet); color: white; }
.primary:hover:not(:disabled), .header-play:hover { background: #4323bc; box-shadow: 0 5px 15px #542dd62b; }
.secondary, .install, .icon-button { background: #f6f5fb; color: var(--ink); border-color: var(--line); }
.secondary:hover:not(:disabled), .install:hover, .icon-button:hover { color: var(--violet); background: #eeebfb; border-color: #dcd4f6; }
.icon-button { width: 44px; padding: 0; }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.controls > :only-child { grid-column: span 2; }
.intro, .game-section {
  width: min(1050px, calc(100% - 56px));
  width: min(1050px, calc(100% - 56px), max(560px, calc((100svh - 215px) * 16 / 9)));
}
.intro { padding-block: 19px 19px; }
.intro h1 { font-size: clamp(2.5rem, 4.8vw, 3.5rem); letter-spacing: -.087em; font-weight: 790; }
.intro p { margin-top: 7px; font-size: 1.05rem; }
.game-panel {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 38px #2820500b, 0 2px 6px #28205008;
}
.game-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 10px 5px 16px; }
.game-toolbar p { font-size: .875rem; font-weight: 650; }
.game-tools { display: flex; flex: none; gap: 6px; }
.game-tools .icon-button > span { display: flex; }
.game-viewport { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #f0eef5; border-radius: 0 0 27px 27px; }
.game-viewport iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-panel:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 0; background: #1a182b; }
.game-panel:fullscreen .game-toolbar, .game-panel:fullscreen .game-viewport { width: min(100%, calc((100dvh - 54px) * 16 / 9)); }
.game-panel:fullscreen .game-toolbar { background: white; }
.game-panel:fullscreen .game-viewport { flex: none; border-radius: 0; }
input { min-width: 0; width: 100%; padding: 10px 13px; min-height: 49px; border: 1px solid #d9d5e4; background: #fbfafe; border-radius: 12px; color: var(--ink); font-size: 1rem; }
input::placeholder { color: #6e6b80; }
.inline-status { font-size: .875rem; }
.inline-status:not(:empty) { margin-top: 10px; }
.art { position: relative; background: #e8e0fa; overflow: hidden; min-width: 0; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art figcaption { position: absolute; bottom: 12px; left: 12px; right: 12px; padding: 7px 11px; color: #28213c; background: #ffffffed; font-size: .83rem; border-radius: 10px; }
.section { margin-block: 68px; }
.section h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); font-weight: 770; letter-spacing: -.061em; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 21px; }
.section-heading p { margin-top: 7px; }
.section-heading .button { flex: none; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: white; border: 1px solid var(--line); border-radius: 23px; overflow: hidden; }
.feature .art { aspect-ratio: 1.47; }
.feature .art img { object-position: center 37%; }
.feature-copy { padding: 23px; }
.feature h3 { font-size: 1.23rem; letter-spacing: -.035em; }
.feature p, .legal p { margin-top: 12px; }
.practice-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.practice-grid .art { aspect-ratio: 1.65; border-radius: 23px; }
.practice-note { margin-top: 16px; }
.faq-items { padding-inline: clamp(15px, 3vw, 32px); background: white; border: 1px solid var(--line); border-radius: 23px; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { min-height: 57px; padding: 14px 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--violet); transition: transform .15s; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding-bottom: 16px; }
.legal { width: min(800px, calc(100% - 56px)); margin: 44px auto 72px; padding: clamp(22px, 5vw, 52px); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.legal h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -.065em; }
.legal h2 { font-size: 1.32rem; margin-top: 27px; }
.legal p a { color: var(--violet); text-decoration: underline; }
.legal > .button { margin-top: 24px; }
.footer { background: #1a182b; color: #f6f4ff; border-top: 1px solid #2d2942; padding-top: 45px; }
.footer-main { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.2fr); gap: clamp(36px, 5vw, 72px); }
.footer-main p { color: #c3c0d3; margin-top: 10px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.footer h2 { min-height: 45px; font-size: .88rem; }
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li a { min-height: 44px; display: flex; align-items: center; color: #d8d5e6; font-size: .95rem; overflow-wrap: anywhere; }
.footer li a:hover { color: #fff; text-decoration: underline; }
.copyright { border-top: 1px solid #38354b; margin-top: 36px; padding-block: 16px; font-size: .875rem; color: #c3c0d3; }
dialog { width: min(470px, calc(100% - 30px)); padding: 22px; border: 1px solid var(--line); border-radius: 23px; color: var(--ink); box-shadow: 0 18px 60px #160f3433; }
dialog::backdrop { background: #1a183374; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-top h2 { font-size: 1.45rem; letter-spacing: -.04em; }
dialog p:not(:empty) { margin-block: 12px; }
dialog input { margin-top: 12px; }
@media (max-width: 900px) {
  .footer-main { grid-template-columns: 1fr; gap: 25px; }
  .feature-grid { gap: 10px; }
  .feature-copy { padding: 18px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 30px); }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; min-height: 58px; gap: 0 8px; padding-block: 5px; }
  .header nav { grid-column: 1 / -1; grid-row: 2; gap: 9px; }
  .header nav a { padding-inline: 5px; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .header-play, .install { min-width: 44px; padding-inline: 8px; }
  .header-play span { display: none; }
  .intro { padding-block: 10px 17px; }
  .intro p { font-size: .96rem; }
  .feature-grid, .practice-grid { grid-template-columns: minmax(0, 1fr); }
  .feature .art { aspect-ratio: 1.6; }
  .section { margin-block: 43px; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .legal { width: calc(100% - 30px); }
}
@media (max-width: 520px) {
  .header .wordmark { gap: 5px; font-size: 1.25rem; }
  .header .wordmark img { width: 26px; height: 26px; }
  .footer-links { grid-template-columns: 1fr; gap: 19px; }
  .footer h2 { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
