:root {
  --navy: #13284d;
  --coral: #b5423b;
  --teal: #087f82;
  --paper: #fff8e8;
  --line: #13284d;
  --gold: #f1bb3e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--navy);
  background: var(--paper);
  font:
    17px/1.38 system-ui,
    sans-serif;
}
button,
a,
summary {
  min-height: 44px;
  font: inherit;
  color: var(--navy);
}
button {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 750;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 2px;
}
.primary {
  min-height: 48px;
  background: var(--coral);
  color: #fff;
}
.button,
.dialog-all-games {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--navy);
  font-weight: 750;
  text-decoration: none;
}
.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 55px;
  padding: 6px 14px;
  border-bottom: 2px solid var(--line);
  background: #fff;
}
.game-bar p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
main {
  max-width: 1120px;
  margin: auto;
  padding: 14px;
}
.card,
.tool-panel {
  background: #fffdf7;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 0 var(--line);
}
.activity-head {
  max-width: 920px;
  margin: 0 auto 10px;
}
.activity-head h1 {
  margin: 0.15rem 0;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
}
.activity-head p {
  margin: 0.3rem 0;
}
.step {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
}
h1,
h2,
h3 {
  line-height: 1.12;
}
h2 {
  margin: 0.22rem 0 0.55rem;
  font-size: 1.25rem;
}
h3 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1rem;
}
#feedback {
  min-height: 1.4em;
  color: #8a2927;
  font-weight: 700;
}
.workspace {
  display: grid;
  gap: 14px;
}
.make-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(218px, 0.86fr);
  gap: 14px;
  align-items: start;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 8px;
}
.tool-grid button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.tool-grid button span:first-child {
  width: 1.3em;
  font-size: 1.65rem;
  line-height: 1;
}
.selected {
  outline: 4px solid var(--gold);
  outline-offset: 1px;
}
.editor {
  display: grid;
  justify-items: center;
  gap: 5px;
}
.stamp {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  width: min(100%, 280px);
  overflow: hidden;
  border: 3px solid var(--line);
  background: #f6e7bf;
}
.cell {
  display: grid;
  place-items: center;
  min-height: 78px;
  border: 1px solid var(--line);
  background: #fffdf7;
  font-size: 2.4rem;
  line-height: 1;
}
button.cell {
  padding: 0;
  border-radius: 0;
}
.editor .cell {
  min-height: 104px;
}
.compact-stamp {
  width: 106px;
}
.compact-stamp .cell {
  min-height: 46px;
  font-size: 1.55rem;
}
.stamp-description {
  width: 100%;
  margin: 0;
  font-size: 0.86rem;
}
.mark.DOTTED {
  display: inline-block;
  color: transparent;
  background: radial-gradient(var(--dot) 1.5px, transparent 1.8px);
  background-size: 5px 5px;
  -webkit-background-clip: text;
  background-clip: text;
}
.mark.DOTTED.NAVY {
  --dot: #13284d;
}
.mark.DOTTED.CORAL {
  --dot: #a43731;
}
.mark.DOTTED.TEAL {
  --dot: #076c6e;
}
.NAVY {
  color: #13284d;
}
.CORAL {
  color: #a43731;
}
.TEAL {
  color: #076c6e;
}
.options {
  margin: 10px 0;
}
.options summary {
  display: list-item;
  width: max-content;
  padding: 8px 3px;
  font-weight: 750;
  cursor: pointer;
}
.palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 8px 0;
}
.palette > span {
  font-weight: 750;
}
.palette button {
  min-width: 74px;
}
.trace-panel,
.intentions,
.comparison {
  margin-top: 14px;
}
.copy-strip,
.help-copies {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding: 4px;
}
.copy {
  flex: 0 0 140px;
  min-height: 48px;
  padding: 7px;
}
.copy .stamp {
  margin: 6px auto 0;
}
.action-row,
.always-actions,
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.intention-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.intention-list button {
  min-height: 48px;
  text-align: left;
}
.intention-list small {
  display: block;
  font-weight: 500;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.compare-grid .stamp {
  margin: auto;
}
.change-description {
  font-weight: 700;
}
.ending {
  max-width: 820px;
  margin: auto;
}
.completion-action {
  max-width: 820px;
  margin: 14px auto;
}
.chooser {
  max-width: 760px;
  margin: auto;
}
.chooser > button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  margin: 8px 0;
  text-align: left;
}
.paper-chip {
  width: 24px;
  height: 18px;
  border: 2px solid var(--line);
  background: #f6e7bf;
  transform: rotate(-5deg);
}
.static-guide {
  max-width: 820px;
  margin: 26px auto 0;
  border-top: 2px solid var(--line);
  padding-top: 12px;
  font-size: 0.92rem;
}
.static-guide h2 {
  font-size: 1rem;
}
dialog {
  width: min(840px, calc(100% - 18px));
  max-height: calc(100% - 18px);
  overflow: auto;
  color: var(--navy);
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fffdf7;
}
dialog::backdrop {
  background: #13284daa;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.help-card {
  margin: 12px 0;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.help-frames {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  margin: 8px 0;
}
.help-frames .stamp {
  margin-top: 5px;
}
.help-copies > div {
  flex: 0 0 126px;
}
.help-copies .stamp {
  margin-top: 5px;
}
.example-copy {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.definitions button {
  margin: 3px;
}
@media (max-width: 600px) {
  main {
    padding: 10px;
  }
  .game-bar p {
    font-size: 0.66rem;
  }
  .make-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor .cell {
    min-height: 76px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .help-copies {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
  .help-copies > div {
    min-width: 0;
  }
  .compact-stamp {
    width: 100%;
  }
  .compact-stamp .cell {
    min-height: 38px;
  }
}
@media (max-height: 430px) and (orientation: landscape) {
  .game-bar {
    min-height: 42px;
    padding: 2px 10px;
  }
  .game-bar a {
    min-height: 44px;
    padding: 4px 8px;
  }
  main {
    padding: 6px 10px;
  }
  .activity-head {
    margin-bottom: 5px;
  }
  .activity-head h1 {
    font-size: 1.15rem;
  }
  .activity-head p {
    margin: 0;
    font-size: 0.84rem;
  }
  .tool-panel {
    padding: 9px;
  }
  .tool-panel h2 {
    font-size: 1rem;
    margin: 0;
  }
  .make-grid {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 8px;
  }
  .tool-grid {
    gap: 5px;
  }
  .tool-grid button {
    min-height: 48px;
    padding: 5px 8px;
    font-size: 0.88rem;
  }
  .editor .cell {
    min-height: 48px;
  }
  .stamp {
    width: 176px;
  }
  .options {
    margin: 5px 0;
  }
  .options summary {
    min-height: 44px;
    padding: 8px 2px;
  }
  .static-guide {
    margin-top: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
