:root {
  --ink: #17233c;
  --violet: #7254be;
  --teal: #168f95;
  --gold: #f5bd48;
  --mist: #eee7ff;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #e6dcff, #d7f3ef 55%, #fff0c5);
  font:
    18px/1.35 system-ui,
    sans-serif;
}
button,
a {
  min-height: 44px;
  font: inherit;
}
button {
  cursor: pointer;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
:focus-visible {
  outline: 4px solid #ed5a79;
  outline-offset: 3px;
}
.game-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  pointer-events: none;
}
.game-bar > * {
  pointer-events: auto;
}
.game-bar a {
  display: flex;
  align-items: center;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
main {
  width: min(1120px, 100%);
  margin: auto;
  padding: 8px 18px 28px;
}
.start-card,
.finish-card,
.sentence-card {
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid var(--ink);
  border-radius: 25px;
  box-shadow: 7px 8px 0 var(--ink);
}
.start-card,
.finish-card {
  max-width: 720px;
  margin: 4vh auto;
  padding: clamp(22px, 5vw, 54px);
  text-align: center;
}
.start-card h1 {
  margin: 0.1em 0;
  font-size: clamp(2.3rem, 8vw, 5rem);
  line-height: 0.92;
}
.eyebrow {
  margin: 0;
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.model {
  margin: 22px auto;
  padding: 15px;
  border-radius: 15px;
  background: var(--mist);
  font-size: 1.15rem;
}
.model mark,
.sentence mark {
  padding: 1px 4px;
  border-radius: 5px;
  background: #ffe08a;
}
.model span,
.relative {
  padding: 1px 4px;
  border-radius: 5px;
  background: #c8f2ed;
}
.model small {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
}
.support-note {
  font-size: 0.85rem;
}
.primary {
  background: var(--gold);
  box-shadow: 0 3px 0 #ad731d;
}
.quest-head {
  text-align: center;
}
.quest-head h2 {
  margin: 0.1em 0;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}
.quest-head p {
  max-width: 68ch;
  margin: 0.3em auto;
}
.scene-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.candidate {
  min-height: 174px;
  padding: 13px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  text-align: left;
}
.candidate[aria-pressed="true"] {
  background: #fff4c7;
  box-shadow: 0 0 0 5px #f4bf4b;
}
.candidate[data-target="true"] {
  outline: 5px solid var(--teal);
  outline-offset: 2px;
}
.scene-art {
  position: relative;
  display: block;
  height: 92px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #d8f2f2;
}
.scene-art:before,
.scene-art:after {
  position: absolute;
  content: "";
}
.explorer-map:before,
.explorer-torch:before {
  left: 22%;
  top: 15px;
  width: 39px;
  height: 62px;
  border-radius: 25px 25px 12px 12px;
  background: #7756bd;
  box-shadow: 57px 12px 0 #f4b45a;
}
.explorer-map:after {
  left: 30%;
  top: 38px;
  width: 27px;
  height: 22px;
  border: 2px solid var(--ink);
  background: #f5df88;
  transform: rotate(-10deg);
}
.explorer-torch:after {
  right: 20%;
  top: 20px;
  width: 8px;
  height: 52px;
  border-radius: 5px;
  background: #9b643c;
  box-shadow: 0 -12px 0 7px #f9cf58;
}
.machine-sort:before,
.machine-crush:before {
  left: 20%;
  top: 18px;
  width: 120px;
  height: 55px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  background: #6cc5cc;
}
.machine-sort:after {
  left: 30%;
  top: 35px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    27px 8px 0 #fff,
    54px -3px 0 #fff;
}
.machine-crush:after {
  left: 45%;
  top: 15px;
  width: 30px;
  height: 64px;
  background: repeating-linear-gradient(90deg, #e77975 0 7px, #9e3d4e 8px 12px);
}
.workshop-recharge:before,
.workshop-sleep:before {
  left: 30%;
  top: 15px;
  width: 38px;
  height: 64px;
  border-radius: 18px;
  background: #adb7d6;
  box-shadow: 57px 0 0 #adb7d6;
}
.workshop-recharge:after {
  left: 36%;
  top: 25px;
  width: 10px;
  height: 26px;
  background: #f5d34d;
  box-shadow: 57px 0 #f5d34d;
}
.workshop-sleep:after {
  left: 37%;
  top: 19px;
  color: #455aa4;
  content: "Z Z";
  font-weight: 900;
}
.evening-lantern,
.evening-fireworks {
  background: #263a70;
}
.evening-lantern:before {
  left: 24%;
  top: 18px;
  width: 18px;
  height: 38px;
  border-radius: 50%;
  background: #f8cf51;
  box-shadow:
    50px 8px #f8cf51,
    100px -3px #f8cf51;
}
.evening-fireworks:before {
  left: 50%;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff826f;
  box-shadow:
    20px 20px 0 8px #ffcf55,
    -22px 25px 0 6px #80d9d3;
}
.artist-open:before,
.artist-closed:before {
  left: 25%;
  top: 12px;
  width: 45px;
  height: 72px;
  border-radius: 25px 25px 10px 10px;
  background: #ed9b92;
}
.artist-open:after,
.artist-closed:after {
  right: 17%;
  top: 30px;
  width: 44px;
  height: 34px;
  border: 3px solid var(--ink);
  background: #ffe49b;
}
.artist-open:after {
  transform: skewY(-16deg);
}
.artist-closed:after {
  background: #b77c61;
}
.bridge-stream:before,
.bridge-meadow:before {
  right: 15%;
  bottom: 19px;
  left: 15%;
  height: 42px;
  border: 6px solid var(--ink);
  border-bottom: 0;
  border-radius: 80px 80px 0 0;
}
.bridge-stream:after,
.bridge-meadow:after {
  right: 0;
  bottom: 0;
  left: 0;
  height: 20px;
}
.bridge-stream:after {
  background: repeating-radial-gradient(
    ellipse at 14px -2px,
    transparent 0 8px,
    #167f9b 9px 11px,
    #55c6d0 12px 20px
  );
}
.bridge-meadow:after {
  background: repeating-linear-gradient(
    72deg,
    #8bc66c 0 10px,
    #5f9f49 11px 13px,
    #8bc66c 14px 20px
  );
}
.sentence-card {
  padding: 18px;
}
.sentence {
  min-height: 58px;
  margin: 7px 0;
  padding: 12px;
  border: 2px dashed var(--violet);
  border-radius: 13px;
  background: #fffdf8;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 800;
}
.clause-note {
  min-height: 25px;
  margin: 0;
  font-size: 0.9rem;
}
.tile-tray,
.actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.tile {
  min-height: 48px;
  background: #e5fbf6;
}
.tile[aria-pressed="true"] {
  background: #c0e8df;
}
.actions button {
  min-height: 48px;
}
#feedback {
  min-height: 29px;
  margin: 12px 2px;
  font-weight: 800;
}
.finish-card ol {
  text-align: left;
}
.finish-card li {
  margin: 8px 0;
}
.finish-card details {
  margin-top: 14px;
  text-align: left;
}
.finish-card summary {
  font-weight: 750;
}
@media (max-width: 520px) {
  main {
    padding: 5px 10px 18px;
  }
  .scene-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
  }
  .candidate {
    min-height: 120px;
    padding: 8px;
    border-radius: 14px;
    font-size: 0.82rem;
  }
  .scene-art {
    height: 64px;
    margin-bottom: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
.primary {
  min-height: 48px;
}
.main-clause {
  font-weight: 800;
}
.noun-phrase.highlight,
.noun-phrase {
  padding: 1px 4px;
  border-radius: 5px;
  background: #ffe08a;
}
.relative-clause {
  padding: 1px 4px;
  border-radius: 5px;
  background: #c8f2ed;
}
.relative-pronoun {
  font-weight: 900;
  text-decoration: underline;
}
.clause-bracket::before,
.clause-bracket::after {
  font-weight: 900;
}
.clause-bracket::before {
  content: "[ ";
}
.clause-bracket::after {
  content: " ]";
}
@media (max-height: 420px) and (min-width: 521px) {
  .game-bar {
    padding: 4px 10px;
  }
  main {
    padding-top: 2px;
    padding-bottom: 12px;
  }
  #start-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
    grid-template-areas:
      "eyebrow eyebrow"
      "title model"
      "intro model"
      "support action"
      "help help";
    column-gap: 18px;
    max-width: 780px;
    margin: 2px auto;
    padding: 10px 18px;
    text-align: left;
  }
  #start-screen .eyebrow {
    grid-area: eyebrow;
  }
  #start-screen h1 {
    grid-area: title;
    align-self: end;
    font-size: clamp(2rem, 5vw, 3.25rem);
  }
  #start-screen > p:not(.eyebrow, .support-note) {
    grid-area: intro;
    margin: 4px 0;
    font-size: 0.9rem;
  }
  #start-screen .model {
    grid-area: model;
    align-self: center;
    margin: 0;
    padding: 9px;
    font-size: 0.95rem;
  }
  #start-screen .model p {
    margin: 0;
  }
  #start-screen .support-note {
    grid-area: support;
    align-self: center;
    margin: 4px 0;
    font-size: 0.75rem;
  }
  #start-screen #play {
    grid-area: action;
    align-self: center;
    justify-self: center;
  }
  #start-screen details {
    grid-area: help;
  }
  #start-screen details p {
    margin: 0 0 4px;
    font-size: 0.8rem;
  }
}
