@font-face {
  font-family: Nunito;
  src: url("../assets/nunito.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Baloo;
  src: url("../assets/baloo.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Lora;
  src: url("../assets/lora-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}
:root {
  --paper: #fff8ea;
  --surface: #fffdf8;
  --ink: #293247;
  --muted: #606a78;
  --blue: #215fd1;
  --gold: #e8b94f;
  --green: #237c69;
  --error: #ba4250;
  --line: #e5dece;
  --radius: 22px;
  --shadow: 0 7px 0 #e9e1d0, 0 15px 35px #45432a09;
  --heading: Baloo, Nunito, sans-serif;
  --body: Nunito, "Segoe UI", sans-serif;
  --quote: Lora, Georgia, serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  padding-top: var(--safe-top, env(safe-area-inset-top));
  padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom));
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
button {
  color: inherit;
}
a {
  color: var(--blue);
}
.icon {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  vertical-align: middle;
  transform-origin: center;
  pointer-events: none;
}
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(#b7a58138 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(
    90deg,
    #000,
    transparent 30%,
    transparent 70%,
    #000
  );
}
.app {
  max-width: 1180px;
  margin: auto;
  padding: 0 max(32px, var(--safe-right, env(safe-area-inset-right))) 0
    max(32px, var(--safe-left, env(safe-area-inset-left)));
}
.topbar {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0;
  text-align: left;
}
.brand img {
  object-fit: contain;
  width: 178px;
  height: 90px;
}
.brand span {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 900;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  max-width: 150px;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.player-supplies {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}
.inventory-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.inventory-summary:hover {
  background: #f3eedf;
  border-color: #c4b899;
}
.inventory-caption {
  max-width: 45px;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  color: var(--muted);
  font-weight: 800;
}
.inventory-items {
  display: flex;
  gap: 10px;
}
.inventory-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 24px;
  color: var(--blue);
}
.inventory-item .icon {
  width: 20px;
  height: 20px;
}
.inventory-item strong {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.inventory-item.is-empty,
.inventory-item.is-empty strong {
  color: var(--muted);
}
.inventory-detail {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.inventory-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.inventory-detail-row > .icon {
  color: var(--blue);
}
.inventory-detail-row > div {
  flex: 1;
  min-width: 0;
}
.inventory-detail-row > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stock-count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 900;
}
.coin-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
  background: #fff0c3;
  border: 1px solid #e8cb75;
  border-radius: 50px;
  padding: 8px 14px;
  min-height: 46px;
  white-space: nowrap;
}
.coin-pill .icon {
  color: #977015;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: #f0ecdf;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--green);
  margin: 0 0 12px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--heading);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(36px, 4.4vw, 58px);
  margin-bottom: 18px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 22px;
}
.muted {
  color: var(--muted);
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 45px;
  padding: 46px 0 34px;
}
.hero-copy {
  max-width: 520px;
}
.hero-copy p {
  font-size: 17px;
  max-width: 400px;
  margin-bottom: 25px;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--blue);
  position: relative;
  white-space: nowrap;
}
.hero-copy h1 em:after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  border-bottom: 5px solid #e8b94f88;
  z-index: -1;
  border-radius: 50%;
}
.primary,
.secondary,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: 14px;
  padding: 12px 23px;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.15s,
    background 0.15s;
}
.primary {
  background: linear-gradient(180deg, #2678f6 0%, #1763e2 65%, #1556cc 100%);
  border: 2px solid #1456bc;
  border-radius: 20px;
  color: white;
  box-shadow:
    inset 0 0 0 3px #6aabff75,
    inset 0 2px 0 #ffffff66,
    0 5px 0 #103f89,
    0 8px 12px #17376a18;
}
@media (hover: hover) and (pointer: fine) {
  .primary:not(:disabled):hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
  }
  .secondary:not(:disabled):hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
  }
}
.primary:not(:disabled):active,
.secondary:not(:disabled):active {
  transform: translateY(4px);
  box-shadow:
    inset 0 0 0 3px #ffffff40,
    0 1px 0 #17376a55;
}
.secondary {
  background: linear-gradient(180deg, #fffefa, #fff7e6);
  border: 2px solid #ded1b7;
  border-radius: 20px;
  color: #203354;
  box-shadow:
    inset 0 0 0 3px #ffffff,
    0 5px 0 #d4c7ae,
    0 8px 12px #45352012;
}
.small-btn {
  min-height: 42px;
  padding: 8px 14px;
  background: transparent;
  border-color: var(--line);
  font-size: 13px;
}
.hero-details {
  font-size: 12px !important;
  margin-top: 15px !important;
  color: var(--muted);
  display: flex;
  gap: 16px;
  align-items: center;
}
.hero-details span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.hero-details .icon {
  width: 16px;
  height: 16px;
}
.hero-art {
  position: relative;
  height: 330px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
}
.art-disc {
  position: absolute;
  background: #ebe9d0;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  bottom: 0;
  z-index: -1;
  border: 1px solid #dedcba;
}
.hero-art img {
  height: 300px;
  max-width: 70%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 8px 0 #44412c0b);
}
.welcome-note {
  position: absolute;
  top: 0;
  left: -12px;
  background: white;
  border: 1.5px solid var(--ink);
  border-radius: 20px 20px 4px 20px;
  width: 214px;
  padding: 15px 18px;
  font-weight: 800;
  transform: rotate(-4deg);
  box-shadow: 4px 5px 0 #29324712;
  z-index: 1;
}
.art-spark {
  position: absolute;
  color: #b58828;
  right: 30px;
  top: 55px;
  transform: rotate(15deg);
}
.art-spark .icon {
  width: 46px;
  height: 46px;
}
.art-caption {
  position: absolute;
  bottom: 16px;
  right: -4px;
  background: #fffdf1;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  transform: rotate(5deg);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}
.section-head h2 {
  margin: 0;
  font-size: 27px;
}
.section-head .muted {
  font-size: 13px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.theme-card {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 0 #e9e1d066;
  min-height: 166px;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  overflow: hidden;
}
.theme-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.theme-card .theme-symbol {
  display: flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  color: var(--theme);
  border-radius: 16px;
  float: left;
  margin-right: 15px;
}
.theme-symbol .icon {
  width: 29px;
  height: 29px;
}
.theme-card h3 {
  font-size: 21px;
  margin: 3px 0 5px;
}
.theme-card p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 23px;
}
.theme-card .theme-meta {
  clear: both;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.theme-meta .icon {
  width: 17px;
  height: 17px;
}
.progress {
  height: 4px;
  background: #e9e4da;
  border-radius: 9px;
  overflow: hidden;
  margin-top: 11px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--theme, var(--blue));
  border-radius: 9px;
}
.bottom-nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 36px auto 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  max-width: 550px;
  background: var(--surface);
}
.bottom-nav button {
  min-height: 50px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: 0;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
}
.bottom-nav button.active {
  color: var(--blue);
  background: #e9effb;
}
.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 18px 0 25px;
}
.site-foot button {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  min-height: 32px;
}
.page-title {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.page-title h1 {
  font-size: 36px;
  margin: 12px 0;
}
.page-title p {
  margin-bottom: 8px;
}
.chapter {
  margin: 28px 0;
}
.chapter-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.chapter-head .chapter-num {
  font-family: var(--heading);
  font-size: 36px;
  color: var(--theme);
  opacity: 0.65;
}
.chapter h2 {
  font-size: 24px;
  margin: 0;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.level-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  text-align: left;
  min-height: 142px;
  position: relative;
}
.level-card h3 {
  margin: 12px 0 6px;
  font-size: 20px;
}
.level-card p {
  font-size: 12px;
  margin: 0;
  color: var(--muted);
}
.level-card .number {
  font-size: 11px;
  font-weight: 900;
  color: var(--theme);
  letter-spacing: 0.08em;
}
.level-card .earned {
  float: right;
  color: #ad7a16;
}
.level-card.final {
  background: linear-gradient(135deg, var(--surface), var(--tint));
}
.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 560px;
}
.mode-switch button {
  padding: 12px;
  min-height: 100px;
  border-radius: 18px;
  background: none;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.mode-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  line-height: 1.2;
}
.mode-time .icon {
  width: 24px;
  height: 24px;
}
.mode-name {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.mode-switch small {
  color: var(--green);
  font-size: 12px;
}
.mode-switch .active small {
  color: #cbeedc;
}
.mode-explainer {
  max-width: 680px;
  margin-bottom: 6px;
  font-size: 14px;
}
.level-seals,
.secret-mode {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: #795414;
  font-size: 12px;
  font-weight: 800;
}
.level-seals > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.special-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 800;
}
.level-seals .icon,
.secret-mode .icon {
  width: 18px;
  height: 18px;
}
.special-area {
  padding: 24px;
  margin: 30px 0;
  border: 1px solid #d9c296;
  border-radius: 24px;
  background: linear-gradient(130deg, #fff0cd, var(--surface) 65%);
}
.special-area h2 {
  margin: 6px 0 0;
}
.special-area .section-head {
  flex-wrap: wrap;
  align-items: center;
}
.seal-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #795414;
}
.seal-counter strong {
  font-size: 24px;
}
.seal-milestones {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.seal-milestones > span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px dashed #bcaa84;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}
.seal-milestones .reached {
  border-style: solid;
  color: var(--green);
  background: #edf3e8;
}
.secret-card:disabled {
  opacity: 1;
  background: #f4efdf;
  color: var(--muted);
}
.secret-card.collected {
  border-color: var(--green);
}
.seal-reward {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff0c6;
  border: 1px solid #d9c296;
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 12px;
  color: #795414;
}
.seal-reward span {
  display: block;
  font-size: 13px;
}
.album-overview {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  margin: 24px 0;
}
.album-overview > summary {
  cursor: pointer;
  min-height: 60px;
}
.album-overview > summary > span:first-child {
  display: inline-flex;
  flex-direction: column;
}
.album-overview summary strong {
  font-family: var(--heading);
  font-size: 24px;
}
.album-overview summary span span,
.album-open {
  font-size: 13px;
  color: var(--muted);
}
.album-open {
  margin-left: 12px;
  color: var(--blue);
}
.album-overview .progress {
  margin-top: 12px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.album-theme {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.album-theme.complete {
  border-color: var(--green);
  background: #edf3e8;
}
.album-theme .section-head {
  margin: 0 0 12px;
}
.album-theme h3 {
  margin: 0;
  font-size: 19px;
}
.album-theme h3 .icon {
  margin-right: 6px;
  color: var(--theme);
}
.album-theme p {
  font-size: 12px;
  color: var(--muted);
}
.album-pages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.album-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px dashed #c6bea9;
  border-radius: 8px;
  color: #84775e;
  background: #f6f1e7;
  font-size: 12px;
}
.album-slot.exclusive {
  background: #fff0c6;
  border-color: #c39745;
}
.album-slot.found {
  border-style: solid;
  color: var(--green);
  background: #e5f0e4;
}
.exclusive-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #795414;
  font-size: 12px;
  font-weight: 800;
}
.exclusive-label .icon {
  width: 18px;
  height: 18px;
}
@media (max-width: 680px) {
  .special-area {
    padding: 16px;
  }
  .special-area .chapter-grid,
  .album-grid {
    grid-template-columns: 1fr;
  }
  .secret-card {
    min-height: 120px;
  }
  .album-open {
    display: block;
    margin-left: 0;
    margin-top: 8px;
  }
}
.mode-switch button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
body.playing .app {
  max-width: 1060px;
}
body.playing .topbar {
  height: 78px;
}
body.playing .brand img {
  width: 132px;
  height: 70px;
}
body.playing .brand span {
  display: none;
}
body.playing .site-foot {
  display: none;
}
body.playing .bottom-nav {
  margin: 16px auto 12px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 650px) 220px;
  gap: 35px;
  justify-content: center;
  padding-top: 20px;
}
.game-main {
  min-width: 0;
}
.game-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.game-title h1 {
  font-size: 24px;
  margin: 2px 0;
}
.game-title .eyebrow {
  font-size: 10px;
  margin-bottom: 5px;
}
.game-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  margin: 12px 0;
}
.game-stats .time {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}
.phrase-strip {
  padding: 8px 4px 12px;
  margin-bottom: 14px;
  min-height: 64px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  font-family: var(--quote);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(19px, 2.8vw, 25px);
  line-height: 1.7;
  color: #877550;
}
.phrase-words {
  min-width: 0;
  text-align: center;
  word-spacing: 0.36em;
}
.phrase-quote {
  font-size: 1.55em;
  line-height: 1;
  color: #ba9247;
  flex-shrink: 0;
}
.phrase-part {
  display: inline-block;
  white-space: nowrap;
  word-spacing: 0;
}
.phrase-punctuation {
  color: #877550;
}
.word-slot {
  display: inline-grid;
  vertical-align: baseline;
  min-width: calc(var(--letters) * 0.68em);
  text-align: center;
  line-height: 1.7;
}
.word-mask,
.word-text {
  grid-area: 1 / 1;
}
.word-mask {
  display: inline-flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.13em;
  transition: opacity 0.18s;
}
.mask-letter {
  font-family: var(--body);
  font-weight: 600;
  font-style: normal;
  width: 0.55em;
  color: #9c885e;
}
.word-text {
  color: var(--green);
  opacity: 0;
}
.word-slot.revealed .word-mask {
  opacity: 0;
}
.word-slot.revealed .word-text {
  opacity: 1;
  animation: phrase-reveal 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes phrase-reveal {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.94);
    text-shadow: 0 0 12px #e8b94f;
  }
  to {
    opacity: 1;
    transform: none;
    text-shadow: 0 0 0 transparent;
  }
}
.board-paper {
  position: relative;
  background: #f3ead5;
  border: 1px solid #dfd4bc;
  box-shadow: 0 5px 0 #d8cdb5;
  border-radius: 22px;
  padding: 12px;
  max-width: 100%;
  margin: auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  width: 100%;
  outline: none;
}
.cell {
  border: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: var(--body);
  font-size: clamp(15px, 3.8vw, 24px);
  font-weight: 900;
  background: #fffdf5;
  box-shadow: inset 0 0 0 1px #e5dcc5;
  color: var(--ink);
  border-radius: 7px;
  touch-action: none;
  user-select: none;
  min-width: 0;
  padding: 0;
  transition:
    background 0.12s,
    color 0.12s,
    box-shadow 0.12s;
}
.cell:before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  pointer-events: none;
}
.cell.selected {
  background: var(--blue);
  color: white;
  box-shadow: inset 0 -3px 0 #16469d;
}
.cell.wrong {
  background: var(--error);
  color: white;
}
.cell.erased {
  background: #eee4ce;
  box-shadow: inset 0 0 0 1px #d9ccb0;
  color: transparent;
}
.cell.coin {
  color: #997015;
  background: #fff0be;
  font-size: 14px;
}
.cell.special {
  color: #836126;
  background: #fff0be;
}
.cell .icon {
  width: 55%;
  height: 55%;
}
.cell.wet {
  background: #d3eeef;
  color: transparent;
}
.cell.wet.original {
  color: var(--green);
  background: #ddf6ce;
  box-shadow: inset 0 0 0 2px #7dab67;
}
.cell.wet.original:before {
  border: 1px solid #fff9;
  box-shadow: 0 0 9px #daf887;
}
.cell.wet:not(.selected):not(.special) {
  background: color-mix(in srgb, #d3eeef var(--wet-strength, 100%), #fffdf5);
  color: rgb(41 50 71 / var(--dry-alpha, 0));
}
.cell.wet.original:not(.selected) {
  color: color-mix(in srgb, var(--green) var(--wet-strength, 100%), var(--ink));
  background: color-mix(in srgb, #ddf6ce var(--wet-strength, 100%), #fffdf5);
  box-shadow: inset 0 0 0 2px
    color-mix(in srgb, #7dab67 var(--wet-strength, 100%), #e5dcc5);
}
.cell.wet.original:before {
  opacity: calc(1 - var(--dry-alpha, 0));
  transition: opacity 0.2s linear;
}
.cell.preview {
  box-shadow: inset 0 0 0 3px var(--theme, var(--blue));
  z-index: 1;
}
.cell.tutorial-cue {
  isolation: isolate;
}
.cell.tutorial-cue:before {
  inset: -5%;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffd466b3 0%,
    #ffdf8a66 32%,
    transparent 70%
  );
  filter: blur(3px);
  z-index: -1;
  opacity: 0.7;
  animation: tutorial-glow 1.8s ease-in-out infinite;
}
@keyframes tutorial-glow {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}
.cell.selected.wet {
  color: white;
  background: var(--blue);
}
.tool-hint {
  font-size: 12px;
  min-height: 38px;
  padding: 10px 0 4px;
  text-align: center;
  color: var(--muted);
}
.tools-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
  justify-content: center;
}
.tool-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 8px 12px;
  flex: 1;
  max-width: 160px;
  position: relative;
  font-size: 12px;
  font-weight: 900;
}
.tool-button .qty {
  font-size: 10px;
  position: absolute;
  top: 3px;
  right: 5px;
  color: var(--muted);
}
.tool-button.active {
  background: #e5ebff;
  border: 2px solid var(--blue);
  color: var(--blue);
}
.game-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  font-size: 12px;
  color: var(--muted);
}
.game-side {
  padding-top: 35px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}
.guide-note {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 3px;
  padding: 18px;
  font-size: 14px;
  margin: 0 0 10px;
  box-shadow: 0 4px 0 #e7dfcd;
}
.game-side img {
  width: 180px;
  max-height: 280px;
  object-fit: contain;
  object-position: bottom;
}
.side-tip {
  font-size: 11px;
  color: var(--muted);
  margin-top: 15px;
}
.tutorial-tip {
  background: #e7f2e3;
  border: 1px solid #c8dcc0;
  border-radius: 13px;
  padding: 10px 13px;
  font-size: 13px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-confirm {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}
.tool-confirm[hidden] {
  display: none;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.quote-card {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 0 #e9e1d066;
}
.quote-card .label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme);
  font-weight: 900;
}
.quote-card blockquote {
  margin: 16px 0;
  font-family: var(--heading);
  font-size: 26px;
  line-height: 1.3;
}
.quote-card p {
  font-size: 13px;
  color: var(--muted);
}
.quote-card small {
  font-size: 11px;
  color: var(--muted);
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}
.card-actions button {
  flex: 1;
}
.empty {
  margin: 35px auto;
  text-align: center;
  max-width: 440px;
  padding: 25px;
}
.empty .icon {
  width: 55px;
  height: 55px;
  color: #a18d5e;
  margin-bottom: 18px;
}
.empty h2 {
  font-size: 28px;
}
.account-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #edf1e5;
  padding: 17px 22px;
  border: 1px solid #d5ddc7;
  border-radius: 17px;
  margin-top: 18px;
}
.account-banner p {
  margin: 0;
  font-size: 13px;
}
.account-banner strong {
  display: block;
}
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.award {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--surface);
  text-align: center;
}
.award .award-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2eee5;
  width: 70px;
  height: 70px;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #a8a292;
}
.award.unlocked .award-symbol {
  background: #ffe9a8;
  color: #977015;
  border: 3px double #cfa338;
}
.award-symbol .icon {
  width: 35px;
  height: 35px;
}
.award h3 {
  font-size: 18px;
  margin-bottom: 7px;
}
.award p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.award small {
  font-size: 11px;
}
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.workshop-help {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 3px solid var(--green);
  padding: 12px 16px;
  background: #edf3e8;
  border-radius: 0 14px 14px 0;
}
.workshop-help > .icon {
  color: var(--green);
}
.workshop-help p {
  margin: 0;
  font-size: 14px;
}
.workshop-help p span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.tool-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 25px;
  background: white;
  display: flex;
  flex-direction: column;
}
.tool-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tool-card-head h3 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}
.tool-card-head .icon {
  width: 48px;
  height: 48px;
  color: var(--blue);
}
.tool-effect {
  font-size: 12px;
  font-weight: 900;
  color: var(--green);
}
.tool-card .tool-description {
  margin: 10px 0 20px;
  flex: 1;
}
.stock-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  padding: 9px 11px;
  background: #f3f1e9;
  font-size: 13px;
}
.stock-line > span {
  color: var(--muted);
}
.tool-purchase {
  margin-top: 18px;
}
.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.price-line strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--ink);
}
.price-line .icon {
  width: 18px;
  height: 18px;
  color: #977015;
}
.tool-purchase .primary,
.upgrade-purchase .primary {
  width: 100%;
  justify-content: center;
}
.purchase-note {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.tool-card > .icon {
  width: 44px;
  height: 44px;
  color: var(--theme, var(--blue));
  margin-bottom: 16px;
}
.tool-card p {
  font-size: 14px;
  color: var(--muted);
}
.upgrade-card {
  margin-top: 20px;
  border: 1px solid #d8c694;
  border-radius: 22px;
  padding: 25px;
  background: linear-gradient(120deg, #fff1cd, #f1e8fb);
  display: flex;
  align-items: center;
  gap: 25px;
}
.upgrade-card > .icon {
  width: 65px;
  height: 65px;
  color: #785cb1;
}
.upgrade-card h2 {
  font-size: 26px;
  margin-bottom: 7px;
}
.upgrade-card p {
  font-size: 14px;
  margin: 0 0 8px;
}
.upgrade-card .primary {
  margin-left: auto;
  white-space: nowrap;
}
.upgrade-description {
  flex: 1;
  min-width: 0;
}
.upgrade-card .upgrade-explanation {
  color: var(--muted);
  font-size: 13px;
}
.upgrade-purchase {
  width: 220px;
  flex-shrink: 0;
}
.upgrade-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.upgrade-requirements li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.upgrade-requirements .icon {
  width: 16px;
  height: 16px;
}
.upgrade-requirements .met {
  color: var(--green);
}
dialog {
  padding: 0;
  border: 1px solid #d5ccb7;
  border-radius: 26px;
  background: var(--paper);
  color: var(--ink);
  max-width: min(560px, calc(100vw - 24px));
  width: 560px;
  max-height: calc(
    100dvh - 32px - var(--safe-top, env(safe-area-inset-top)) -
      var(--safe-bottom, env(safe-area-inset-bottom))
  );
  overflow: auto;
  box-shadow: 0 25px 100px #131a3066;
}
dialog::backdrop {
  background: #26304485;
  backdrop-filter: blur(4px);
}
.dialog-wrap {
  padding: 28px;
  position: relative;
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
}
.dialog-art {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 20px;
}
.dialog-art img {
  width: 118px;
  height: 150px;
  object-fit: contain;
}
.dialog-wrap h2 {
  font-size: 29px;
  margin-bottom: 12px;
}
.dialog-wrap p {
  font-size: 16px;
  line-height: 1.55;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.dialog-actions > * {
  flex: 1;
}
.dialog-details {
  font-size: 12px !important;
  color: var(--muted);
  margin: 14px 0 0;
}
.result-phrase {
  font-family: var(--heading);
  font-size: 30px !important;
  text-align: center;
  background: white;
  padding: 22px;
  border-radius: 17px;
  margin: 20px 0 14px;
  border: 1px solid var(--line);
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.result-stats div {
  background: #eee9da;
  padding: 12px 6px;
  border-radius: 14px;
}
.result-stats strong {
  display: block;
  font-size: 20px;
}
.result-stats span {
  font-size: 11px;
  color: var(--muted);
}
.stars {
  text-align: center;
  color: #a17619;
  letter-spacing: 7px;
  font-size: 23px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}
.setting-row input {
  width: 23px;
  height: 23px;
  accent-color: var(--blue);
}
.setting-row select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: white;
  max-width: 180px;
}
.setting-row small {
  display: block;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 28px);
  background: var(--ink);
  color: white;
  border-radius: 15px;
  padding: 13px 20px;
  box-shadow: 0 10px 35px #0002;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  font-size: 14px;
  text-align: center;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.no-margin {
  margin: 0;
}
.full-width {
  width: 100%;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 11px;
  background: #f2eddf;
  font-weight: 900;
}
.source {
  font-size: 12px;
}
.inline-error {
  color: var(--error);
  font-size: 13px;
}
@media (min-width: 1100px) {
  .board-paper {
    max-width: 530px;
  }
  .game-main .phrase-strip {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  .tools-bar {
    max-width: 530px;
    margin: auto;
  }
}
@media (max-width: 800px) {
  .app {
    padding: 0 max(20px, var(--safe-right, env(safe-area-inset-right))) 0
      max(20px, var(--safe-left, env(safe-area-inset-left)));
  }
  .topbar {
    height: 90px;
  }
  .brand span {
    display: none;
  }
  .brand img {
    width: 145px;
    height: 78px;
  }
  .hero {
    gap: 16px;
    padding: 30px 0;
  }
  .hero-art {
    height: 300px;
  }
  .hero-art img {
    height: 255px;
  }
  .art-disc {
    width: 230px;
    height: 230px;
  }
  .welcome-note {
    width: 180px;
    font-size: 13px;
    left: -5px;
  }
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .theme-card {
    padding: 18px;
  }
  .game-layout {
    display: block;
    padding-top: 14px;
  }
  .game-main {
    max-width: 590px;
    margin: auto;
  }
  .game-side {
    display: none;
  }
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trophy-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .workshop-grid {
    gap: 10px;
  }
  .tool-card {
    padding: 18px;
  }
  .upgrade-card {
    flex-wrap: wrap;
  }
  .upgrade-card .primary {
    margin-left: 0;
  }
  .game-main .board-paper {
    max-width: 500px;
  }
}
@media (max-width: 520px) {
  .app {
    padding: 0 max(16px, var(--safe-right, env(safe-area-inset-right))) 0
      max(16px, var(--safe-left, env(safe-area-inset-left)));
  }
  .topbar {
    height: 81px;
  }
  .brand img {
    width: 125px;
    height: 70px;
  }
  .top-actions {
    gap: 6px;
  }
  .coin-pill {
    min-height: 40px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .coin-pill .icon {
    width: 18px;
    height: 18px;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 25px 0 16px;
  }
  .hero-copy {
    position: relative;
    z-index: 2;
  }
  .hero-copy h1 {
    font-size: 38px;
    max-width: 300px;
    margin-bottom: 14px;
  }
  .hero-copy > p {
    max-width: 255px;
    font-size: 14px;
    margin-bottom: 18px;
  }
  .hero-art {
    height: 0;
    pointer-events: none;
    z-index: 1;
  }
  .hero-art img {
    position: absolute;
    height: 192px;
    right: -10px;
    bottom: 62px;
    max-width: 42%;
  }
  .art-disc {
    width: 142px;
    height: 142px;
    right: 0;
    bottom: 72px;
  }
  .welcome-note,
  .art-caption,
  .art-spark {
    display: none;
  }
  .hero-copy .primary {
    width: 100%;
    margin-top: 14px;
    min-height: 54px;
  }
  .hero-details {
    justify-content: center;
    font-size: 11px !important;
    margin: 14px 0 0 !important;
    max-width: none !important;
  }
  .eyebrow {
    font-size: 9px;
    margin-bottom: 9px;
  }
  .section-head {
    margin: 18px 0 13px;
  }
  .section-head h2 {
    font-size: 23px;
  }
  .section-head .muted {
    font-size: 11px;
  }
  .theme-grid {
    gap: 10px;
  }
  .theme-card {
    padding: 15px;
    min-height: 152px;
    border-radius: 18px;
  }
  .theme-card .theme-symbol {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    float: none;
    margin: 0 0 10px;
  }
  .theme-symbol .icon {
    width: 24px;
    height: 24px;
  }
  .theme-card h3 {
    font-size: 18px;
  }
  .theme-card p {
    font-size: 11px;
    margin: 5px 0 10px;
    line-height: 1.3;
  }
  .theme-card .theme-meta {
    font-size: 10px;
  }
  .bottom-nav {
    position: sticky;
    bottom: calc(8px + var(--safe-bottom, env(safe-area-inset-bottom)));
    z-index: 5;
    margin: 24px 0 8px;
    box-shadow: 0 8px 30px #29324718;
    gap: 2px;
    padding: 5px;
    border-radius: 18px;
  }
  .bottom-nav button {
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    min-height: 52px;
  }
  .bottom-nav .icon {
    width: 21px;
    height: 21px;
  }
  .site-foot {
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 22px;
    gap: 4px 15px;
    font-size: 10px;
  }
  .site-foot > span:first-child {
    display: none;
  }
  .page-title {
    padding-top: 18px;
  }
  .page-title h1 {
    font-size: 29px;
  }
  .page-title p {
    font-size: 13px;
  }
  .chapter {
    margin-top: 20px;
  }
  .chapter-grid {
    gap: 8px;
  }
  .level-card {
    padding: 12px;
    min-height: 130px;
    border-radius: 14px;
  }
  .level-card h3 {
    font-size: 16px;
    margin: 10px 0;
  }
  .level-card p {
    font-size: 10px;
  }
  .level-card .number {
    font-size: 9px;
  }
  .chapter h2 {
    font-size: 22px;
  }
  .chapter-num {
    font-size: 28px !important;
  }
  .mode-switch button {
    font-size: 12px;
    padding: 8px 12px;
  }
  .mode-time {
    font-size: 20px;
    gap: 4px;
  }
  .collection-grid {
    grid-template-columns: 1fr;
  }
  .quote-card {
    padding: 20px;
  }
  .account-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .trophy-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .award {
    padding: 15px;
  }
  .award h3 {
    font-size: 17px;
  }
  .tool-card {
    padding: 20px;
  }
  .tool-card > .icon {
    grid-row: span 3;
  }
  .tool-card h3 {
    margin: 0 0 8px;
  }
  .tool-card p {
    margin-bottom: 12px;
  }
  .tool-card button {
    grid-column: 2;
  }
  .upgrade-card {
    padding: 20px;
    gap: 16px;
  }
  .upgrade-card > .icon {
    width: 40px;
    height: 40px;
  }
  .upgrade-card h2 {
    font-size: 23px;
  }
  .upgrade-purchase {
    width: 100%;
  }
  .upgrade-card .primary {
    width: 100%;
  }
  .dialog-wrap {
    padding: 24px 20px;
  }
  .dialog-art img {
    width: 87px;
    height: 126px;
  }
  .dialog-wrap h2 {
    font-size: 25px;
  }
  .dialog-wrap p {
    font-size: 15px;
  }
  .dialog-actions {
    flex-direction: column;
  }
  .dialog-actions > * {
    flex: none;
  }
  .dialog-details {
    font-size: 11px !important;
  }
  .game-title h1 {
    font-size: 21px;
  }
  .game-title .eyebrow {
    font-size: 9px;
  }
  .game-stats {
    font-size: 12px;
    margin: 9px 0;
  }
  .phrase-strip {
    padding: 6px 0 9px;
    gap: 3px;
    min-height: 50px;
    margin-bottom: 10px;
    font-size: 19px;
  }
  .phrase-strip.compact {
    font-size: 17px;
  }
  .board-paper {
    padding: 7px;
    border-radius: 17px;
  }
  .cell {
    font-size: 19px;
  }
  .tools-bar {
    gap: 6px;
  }
  .tool-button {
    font-size: 10px;
    padding: 6px;
    min-height: 48px;
    gap: 4px;
  }
  .tool-button .icon {
    width: 21px;
    height: 21px;
  }
  .game-bottom {
    margin: 7px 0;
  }
  .game-bottom .small-btn {
    min-height: 36px;
    font-size: 11px;
    padding: 7px 10px;
  }
  body.playing .topbar {
    height: 62px;
  }
  body.playing .brand img {
    width: 106px;
    height: 58px;
  }
  body.playing .bottom-nav {
    margin-top: 13px;
  }
  .tutorial-tip {
    font-size: 12px;
    padding: 8px 10px;
    margin: 9px 0;
  }
  .game-layout {
    padding-top: 10px;
  }
  .tool-hint {
    font-size: 11px;
    min-height: 30px;
    padding-top: 7px;
  }
}
@media (max-height: 700px) and (max-width: 520px) {
  body.playing .bottom-nav {
    position: relative;
    bottom: auto;
    margin-top: 10px;
  }
  body.playing .board-paper {
    max-width: 350px;
  }
  .game-title h1 {
    font-size: 19px;
  }
  .game-stats {
    margin: 6px 0;
  }
  .cell {
    font-size: 18px;
  }
  .tutorial-tip {
    font-size: 11px;
  }
  .tools-bar .tool-button {
    min-height: 43px;
  }
  .phrase-strip {
    min-height: 40px;
  }
  .game-bottom {
    margin: 4px 0;
  }
}
@media (max-width: 350px) {
  .hero-copy h1 {
    font-size: 33px;
  }
  .hero-copy > p {
    max-width: 200px;
  }
  .hero-art img {
    height: 155px;
    right: -8px;
    bottom: 86px;
  }
  .art-disc {
    width: 118px;
    height: 118px;
    bottom: 90px;
  }
  .app {
    padding-left: max(12px, var(--safe-left, env(safe-area-inset-left)));
    padding-right: max(12px, var(--safe-right, env(safe-area-inset-right)));
  }
  .theme-card {
    padding: 12px;
  }
  .theme-card h3 {
    font-size: 17px;
  }
  .top-actions {
    gap: 4px;
  }
  .brand img {
    width: 112px;
  }
  .coin-pill {
    padding: 5px 8px;
  }
  .tool-button span:not(.qty) {
    font-size: 9px;
  }
  .tool-button .icon {
    width: 18px;
  }
}
main:focus {
  outline: none;
}
.section-head {
  flex-wrap: wrap;
}
.section-head .muted {
  white-space: nowrap;
}
@media (max-width: 520px) {
  .hero-copy h1 {
    font-size: 33px;
    max-width: 100%;
    line-height: 1.1;
  }
  .hero-copy > p {
    max-width: 238px;
  }
  .hero-art img {
    height: 132px;
    bottom: 67px;
  }
  .hero-copy .eyebrow {
    max-width: 285px;
    font-size: 8px;
  }
  .bottom-nav {
    margin-bottom: 12px;
  }
  body.playing .bottom-nav {
    display: none;
  }
  .game-bottom {
    gap: 8px;
  }
  .game-bottom > span {
    text-align: center;
    font-size: 10px;
  }
  .game-bottom .small-btn {
    white-space: nowrap;
  }
}
@media (max-width: 350px) {
  .hero-copy h1 {
    font-size: 28px;
  }
  .hero-copy > p {
    max-width: 190px;
  }
  .hero-art img {
    height: 122px;
    bottom: 67px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.mastery {
  color: var(--theme, var(--gold));
  font-weight: 900;
  margin: 12px 0 4px;
}
.setting-row select {
  max-width: 130px;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
}
.share-preview {
  display: block;
  width: 160px;
  max-width: 100%;
  margin: 8px auto 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.board-paper.magic-active {
  border-color: #9b7dc1;
  box-shadow:
    0 0 0 3px #b196d124,
    0 4px 0 #e9e1d0;
}
.magic-active .cell.erased {
  background: #eee4f7;
}

@media (max-width: 680px) {
  .workshop-grid {
    grid-template-columns: 1fr;
  }
}

/* Resource summary stays beside coins; game controls retain their playfield space. */
@media (max-width: 1000px) {
  .game-header .brand span {
    display: none;
  }
}
@media (max-width: 760px) {
  .game-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "supplies supplies";
    height: auto;
    gap: 4px 12px;
    padding: 4px 0 10px;
  }
  .game-header .brand {
    grid-area: brand;
  }
  .game-header .brand img {
    height: 54px;
    width: 122px;
  }
  .game-header .top-actions {
    grid-area: actions;
    gap: 6px;
  }
  .game-header .icon-btn {
    width: 44px;
    height: 44px;
  }
  .player-supplies {
    grid-area: supplies;
    width: 100%;
    margin: 0;
    justify-content: space-between;
  }
  .inventory-summary,
  .coin-pill {
    min-height: 44px;
  }
  .inventory-summary {
    padding: 4px 10px;
  }
  body.playing .game-header {
    display: flex;
    height: 62px;
    padding: 0;
    gap: 8px;
  }
  body.playing .game-header .brand {
    display: none;
  }
  body.playing .player-supplies {
    flex: 1;
    gap: 6px;
  }
  body.playing .inventory-caption {
    display: none;
  }
  body.playing .inventory-items {
    gap: 5px;
  }
  body.playing .inventory-summary {
    padding: 4px 6px;
  }
  body.playing .coin-pill {
    padding: 6px 8px;
    font-size: 12px;
  }
  body.playing .coin-pill .icon {
    width: 18px;
    height: 18px;
  }
  .tool-card-head h3 {
    font-size: 21px;
  }
  .upgrade-purchase {
    width: 100%;
  }
}

/* Temporary letter fragments never intercept input or alter grid layout. */
.board-effects {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  contain: layout paint;
}
.falling-letter {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: clamp(15px, 3.8vw, 24px);
  font-weight: 900;
  color: var(--ink);
  animation: letter-fall 0.52s ease-in forwards;
  pointer-events: none;
}
@keyframes letter-fall {
  0% {
    transform: translateY(0) rotate(0);
    color: var(--ink);
    opacity: 1;
  }
  35% {
    color: #ce5861;
    opacity: 1;
  }
  100% {
    transform: translateY(110px) rotate(var(--fall-turn));
    color: #aa293e;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .board-effects {
    display: none;
  }
}

/* Result composition follows the treasure discovery reference, top to bottom. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0 !important;
}
dialog.result-dialog {
  width: 600px;
  max-width: calc(100vw - 24px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.result-wrap {
  padding: 0 !important;
}
.result-hero {
  height: 240px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.result-hero img {
  width: 310px;
  height: auto;
  align-self: flex-start;
  display: block;
}
.result-card {
  background: var(--paper);
  padding: 14px 24px 0;
  border-radius: 24px 24px 0 0;
}
.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.result-topline .stars {
  display: flex;
  gap: 5px;
  letter-spacing: 0;
  font-size: 24px;
}
.result-topline .stars span {
  display: inline-block;
}
.result-topline .stars .reward-empty {
  color: #d8cfb6;
}
.result-topline .stars .earned {
  animation: reward-star 0.5s both;
  animation-delay: calc(var(--i) * 65ms);
}
.result-coins {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 4px 14px;
  background: #fff0c4;
  border-radius: 20px;
  color: #986716;
  min-width: 95px;
  justify-content: center;
}
.result-coins strong {
  font-family: var(--heading);
  font-size: 29px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.result-coins > .icon {
  width: 27px;
  height: 27px;
}
.coin-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.coin-burst > span {
  position: absolute;
  left: 40%;
  top: 25%;
  opacity: 0;
  animation: coin-reward 0.8s ease-out both;
  animation-delay: calc(var(--i) * 55ms);
}
.coin-burst .icon {
  width: 17px;
  height: 17px;
}
.result-card .result-stats {
  gap: 4px;
}
.result-card .result-stats div {
  padding: 7px 5px;
  background: #eee8d8;
  border-radius: 10px;
}
.result-card .result-stats strong {
  font-size: 20px;
  line-height: 1.1;
}
.result-card .reward-breakdown {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
  margin: 7px 0 16px;
}
.result-scroll {
  position: relative;
  margin: 0 -7px 14px;
  padding: 17px 12px 9px;
  border: 18px solid transparent;
  border-image: url("../assets/parchment-nine-slice.svg") 24 fill / 18px / 0
    stretch;
  text-align: center;
}
.result-scroll figcaption {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--paper);
  padding: 0 9px;
  font-size: 11px;
  color: #87734d;
}
.result-scroll .result-phrase {
  font-family: var(--quote);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(24px, 4.8vw, 33px) !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  margin: 0;
}
.result-scroll .result-phrase:before {
  content: "“";
}
.result-scroll .result-phrase:after {
  content: "”";
}
.result-scroll .result-author {
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
  margin: 12px 0 1px;
  color: #665c4c;
}
.result-kind {
  display: block;
  text-align: right;
  font-size: 10px;
  color: #877d6a;
}
.result-story p {
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0;
}
.result-story p + p {
  font-weight: 750;
}
.result-origin {
  display: inline-block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px;
  text-underline-offset: 3px;
}
.result-reading {
  border-top: 1px solid #e7dcc6;
  margin-top: 12px;
  padding: 10px 0 8px;
  text-align: right;
}
.reading-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.reading-book {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}
.reading-book strong {
  display: block;
  font-size: 13px;
}
.reading-book small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.store-links {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}
.store-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  background: #eee9da;
  padding: 6px 12px;
  text-decoration: none;
  font-size: 12px;
  color: var(--ink);
}
.store-links .icon {
  width: 18px;
  height: 18px;
  color: #a37a38;
}
.store-links a:hover {
  background: #e5dcc5;
}
.result-reading .affiliate-note {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  margin: 8px 0 0;
}
.result-wrap > .dialog-actions {
  flex-direction: row;
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid #e7dcc6;
  padding: 14px 20px 18px;
  margin: 0;
  border-radius: 0 0 22px 22px;
  z-index: 2;
}
.result-wrap > .dialog-actions button {
  flex: 1 1 0;
  font-size: 14px;
  min-height: 50px;
}
.album-author {
  font-size: 12px !important;
  color: var(--muted);
}
.album-reading {
  font-size: 12px;
}
@keyframes reward-star {
  from {
    transform: scale(0.3) rotate(-20deg);
    opacity: 0;
  }
  65% {
    transform: scale(1.18) rotate(5deg);
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes coin-reward {
  0% {
    transform: translate(var(--x), -45px) scale(0.65) rotate(-35deg);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 4px) scale(0.25) rotate(25deg);
    opacity: 0;
  }
}
@media (max-width: 600px) {
  .result-hero {
    height: 190px;
  }
  .result-hero img {
    width: 250px;
  }
  .result-card {
    padding: 12px 16px 0;
  }
  .result-scroll {
    padding: 12px 4px 6px;
    margin-left: -4px;
    margin-right: -4px;
  }
  .result-scroll .result-phrase {
    font-size: 25px !important;
  }
  .result-scroll .result-author {
    font-size: 11px;
  }
  .result-wrap > .dialog-actions {
    padding: 12px;
    gap: 8px;
  }
  .result-wrap > .dialog-actions button {
    font-size: 12px;
    padding: 10px 8px;
    min-width: 0;
  }
}
@media (max-height: 700px) {
  .result-hero {
    height: 135px;
  }
  .result-hero img {
    width: 180px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .coin-burst {
    display: none;
  }
}
/* Shared paper dialogue: fixed corners, stretchable center, separate crisp tail. */
.speech-bubble {
  --bubble-tilt: 0deg;
  position: relative;
  background: transparent;
  border: 24px solid transparent;
  border-image: url("../assets/speech-nine-slice.svg") 28 fill / 24px / 0
    stretch;
  border-radius: 0;
  padding: 2px 6px 4px;
  box-shadow: none;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
  transform: rotate(var(--bubble-tilt));
  transform-origin: 70% 100%;
  animation: bubble-arrive 520ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 28px;
  right: 6px;
  bottom: -42px;
  background: url("../assets/speech-tail.svg") center / contain no-repeat;
  pointer-events: none;
}
.welcome-note.speech-bubble {
  position: absolute;
  --bubble-tilt: -3deg;
  width: 236px;
  top: -6px;
  left: -10px;
  animation-delay: 100ms;
}
.guide-note.speech-bubble {
  margin-bottom: 28px;
}
.dialog-wrap .dialog-speech {
  margin: 18px 0 28px;
  font-size: 16px;
}
.dialog-speech::after {
  right: auto;
  left: 8px;
  transform: scaleX(-1);
}
.bubble-hint.speech-bubble {
  border-width: 12px;
  border-image-width: 12px;
  padding: 3px 6px;
}
.bubble-hint.speech-bubble::after {
  width: 20px;
  height: 17px;
  bottom: -24px;
}
.bubble-samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 32px;
  padding: 12px 0 28px;
}
.bubble-samples .speech-bubble {
  margin: 0;
  align-self: start;
}
@keyframes bubble-arrive {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(var(--bubble-tilt)) scale(0.88);
  }
  65% {
    opacity: 1;
    transform: translateY(-2px) rotate(var(--bubble-tilt)) scale(1.025);
  }
  to {
    opacity: 1;
    transform: rotate(var(--bubble-tilt)) scale(1);
  }
}
/* Keep native scrolling and keyboard access, without desktop scrollbar chrome. */
dialog {
  scrollbar-width: none;
  overscroll-behavior: contain;
  overflow-x: hidden;
}
dialog::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
dialog:focus {
  outline: none;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.result-topline .stars {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
}
.result-topline .stars span {
  margin: 0;
  padding: 0;
}
@media (max-height: 950px) and (min-width: 601px) {
  .result-hero {
    height: 170px;
  }
  .result-hero img {
    width: 220px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .speech-bubble {
    animation: none;
  }
}
/* Full-art invitation: one composition shared with the component gallery. */
dialog.illustrated-dialog {
  width: 820px;
  max-width: calc(100vw - 24px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.illustrated-wrap {
  position: relative;
  padding-top: 68px;
  isolation: isolate;
}
.illustrated-art {
  position: absolute;
  top: 0;
  right: 8px;
  width: 350px;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.illustrated-art img {
  position: relative;
  width: 350px;
  height: auto;
  display: block;
  animation: full-art-arrive 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.illustrated-halo {
  position: absolute;
  inset: 80px 10px 70px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #f6d77b66, transparent 70%);
}
.illustrated-spark {
  position: absolute;
  color: #e8b94f;
  font-size: 36px;
  line-height: 1;
  animation: full-art-arrive 500ms 160ms both;
}
.spark-one {
  left: 10px;
  top: 115px;
}
.spark-two {
  right: 14px;
  top: 340px;
  font-size: 25px;
}
.illustrated-card {
  position: relative;
  background: var(--paper);
  border: 1px solid #e4d5b4;
  border-radius: 30px;
  padding: 32px;
  box-shadow: inset 0 -5px 0 #e6d8b9;
}
.illustrated-copy {
  position: relative;
  z-index: 2;
  width: calc(100% - 310px);
}
.illustrated-label {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 9px;
  background: #ffe6ae;
  color: #815c24;
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 900;
  transform: rotate(-2deg);
  box-shadow: 0 2px 0 #e6cc95;
}
.illustrated-copy h2 {
  font-family: var(--heading);
  font-size: 43px;
  line-height: 1.08;
  margin: 20px 0 18px;
  text-wrap: balance;
}
.illustrated-copy h2::after {
  content: "";
  display: block;
  height: 5px;
  width: 72%;
  background: #eebc52;
  border-radius: 100%;
  margin-top: 12px;
  transform: rotate(-2deg);
}
.illustrated-description {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.illustrated-copy .dialog-details {
  font-size: 12px !important;
  line-height: 1.5;
  color: #667086;
}
.illustrated-card > .dialog-actions {
  position: relative;
  z-index: 2;
  width: calc(100% - 300px);
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.illustrated-card > .dialog-actions button {
  flex: none;
  width: 100%;
  min-height: 52px;
  font-size: 15px;
}
.illustrated-footnote {
  position: relative;
  z-index: 2;
  max-width: calc(100% - 280px);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin: 18px 0 0;
}
@keyframes full-art-arrive {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 660px) {
  .illustrated-wrap {
    padding-top: 190px;
  }
  .illustrated-art {
    width: 280px;
    height: 245px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .illustrated-art img {
    width: 250px;
    margin: 0 auto;
  }
  .spark-one {
    top: 100px;
    left: 4px;
  }
  .spark-two {
    top: 160px;
    right: 0;
  }
  .illustrated-card {
    z-index: 2;
    padding: 22px;
    border-radius: 26px;
  }
  .illustrated-copy {
    width: 100%;
    text-align: center;
  }
  .illustrated-copy h2 {
    font-size: 32px;
    margin: 14px 0;
  }
  .illustrated-copy h2::after {
    margin: 10px auto 0;
  }
  .illustrated-description {
    font-size: 15px;
  }
  .illustrated-card > .dialog-actions {
    width: 100%;
    margin-top: 20px;
  }
  .illustrated-footnote {
    max-width: none;
    text-align: center;
  }
}
@media (max-height: 700px) and (max-width: 660px) {
  .illustrated-wrap {
    padding-top: 115px;
  }
  .illustrated-art {
    height: 175px;
    width: 210px;
  }
  .illustrated-art img {
    width: 180px;
  }
  .illustrated-card {
    padding: 16px;
  }
  .illustrated-label {
    padding: 5px 9px;
    font-size: 10px;
  }
  .illustrated-copy h2 {
    font-size: 27px;
    margin: 10px 0;
  }
  .illustrated-description {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .illustrated-copy .dialog-details {
    font-size: 11px !important;
    margin-top: 8px;
  }
  .illustrated-card > .dialog-actions {
    margin-top: 14px;
    gap: 10px;
  }
  .illustrated-card > .dialog-actions button {
    min-height: 46px;
    font-size: 14px;
    padding: 10px;
  }
  .illustrated-footnote {
    margin-top: 12px;
    font-size: 10px;
  }
}
@media (max-height: 600px) and (min-width: 661px) {
  .illustrated-wrap {
    padding-top: 20px;
  }
  .illustrated-card {
    padding: 20px;
  }
  .illustrated-copy h2 {
    font-size: 30px;
    margin: 12px 0;
  }
  .illustrated-copy .dialog-details {
    margin-top: 8px;
  }
  .illustrated-art {
    width: 265px;
    right: 20px;
  }
  .illustrated-art img {
    width: 265px;
  }
  .illustrated-card > .dialog-actions {
    margin-top: 14px;
    flex-direction: row;
    gap: 10px;
  }
  .illustrated-card > .dialog-actions button {
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 48px;
    font-size: 13px;
    padding: 10px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .illustrated-art img,
  .illustrated-spark {
    animation: none;
  }
}
/* Desktop hover previews are invitations, never selected cells or tool commits. */
.illustrated-speech.speech-bubble {
  margin: 0 0 16px;
  padding: 16px;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
}
.hero-art .star-companion {
  width: 80px;
  height: 80px;
  max-width: none;
  filter: none;
  animation: companion-arrive 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-portrait {
  position: absolute;
  bottom: 0;
  width: 280px;
  height: 330px;
  overflow: hidden;
  border-radius: 0 0 140px 140px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.hero-portrait img {
  position: static;
  max-width: none;
  width: auto;
  filter: none;
}
/* Full art melts into its paper panel rather than ending at a hard cut. */
.illustrated-art > img {
  mask-image: linear-gradient(#000 0%, #000 78%, transparent 99%);
}
@media (max-width: 800px) {
  .hero-portrait {
    width: 230px;
    height: 300px;
    border-radius: 0 0 115px 115px;
  }
}
@media (max-width: 520px) {
  .hero-portrait {
    width: 142px;
    height: 165px;
    right: 0;
    bottom: 72px;
    border-radius: 0 0 71px 71px;
  }
  .hero-portrait img {
    position: static;
    max-width: none;
  }
  .design-hero .hero-art {
    height: 220px;
  }
  .design-hero .hero-portrait,
  .design-hero .art-disc {
    bottom: 0;
    right: auto;
  }
}
@media (max-width: 350px) {
  .hero-portrait {
    width: 118px;
    height: 150px;
    bottom: 90px;
    border-radius: 0 0 59px 59px;
  }
}
@keyframes companion-arrive {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-12deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.character-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.character-gallery article {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
}
.character-gallery h3 {
  margin: 16px 0 4px;
}
.character-gallery p {
  color: var(--muted);
  font-size: 14px;
}
.character-portrait {
  height: 240px;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(ellipse, #ffe8ac80, transparent 72%);
}
.character-portrait img {
  width: 100%;
  height: auto;
}
.character-portrait .character-star {
  height: 100%;
  object-fit: contain;
}
.character-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}
.approved-study {
  margin: 24px 0;
}
.approved-study summary {
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 10px 0;
}
@media (max-width: 700px) {
  .character-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .character-portrait {
    height: 180px;
  }
}
@media (max-height: 700px) and (max-width: 660px) {
  .illustrated-speech.speech-bubble {
    font-size: 13px;
    padding: 12px;
  }
  .illustrated-wrap[data-scene="help"] {
    padding-top: 85px;
  }
  .illustrated-wrap[data-scene="help"] .illustrated-art {
    height: 135px;
  }
  .illustrated-wrap[data-scene="help"] .illustrated-art img {
    width: 155px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .star-companion {
    animation: none;
  }
}
@media (hover: hover) and (pointer: fine) {
  .cell:not(.selected):not(.erased):hover {
    background: #fff1cf;
    box-shadow: inset 0 0 0 2px #cfb474;
  }
  .cell.selected:hover {
    filter: brightness(1.12);
  }
  .cell.hover-target {
    box-shadow: inset 0 0 0 2px #42a8bb;
    background-color: #e3f3ed;
  }
  .board[data-feedback-tool]:not([data-feedback-tool=""]) .cell {
    cursor: crosshair;
  }
  .tool-button:not(:disabled):hover {
    background: #e9f1ff;
    border-color: #92b5eb;
    transform: translateY(-2px);
  }
  .icon-btn:not(:disabled):hover,
  .small-btn:not(:disabled):hover {
    background-color: #eee6d5;
  }
}
.tool-ripple {
  position: absolute;
  border: 3px solid #54bcce;
  border-radius: 35%;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  animation: tool-ripple 480ms ease-out both;
}
@keyframes tool-ripple {
  from {
    transform: scale(0.35);
    opacity: 0.8;
  }
  to {
    transform: scale(1.05);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tool-ripple {
    display: none;
  }
  .tool-button:not(:disabled):hover {
    transform: none;
  }
}
