:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --paper-bright: #fffdf8;
  --paper-shadow: #e8dfd0;
  --ink: #2c3029;
  --ink-soft: #565b53;
  --rule: #c8bfaf;
  --green: #49644e;
  --gold: #8a6828;
  --rose: #7a4149;
  --shadow-soft: 0 10px 30px rgb(53 47 36 / 12%);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
}

body { overflow-x: hidden; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #315f4c;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.game-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 780px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 50% 43%, rgb(255 253 248 / 56%), transparent 54%),
    var(--paper);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wordmark {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid #867451;
  border-radius: 50%;
  color: #654f2e;
  font-size: 16px;
}

.save-state {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  white-space: normal;
}

.save-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #496c50; }
.save-state.is-saving .save-dot { background: var(--gold); }
.save-state.is-volatile .save-dot { background: var(--rose); }

.game-main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.game-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 3px 1px 4px;
}

h1 {
  margin: 0;
  font: 400 clamp(24px, 6vw, 29px)/1.05 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
}

.progress-copy {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: end;
  gap: 5px;
  padding-bottom: 2px;
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.progress-track { display: block; width: 86px; height: 5px; overflow: hidden; border-radius: 5px; background: #d6cebf; }
.progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #496c50; transition: width .22s ease; }

.mode-section { position: relative; display: grid; gap: 4px; }
.mode-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
  gap: 6px;
}
.mode-button {
  min-width: 0;
  min-height: 48px;
  padding: 6px 9px;
  border: 1px solid #777365;
  border-radius: 12px;
  color: #363a33;
  background: rgb(255 253 248 / 76%);
  cursor: pointer;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.15;
}
.mode-button.is-selected { border-color: #3f5f45; color: #fffdf8; background: #49644e; }
.challenge-trigger { display: flex; align-items: center; justify-content: center; gap: 6px; }
.challenge-trigger > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-chevron { flex: 0 0 auto; font-size: 19px; line-height: .8; }
.help-trigger, .rules-close, .gallery-disclosure, .sound-toggle, .quiet-action {
  min-width: 48px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid #777365;
  border-radius: 11px;
  color: #363a33;
  background: #fffdf8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}
.help-trigger { min-width: 54px; }
.challenge-menu {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 14;
  display: grid;
  width: min(330px, 100%);
  gap: 4px;
  padding: 7px;
  border: 1px solid #777365;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: var(--shadow-soft);
}
.challenge-option {
  display: flex;
  width: 100%;
  min-height: 52px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 6px 9px;
  border: 0;
  border-radius: 9px;
  color: #363a33;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.challenge-option:hover, .challenge-option:focus-visible, .challenge-option[aria-selected="true"] { background: #edf0e8; }
.challenge-option strong { font-size: 16px; }
.challenge-option span { color: #555950; font-size: 14px; line-height: 1.2; }
.challenge-meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.challenge-status {
  margin: 0;
  padding: 3px 2px 0;
  color: #41463f;
  font-size: 14px;
  line-height: 1.3;
}
.challenge-status.is-error { color: #763a42; font-weight: 650; }
.challenge-status.is-guidance { color: #515c4c; }

.rules-panel, .saved-gallery {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #b9b09f;
  border-radius: 13px;
  background: rgb(255 253 248 / 96%);
  box-shadow: 0 3px 12px rgb(53 47 36 / 7%);
}
.rules-heading-row, .gallery-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rules-heading-row h2, .gallery-heading-row h2 { margin: 0; color: #343a33; font: 400 19px/1.15 Georgia, "Times New Roman", serif; }
.rules-close { min-height: 48px; padding-inline: 11px; }
.rules-objective, .gesture-tip, .rules-example p { margin: 0; color: #454a43; font-size: 14px; line-height: 1.3; }
.rules-example {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f1eee5;
}
.example-markers { display: flex; align-items: center; gap: 4px; min-width: 54px; }
.example-marker { display: grid; width: 27px; height: 27px; place-items: center; border: 2px solid #725c36; border-radius: 50%; color: #3b4038; background: #fffdf8; font-size: 13px; font-weight: 750; }
.example-link { color: #725c36; font-size: 18px; font-weight: 800; }
.gesture-tip { padding: 0 2px; }
.help-preferences { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #454a43; font-size: 14px; }
.sound-toggle[aria-pressed="true"] { border-color: #49644e; color: #fffdf8; background: #49644e; }
.gallery-disclosure { display: inline-flex; width: fit-content; align-items: center; gap: 8px; padding-inline: 12px; }
.gallery-disclosure > span { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fffdf8; background: #49644e; font-size: 12px; }
.gallery-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 7px; }
.gallery-item { display: grid; min-width: 0; min-height: 48px; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 7px; padding: 5px; border: 1px solid #c8bfaf; border-radius: 10px; color: #363a33; background: #fffdf8; cursor: pointer; text-align: left; }
.gallery-item[aria-pressed="true"] { border-color: #49644e; box-shadow: inset 0 0 0 1px #49644e; }
.gallery-item svg, .saved-preview-art svg { display: block; width: 100%; height: 100%; }
.gallery-thumb { display: block; width: 44px; height: 44px; }
.gallery-item-label { min-width: 0; font-size: 13px; line-height: 1.2; }
.gallery-empty { margin: 0; color: #555950; font-size: 14px; }
.saved-preview { display: grid; grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); align-items: center; gap: 9px; padding-top: 7px; border-top: 1px solid #d8d2c7; }
.saved-preview-art { width: 100%; aspect-ratio: 1; }
.saved-preview strong { color: #343a33; font-size: 15px; }
.saved-preview p { margin: 3px 0 0; color: #555950; font-size: 14px; line-height: 1.25; }

.completion-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 7px 0 4px;
}
.completion-heading { display: flex; align-items: center; gap: 7px; }
.completion-spark { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border: 1px solid #ac8737; border-radius: 50%; color: #765c20; background: #f7edcf; font-size: 23px; }
.completion-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.completion-copy strong { color: #354c38; font-size: 16px; }
.completion-copy span { color: #454a43; font-size: 14px; line-height: 1.25; }
.next-activity { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 7px; border: 1px solid #75856e; border-radius: 12px; background: #edf0e8; }
.next-preview { width: 48px; height: 48px; overflow: hidden; border: 1px solid #bcb39f; border-radius: 50%; background: #fffdf8; }
.next-copy { min-width: 0; }
.next-copy strong { color: #354c38; font-size: 15px; }
.next-copy p { margin: 2px 0 0; color: #454a43; font-size: 14px; line-height: 1.2; }
.completion-next {
  min-height: 48px;
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid #49644e;
  border-radius: 10px;
  color: #fffdf8;
  background: #49644e;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.completion-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.quiet-action { min-height: 48px; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 2px; }
.historical-finish-note { margin: 0; color: #555950; font-size: 14px; line-height: 1.25; }

.artwork-section {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.artwork-frame {
  position: relative;
  display: grid;
  width: min(100%, 560px);
  flex: 0 0 auto;
  aspect-ratio: 1;
  place-items: center;
  isolation: isolate;
}
.celebration-layer { position: absolute; z-index: 2; inset: -3%; overflow: visible; border-radius: 50%; pointer-events: none; }
.celebration-layer[data-active="false"] { display: none; }
.celebration-layer::before { position: absolute; inset: 1%; border: 3px solid rgb(180 137 46 / 78%); border-radius: 50%; box-shadow: 0 0 0 4px rgb(180 137 46 / 12%); content: ""; animation: golden-ripple 1.5s ease-out both; }
.celebration-petal { position: absolute; top: var(--petal-top); left: var(--petal-left); width: 9px; height: 15px; border: 1px solid rgb(112 80 36 / 48%); border-radius: 80% 20% 75% 25%; background: var(--petal-color); opacity: 0; animation: petal-drift 1.45s ease-out both; animation-delay: var(--petal-delay); }
.celebration-layer[data-active="false"] .celebration-petal, .celebration-layer[data-active="false"]::before { animation: none; }
@keyframes golden-ripple { 0% { opacity: .85; transform: scale(.96); } 75% { opacity: .35; transform: scale(1.045); } 100% { opacity: 0; transform: scale(1.07); } }
@keyframes petal-drift { 0% { opacity: 0; transform: translateY(8px) rotate(-12deg); } 18% { opacity: .85; } 100% { opacity: 0; transform: translateY(-22px) rotate(37deg); } }

.artwork-wash {
  position: absolute;
  inset: 2%;
  z-index: -1;
  border-radius: 50%;
  background: rgb(247 241 229 / 78%);
  box-shadow: inset 0 0 0 1px rgb(145 126 92 / 26%), 0 6px 24px rgb(75 62 38 / 8%);
}

.artwork-viewport {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.artwork-stage {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center;
  will-change: transform;
}

.artwork-stage.is-panning { transition: none !important; }
.artwork-stage.is-settling { transition: transform .2s cubic-bezier(.2,.72,.25,1); }
.svg-host { display: grid; width: 100%; height: 100%; place-items: center; }
.svg-host > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.loading-message { color: var(--ink-soft); font: 400 16px Georgia, serif; }

.svg-host [data-region-id] {
  cursor: pointer;
  transition: fill .11s ease, filter .11s ease;
  outline: none;
}
.svg-host [data-region-id]:focus-visible {
  filter: drop-shadow(0 0 3px #315f4c) drop-shadow(0 0 2px #315f4c);
}
.svg-host [data-region-id].is-selected-region {
  filter: drop-shadow(0 0 3px rgb(49 95 76 / 85%));
}
.svg-host [data-region-id].is-conflict-region {
  filter: drop-shadow(0 0 4px #a52f38) drop-shadow(0 0 2px #a52f38);
}
.svg-host [data-region-id].is-conflict-neighbor {
  filter: drop-shadow(0 0 3px #8b4b24) drop-shadow(0 0 1px #8b4b24);
}
.svg-host [data-region-id].is-mirror-partner { filter: drop-shadow(0 0 4px #315f4c) drop-shadow(0 0 2px #315f4c); }
.svg-host [data-region-id].is-example-region { filter: drop-shadow(0 0 5px #ab7f25) drop-shadow(0 0 2px #ab7f25); }
.svg-host [data-region-id][fill="none"] { cursor: pointer; }
.svg-host .line-art, .svg-host [data-line-art], .svg-host [data-region-id] line,
.svg-host [data-region-id] path[stroke]:not([data-region-id]) { pointer-events: none; }

.canvas-tools {
  display: flex;
  width: min(100%, 560px);
  min-height: 48px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.view-button {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 48px;
  padding: 5px 11px;
  border: 1px solid #777365;
  border-radius: 11px;
  color: #353a33;
  background: rgb(255 253 248 / 78%);
  cursor: pointer;
  font-size: 16px;
  font-weight: 650;
}
.canvas-hint {
  min-width: 0;
  flex: 1 1 100px;
  margin: 0 0 0 auto;
  color: #4d524b;
  font-size: 14px;
  line-height: 1.25;
  text-align: right;
}

.controls {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 3px;
  padding-top: 2px;
  background: linear-gradient(180deg, rgb(245 240 230 / 0%), rgb(245 240 230 / 92%) 10%);
}

.palette-block, .used-block { min-width: 0; }
.palette-heading {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-inline: 2px;
}
.palette-heading h2, .used-label-row h2 {
  margin: 0;
  color: #41463f;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: .005em;
}
.palette-heading p {
  margin: 1px 0 0;
  color: #575b54;
  font-size: 14px;
  line-height: 1.1;
}
.shades-button {
  min-width: 72px;
  min-height: 48px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #6d685a;
  border-radius: 11px;
  color: #363a33;
  background: #fffdf8;
  cursor: pointer;
  font-size: 16px;
  font-weight: 680;
}

.palette-scroller {
  display: flex;
  gap: 6px;
  min-width: 0;
  height: 48px;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #a59c8c transparent;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
.palette-swatch {
  position: relative;
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
  -webkit-tap-highlight-color: transparent;
}
.palette-swatch > span {
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(42 38 31 / 32%);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 30%), 0 2px 4px rgb(67 55 36 / 10%);
}
.palette-swatch[aria-pressed="true"] { border-color: var(--ink); }
.palette-swatch[aria-pressed="true"]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--paper-bright);
  border-radius: 50%;
  color: var(--paper-bright);
  background: var(--ink);
  content: "✓";
  font-size: 12px;
  font-weight: 800;
}

.used-label-row {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-inline: 2px;
}
.used-label-row > span { color: #555a52; font-size: 14px; font-variant-numeric: tabular-nums; }
.used-colors {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #a59c8c transparent;
}
.used-empty { color: #555950; font: italic 14px Georgia, "Times New Roman", serif; }
.used-swatch {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  padding: 3px;
  border: 1px solid #777365;
  border-radius: 50%;
  background: rgb(255 253 248 / 80%);
  cursor: pointer;
}
.used-swatch > i { display: block; width: 36px; height: 36px; border: 1px solid rgb(42 38 31 / 30%); border-radius: 50%; background: var(--swatch); }
.used-swatch[aria-pressed="true"] { border: 3px solid var(--ink); }
.used-swatch[aria-pressed="true"]::after { position: absolute; top: -1px; right: -1px; width: 12px; height: 12px; border: 1px solid var(--paper); border-radius: 50%; background: var(--ink); content: ""; }

.tool-row-wrap { position: relative; min-width: 0; }
.tool-trigger {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 4px 11px;
  border: 1px solid #777365;
  border-radius: 12px;
  background: rgb(255 253 248 / 92%);
  box-shadow: 0 2px 7px rgb(60 53 39 / 5%);
  cursor: pointer;
  text-align: left;
}
.tool-trigger-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: #614d2d;
  background: #f0e6d3;
  font: 18px/1 Georgia, serif;
}
.tool-trigger-copy { display: flex; flex: 1; flex-direction: column; gap: 1px; color: #4e524b; font-size: 14px; line-height: 1.15; }
.tool-trigger-copy strong { color: var(--ink); font-size: 16px; font-weight: 680; }
.chevron { width: 9px; height: 9px; margin: 0 4px 4px 0; border-right: 2px solid #54564d; border-bottom: 2px solid #54564d; transform: rotate(45deg); transition: transform .16s ease, margin .16s ease; }
.tool-trigger[aria-expanded="true"] .chevron { margin-bottom: -4px; transform: rotate(225deg); }

.tool-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  left: 0;
  z-index: 12;
  padding: 7px;
  border: 1px solid #777365;
  border-radius: 15px;
  background: #fffdf8;
  box-shadow: var(--shadow-soft), 0 2px 5px rgb(53 47 36 / 8%);
  animation: panel-in .14s ease-out both;
}
.material-message {
  margin: 0 3px 5px;
  padding: 7px 8px;
  border-radius: 9px;
  color: #42473f;
  background: #f0eee7;
  font-size: 14px;
  line-height: 1.3;
}
.material-option {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.material-option + .material-option { border-top: 1px solid #ded9cf; }
.material-option:not(.is-locked):hover, .material-option:not(.is-locked):focus-visible { background: #f7f2e8; }
.material-option.is-selected .material-copy strong { color: #36563c; }
.material-option.is-locked { cursor: default; }
.material-sample {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(75 67 53 / 30%);
  border-radius: 50%;
  background: #e9c576;
}
.material-sample > i { display: block; width: 23px; height: 23px; border: 1px solid rgb(89 64 28 / 35%); border-radius: 43% 57% 55% 45%; background: #cf8a56; }
.pencil-sample { background: repeating-linear-gradient(128deg, #f3d98f 0 3px, #e9c576 3px 6px); }
.pencil-sample > i { background: repeating-linear-gradient(135deg, #ca8050 0 3px, #d99a67 3px 5px); }
.marker-sample { background: #e9c576; }
.marker-sample > i { border-radius: 5px; background: #cf754e; }
.oil-sample { background: radial-gradient(circle at 30% 28%, #f8e6a7 0 10%, transparent 38%), #c89b58; }
.oil-sample > i { border-radius: 48% 52% 44% 56%; background: radial-gradient(circle at 33% 25%, #eab57c 0 12%, #ae674a 52%, #904d42 100%); box-shadow: 2px 3px 3px rgb(70 48 31 / 25%); }
.material-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.material-copy strong { color: #343831; font-size: 16px; font-weight: 680; }
.material-copy small { color: #555950; font-size: 14px; }
.material-check, .lock-mark { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 50%; }
.material-check { color: #fffdf8; background: #49644e; font-size: 14px; font-weight: 800; }
.lock-mark { color: #584b35; background: #f1e9dc; font-size: 16px; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  padding: 1px 1px 0;
}
.action-button {
  display: inline-flex;
  min-width: 76px;
  min-height: max(48px, 3em);
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #777365;
  border-radius: 12px;
  color: #373b35;
  background: rgb(255 253 248 / 90%);
  cursor: pointer;
  font-size: 16px;
  font-weight: 650;
}
.action-button:disabled { border-color: #868276; color: #5c5d56; background: #efebe2; cursor: default; }
.action-button[aria-pressed="true"] { border-color: #59414a; color: #fffaf5; background: #684e57; box-shadow: 0 2px 0 #503942; }
.action-icon { font: 25px/.8 Georgia, serif; }
.eraser-icon { position: relative; display: block; width: 16px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px 5px 2px 4px; transform: rotate(-42deg); }
.eraser-icon::after { position: absolute; top: 0; right: 3px; width: 1px; height: 12px; background: currentColor; content: ""; }
.active-color-note { display: inline-flex; min-width: 0; max-width: 100%; flex: 1 1 86px; align-items: center; gap: 6px; margin-left: auto; color: #484c45; font-size: 16px; white-space: normal; }
.active-color-note > span { min-width: 0; overflow-wrap: anywhere; }
.active-color-note > i { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid rgb(42 38 31 / 36%); border-radius: 50%; background: var(--active-color, #e5af52); box-shadow: 0 1px 2px rgb(53 47 36 / 9%); }

.shade-scrim { position: fixed; inset: 0; z-index: 19; background: rgb(34 35 30 / 10%); }
.shade-popover {
  position: fixed;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 64px));
  gap: 5px;
  max-width: calc(100vw - 16px);
  padding: 9px;
  border: 1px solid #777365;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 9px 28px rgb(52 43 29 / 24%);
  animation: panel-in .12s ease-out both;
}
.shade-panel-title {
  grid-column: 1 / -1;
  margin: 0 2px 1px;
  color: #363a33;
  font-size: 16px;
  font-weight: 700;
}
.shade-choice {
  display: flex;
  min-width: 0;
  min-height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #363a33;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}
.shade-choice > i { display: block; width: 34px; height: 34px; border: 1px solid rgb(42 38 31 / 36%); border-radius: 50%; background: var(--shade); box-shadow: inset 0 1px 2px rgb(255 255 255 / 25%); }
.shade-choice:hover, .shade-choice:focus-visible { border-color: var(--ink); background: #f4f0e8; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

@keyframes panel-in { from { opacity: 0; transform: translateY(5px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 600px) {
  .game-shell { padding-inline: 22px; }
  .topbar { min-height: 40px; }
  .game-main { gap: 6px; }
  .game-heading { min-height: 48px; }
  .artwork-frame, .canvas-tools { width: min(100%, 560px); }
  .controls { gap: 8px; padding-inline: max(0px, calc((100% - 500px) / 2)); }
  .palette-swatch { flex-basis: 52px; width: 52px; height: 52px; }
  .palette-scroller, .used-colors { height: 52px; }
  .used-swatch { width: 50px; height: 50px; flex-basis: 50px; }
  .tool-trigger, .action-button, .view-button, .shades-button, .mode-button, .completion-next { min-height: 52px; }
}

@media (max-width: 350px) {
  .game-shell { padding-right: max(8px, env(safe-area-inset-right)); padding-left: max(8px, env(safe-area-inset-left)); }
  .wordmark { font-size: 13px; }
  .save-state { gap: 5px; font-size: 13px; }
  .game-heading { min-height: 50px; }
  h1 { font-size: 24px; }
  .progress-track { width: 60px; }
  .canvas-hint { max-width: 106px; white-space: normal; }
  .completion-panel { align-items: stretch; flex-direction: column; }
  .completion-next { width: 100%; }
  .shade-popover { grid-template-columns: repeat(4, 60px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .celebration-layer.is-reduced::before { opacity: .38; transform: none; animation: none; }
  .celebration-layer.is-reduced .celebration-petal { opacity: .62; transform: none; animation: none; }
}
