:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #533a26;
  background: #251c18;
  font-synthesis: none;
  --gold: #e9bd67;
  --brown: #694726;
  --paper: #f7e8c4;
  --line: #ceac70;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #b87123;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.game-stage {
  position: relative;
  height: 100dvh;
  width: min(100vw, calc(100dvh * 750 / 1334));
  margin: auto;
  overflow: hidden;
  background: #34221b;
}
#game-host,
#game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.entry-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #271b17;
  color: #f7d89b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12vh 12px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  text-align: center;
}
.entry-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(26, 15, 12, 0.35),
      transparent 42%,
      #281b16 86%
    ),
    url("/platform/game-cover.jpg") 52% 40% / auto 100% no-repeat;
  opacity: 0.8;
  z-index: -1;
}
.entry-title {
  width: 86%;
  max-width: 560px;
  flex-shrink: 0;
}
.entry-title img {
  display: block;
  width: 100%;
  height: auto;
}
.entry-actions {
  width: 100%;
  max-width: 300px;
  margin-top: auto;
  margin-bottom: 28px;
  flex-shrink: 0;
}
.entry-actions > p:first-child {
  font-size: 13px;
  min-height: 24px;
  margin-bottom: 18px;
}
.entry-footer {
  width: 100%;
  flex-shrink: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: clamp(10px, 3vw, 12px);
  line-height: 1.6;
  color: #dfc4a1;
}
.entry-footer .publication-info {
  margin-top: 8px;
  font-size: clamp(8px, 2.25vw, 10px);
  color: #c6ad91;
  line-height: 1.6;
}
.gold-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  background: linear-gradient(#f9da87, #dba346);
  border: 2px solid #8d5627;
  border-radius: 10px;
  color: #613716;
  font-family: "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 21px;
  font-weight: bold;
  box-shadow:
    inset 0 1px 0 #fff2bf,
    0 3px 0 #663b20;
  text-shadow: 0 1px #ffe5a6;
}
.gold-button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 #fff2bf,
    0 2px 0 #663b20;
}
dialog {
  width: calc(100vw - 32px);
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 3px solid #8d643b;
  border-radius: 16px;
  background: var(--paper);
  color: #533a26;
  box-shadow:
    0 0 0 2px #d2ad71,
    0 20px 70px #160d0ba6;
}
dialog::backdrop {
  background: #160d0b99;
}
.sheet-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 15px 54px;
  background: #e8c78f;
  border-bottom: 2px solid #b7874c;
}
.sheet-heading h2 {
  font-family: "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  color: #614020;
  text-shadow: 0 1px #fff3ce;
}
.icon-button {
  position: absolute;
  top: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #82512d;
  font-size: 33px;
  line-height: 1;
}
.icon-button.close {
  right: 8px;
}
.icon-button.back {
  left: 8px;
}
.sheet-body {
  padding: 25px;
}
.sheet-intro {
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
  color: #8a6948;
  margin-bottom: 22px;
}
.game-form {
  display: grid;
  gap: 10px;
}
.game-form label,
.sheet-body > label {
  font-size: 13px;
  font-weight: bold;
}
.game-form .gold-button {
  margin-top: 10px;
}
input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8a66e;
  background: #fff8e6;
  color: #533a26;
  border-radius: 7px;
  padding: 11px 12px;
  font-size: 14px;
}
input::placeholder {
  color: #a58a64;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 56px;
}
.password-field button {
  position: absolute;
  right: 2px;
  top: 2px;
  height: 42px;
  background: none;
  border: 0;
  color: #8d632f;
  padding: 0 10px;
  font-size: 12px;
}
.text-button {
  display: block;
  border: 0;
  background: none;
  color: #875526;
  padding: 12px;
  margin: 8px auto 0;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.auth-switch {
  margin-top: 16px;
}
.form-error {
  color: #a63526;
  font-size: 13px;
  line-height: 1.6;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.fine-print {
  color: #92754f;
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 15px;
}
.notice {
  font-size: 13px;
  line-height: 1.8;
  padding: 13px;
  background: #ecd6aa;
  border: 1px solid #d7b880;
  border-radius: 6px;
  margin-bottom: 18px;
}
.game-products {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.game-product {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
  border: 1px solid #ceac70;
  border-radius: 10px;
  background: #fff3d5;
  box-shadow: inset 0 0 0 3px #f2dfb2;
}
.jade-coin {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  color: #318c65;
  font-size: 41px;
  text-shadow:
    1px 2px #225137,
    -1px -1px #a6e6a0;
}
.game-product h3 {
  font-size: 15px;
  font-family: "STKaiti", "KaiTi", "SimSun", serif;
  margin-bottom: 7px;
}
.game-product p {
  font-size: 11px;
  color: #8a6842;
}
.game-product strong {
  font-family: Georgia, serif;
  font-size: 21px;
  color: #674525;
}
.game-product button {
  padding: 9px 11px;
  min-height: 40px;
  min-width: 70px;
  border: 1px solid #98642b;
  border-radius: 7px;
  background: #efc16a;
  color: #5b341c;
  font-weight: bold;
  font-size: 15px;
  box-shadow: 0 2px #9b642e;
}
.order-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  text-align: left;
  gap: 12px;
  background: none;
  border: 0;
  border-bottom: 1px solid #d6bc8e;
  padding: 18px 0;
  color: #5f4128;
  font-size: 14px;
}
.order-item > span:last-child {
  text-align: right;
}
.order-item small {
  display: block;
  font-size: 11px;
  color: #927854;
  margin-top: 8px;
}
.order-item .paid {
  color: #30794c;
}
.empty-state {
  padding: 35px 0;
  text-align: center;
  color: #927854;
}
.checkout {
  text-align: center;
}
.jade-coin.large {
  margin: 0 auto 14px;
  font-size: 57px;
  width: 65px;
  height: 70px;
}
.checkout h3 {
  font-size: 21px;
  margin-bottom: 10px;
}
.checkout > p {
  line-height: 1.8;
  font-size: 14px;
}
.checkout-price {
  display: block;
  font-family: Georgia, serif;
  font-size: 36px;
  color: #8e561c;
  margin: 18px 0;
}
.checkout .gold-button {
  margin-top: 15px;
}
.qr {
  width: 240px;
  max-width: 100%;
  display: block;
  margin: 20px auto;
  border: 6px solid white;
  border-radius: 6px;
}
.order-number {
  overflow-wrap: anywhere;
}
.player-profile {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0 0 24px;
}
.profile-seal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: #784e30;
  color: #f0cf8c;
  border: 3px double #d3a762;
  border-radius: 12px;
  font-family: "KaiTi", "SimSun", serif;
  font-size: 32px;
}
.player-profile h3 {
  font-size: 19px;
  margin-bottom: 8px;
}
.player-profile p {
  font-size: 12px;
  color: #92754f;
}
.setting-list {
  display: grid;
  gap: 10px;
}
.setting-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px;
  background: #fff3d5;
  border: 1px solid #ceac70;
  border-radius: 8px;
  color: #624024;
  text-align: left;
  font-size: 15px;
}
.setting-list span {
  font-size: 22px;
  color: #a77d49;
}
#toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(25px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 12px 20px;
  background: #3b251ee8;
  color: #ffdfac;
  border: 1px solid #b18b50;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.7;
  z-index: 1000;
  pointer-events: none;
}
#toast.visible {
  display: block;
}
.loading {
  padding: 35vh 20px;
  text-align: center;
  color: #e8c78f;
}
@media (max-width: 600px) {
  .game-stage {
    width: 100vw;
  }
  .sheet-body {
    padding: 20px;
  }
  .sheet-heading h2 {
    font-size: 25px;
  }
  .entry-screen {
    padding-top: 14vh;
  }
  .game-product {
    gap: 9px;
  }
}
@media (max-height: 580px) {
  .entry-screen {
    padding: 24px 12px 12px;
  }
  .entry-title {
    max-width: 340px;
  }
  .sheet-heading {
    min-height: 56px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .icon-button {
    top: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .gold-button:active {
    transform: none;
  }
}
