:root {
  --ink: #172743;
  --coral: #ef705c;
  --teal: #157a80;
  --cream: #fff5e8;
  --paper: #fffdf8;
  --line: #ddcdbd;
  --shadow: 0 8px 0 #ead7c3;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0, #ffe1c8 0 7%, transparent 24%), #f4e7d9;
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", Arial, sans-serif;
}
button,
a {
  font: inherit;
}
button {
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
}
button:hover {
  transform: translateY(-1px);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid #2d8ce1;
  outline-offset: 3px;
}
.game-bar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px clamp(14px, 4vw, 48px);
  background: #172743;
  color: white;
  border-bottom: 5px solid var(--coral);
}
.home-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: white;
  font-weight: 800;
  text-decoration: none;
}
.brand {
  margin: 0 auto 0 0;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.brand span {
  font-size: 0.72em;
  color: #ffdba3;
  margin-left: 8px;
}
.game-bar button {
  color: var(--ink);
  min-width: 76px;
}
.paper {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  border-radius: 22px;
}
.welcome {
  max-width: 680px;
  margin: clamp(24px, 8vh, 88px) auto;
  padding: clamp(24px, 5vw, 52px);
  text-align: center;
}
.eyebrow {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--teal);
  margin: 0.1rem 0 0.6rem;
}
.welcome h1,
.completion h2 {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 0.98;
  margin: 0.3rem 0 1rem;
}
.welcome > p:not(.eyebrow):not(.quiet-note) {
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 560px;
  margin: 0 auto 1.4rem;
}
.primary {
  background: var(--coral);
  color: var(--ink);
  border-color: var(--ink);
  min-height: 52px;
  padding: 11px 20px;
  font-weight: 900;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  margin: 8px auto;
  display: block;
}
.quiet-note {
  font-size: 0.85rem;
  color: #4b5b70;
}
.desk-art {
  height: 104px;
  position: relative;
  margin-bottom: 8px;
}
.lamp {
  display: block;
  background: #ffd165;
  border: 3px solid var(--ink);
  width: 66px;
  height: 66px;
  border-radius: 50% 50% 8px 8px;
  transform: skew(-9deg);
  position: absolute;
  left: 29%;
  top: 12px;
}
.pencil {
  display: block;
  width: 145px;
  height: 20px;
  background: var(--coral);
  border: 3px solid var(--ink);
  transform: rotate(-12deg);
  position: absolute;
  right: 17%;
  top: 63px;
}
.stamp {
  display: grid;
  place-content: center;
  position: absolute;
  right: 28%;
  top: 8px;
  height: 54px;
  width: 70px;
  border: 3px dashed var(--teal);
  color: var(--teal);
  font-weight: 900;
  transform: rotate(10deg);
}
#studio {
  max-width: 1040px;
  margin: 25px auto;
  padding: 0 18px 40px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.progress-row p {
  font-weight: 900;
  letter-spacing: 0.12em;
}
.source,
.editor {
  padding: clamp(17px, 3vw, 30px);
  margin: 15px 0;
}
.source-sentence {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 800;
  line-height: 1.4;
  margin: 0.4rem 0 1rem;
}
.role-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.role-row button {
  border-color: var(--teal);
  color: #075f64;
  background: #e6fbf6;
}
.role-row button.selected {
  background: #a9e7dc;
}
.focus-prompt {
  margin: 14px 0 0;
  font-weight: 800;
  color: #9c3c36;
}
#support-note,
#role-explanation,
.relationship {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 5px solid var(--teal);
  background: #e7f6f5;
  font-weight: 700;
  line-height: 1.4;
}
.editor-heading {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: start;
}
.editor h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin: 0.2rem 0;
}
.editor-heading span {
  white-space: nowrap;
  background: #ffe4a5;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 800;
}
.draft {
  min-height: 85px;
  display: flex;
  align-items: center;
  align-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 13px;
  margin: 16px 0 7px;
  border: 3px dashed #b39a84;
  border-radius: 14px;
  background: #fff8ef;
}
.draft-token,
.tray-token {
  min-height: 48px;
  min-width: 48px;
  background: #fff;
  border-color: #9a8370;
  border-radius: 9px;
}
.draft-token {
  background: #fff0d9;
}
.cursor {
  height: 43px;
  min-width: 18px;
  border-left: 4px solid var(--coral);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 12px 0 0 5px;
  color: #95463b;
}
.cursor-note,
.tray-label {
  font-size: 0.86rem;
  margin: 7px 0;
  color: #526072;
}
.edit-actions,
.tray {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.edit-actions button {
  font-size: 0.84rem;
}
.tray {
  padding: 12px;
  background: #e7f6f5;
  border-radius: 14px;
}
.tray-token {
  font-size: 1rem;
}
.check {
  display: block;
  margin: 18px 0 0;
}
.feedback {
  border-left: 7px solid var(--teal);
  padding: 13px;
  margin-top: 16px;
  background: #e9f7f1;
  font-weight: 700;
}
.feedback p {
  margin: 0 0 10px;
  line-height: 1.45;
}
.feedback div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.completion {
  max-width: 780px;
  margin: 35px auto;
  padding: clamp(23px, 5vw, 46px);
}
.completion li {
  padding: 0.5rem 0;
  line-height: 1.5;
}
.completion details {
  margin: 22px 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
}
.completion summary {
  font-weight: 900;
  cursor: pointer;
}
dialog {
  max-width: min(560px, calc(100vw - 30px));
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 25px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 0 #90766b;
}
dialog::backdrop {
  background: #172743aa;
}
.diagnostic-options {
  display: grid;
  gap: 10px;
}
.diagnostic-options button {
  text-align: left;
  min-height: 50px;
}
.recovery {
  max-width: 600px;
  margin: 50px auto;
  padding: 32px;
}
.recovery[hidden] {
  display: none;
}
@media (max-width: 620px) {
  .game-bar {
    min-height: 62px;
    gap: 8px;
  }
  .brand {
    font-size: 0.83rem;
  }
  .brand span {
    display: none;
  }
  #studio {
    padding: 0 10px;
  }
  .source,
  .editor {
    padding: 16px;
  }
  .editor-heading {
    display: block;
  }
  .editor-heading span {
    display: inline-block;
    margin-top: 8px;
  }
  .edit-actions button {
    flex: 1 1 42%;
    padding: 7px;
    font-size: 0.77rem;
  }
  .role-row button {
    width: 100%;
    text-align: left;
  }
  .completion {
    margin: 18px 12px;
  }
  .welcome {
    margin: 20px 12px;
  }
  .draft {
    gap: 5px;
  }
  .draft-token,
  .tray-token {
    font-size: 0.9rem;
    padding: 6px 9px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .welcome {
    margin: 12px auto;
    padding: 18px;
    max-width: 760px;
  }
  .desk-art {
    display: none;
  }
  .welcome h1 {
    font-size: 2rem;
  }
  .welcome > p:not(.eyebrow):not(.quiet-note) {
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
  }
  .game-bar {
    min-height: 52px;
  }
  .source,
  .editor {
    margin: 8px 0;
    padding: 13px;
  }
  .source-sentence {
    margin: 0.2rem 0;
    font-size: 1.1rem;
  }
  .draft {
    min-height: 55px;
    margin: 8px 0;
  }
  .tray {
    padding: 7px;
  }
  .check {
    margin-top: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

summary {
  min-height: 44px;
  padding-block: 10px;
  cursor: pointer;
}
