:root {
  color-scheme: light;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
  color: #292039;
  background: #f6f2fc;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #6d43bd; outline-offset: 4px; }
.site-header {
  width: min(1120px, calc(100% - 48px)); margin: auto; min-height: 78px;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #dfd5ef;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 1.12rem; font-weight: 800; text-decoration: none; }
.header-actions { display: flex; gap: 7px; }
.mobile-gallery-trigger { display: none; }
.logo { width: 36px; height: 29px; position: relative; border-radius: 52% 50% 47% 42%; background: #d3f487; transform: rotate(-11deg); border: 2px solid #292039; }
.logo i { position: absolute; top: 8px; left: 9px; width: 3px; height: 4px; border-radius: 50%; background: #292039; }
.logo i + i { left: 19px; }
.logo b { position: absolute; top: 14px; left: 13px; width: 8px; height: 5px; border: 2px solid #292039; border-top: 0; border-radius: 0 0 8px 8px; }
.layout { width: min(1040px, calc(100% - 48px)); margin: clamp(32px, 7vh, 80px) auto; display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: clamp(24px, 6vw, 80px); }
h1 { margin: 0; font-size: clamp(3rem, 6.5vw, 5.9rem); line-height: .92; letter-spacing: -.075em; font-weight: 900; }
.description { font-size: 1.18rem; line-height: 1.5; max-width: 29ch; margin: 24px 0 35px; color: #514663; }
.instructions { display: flex; align-items: flex-start; gap: 13px; max-width: 340px; padding-top: 18px; border-top: 1px solid #dfd5ef; }
.instruction-mark { flex: none; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px; background: #e6daf9; }
.instructions p { margin: 5px 0 0; color: #514663; line-height: 1.5; }
.game { min-width: 0; max-width: 510px; width: 100%; justify-self: center; border: 1px solid #dacbec; padding: 9px; border-radius: 32px; background: #fff; box-shadow: 0 18px 65px #532d811b; }
.stage { aspect-ratio: 390 / 440; position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; touch-action: none; cursor: grab; user-select: none; background-color: #e5d6fa; background-image: radial-gradient(ellipse at 50% 44%, #f7eaff 0%, transparent 64%), radial-gradient(#8764b938 1px, transparent 1px); background-size: auto, 17px 17px; }
.stage:active { cursor: grabbing; }
.playfield { position: absolute; inset: 0; }
.playfield canvas, .cut-panel canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.loading-pose { position: absolute; top: 2%; left: 11%; width: 78%; height: 91%; object-fit: contain; pointer-events: none; }
.sparkle { position: absolute; pointer-events: none; color: #7650a9; line-height: 1; font-size: clamp(1.5rem, 4vw, 2.75rem); }
.sparkle-left { left: 12%; top: 33%; transform: rotate(-11deg); }
.sparkle-right { right: 12%; top: 60%; transform: rotate(13deg); }
.game-controls { display: flex; flex-wrap: wrap; min-height: 76px; align-items: center; padding: 10px 6px 4px; gap: 8px; }
.game-status { flex: 1 1 112px; padding-inline: 4px; }
.game-status p { margin: 0 0 6px; font-weight: 700; font-size: .9rem; }
progress { display: block; width: min(100%, 140px); height: 7px; border: 0; border-radius: 10px; appearance: none; background: #ece3f7; color: #7846bd; }
progress::-webkit-progress-bar { border-radius: 10px; background: #ece3f7; }
progress::-webkit-progress-value { border-radius: 10px; background: #7846bd; }
progress::-moz-progress-bar { border-radius: 10px; background: #7846bd; }
.pill, .primary { border-radius: 999px; min-height: 44px; padding: 8px 15px; font-weight: 800; font-size: .92rem; }
.pill { background: #fff; color: #292039; border: 1px solid #d9cce9; }
.pill:hover { background: #f0e8fa; }
.primary { border: 1px solid #292039; color: #292039; background: #d3f487; }
.primary:hover:enabled { background: #c4ee63; }
.primary:disabled { cursor: default; border-color: #ddd2ea; background: #f0eaf7; color: #655875; }
.result { position: absolute; inset: 0; display: grid; align-content: center; gap: 18px; padding: clamp(13px, 4%, 22px); background: #e8dbfa; cursor: default; }
.result h2 { margin: 0; text-align: center; font-size: clamp(1.75rem, 5vw, 2.8rem); letter-spacing: -.05em; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comparison figure { margin: 0; display: grid; grid-template-rows: 1fr auto; place-items: center; aspect-ratio: .82; padding: 12px 8px; border-radius: 20px; background: #faf6ff; font-weight: 800; }
.comparison canvas, .comparison img { display: block; width: 100%; height: auto; }
.gallery-link { display: inline-flex; align-items: center; margin-top: 16px; text-decoration: none; }
.cut-panel { position: absolute; inset: 0; }
.guess { padding: 12px clamp(10px, 4%, 22px) 3px; text-align: center; }
.guess #skip[hidden] { display: inline-block !important; visibility: hidden; }
.guess h2 { margin: 0 0 8px; font-size: clamp(1.1rem, 4vw, 1.35rem); }
.guess p { margin: -3px auto 9px; max-width: 34ch; color: #514663; font-size: .9rem; }
.game-status .knead-instruction { margin: 5px 0 0; font-weight: 400; color: #514663; }
.guess-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.guess-choice { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; min-height: 46px; border: 1px solid #d9cce9; border-radius: 12px; padding: 5px; color: inherit; background: #fff; font-weight: 800; }
.guess-choice[aria-pressed='true'] { border: 2px solid #6944a9; }
.guess-chip { display: block; height: 28px; border-radius: 7px; border: 1px solid #291f3140; }
.guess-memory { display: inline-flex; align-items: center; gap: 6px; font-size: .87rem; }
.guess-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #29203960; }
.color-reveal { position: absolute; inset: 14px 14px auto; padding: 10px 14px; border-radius: 18px; background: #fff9; text-align: center; pointer-events: none; }
.color-reveal h2 { margin: 0; font-size: clamp(1.6rem, 6vw, 2.5rem); letter-spacing: -.04em; }
.color-reveal p { margin: 3px 0 0; font-weight: 700; }
.cut-panel { background: #eadcfb; cursor: crosshair; }
#section-hint, #section-review { position: absolute; left: 12px; right: 12px; text-align: center; pointer-events: none; }
#section-hint { top: 4px; font-weight: 800; }
#section-review { bottom: 10px; padding: 6px; border-radius: 16px; background: #ffffffbf; }
#section-review strong { font-size: clamp(1.3rem, 6vw, 2rem); }
#section-rating { margin: 2px 0 0; }
.gallery { width: min(1040px, calc(100% - 48px)); margin: 0 auto 55px; scroll-margin-top: 12px; }
.gallery h2 { font-size: clamp(1.65rem, 4vw, 2.5rem); margin: 0 0 17px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.gallery-card { display: grid; grid-template-rows: 1fr auto; min-width: 0; text-align: center; align-items: center; border: 1px solid #dacbec; border-radius: 18px; padding: 7px 7px 12px; color: inherit; background: #fff; text-decoration: none; font-weight: 800; }
.gallery-card:hover, .gallery-card[aria-current='page'] { border-color: #8257bd; background: #eee3fb; }
.gallery-card img { display: block; width: 100%; height: auto; }
.gallery-dialog { width: min(640px, 100%); max-height: 100%; padding: 0; color: inherit; background: #f6f2fc; border: 0; }
.gallery-dialog::backdrop { background: #21152db3; }
.gallery-toolbar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: #f6f2fc; border-bottom: 1px solid #dfd5ef; }
.gallery-toolbar h2 { margin: 0; font-size: 1.25rem; }
.mobile-gallery-list { padding: 14px; }
@media (max-width: 700px) {
  :root { background: #302047; }
  .session {
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px;
    height: 100vh; height: 100dvh; min-height: 440px;
    padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: radial-gradient(ellipse at 50% 26%, #523478, #302047 67%);
    color: #fff9ff;
  }
  .site-header { width: min(100%, 550px); min-height: 46px; margin: 0 auto; padding-inline: 4px; border: 0; }
  .wordmark { font-size: .98rem; gap: 7px; white-space: nowrap; }
  .logo { scale: .85; }
  .header-actions .pill, .game-controls .pill { background: #ffffff12; color: #fff9ff; border-color: #ffffff3b; padding-inline: 12px; }
  .mobile-gallery-trigger { display: inline-block; }
  .layout { width: min(100%, 550px); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 8px; margin: 0 auto; }
  .intro { padding: 0 6px; }
  h1 { font-size: clamp(1.3rem, 5.5vw, 1.85rem); line-height: 1.1; letter-spacing: -.045em; }
  .description, .instructions, .gallery-link, .gallery { display: none; }
  .game { max-width: none; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 7px; border: 0; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .stage { width: 100%; aspect-ratio: auto; container-type: size; border-radius: 22px; box-shadow: inset 0 0 0 1px #ffffffad; color: #292039; }
  .playfield, .cut-panel canvas { margin: auto; width: min(100%, 88.636cqh); height: auto; aspect-ratio: 390 / 440; }
  .sparkle-left { left: 9%; }
  .sparkle-right { right: 9%; }
  .guess, .game-controls { border: 1px solid #ffffff24; border-radius: 20px; background: #241735; }
  .guess { padding: 10px 11px 4px; }
  .guess h2 { margin-bottom: 5px; }
  .guess p, .game-status .knead-instruction { color: #e0d1f2; }
  .guess-options { margin-bottom: 2px; }
  .guess-choice { color: #292039; }
  .guess-choice[aria-pressed='true'] { border-color: #8a52e3; }
  .guess #skip { color: #eadbfa; background: transparent; border-color: transparent; }
  .game-controls { min-height: 60px; padding: 7px 10px; gap: 6px; }
  .game-controls p { margin-bottom: 4px; }
  .game-status { padding-inline: 2px; }
  .result { overflow-y: auto; align-content: safe center; gap: 10px; padding: 10px; }
  .comparison { width: min(100%, 89cqh); margin-inline: auto; }
  .comparison figure { padding: 6px; }
  .gallery-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .gallery-dialog .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
  .gallery-dialog .gallery-card { font-size: .86rem; }
}
@media (max-width: 350px) {
  .wordmark { font-size: .88rem; gap: 3px; }
  .header-actions .pill { padding-inline: 9px; }
}
