/* Actual current-game RGBA artwork. Load after styles.css; installGameUi() adds
   presentation attributes only. Original alpha supplies every torn edge. */
:root {
  --game-reading-font: Georgia,"Noto Serif CJK SC","STZhongsong","STSong","SimSun",serif;
  --game-ui-font: Georgia,"SimHei","黑体","Microsoft YaHei",sans-serif;
  --game-control-ink: #302014;
  --game-control-red: #6d3028;
  --game-control-paper: url('/assets/game-ui/paper-ticket.png');
  --game-control-pigment: url('/assets/game-ui/fiber-ink.png');
  --game-control-icons: url('/assets/game-ui/painted-icons.png');
  --game-dialog-paper: url('/assets/game-ui/dialog-paper.png');
}
@supports (background-image: image-set(url('/assets/game-ui/paper-ticket.webp') type('image/webp'))) {
  :root {
    --game-control-paper: image-set(url('/assets/game-ui/paper-ticket.webp') type('image/webp'),url('/assets/game-ui/paper-ticket.png') type('image/png'));
    --game-control-pigment: image-set(url('/assets/game-ui/fiber-ink.webp') type('image/webp'),url('/assets/game-ui/fiber-ink.png') type('image/png'));
    --game-control-icons: image-set(url('/assets/game-ui/painted-icons.webp') type('image/webp'),url('/assets/game-ui/painted-icons.png') type('image/png'));
    --game-dialog-paper: image-set(url('/assets/game-ui/dialog-paper.webp') type('image/webp'),url('/assets/game-ui/dialog-paper.png') type('image/png'));
  }
}

html[data-game-ui-ready] [data-game-ui]:where(:not([data-game-ui=off])) {
  --game-paper: var(--game-control-paper);
  --game-paper-position: center;
  --game-paper-size: 100% 100%;
  position: relative;
  isolation: isolate;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
  color: var(--game-control-ink);
  font-family: var(--game-reading-font);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .04em;
  text-decoration: none;
  text-shadow: none;
  -webkit-text-stroke: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(0) rotate(0) scale(1);
  transition: transform .16s cubic-bezier(.2,.65,.3,1),color .18s,opacity .18s;
}

html[data-game-ui-ready] [data-game-ui]::before,
html[data-game-ui-ready] [data-game-ui]::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  margin: 0;
  transform: none;
}

html[data-game-ui-ready] [data-game-ui]::before {
  z-index: -2;
  background: var(--game-paper) var(--game-paper-position) / var(--game-paper-size) no-repeat;
}

html[data-game-ui-ready] [data-game-ui]::after {
  z-index: -1;
  background: var(--game-control-pigment) center / 100% 100% no-repeat;
  -webkit-mask: var(--game-paper) var(--game-paper-position) / var(--game-paper-size) no-repeat;
  mask: var(--game-paper) var(--game-paper-position) / var(--game-paper-size) no-repeat;
  mix-blend-mode: multiply;
  opacity: 0;
  /* The rectangle only uncovers the unchanged pigment; it draws no edge. */
  clip-path: inset(46% 46%);
  transition: clip-path .48s cubic-bezier(.18,.62,.24,1),opacity .25s;
}

@media (hover:hover) {
  html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):hover {
    transform: translateY(-3px) rotate(-.8deg);
    color: #702c1c;
  }
  html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):hover::after {
    opacity: .26;
    clip-path: inset(0);
  }
}

html[data-game-ui-ready] [data-game-ui]:focus-visible {
  outline: 2px dashed #8e2e25;
  outline-offset: 5px;
}
html[data-game-ui-ready] [data-game-ui]:focus:not(:focus-visible) {outline: none;}
html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):focus-visible::after {
  opacity: .26;
  clip-path: inset(0);
}
html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):is(:active,[data-game-ui-down=true]) {
  transform: translateY(2px) rotate(.3deg) scale(.97);
}
html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):is(:active,[data-game-ui-down=true])::after {
  opacity: .38;
  clip-path: inset(0);
}
html[data-game-ui-ready] [data-game-ui]:is([aria-pressed=true],[aria-selected=true],[aria-checked=true],[aria-current=page],[aria-expanded=true]),
html[data-game-ui-ready] details[open] > summary[data-game-ui] {color: var(--game-control-red);}
html[data-game-ui-ready] [data-game-ui]:is([aria-pressed=true],[aria-selected=true],[aria-checked=true],[aria-current=page],[aria-expanded=true],[data-game-ui-pulse=true])::after,
html[data-game-ui-ready] details[open] > summary[data-game-ui]::after {
  opacity: .29;
  clip-path: inset(0);
  transition: opacity .5s ease,clip-path .52s cubic-bezier(.18,.62,.24,1);
}
html[data-game-ui-ready] [data-game-ui]:is(:disabled,[aria-disabled=true]) {
  cursor: default;
  opacity: .48;
  transform: none;
  filter: none;
}
html[data-game-ui-ready] [data-game-ui]:is(:disabled,[aria-disabled=true])::after {opacity: 0;}

/* The source square controls already contain painted ink and torn paper. */
html[data-game-ui-ready] [data-game-ui=square],
html[data-game-ui-ready] [data-game-ui=language],
html[data-game-ui-ready] [data-game-ui=close] {
  --game-paper: var(--game-control-icons);
  --game-paper-position: 100% 100%;
  --game-paper-size: 400% 300%;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 16px;
  letter-spacing: 0;
}
html[data-game-ui-ready] [data-game-ui=language] {transition: transform .14s ease,color .2s,opacity .18s;}
@media(hover:hover) {
  html[data-game-ui-ready] [data-game-ui=language]:not(:disabled):hover {transform: translateY(-2px);}
  html[data-game-ui-ready] [data-game-ui=square]:not(:disabled):hover,
  html[data-game-ui-ready] [data-game-ui=close]:not(:disabled):hover {transform: translateY(-2px) rotate(-3deg);}
}
html[data-game-ui-ready] [data-game-ui=language]:not(:disabled):is(:active,[data-game-ui-down=true]) {transform: translateY(1px) scale(.96);}
html[data-game-ui-ready] [data-game-ui=square]:not(:disabled):is(:active,[data-game-ui-down=true],[aria-pressed=true]),
html[data-game-ui-ready] [data-game-ui=close]:not(:disabled):is(:active,[data-game-ui-down=true]) {transform: translateY(2px) rotate(4deg);}
html[data-game-ui-ready] [data-game-ui=close] {
  --game-paper-position: 66.666667% 0%;
  position: absolute;
  top: 17px;
  right: 18px;
  width: 48px;
  height: 48px;
  padding: 0;
  color: transparent;
  font-size: 0;
  z-index: 2;
}
html[data-game-ui-ready] [data-game-ui=close]:is(:hover,:focus-visible,:active) {color: transparent;}

/* The game also has bare ink links. Keep the brand and page-turn hit area. */
html[data-game-ui-ready] [data-game-ui=ink] {
  --game-paper: none;
  padding: 4px 0;
  color: #dec397;
}
html[data-game-ui-ready] [data-game-ui=ink]::before {content: none;}
html[data-game-ui-ready] [data-game-ui=ink]::after {
  inset: auto 0 0;
  height: 12px;
  -webkit-mask: none;
  mask: none;
  mix-blend-mode: normal;
  opacity: .1;
  clip-path: inset(0 48%);
  transition: clip-path .52s cubic-bezier(.18,.62,.24,1),opacity .25s;
}
html[data-game-ui-ready] [data-game-ui=ink]:is(:hover,:focus-visible)::after {
  opacity: .65;
  clip-path: inset(0);
}
html[data-game-ui-ready] [data-game-ui=ink]:hover {color: #f0d7a6;}
html[data-game-ui-ready] .skip[data-game-ui] {position: fixed;}
html[data-game-ui-ready] .scroll-cue[data-game-ui] {position: absolute;}

/* Header controls use the same live ink labels, with room for both languages. */
html[data-game-ui-ready] .site-header {gap: clamp(16px,3vw,44px);}
html[data-game-ui-ready] .site-header nav {
  gap: 9px;
  padding-left: 0;
  border: 0;
}
html[data-game-ui-ready] .site-header nav a[data-game-ui] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 16px;
  white-space: nowrap;
}
html[data-game-ui-ready] .utilities {gap: 14px;}
html[data-game-ui-ready] .languages {gap: 2px;}
html[data-game-ui-ready] .languages > span {display: none;}
html[data-game-ui-ready] .languages button[data-game-ui] {width: 44px;height: 44px;}
html[data-game-ui-ready] .account-link[data-game-ui] {
  min-width: 72px;
  padding: 11px 20px;
  gap: 0;
  font-size: 15px;
  border: 0;
}
html[data-game-ui-ready] .account-link svg {display: none;}
html[data-game-ui-ready] .account-link span {display: inline;}

html[data-game-ui-ready] .button[data-game-ui] {
  min-height: 62px;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  color: #493017;
  background: transparent;
  border: 0;
  clip-path: none;
  letter-spacing: .04em;
}
html[data-game-ui-ready] .paper-button[data-game-ui] {color: #773b26;}
html[data-game-ui-ready] .paper-button[data-game-ui]::after {
  opacity: .13;
  clip-path: inset(0);
}
html[data-game-ui-ready] .text-link[data-game-ui] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 26px;
  gap: 20px;
  border: 0;
  font-size: 16px;
  color: #4d3320;
  text-align: center;
}
html[data-game-ui-ready] .text-link[data-game-ui]:hover {gap: 20px;}
html[data-game-ui-ready] .theme .text-link[data-game-ui] {min-width: 168px;}
html[data-game-ui-ready] .purchase-row {gap: 16px;flex-wrap: wrap;}

/* Download rows remain one semantic link. Text stays on the flat paper centre. */
html[data-game-ui-ready] .download-row[data-game-ui] {
  display: flex;
  min-height: 116px;
  padding: 25px 34px;
  margin-bottom: 13px;
  gap: 22px;
  color: #392316;
}
html[data-game-ui-ready] .download-row :is(strong,small,.platform-mark,.download-label) {color: #493017;}
html[data-game-ui-ready] .download-row .download-format {color: #735138;}
html[data-game-ui-ready] .android-mark {border: 0;}
html[data-game-ui-ready] .download-label {font-weight: 700;}

html[data-game-ui-ready] .faq details {padding: 0;margin-bottom: 12px;border: 0;}
html[data-game-ui-ready] .faq summary[data-game-ui] {
  display: block;
  padding: 19px 58px 19px 28px;
  min-height: 66px;
  font-size: 16px;
  font-weight: 600;
}
html[data-game-ui-ready] .faq summary::marker {content: '';}
.game-ui-disclosure {
  position: absolute;
  right: 27px;
  top: 50%;
  display: block;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform .16s;
}
html:not([data-game-ui-ready]) .game-ui-disclosure {display: none;}
details[open] > summary .game-ui-disclosure {transform: translateY(-50%) rotate(45deg);}
html[data-game-ui-ready] .faq details p {margin: 16px 26px 22px;font-family: var(--game-reading-font);}
html[data-game-ui-ready] .faq details[open] > p {animation: game-ui-unfold .38s cubic-bezier(.2,.7,.25,1) both;}
@keyframes game-ui-unfold {from {opacity:0;transform:translateY(11px)}to {opacity:1;transform:translateY(0)}}
html[data-game-ui-ready] .footer-links {gap: 8px;}
html[data-game-ui-ready] .footer-links button[data-game-ui] {padding: 11px 19px;min-height: 44px;font-size: 13px;}

/* The unchanged current title-settings paper replaces the rectangular modal. */
html[data-game-ui-ready] dialog {
  background: transparent;
  color: #352a1f;
  border: 0;
  box-shadow: none;
  padding: 0;
  width: min(700px,calc(100% - 24px));
  max-height: calc(100svh - 24px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #94724d88 transparent;
  translate: 100vw 0;
  opacity: 0;
  transition: translate .26s ease-in,opacity .26s ease-in,display .26s allow-discrete,overlay .26s allow-discrete;
}
html[data-game-ui-ready] dialog[open] {
  translate: 0 0;
  opacity: 1;
  transition: translate .34s cubic-bezier(.2,.8,.24,1),opacity .2s ease-out,display .34s allow-discrete,overlay .34s allow-discrete;
}
@starting-style {
  html[data-game-ui-ready] dialog[open] {translate: 100vw 0;opacity: 0;}
}
html[data-game-ui-ready] dialog::backdrop {background: #0c0906bd;backdrop-filter: none;}
html[data-game-ui-ready] .dialog-frame {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  padding: 62px 65px 60px;
  background: transparent;
  font-family: var(--game-reading-font);
  color: #352a1f;
}
html[data-game-ui-ready] .dialog-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
html[data-game-ui-ready] dialog[data-game-ui-paper-ready] .dialog-frame::before {
  background: var(--game-dialog-paper) center / 100% 100% no-repeat;
}
html[data-game-ui-ready] .dialog-frame h2 {
  margin-right: 10px;
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: .05em;
}
html[data-game-ui-ready] .dialog-frame :is(p,li) {
  font-family: var(--game-reading-font);
  font-size: 16px;
  line-height: 1.8;
}
html[data-game-ui-ready] .dialog-frame .notice {
  border-left: 2px solid #8a4433;
  padding: 4px 0 4px 13px;
  background: transparent;
  color: #67452c;
  font-size: 14px;
}
html[data-game-ui-ready] .dialog-frame .button[data-game-ui] {font-size: 17px;min-height: 58px;padding-inline: 26px;}
html[data-game-ui-ready] .dialog-frame .text-link[data-game-ui] {font-size: 15px;}
html[data-game-ui-ready] .dialog-actions {gap: 12px;align-items: center;}
html[data-game-ui-ready] .auth-tabs {border: 0;gap: 12px;margin-top: 22px;}
html[data-game-ui-ready] .auth-tabs button[data-game-ui] {min-width: 100px;padding: 13px 24px;border: 0;font-size: 17px;}
html[data-game-ui-ready] .auth-form {gap: 18px;}
html[data-game-ui-ready] .auth-form :is(label,input,button),
html[data-game-ui-ready] .auth-tabs button,
html[data-game-ui-ready] .account-email {font-family: var(--game-ui-font);}
html[data-game-ui-ready] .field {font-family: var(--game-ui-font);font-size: 15px;gap: 5px;}
html[data-game-ui-ready] .field input {
  min-height: 60px;
  padding: 15px 28px;
  border: 0;
  background: var(--game-control-paper) center / 100% 100% no-repeat;
  color: #302014;
  font-family: var(--game-ui-font);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
  border-radius: 0;
}
html[data-game-ui-ready] .field input:focus-visible {outline: none;}
html[data-game-ui-ready] .field input:disabled {opacity: .48;}
html[data-game-ui-ready] input[type=checkbox] {width: 23px;height: 23px;margin: 0;accent-color: #65482b;flex-shrink: 0;}
html[data-game-ui-ready] .demo-checkbox {min-height: 44px;line-height: 1.5;}
html[data-game-ui-ready] .vision-controls {gap: 9px;}
html[data-game-ui-ready] .vision-controls button[data-game-ui] {width: 50px;height: 50px;font: italic 700 20px var(--game-reading-font);}
html[data-game-ui-ready] .ownership {border-color: #795a3b52;}
html[data-game-ui-ready] .dialog-frame .hash {font-family: var(--game-reading-font);font-size: 12px;}

/* Keep semantic state stronger than later size/context variants. */
html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):is([aria-pressed=true],[aria-selected=true],[aria-checked=true],[aria-current=page],[aria-expanded=true]),
html[data-game-ui-ready] details[open] > summary[data-game-ui] {color: var(--game-control-red);}
html[data-game-ui-ready] [data-game-ui]:where(:not(:disabled):not([aria-disabled=true])):is([aria-pressed=true],[aria-selected=true],[aria-checked=true],[aria-current=page],[aria-expanded=true],[data-game-ui-pulse=true])::after {
  opacity: .29;
  clip-path: inset(0);
}

@media(max-width:1120px) {
  html[data-game-ui-ready] .site-header {gap: 18px;}
  html[data-game-ui-ready] .site-header nav {gap: 4px;}
  html[data-game-ui-ready] .site-header nav a[data-game-ui] {font-size: 14px;padding-inline: 14px;}
  html[data-game-ui-ready] .utilities {gap: 8px;}
  html[data-game-ui-ready] .account-link[data-game-ui] {min-width: 60px;padding-inline: 14px;}
}
@media(max-width:800px) {
  html[data-game-ui-ready] .site-header {gap: 12px;}
  html[data-game-ui-ready] .site-header nav {display: none;}
  html[data-game-ui-ready] .button[data-game-ui] {min-width: 0;}
}
@media(max-width:540px) {
  html[data-game-ui-ready] .site-header {margin-inline: 16px;gap: 8px;}
  html[data-game-ui-ready] .brand[data-game-ui] {gap: 7px;min-height: 44px;}
  html[data-game-ui-ready] .utilities {gap: 5px;}
  html[data-game-ui-ready] .languages button[data-game-ui] {font-size: 14px;}
  html[data-game-ui-ready] .account-link[data-game-ui] {min-width: 44px;padding-inline: 11px;font-size: 12px;}
  html[data-game-ui-ready] .hero-actions .button[data-game-ui] {padding: 15px 23px;font-size: 17px;min-height: 60px;}
  html[data-game-ui-ready] .text-link[data-game-ui] {padding: 12px 24px;font-size: 15px;gap: 16px;}
  html[data-game-ui-ready] .download-row[data-game-ui] {padding: 22px 24px;gap: 13px;min-height: 104px;}
  html[data-game-ui-ready] .download-row .platform-mark {width: 26px;font-size: 27px;}
  html[data-game-ui-ready] .download-row .android-mark {font-size: 21px;}
  html[data-game-ui-ready] .download-row strong {font-size: 18px;}
  html[data-game-ui-ready] .download-row small {font-size: 13px;}
  html[data-game-ui-ready] .download-label {font-size: 13px;}
  html[data-game-ui-ready] .download-format {font-size: 11px;}
  html[data-game-ui-ready] .faq summary[data-game-ui] {font-size: 15px;padding: 18px 45px 18px 24px;}
  html[data-game-ui-ready] .game-ui-disclosure {right: 23px;}
  html[data-game-ui-ready] .dialog-frame {padding: 58px 30px 48px;}
  html[data-game-ui-ready] .dialog-frame h2 {font-size: 25px;}
  html[data-game-ui-ready] .dialog-frame :is(p,li) {font-size: 15px;}
  html[data-game-ui-ready] [data-game-ui=close] {top: 11px;right: 11px;}
  html[data-game-ui-ready] .dialog-actions > .button[data-game-ui] {max-width: 100%;font-size: 15px;padding-inline: 23px;}
  html[data-game-ui-ready] .footer-links button[data-game-ui] {padding-inline: 18px;}
  html[lang=en][data-game-ui-ready] .brand[data-game-ui] {font-size: 13px;letter-spacing: 0;}
  html[lang=en][data-game-ui-ready] .hero-actions .button[data-game-ui] {font-size: 16px;}
  html[lang=en][data-game-ui-ready] .download-row[data-game-ui] {padding-inline: 22px;gap: 10px;}
}

@media(prefers-reduced-motion:reduce) {
  html[data-game-ui-ready]:not([data-reduced-motion]) [data-game-ui],html[data-game-ui-ready]:not([data-reduced-motion]) [data-game-ui]::before,html[data-game-ui-ready]:not([data-reduced-motion]) [data-game-ui]::after,
  html[data-game-ui-ready]:not([data-reduced-motion]) dialog,html[data-game-ui-ready]:not([data-reduced-motion]) .game-ui-disclosure,html[data-game-ui-ready]:not([data-reduced-motion]) .faq details[open] > p {transition: none!important;animation: none!important;}
  html[data-game-ui-ready]:not([data-reduced-motion]) [data-game-ui]:is(:hover,:active,[data-game-ui-down=true]) {transform: none!important;}
}
html[data-game-ui-ready][data-reduced-motion=true] [data-game-ui],
html[data-game-ui-ready][data-reduced-motion=true] [data-game-ui]::before,
html[data-game-ui-ready][data-reduced-motion=true] [data-game-ui]::after,
html[data-game-ui-ready][data-reduced-motion=true] dialog,
html[data-game-ui-ready][data-reduced-motion=true] .game-ui-disclosure,
html[data-game-ui-ready][data-reduced-motion=true] .faq details[open] > p {transition: none!important;animation: none!important;}
html[data-game-ui-ready][data-reduced-motion=true] [data-game-ui]:is(:hover,:active,[data-game-ui-down=true]) {transform: none!important;}
