:root {
  --paper: #efede5;
  --paper-deep: #e5e1d6;
  --card: #fbfaf6;
  --card-strong: #ffffff;
  --ink: #1b1917;
  --ink-soft: #4c4843;
  --ink-faint: #827b70;
  --line: rgba(27, 25, 23, 0.12);
  --line-strong: rgba(27, 25, 23, 0.2);
  --red: #a6341f;
  --red-deep: #8c2d1b;
  --yellow: #d99a28;
  --yellow-soft: #f1c66d;
  --black: #191715;
  --white: #f4f1e8;
  --green: #47674e;
  --radius: 24px;
  --shadow: 0 18px 60px rgba(70, 55, 35, 0.11);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(217, 154, 40, 0.12), transparent 30rem),
    radial-gradient(circle at 88% 32%, rgba(166, 52, 31, 0.07), transparent 34rem),
    linear-gradient(180deg, #f3f1e9 0%, var(--paper) 55%, #e9e5da 100%);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(166, 52, 31, 0.35);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.ambient-one {
  top: 20vh;
  left: -13rem;
  width: 26rem;
  height: 26rem;
  border: 1px solid rgba(166, 52, 31, 0.1);
  box-shadow: 0 0 0 4rem rgba(166, 52, 31, 0.015), 0 0 0 8rem rgba(166, 52, 31, 0.012);
}

.ambient-two {
  right: -10rem;
  bottom: 8vh;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(217, 154, 40, 0.17);
  box-shadow: 0 0 0 4rem rgba(217, 154, 40, 0.03);
}

.app-shell {
  width: min(1380px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 94px;
  padding: 15px max(28px, calc((100vw - 1380px) / 2 + 4px));
  border-bottom: 1px solid transparent;
  background: rgba(243, 241, 233, 0.83);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ink);
  box-shadow: 0 5px 16px rgba(27, 25, 23, 0.14);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.desktop-nav {
  justify-self: center;
  display: flex;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 246, 0.58);
}

.nav-link {
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(27, 25, 23, 0.05);
}

.nav-link.is-active {
  color: var(--white);
  background: var(--ink);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.privacy-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 103, 78, 0.12);
}

.device-pill {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.device-pill:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.device-pill svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.device-indicator,
.connect-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(27, 25, 23, 0.24);
  border-radius: 50%;
  background: #d6d1c5;
}

.device-pill #device-pill-label {
  overflow: hidden;
  max-width: 150px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-indicator.is-connected,
.connect-dot.is-connected {
  border-color: transparent;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(71, 103, 78, 0.12);
}

.main-stage {
  min-height: calc(100vh - 180px);
}

.view {
  display: none;
  padding: 44px 0 80px;
}

.view.is-active {
  display: block;
  animation: view-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(400px, 0.9fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  min-height: 660px;
  padding: 22px 4px 52px;
}

.eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.eyebrow > span {
  width: 20px;
  height: 1px;
  background: var(--red);
}

.hero h1 {
  margin: 28px 0 22px;
  font-family: var(--display);
  font-size: clamp(56px, 7.2vw, 98px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero h1 em,
.page-heading h2 em {
  color: var(--red);
  font-style: normal;
}

.hero-lede {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.hero-body {
  max-width: 540px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.button-primary {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 8px 24px rgba(27, 25, 23, 0.18);
}

.button-primary:hover {
  background: #2c2824;
}

.button-ink {
  color: var(--white);
  background: var(--red);
}

.button-ink:hover {
  background: var(--red-deep);
}

.button-quiet {
  border-color: var(--line);
  background: rgba(251, 250, 246, 0.58);
}

.button-quiet:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.button.small {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
}

.hero-specs {
  display: flex;
  gap: 34px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-specs div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-specs strong {
  font-family: var(--display);
  font-size: 17px;
}

.hero-specs span {
  color: var(--ink-faint);
  font-size: 11px;
}

.hero-visual {
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(120px, 158px);
  gap: 25px;
  align-items: end;
  justify-content: center;
}

.hero-art-wrap {
  position: relative;
}

.hero-art {
  position: relative;
  width: 100%;
  aspect-ratio: 552 / 768;
  padding: 7px;
  border: 1px solid rgba(27, 25, 23, 0.1);
  border-radius: 8px;
  background: #e6e0d4;
  box-shadow: 0 26px 65px rgba(61, 45, 25, 0.2), 0 2px 0 rgba(255, 255, 255, 0.7) inset;
  transform: rotate(-1.2deg);
}

.hero-art canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: var(--white);
}

.art-pin {
  position: absolute;
  top: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 2px 4px rgba(27, 25, 23, 0.2);
}

.pin-left {
  left: 17%;
}

.pin-right {
  right: 17%;
  background: var(--red);
}

.hero-art-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

.hero-art-meta strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.01em;
}

.meta-kicker {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.crc-line {
  font-family: var(--mono);
  font-size: 9px;
}

.palette-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 0 5px;
}

.palette-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.palette-bars {
  display: grid;
  gap: 7px;
}

.palette-bar {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.palette-bar i {
  width: 22px;
  height: 4px;
  border-radius: 4px;
}

.palette-bar .bar-track {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(27, 25, 23, 0.08);
}

.palette-bar .bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--ink));
}

.home-bottom {
  display: grid;
  grid-template-columns: 1fr minmax(310px, 0.68fr);
  gap: 16px;
  margin-top: 16px;
}

.connect-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 90px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: left;
  background: rgba(251, 250, 246, 0.72);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.connect-strip:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.connect-strip > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.connect-strip strong {
  font-size: 14px;
}

.connect-strip small {
  color: var(--ink-faint);
  font-size: 11px;
}

.connect-arrow {
  color: var(--ink-faint);
  font-size: 26px;
  font-weight: 300;
}

.privacy-note {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(217, 154, 40, 0.08);
}

.note-mark {
  flex: 0 0 auto;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: 0.08em;
}

.privacy-note p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.7;
}

.privacy-note strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.page-heading {
  display: flex;
  gap: 50px;
  align-items: end;
  justify-content: space-between;
  padding: 18px 4px 52px;
}

.page-heading h2 {
  margin: 24px 0 0;
  font-family: var(--display);
  font-size: clamp(48px, 5.4vw, 74px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-heading > p,
.play-heading-action p,
.works-heading-action p {
  max-width: 410px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.85;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.workspace-panel,
.control-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 250, 246, 0.75);
}

.workspace-panel {
  padding: 14px;
}

.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 5px 5px 14px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.workspace-state {
  color: var(--red);
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 590px);
  aspect-ratio: 552 / 768;
  margin: 0 auto;
  overflow: hidden;
  border: 1px dashed rgba(27, 25, 23, 0.22);
  border-radius: 14px;
  background: #e9e5da;
  transition: border-color 180ms ease, background 180ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--red);
  background: rgba(166, 52, 31, 0.06);
}

.drop-zone canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 48%),
    #ebe7dc;
  cursor: pointer;
}

.canvas-empty.is-hidden {
  display: none;
}

.empty-glyph {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--red);
  font-size: 24px;
  font-weight: 300;
}

.canvas-empty strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
}

.canvas-empty small {
  font-size: 10px;
}

.processing-veil {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(244, 241, 232, 0.72);
  backdrop-filter: blur(4px);
}

.processing-veil.is-visible {
  display: flex;
}

.processing-veil > span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(27, 25, 23, 0.14);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.processing-veil small {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.preview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 13px 5px 8px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.preview-footer span:first-child {
  margin-right: auto;
  color: var(--ink-soft);
}

.color-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 5px;
}

.color-stat {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(27, 25, 23, 0.035);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.color-stat i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(27, 25, 23, 0.08);
  border-radius: 3px;
  background: var(--stat-color);
}

.color-stat strong {
  margin-left: auto;
  color: var(--ink-soft);
  font-weight: 500;
}

.control-panel {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 126px);
  padding: 22px;
  overflow: auto;
}

.control-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--red);
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0;
  background: transparent;
  cursor: pointer;
}

.control-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.control-label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 17px 0 7px 0;
}

.control-row:first-child {
  margin-top: 0;
}

.control-row output {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
}

.style-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.style-pill {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.style-pill i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill-color, var(--ink));
}

.style-pill:hover {
  border-color: var(--line-strong);
}

.style-pill.is-active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.range {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(166, 52, 31, 0.48), rgba(27, 25, 23, 0.1));
}

.range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 3px rgba(27, 25, 23, 0.22);
  appearance: none;
}

.range::-moz-range-track {
  height: 3px;
  border-radius: 4px;
  background: rgba(27, 25, 23, 0.12);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 10px;
}

.compact-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.compact-grid .toggle-field {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.compact-grid .toggle-field input,
.field.toggle-field input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--red);
}

.split-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.split-controls label {
  display: grid;
  gap: 7px;
}

.transform-reset {
  margin-top: 12px;
}

.select,
.field input,
.field select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.52);
}

.select:focus,
.field input:focus,
.field select:focus {
  border-color: var(--red);
  outline: none;
}

.control-actions {
  display: grid;
  gap: 8px;
  padding-top: 20px;
}

.split-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.split-actions .button {
  min-height: 42px;
  padding: 9px 11px;
  font-size: 12px;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.board-workspace {
  padding: 14px;
  background: #e7e2d6;
}

.board-stage {
  display: grid;
  place-items: center;
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 14px;
  border-radius: 12px;
  background: #d9d3c6;
}

.board-stage canvas {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 3px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(50, 40, 28, 0.2);
  touch-action: none;
  cursor: crosshair;
}

.board-tools {
  position: sticky;
}

.ink-palette {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.ink-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  background: transparent;
  cursor: pointer;
}

.ink-chip span {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(27, 25, 23, 0.13);
  border-radius: 6px;
  background: var(--chip);
}

.ink-chip.is-active {
  border-color: var(--ink);
  background: rgba(27, 25, 23, 0.055);
}

.brush-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 11px;
}

.brush-button {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 63px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.brush-button i {
  display: block;
  width: var(--size);
  height: var(--size);
  max-width: 32px;
  max-height: 32px;
  border-radius: 50%;
  background: var(--ink);
}

.brush-button span {
  color: var(--ink-faint);
  font-size: 9px;
}

.brush-button.is-active {
  border-color: var(--red);
  background: rgba(166, 52, 31, 0.06);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 11px;
}

.tool-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  background: transparent;
  cursor: pointer;
}

.tool-button.is-active {
  color: var(--white);
  background: var(--ink);
}

.board-hint {
  margin-top: 16px;
  padding: 12px;
  border-radius: 9px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.65;
  background: rgba(217, 154, 40, 0.08);
}

.board-hint span {
  display: block;
  margin-bottom: 3px;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.play-heading-action,
.works-heading-action {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.play-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.play-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  background: rgba(251, 250, 246, 0.72);
  cursor: pointer;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.play-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.play-card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  background: var(--paper-deep);
}

.play-card-meta {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
  padding: 12px 3px 5px;
}

.play-card-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.play-card-meta strong {
  font-family: var(--display);
  font-size: 18px;
}

.play-card-meta small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.play-card-number {
  color: rgba(27, 25, 23, 0.28);
  font-family: var(--mono);
  font-size: 8px;
}

.play-note {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-top: 18px;
  padding: 28px 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(217, 154, 40, 0.07);
}

.play-note-number {
  color: var(--yellow);
  font-family: var(--display);
  font-size: 70px;
  line-height: 0.8;
}

.play-note p {
  max-width: 750px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.8;
}

.play-note strong {
  color: var(--ink);
}

.works-count {
  color: var(--red);
  font-family: var(--display);
  font-size: 30px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(251, 250, 246, 0.72);
}

.work-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 11px;
  background: var(--paper-deep);
  cursor: pointer;
}

.work-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.work-image:hover img {
  transform: scale(1.025);
}

.work-meta {
  padding: 12px 4px 5px;
}

.work-meta strong {
  display: block;
  overflow: hidden;
  font-family: var(--display);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-meta small {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.work-actions {
  display: flex;
  gap: 4px;
  padding-top: 8px;
}

.work-actions button {
  flex: 1;
  min-height: 30px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  background: transparent;
  cursor: pointer;
}

.work-actions button:hover {
  border-color: var(--line-strong);
  background: rgba(27, 25, 23, 0.04);
}

.works-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.works-empty[hidden] {
  display: none;
}

.empty-art {
  margin-bottom: 8px;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 54px;
}

.works-empty strong {
  font-family: var(--display);
  font-size: 24px;
}

.works-empty p {
  margin: 0 0 14px;
  color: var(--ink-faint);
  font-size: 11px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 4px 34px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.bottom-nav {
  display: none;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  background: rgba(27, 25, 23, 0.42);
  opacity: 0;
  transition: opacity 240ms ease, visibility 240ms ease;
  backdrop-filter: blur(3px);
}

.sheet-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.device-sheet {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(460px, 100vw);
  height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 24rem),
    var(--paper);
  box-shadow: -20px 0 70px rgba(27, 25, 23, 0.18);
  transform: translateX(105%);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.device-sheet.is-open {
  transform: translateX(0);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding-bottom: 24px;
}

.sheet-head h3 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: 34px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.device-status-card {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 250, 246, 0.8);
}

.device-status-orb {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(27, 25, 23, 0.22);
  border-radius: 50%;
  background: #d8d2c6;
}

.device-status-orb.is-connected {
  border-color: transparent;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(71, 103, 78, 0.11);
}

.device-status-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.device-status-card strong {
  font-size: 13px;
}

.device-status-card small {
  color: var(--ink-faint);
  font-size: 9px;
}

.compat-warning {
  margin-top: 10px;
  padding: 13px;
  border-radius: 10px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.65;
  background: rgba(166, 52, 31, 0.07);
}

.send-progress {
  display: none;
  margin-top: 14px;
}

.send-progress.is-visible {
  display: block;
}

.send-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(27, 25, 23, 0.09);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow));
  transition: width 120ms linear;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.protocol-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(251, 250, 246, 0.58);
}

.protocol-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.protocol-panel summary::-webkit-details-marker {
  display: none;
}

.protocol-panel summary span {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}

.protocol-panel summary small {
  color: var(--ink-faint);
  font-size: 9px;
}

.protocol-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 9px;
  padding: 2px 16px 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.toggle-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field[hidden] {
  display: none;
}

.field > span {
  color: var(--ink-faint);
  font-size: 9px;
}

.field-help {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.65;
}

.field-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 9px;
}

.field-range-head output {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
}

.dither-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.dither-choice {
  min-height: 36px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.dither-choice:hover {
  border-color: var(--line-strong);
  background: var(--card);
}

.dither-choice.is-active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.panel-profile-note {
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.65;
  background: rgba(27, 25, 23, 0.045);
}

.hardware-note {
  padding: 11px 12px;
  border-left: 2px solid var(--yellow);
  border-radius: 0 8px 8px 0;
  background: rgba(217, 154, 40, 0.06);
}

.hardware-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
}

.hardware-note p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.7;
}

.protocol-body > .button.wide {
  grid-column: 1 / -1;
}

.device-info-line {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.35);
}

.uuid-list,
.status-readout {
  flex-direction: column;
}

.uuid-list code,
.status-readout code {
  display: block;
  padding: 9px 10px;
  overflow-wrap: anywhere;
  border-radius: 7px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  background: rgba(27, 25, 23, 0.05);
}

.maintenance-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.maintenance-actions .button {
  min-height: 38px;
  padding: 8px;
  font-size: 10px;
}

.protocol-note {
  margin-top: 12px;
  padding: 13px 15px;
  border-left: 2px solid var(--yellow);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.7;
  background: rgba(217, 154, 40, 0.06);
}

.log-panel {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #201d1a;
}

.log-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 241, 232, 0.55);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.log-head button {
  padding: 0;
  border: 0;
  color: rgba(244, 241, 232, 0.55);
  font-size: 8px;
  background: transparent;
  cursor: pointer;
}

.log-body {
  height: 150px;
  padding: 11px 13px;
  overflow-y: auto;
  color: #d5b574;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.65;
}

.log-line.muted {
  color: rgba(244, 241, 232, 0.35);
}

.log-line.error {
  color: #e68574;
}

.save-dialog {
  width: min(410px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(27, 25, 23, 0.26);
}

.save-dialog::backdrop {
  background: rgba(27, 25, 23, 0.42);
  backdrop-filter: blur(4px);
}

.save-dialog form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 26px;
}

.save-dialog h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 31px;
}

.save-dialog input {
  min-height: 46px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  background: var(--ink);
  box-shadow: 0 12px 35px rgba(27, 25, 23, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
    gap: 40px;
  }

  .hero-visual {
    grid-template-columns: minmax(210px, 290px) 120px;
  }

  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .play-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 32px, 780px);
  }

  .desktop-nav {
    display: none;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    padding-inline: max(20px, calc((100vw - 780px) / 2 + 4px));
  }

  .top-actions {
    justify-self: end;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 50px;
    padding-top: 16px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-visual {
    grid-template-columns: minmax(220px, 330px) minmax(120px, 160px);
    justify-self: center;
  }

  .editor-layout,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .board-tools {
    position: static;
    max-height: none;
  }

  .play-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-heading {
    gap: 30px;
  }

  .site-footer {
    margin-bottom: 78px;
  }

  .bottom-nav {
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(27, 25, 23, 0.12);
    border-radius: 20px;
    background: rgba(251, 250, 246, 0.92);
    box-shadow: 0 14px 40px rgba(27, 25, 23, 0.16);
    backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    border: 0;
    border-radius: 14px;
    color: var(--ink-faint);
    font-size: 9px;
    background: transparent;
    cursor: pointer;
  }

  .bottom-nav button span {
    font-size: 16px;
    line-height: 1;
  }

  .bottom-nav button.is-active {
    color: var(--white);
    background: var(--ink);
  }
}

@media (max-width: 760px) {
  .page-heading {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .page-heading > p,
  .play-heading-action p,
  .works-heading-action p {
    max-width: 560px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 22px, 580px);
  }

  .topbar {
    min-height: 76px;
    gap: 10px;
    padding-inline: max(15px, calc((100vw - 580px) / 2 + 4px));
  }

  .privacy-chip {
    display: none;
  }

  .device-pill {
    padding: 9px 10px;
    font-size: 10px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .view {
    padding-top: 24px;
    padding-bottom: 100px;
  }

  .hero {
    min-height: auto;
    padding-bottom: 36px;
  }

  .hero h1 {
    margin-top: 20px;
    font-size: clamp(45px, 13.2vw, 66px);
    letter-spacing: -0.065em;
  }

  .hero-lede {
    font-size: 15px;
  }

  .hero-body {
    font-size: 12px;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions .button {
    flex: 1;
    min-width: 135px;
  }

  .hero-specs {
    gap: 18px;
    justify-content: space-between;
  }

  .hero-specs strong {
    font-size: 14px;
  }

  .hero-specs span {
    font-size: 9px;
  }

  .hero-visual {
    grid-template-columns: minmax(0, 270px) minmax(95px, 120px);
    gap: 16px;
  }

  .home-bottom {
    grid-template-columns: 1fr;
  }

  .page-heading {
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: flex-start;
    padding-bottom: 32px;
  }

  .page-heading h2 {
    font-size: 50px;
  }

  .editor-layout,
  .board-layout {
    gap: 14px;
  }

  .workspace-panel,
  .control-panel {
    border-radius: 18px;
  }

  .workspace-panel {
    padding: 10px;
  }

  .control-panel {
    padding: 18px;
  }

  .style-pills {
    grid-template-columns: 1fr 1fr;
  }

  .color-stats {
    grid-template-columns: 1fr 1fr;
  }

  .play-heading-action,
  .works-heading-action {
    gap: 12px;
  }

  .play-grid {
    gap: 9px;
  }

  .play-card {
    padding: 7px;
    border-radius: 13px;
  }

  .play-card-meta {
    padding: 9px 2px 3px;
  }

  .play-card-meta strong {
    font-size: 15px;
  }

  .play-card-meta small {
    font-size: 8px;
  }

  .play-note {
    gap: 18px;
    padding: 22px;
  }

  .play-note-number {
    font-size: 50px;
  }

  .works-grid {
    gap: 9px;
  }

  .work-card {
    padding: 7px;
    border-radius: 13px;
  }

  .work-meta {
    padding: 9px 3px 3px;
  }

  .work-meta strong {
    font-size: 14px;
  }

  .work-actions {
    flex-wrap: wrap;
  }

  .work-actions button {
    min-width: 45%;
  }

  .site-footer {
    flex-direction: column;
    gap: 7px;
  }

  .device-sheet {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(88dvh, 820px);
    padding: 22px 18px 30px;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 24px 24px 0 0;
    transform: translateY(105%);
  }

  .device-sheet.is-open {
    transform: translateY(0);
  }

  .sheet-head h3 {
    font-size: 28px;
  }

  .protocol-body {
    gap: 10px 7px;
  }

  .toast {
    bottom: 85px;
  }
}

@media (max-width: 480px) {
  .topbar {
    min-height: 70px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .device-pill {
    gap: 6px;
    max-width: 142px;
  }

  .device-pill #device-pill-label {
    max-width: 84px;
  }

  .privacy-chip {
    display: none;
  }

  .hero h1 {
    font-size: clamp(40px, 12.5vw, 55px);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-specs {
    gap: 12px;
  }

  .hero-visual {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 300px);
    justify-self: center;
  }

  .palette-card {
    padding-top: 0;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .split-actions {
    grid-template-columns: 1fr;
  }

  .split-controls,
  .maintenance-actions {
    grid-template-columns: 1fr;
  }

  .play-grid {
    grid-template-columns: 1fr;
  }

  .play-card canvas {
    aspect-ratio: 4 / 4.8;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .protocol-body {
    grid-template-columns: 1fr;
  }

  .dither-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-actions {
    grid-template-columns: 1fr;
  }

  .device-status-card {
    flex-wrap: wrap;
  }

  .device-status-card .button {
    width: 100%;
    margin-top: 7px;
  }
}

.play-heading {
  display: block;
  padding-bottom: 28px;
}

.play-heading h2 {
  margin-top: 18px;
}

.play-intro {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1.85;
}

.four-ink-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 10px;
  margin: 0 2px 26px;
  overflow: hidden;
  border-radius: 999px;
}

.four-ink-strip span:nth-child(1) {
  background: var(--black);
}

.four-ink-strip span:nth-child(2) {
  background: var(--white);
}

.four-ink-strip span:nth-child(3) {
  background: #eeee2d;
}

.four-ink-strip span:nth-child(4) {
  background: #d33722;
}

.play-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.play-tool-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 238px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  text-align: left;
  background: rgba(251, 250, 246, 0.74);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.play-tool-card:hover {
  border-color: rgba(166, 52, 31, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.play-tool-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--red);
}

.play-tool-icon svg {
  display: block;
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.play-tool-card:nth-child(1) .play-tool-icon svg {
  fill: currentColor;
  stroke: none;
}

.play-tool-copy {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}

.play-tool-copy strong {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
}

.play-tool-copy small {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.7;
}

.play-tool-index {
  align-self: flex-end;
  margin-top: -52px;
  color: rgba(27, 25, 23, 0.25);
  font-family: var(--mono);
  font-size: 9px;
}

.play-detail-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 30px;
  align-items: start;
  padding: 16px 4px 36px;
}

.play-back {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 7px;
  padding: 7px 4px;
  border: 0;
  color: var(--red);
  font-size: 13px;
  background: transparent;
  cursor: pointer;
}

.play-back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.play-detail-heading h2 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.play-detail-heading p {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.7;
}

.play-detail-count {
  color: rgba(27, 25, 23, 0.26);
  font-family: var(--mono);
  font-size: 10px;
}

.play-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.play-workspace {
  min-width: 0;
}

.play-stage-wrap {
  position: relative;
  display: grid;
  width: min(100%, 650px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(27, 25, 23, 0.025) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(315deg, rgba(27, 25, 23, 0.025) 25%, transparent 25%) 0 0 / 14px 14px,
    var(--paper-deep);
}

.play-stage-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 552 / 768;
  object-fit: contain;
}

.play-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  background: rgba(229, 225, 214, 0.82);
}

.play-stage-empty.is-hidden {
  display: none;
}

.play-stage-empty span {
  color: var(--red);
  font-family: var(--display);
  font-size: 44px;
}

.play-stage-empty strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
}

.play-stage-empty small {
  font-size: 11px;
}

.play-auto-label {
  color: var(--ink-faint);
  font-size: 9px;
}

.play-controls {
  position: sticky;
  top: 100px;
}

.play-field-grid {
  display: grid;
  gap: 13px;
}

.play-control-section {
  display: grid;
  gap: 9px;
  margin-bottom: 21px;
}

.play-control-section:last-child {
  margin-bottom: 0;
}

.play-control-section > label,
.play-control-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.play-control-section input[type="text"],
.play-control-section input[type="number"],
.play-control-section input[type="tel"],
.play-control-section input[type="email"],
.play-control-section input[type="url"],
.play-control-section textarea,
.play-control-section select {
  width: 100%;
  min-height: 43px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font-size: 12px;
  background: var(--card-strong);
}

.play-control-section textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.65;
}

.play-control-section input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.play-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.play-inline-row > input {
  flex: 1;
}

.play-mini-button,
.play-chip {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.play-mini-button {
  flex: 0 0 auto;
  min-height: 43px;
  border-radius: 11px;
  color: var(--red);
}

.play-chip.is-active {
  color: var(--red);
  border-color: rgba(166, 52, 31, 0.46);
  background: rgba(166, 52, 31, 0.08);
}

.play-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.play-glyph {
  min-width: 36px;
  padding-inline: 9px;
  color: var(--red);
  font-family: var(--display);
  font-size: 15px;
}

.play-chip-toggle {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}

.play-chip-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--red);
}

.play-ink-row {
  display: flex;
  gap: 9px;
  align-items: center;
}

.play-ink-dot {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--dot);
  cursor: pointer;
}

.play-ink-dot.is-active {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--red);
}

.play-photo-picker {
  display: flex;
  gap: 12px;
  align-items: center;
}

.play-photo-picker .button {
  flex: 0 0 auto;
}

.play-photo-picker small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.play-photo-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 3px 1px 8px;
}

.play-photo-thumb {
  position: relative;
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
}

.play-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-photo-thumb span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: white;
  font-family: var(--mono);
  font-size: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.play-photo-thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  font-size: 11px;
  background: rgba(27, 25, 23, 0.7);
  cursor: pointer;
}

.play-photo-thumb.is-lifted {
  opacity: 0.36;
}

.play-photo-thumb.is-over {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(166, 52, 31, 0.22);
}

.play-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  color: var(--ink-soft);
  font-size: 11px;
}

.play-toggle input {
  width: 38px;
  height: 22px;
  accent-color: var(--red);
}

.play-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.play-range-head output {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
}

.play-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 17px;
  background: linear-gradient(180deg, rgba(251, 250, 246, 0), rgba(251, 250, 246, 0.96) 16%);
}

.play-hint {
  margin-top: 11px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .play-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .play-editor-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
  }
}

@media (max-width: 900px) {
  .play-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .play-editor-layout {
    grid-template-columns: 1fr;
  }

  .play-controls {
    position: static;
  }
}

@media (max-width: 760px) {
  .play-detail-heading {
    grid-template-columns: auto 1fr;
    gap: 14px 20px;
  }

  .play-detail-count {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .play-intro {
    font-size: 12px;
  }

  .four-ink-strip {
    height: 8px;
    margin-bottom: 18px;
  }

  .play-tool-grid {
    gap: 10px;
  }

  .play-tool-card {
    gap: 13px;
    min-height: 212px;
    padding: 17px;
    border-radius: 18px;
  }

  .play-tool-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .play-tool-icon svg {
    width: 31px;
    height: 31px;
  }

  .play-tool-copy strong {
    font-size: 19px;
  }

  .play-tool-copy small {
    font-size: 10px;
  }

  .play-detail-heading {
    display: block;
    padding-bottom: 24px;
  }

  .play-back {
    margin-bottom: 18px;
  }

  .play-detail-heading h2 {
    font-size: 42px;
  }

  .play-detail-count {
    display: none;
  }

  .play-stage-wrap {
    border-radius: 12px;
  }

  .play-auto-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* The mini program keeps 玩法 in a narrow, vertically stacked paper layout. */
.play-page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
}

.play-heading {
  display: block;
  padding: 2px 0 0;
}

.play-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.play-intro {
  max-width: none;
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.7;
}

.play-page-shell .four-ink-strip {
  height: 6px;
  margin: 20px 0 16px;
  border-radius: 4px;
}

.play-tool-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.play-tool-card {
  display: flex;
  flex: 0 0 calc(50% - 6px);
  flex-direction: column;
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: rgba(251, 250, 246, 0.82);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.play-tool-card:hover {
  border-color: rgba(166, 52, 31, 0.3);
  background: var(--card-strong);
  box-shadow: 0 10px 28px rgba(70, 55, 35, 0.08);
  transform: translateY(-2px);
}

.play-tool-icon {
  display: block;
  width: auto;
  height: auto;
  flex: none;
  color: var(--red);
  font-family: var(--body);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}

.play-tool-icon svg {
  display: none;
}

.play-tool-copy {
  display: block;
  margin-top: auto;
  padding-top: 18px;
}

.play-tool-copy strong {
  display: block;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.play-tool-copy small {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.55;
}

.play-tool-index {
  display: none;
}

.board-heading-back {
  display: flex;
  width: max-content;
  margin: 0 0 12px;
  padding-left: 0;
}

.play-detail-shell {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.play-detail-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 0;
}

.play-back {
  flex: none;
  min-width: 52px;
  margin: 3px 0 0;
  padding: 5px 4px;
  border: 0;
  color: var(--red);
  font-size: 13px;
  background: transparent;
  cursor: pointer;
}

.play-detail-heading h2 {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.play-detail-heading p {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}

.play-paper {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.play-section-title {
  display: block;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.play-control-card #play-control-sections {
  display: grid;
  gap: 20px;
  margin-top: 15px;
}

.play-control-card .play-control-section {
  display: grid;
  gap: 9px;
  margin: 0;
}

.play-control-card .play-control-section > label,
.play-control-card .play-control-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.play-control-card input[type="text"],
.play-control-card input[type="number"],
.play-control-card input[type="tel"],
.play-control-card input[type="email"],
.play-control-card input[type="url"],
.play-control-card textarea,
.play-control-card select {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.play-control-card input[type="range"] {
  accent-color: var(--red);
}

.play-control-card .play-inline-row {
  gap: 8px;
}

.play-control-card .play-mini-button,
.play-control-card .play-chip {
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 11px;
  background: var(--paper-deep);
}

.play-control-card .play-mini-button {
  min-height: 42px;
  border-radius: 10px;
  color: var(--red);
  background: transparent;
}

.play-control-card .play-chip.is-active {
  border-color: var(--red);
  color: var(--red-deep);
  background: rgba(166, 52, 31, 0.08);
  font-weight: 500;
}

.play-control-card .play-chip-row {
  gap: 8px;
}

.play-control-card .play-glyph {
  min-width: 34px;
  padding-inline: 10px;
  color: var(--red);
  font-size: 16px;
}

.play-control-card .play-toggle {
  min-height: 38px;
  padding: 0;
  font-size: 12px;
}

.play-control-card .play-toggle input {
  width: 38px;
  height: 22px;
}

.play-control-card .play-hint,
.play-control-tip {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.65;
}

.play-control-tip {
  display: block;
  margin-top: 16px;
}

.play-generate-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  background: var(--red);
  cursor: pointer;
}

.play-generate-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.play-result-card[hidden] {
  display: none;
}

.play-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.play-result-state {
  color: var(--ink-faint);
  font-size: 10px;
}

.play-stage-wrap {
  width: min(100%, 520px);
  margin: 13px auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.play-stage-wrap canvas {
  border-radius: 11px;
  touch-action: none;
  user-select: none;
}

.play-result-meta {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 10px 2px 0;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.play-result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  margin-top: 14px;
}

.play-result-actions .button {
  min-height: 42px;
  padding: 9px 16px;
  font-size: 12px;
}

.play-preview-button {
  justify-self: stretch;
}

.play-download-button {
  padding: 8px 8px;
  color: var(--red);
  font-size: 11px;
}

.play-local-note {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 520px) {
  .play-page-shell {
    width: 100%;
  }

  .play-heading h2 {
    font-size: 38px;
  }

  .play-tool-card {
    flex-basis: calc(50% - 5px);
    min-height: 150px;
    padding: 15px;
  }

  .play-tool-grid {
    gap: 10px;
  }

  .play-tool-copy strong {
    font-size: 15px;
  }

  .play-tool-copy small {
    font-size: 11px;
  }

  .play-detail-heading {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  .play-detail-heading h2 {
    font-size: 30px;
  }

  .play-paper {
    padding: 14px;
  }

  .play-result-actions {
    grid-template-columns: 1fr auto;
  }

  .play-download-button {
    grid-column: 1 / -1;
    justify-self: center;
  }
}
