* {
  box-sizing: border-box;
}
html,
body,
#world {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  background: #08171c;
  color: #f0ece1;
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  --gold: #e5bf83;
  --line: rgba(214, 216, 191, 0.19);
  --glass: rgba(13, 29, 33, 0.74);
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
header,
footer,
.intro,
#instrument,
#hide,
#toast {
  position: absolute;
}
header {
  left: 4.1%;
  right: calc(4.1% + 48px);
  top: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand strong {
  display: block;
  font:
    600 20px 'Songti SC',
    serif;
  letter-spacing: 4px;
}
.brand strong span {
  color: var(--gold);
  margin: 0 1px;
}
.brand small,
.eyebrow,
.readout small,
.footer-mark,
.section-label,
.panel-head small {
  font:
    10px/1.4 'Helvetica Neue',
    sans-serif;
  letter-spacing: 2.2px;
}
.brand small {
  font-size: 8px;
  letter-spacing: 2.65px;
  color: #c9c9b8;
}
#seal {
  display: grid;
  place-items: center;
  border: 1px solid #d2aa74;
  border-radius: 9px 9px 7px 7px;
  color: var(--gold);
  width: 38px;
  height: 42px;
}
#seal svg {
  width: 29px;
  height: 29px;
}
.system,
#actions,
#variants {
  display: flex;
  align-items: center;
  gap: 8px;
}
button,
select {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
button:hover {
  border-color: #d8bd8a99;
  background: #32413d;
}
button:active {
  transform: scale(0.96);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.system button,
#actions button,
#variants button,
.option,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  font-size: 13px;
  min-height: 38px;
}
button svg {
  width: 17px;
  height: 17px;
  flex: none;
}
#wallet {
  color: #f2cd93;
}
button.round {
  display: grid;
  place-items: center;
  padding: 0;
  width: 38px;
  height: 38px;
  font-size: 23px;
}
#hide {
  right: 4.1%;
  top: 28px;
  z-index: 3;
}
.intro {
  pointer-events: none;
  top: 17%;
  left: 5.2%;
  text-shadow: 0 2px 16px #071316b0;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 2.8px;
}
.eyebrow i,
.footer-mark i {
  width: 26px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}
.intro h1 {
  margin: 12px 0 8px;
  font:
    500 clamp(36px, 4.45vw, 73px) / 1.18 'Songti SC',
    'STSong',
    'Noto Serif CJK SC',
    serif;
  letter-spacing: 0.12em;
}
.intro p {
  font:
    14px/1.7 'Songti SC',
    serif;
  letter-spacing: 0.18em;
  color: #d1d8cb;
  margin: 0;
}
#variants {
  pointer-events: auto;
  margin-top: 14px;
}
#variants:empty {
  display: none;
}
#variants button.on,
.option.on {
  color: var(--gold);
  border-color: #b49762;
}
#instrument {
  bottom: 116px;
  left: 5.2%;
  right: 5.2%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
#actions {
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#actions button:first-child,
.primary {
  background: #dfbe88;
  color: #202c29;
  border-color: #f3d7a5;
}
#actions button:first-child:hover,
.primary:hover {
  background: #f0d5a8;
}
.readout {
  display: grid;
  gap: 5px;
  text-shadow: 0 2px 10px #000;
}
.readout small {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c7c6b0;
  font-size: 9px;
}
.readout small:before {
  content: '';
  background: #a8cfb0;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  box-shadow: 0 0 9px #b0dcb2;
}
.readout span {
  font-size: 13px;
  letter-spacing: 1px;
}
footer {
  bottom: 0;
  left: 4.1%;
  right: 4.1%;
  height: 90px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#dock {
  display: flex;
  border-radius: 60px;
  padding: 5px;
  border: 1px solid var(--line);
  background: #122328da;
  backdrop-filter: blur(16px);
  gap: 3px;
}
#dock button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  background: transparent;
  border-color: transparent;
  color: #b7c3bc;
  backdrop-filter: none;
}
#dock button.active {
  background: #cfb3831e;
  border-color: #e7c18a65;
  color: #f0ce92;
}
#dock button svg {
  width: 20px;
  height: 20px;
}
.section-label b {
  font:
    italic 23px Georgia,
    serif;
  color: #e7c18a;
}
.section-label span,
.footer-mark {
  color: #b6c1b0;
}
.footer-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chrome {
  transition: opacity 0.25s;
}
.hidden-ui .chrome {
  opacity: 0;
  visibility: hidden;
}
#toast {
  left: 50%;
  bottom: 175px;
  transform: translate(-50%, 5px);
  pointer-events: none;
  opacity: 0;
  color: #f5e4c8;
  background: #15252be8;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px 18px;
  max-width: 90vw;
  text-align: center;
  transition: 0.2s;
  z-index: 5;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  background: linear-gradient(135deg, #21373a, #132228 75%);
  color: #f2eee2;
  padding: 24px 27px;
  border: 1px solid #a99a725e;
  border-radius: 24px;
  width: min(460px, 94vw);
  max-height: 85dvh;
  box-shadow: 0 24px 90px #0009;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #02101480;
  backdrop-filter: blur(5px);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
}
dialog h2 {
  font:
    29px 'Songti SC',
    serif;
  letter-spacing: 3px;
  margin: 5px 0 18px;
}
dialog p {
  color: #c6d0c7;
  line-height: 1.8;
}
dialog h3 {
  font-size: 13px;
  letter-spacing: 1px;
  color: #e8cea0;
  margin: 18px 0 8px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.option,
.btn {
  font-size: 13px;
  padding: 7px 13px;
}
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.item small {
  display: block;
  color: #bcc5bb;
}
.item button {
  white-space: nowrap;
}
input,
select {
  border: 1px solid var(--line);
  background: #0e2025;
  color: #f7ecdb;
  border-radius: 12px;
  padding: 8px;
  max-width: 100%;
}
.slip {
  padding: 20px;
  text-align: center;
  border: 1px solid #c1a36690;
  border-radius: 12px;
  background: #dcc18d12;
}
.slip strong {
  font:
    32px 'Songti SC',
    serif;
  color: #ecd4a4;
}
.paper {
  width: 100%;
  aspect-ratio: 2/1;
  background: #f8f3e8;
  border-radius: 12px;
  touch-action: none;
  display: block;
}
.swatch {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 2px solid #aaa;
}
.swatch.on {
  outline: 2px solid #fff;
}
.editrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0;
  flex-wrap: wrap;
}
.editrow input[type='range'] {
  width: 85px;
}
#panel-body .note {
  font-size: 12px;
  color: #bac5bb;
}
#variants button {
  padding: 5px 10px;
  min-height: 30px;
  font-size: 12px;
}
.ip-kitty .intro,
.ip-kitty .readout,
.ip-kitty .brand,
.ip-kitty .section-label,
.ip-kitty .footer-mark {
  color: #533b4f;
  text-shadow: none;
}
.ip-kitty .intro p,
.ip-kitty .eyebrow,
.ip-kitty .readout small,
.ip-kitty .brand small {
  color: #6a485a;
}
@media (max-width: 760px) {
  header {
    top: 18px;
    left: 4%;
    right: calc(4% + 39px);
  }
  #hide {
    top: 20px;
    right: 4%;
  }
  .brand {
    gap: 7px;
  }
  .brand strong {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .brand small {
    font-size: 6px;
  }
  .brand #seal {
    width: 29px;
    height: 34px;
  }
  .system {
    gap: 4px;
  }
  .system button {
    padding: 6px 9px;
    font-size: 12px;
    min-height: 31px;
  }
  button.round {
    width: 32px;
    height: 32px;
  }
  .intro {
    top: 14%;
    left: 6%;
  }
  .intro h1 {
    font-size: 43px;
  }
  .intro p {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
  }
  #instrument {
    bottom: 90px;
    left: 5%;
    right: 5%;
    display: grid;
    gap: 10px;
  }
  #actions {
    justify-content: flex-start;
    gap: 5px;
  }
  #actions button {
    padding: 7px 10px;
    font-size: 12px;
    min-height: 34px;
  }
  .readout {
    gap: 2px;
  }
  .readout span {
    font-size: 12px;
  }
  .readout small {
    font-size: 8px;
  }
  footer {
    height: 72px;
    justify-content: center;
    left: 3%;
    right: 3%;
  }
  .section-label,
  .footer-mark {
    display: none;
  }
  #dock {
    width: 100%;
    max-width: 445px;
    justify-content: space-around;
    padding: 3px;
  }
  #dock button {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    font-size: 10px;
  }
  #dock button svg {
    width: 17px;
    height: 17px;
  }
  #toast {
    bottom: 195px;
    width: max-content;
  }
  .brand strong span {
    margin: 0;
  }
  .intro #variants {
    margin-top: 8px;
  }
}
@media (max-height: 540px) and (min-width: 600px) {
  .intro {
    top: 22%;
  }
  .intro h1 {
    font-size: 35px;
  }
  footer {
    height: 58px;
  }
  #instrument {
    bottom: 68px;
  }
  header {
    top: 10px;
  }
  #hide {
    top: 13px;
  }
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}
.credit {
  text-align: center;
  color: var(--gold);
  animation: credit-in 0.6s ease-out;
}
@keyframes credit-in {
  from {
    transform: translateY(8px);
    opacity: 0.1;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.sketchpad {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  background: #f3ecda;
  border-radius: 12px;
}
.tools,
.pair {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0;
}
.tools {
  flex-wrap: wrap;
}
.tools button,
.cta {
  padding: 7px 12px;
  font-size: 13px;
}
.tools button.sel {
  border-color: var(--gold);
  color: var(--gold);
}
.tools input[type='color'] {
  width: 36px;
  height: 32px;
  padding: 2px;
}
.pair input {
  min-width: 0;
  flex: 1;
}
.cta {
  width: 100%;
  margin: 6px 0;
  background: #dfbe88;
  color: #202c29;
}
.fortune {
  text-align: center;
  padding: 22px 12px;
  font:
    19px/2.1 'Songti SC',
    serif;
  color: #e9cf98;
}
.fortune h2 {
  margin: 12px;
}
.fortune small {
  font: 12px system-ui;
}
dialog #toast {
  position: sticky;
  bottom: 0;
  left: 0;
  margin: 10px auto 0;
  transform: none;
  display: none;
  width: fit-content;
}
dialog #toast.show {
  display: block;
}
.item small {
  margin-top: 4px;
  line-height: 1.55;
}
.item .btn {
  flex: none;
}
.item b {
  font-weight: 550;
}

.site-links {display:flex;gap:16px;margin-right:auto;margin-left:25px}
.site-links a {font:12px/1.6 system-ui,sans-serif;color:inherit;text-decoration:none;opacity:.78}
.site-links a:hover,.site-links a:focus-visible {opacity:1;text-decoration:underline}
.brush-size {width:65px}
@media(max-width:760px){
  .site-links {position:absolute;top:calc(100% + 7px);left:0;margin:0;gap:14px}
  .site-links a {font-size:10px;padding:2px 0}
}
