.kokugo-frame { --app-accent: var(--mint); --app-accent-soft: var(--mint-soft); }
.jw-home { max-width: 720px; margin: 24px auto; }
.jw-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.jw-level { min-width: 0; display: grid; gap: 6px; text-align: center; }
.jw-level strong { font-size: 20px; }
.jw-level small { font-size: 14px; }
.jw-level .jw-level-count { color: var(--muted); font-weight: 600; }
.jw-menu { max-width: 440px; width: 100%; margin-inline: auto; }
.jw-game { max-width: 880px; width: 100%; margin-inline: auto; gap: 14px; }
.jw-order-ticket { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--ink); border-radius: var(--control-radius); background: var(--yellow-soft); }
.jw-order-ticket strong { font-size: 26px; white-space: nowrap; }
.jw-order-ticket span { font-size: 15px; text-align: right; }
.jw-order-ticket span { margin-left: auto; }
.jw-scene-picture { width: 88px; height: 88px; flex: 0 0 88px; background-image: url('./jukugo-workshop-scenes-v1.png'); background-size: 400% 200%; background-repeat: no-repeat; border-radius: var(--control-radius); }
.jw-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'route controls'; gap: 24px; align-items: start; }
.jw-controls { grid-area: controls; }
.jw-route { grid-area: route; }
.jw-route, .jw-controls { min-width: 0; }
.jw-tap-result { min-height: 28px; margin: 0 0 6px; font-size: 17px; font-weight: 900; text-align: center; }
.jw-tap-result:not(:empty) { background: var(--mint-soft); border-radius: var(--control-radius); }
.jw-tap-result.is-ng { background: var(--coral-soft); }
.jw-path { display: grid; grid-template-columns: repeat(var(--slot-count), minmax(0,1fr)); gap: 24px; list-style: none; padding: 0; margin: 4px 0; align-items: start; }
.jw-path li { position: relative; min-width: 0; padding: 6px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--control-radius); }
.jw-path li:not(:last-child)::after { content: '→'; position: absolute; left: calc(100% + 4px); top: 28px; font-size: 18px; font-weight: 900; color: var(--ink); }
.jw-path li.is-filled { background: var(--mint-soft); }
.jw-path li.is-current { background: var(--yellow-soft); border-style: dashed; }
.jw-path li.is-blocked { background: var(--coral-soft); border-color: var(--coral); }
.jw-slot-body { display: grid; grid-template-rows: 14px 36px 18px; justify-items: center; align-items: center; min-height: 68px; }
.jw-word-button { width: 100%; min-height: 68px; min-width: 44px; padding: 0; color: var(--ink); background: none; border: 0; cursor: pointer; touch-action: manipulation; }
.jw-word-button[aria-pressed="true"] { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.jw-path-number { color: var(--muted); font-size: 11px; line-height: 14px; }
.jw-path .jw-slot-text { font-size: 28px; line-height: 36px; white-space: nowrap; }
.jw-path .kg-reading { font-size: 12px; line-height: 18px; }
.jw-word-meaning { font-size: 14px; line-height: 1.7; max-width: 30ch; overflow-wrap: anywhere; }
.jw-instruction { margin: 8px 0; font-size: 14px; }
.jw-feedback { padding: 10px 12px; background: var(--mint-soft); border-left: 4px solid var(--mint); margin-top: 12px; }
.jw-feedback p { margin: 4px 0; line-height: 1.7; overflow-wrap: anywhere; }
.jw-feedback-word { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.jw-feedback-word strong { font-size: 24px; }
.jw-feedback-word .kg-reading { margin-top: 0; }
.jw-feedback-note { font-size: 14px; }
.jw-verdict { font-weight: 900; color: var(--ink); }
.jw-feedback.is-unlisted { background: var(--coral-soft); border-left-color: var(--coral); }
.jw-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.jw-tile { position: relative; min-height: 68px; padding: 6px 4px; font-size: 30px; }
.jw-tile strong { display: block; line-height: 1; padding-bottom: 12px; }
.jw-tile small { position: absolute; left: 0; right: 0; bottom: 4px; display: block; font-size: 11px; line-height: 1; }
.jw-tile.is-hint { border: 3px dashed var(--blue); background: var(--yellow-soft); }
.jw-controls > .kg-primary { width: 100%; margin-bottom: 10px; }
.jw-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.jw-actions .kg-button { min-width: 0; padding-inline: 4px; }
.jw-review-prompt { background: var(--yellow-soft); }
.jw-review-prompt p { font-size: 22px; line-height: 1.9; }
.jw-options { margin: 0; }
.jw-options .kg-choice { min-height: 100px; }
.jw-options .kg-choice strong { font-size: 22px; }
.jw-options .kg-choice:disabled { opacity: 1; }
.jw-options .is-correct { border: 3px solid var(--mint); background: var(--mint-soft); }
.jw-options .is-wrong { border: 3px dashed var(--coral); background: var(--coral-soft); }
.jw-answer-label { display: block; font-weight: 800; margin-top: 8px; }
.jw-review-feedback > p { margin: 4px 0; }
.jw-review-feedback > .kg-primary { width: 100%; margin-top: 10px; }
.jw-result { max-width: 640px; width: 100%; margin: 24px auto; }
.jw-sources { margin-top: 24px; font-size: 12px; color: var(--muted); }
.jw-sources summary { min-height: 44px; display: list-item; padding-block: 12px; cursor: pointer; touch-action: manipulation; }
.jw-sources p { line-height: 1.8; overflow-wrap: anywhere; }
.jw-sources a { color: var(--ink); }
.jw-result > .kg-muted { text-align: center; margin-bottom: 0; }
.jw-score { font-size: 64px; font-weight: 900; text-align: center; margin: 10px 0 24px; }
@media (max-width: 720px) {
  .jw-home { margin-block: 12px; }
  .jw-levels { gap: 8px; }
  .jw-level { padding: 10px 4px; }
  .jw-level strong { font-size: 16px; }
  .jw-level small { font-size: 12px; }
  .jw-board { grid-template-columns: 1fr; grid-template-areas: 'route' 'controls'; gap: 6px; }
  .jw-game { gap: 4px; }
  .jw-playing .app-header { padding-bottom: 0; min-height: 44px; }
  .jw-playing .brand { min-height: 44px; }
  .jw-playing .brand-logo { width: 112px; }
  .jw-playing #gameRoot { padding-top: 6px; }
  .jw-game .kg-heading h1 { font-size: 22px; }
  .jw-game .kg-status { align-items: center; }
  .jw-game .kg-status > .kg-button, .jw-actions .kg-button { min-height: 44px; }
  .jw-game .kg-heading .eyebrow { margin-bottom: 2px; font-size: 11px; }
  .jw-tile { min-height: 48px; font-size: 24px; padding-block: 3px; }
  .jw-tile strong { padding-bottom: 10px; }
  .jw-tiles { gap: 6px; margin-bottom: 6px; }
  .jw-tap-result { display: none; }
  .jw-order-ticket { padding: 4px 8px; gap: 8px; }
  .jw-order-ticket strong { font-size: 24px; }
  .jw-order-ticket span { font-size: 13px; }
  .jw-scene-picture { width: 40px; height: 40px; flex-basis: 40px; }
  .jw-path { gap: 12px; margin: 0; }
  .jw-path--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .jw-path--5 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .jw-path--4 li:nth-child(2)::after, .jw-path--5 li:nth-child(3)::after { content: '↓'; left: auto; right: calc(50% - 9px); top: calc(100% + 2px); }
  .jw-path--4 li:nth-child(3) { grid-column: 2; grid-row: 2; }
  .jw-path--4 li:nth-child(4) { grid-column: 1; grid-row: 2; }
  .jw-path--5 li:nth-child(4) { grid-column: 3; grid-row: 2; }
  .jw-path--5 li:nth-child(5) { grid-column: 2; grid-row: 2; }
  .jw-path--4 li:nth-child(3)::after, .jw-path--5 li:nth-child(4)::after { content: '←'; left: auto; right: calc(100% + 4px); }
  .jw-path li { padding: 2px; }
  .jw-slot-body { grid-template-rows: 8px 26px 14px; min-height: 48px; }
  .jw-word-button { min-height: 48px; }
  .jw-path-number { font-size: 9px; line-height: 8px; }
  .jw-path .jw-slot-text { font-size: 22px; line-height: 26px; }
  .jw-path .kg-reading { font-size: 12px; line-height: 14px; margin-top: 0; }
  .jw-word-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
  .jw-path li:not(:last-child)::after { left: 100%; top: 16px; font-size: 12px; line-height: 1; z-index: 1; }
  .jw-path--4 li:nth-child(2)::after, .jw-path--5 li:nth-child(3)::after { left: auto; top: calc(100% + 1px); }
  .jw-path--4 li:nth-child(3)::after, .jw-path--5 li:nth-child(4)::after { left: auto; right: calc(100% + 1px); }
  .jw-feedback { margin-top: 0; min-height: 108px; padding: 6px 8px; }
  .jw-feedback p { margin: 2px 0; line-height: 1.45; }
  .jw-feedback-word { gap: 6px; }
  .jw-feedback-word strong { font-size: 21px; }
  .jw-verdict { font-size: 13px; }
  .jw-definition, .jw-feedback-note { font-size: 13px; }
  .jw-controls > .kg-primary { margin-bottom: 0; }
  .jw-game .kg-primary { min-height: 44px; padding: 8px; font-size: 16px; }
  .jw-review-prompt p { font-size: 19px; }
}
@media (max-width: 360px) {
  .jw-game .kg-heading h1 { font-size: 22px; }
  .jw-levels { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .jw-level { align-items: center; }
  .jw-level strong { font-size: 16px; }
  .jw-level small { font-size: 13px; }
  .jw-order-ticket strong { font-size: 22px; }
  .jw-order-ticket span { font-size: 12px; }
  .jw-actions .kg-button { font-size: 12px; }
}
