:root {
  --gold: #e8c56b;
  --gold-2: #c9a24a;
  --line: #168c24;
  --ink: #f4e7c5;
  --muted: rgba(244, 231, 197, 0.72);
  --panel: rgba(12, 10, 8, 0.55);
  --field: rgba(10, 8, 6, 0.82);
  --stroke: rgba(216, 180, 90, 0.35);
  --art-h: 1792;
  --line-w: 674;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #050403;
  color: var(--ink);
  font-family: "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", "PingFang SC", "Hiragino Sans", "Yu Gothic", sans-serif;
}
body {
  min-height: 100svh;
  background: url("/assets/bg-h5.jpg") center top / cover no-repeat #050403;
  overflow: hidden;
}

.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom));
  position: relative;
}

.panel, .home, .langs {
  width: min(86vw, calc(var(--line-w) / var(--art-h) * 100vh));
}

.panel, .home { padding-bottom: 0; }

/* Official mocks have no card/frame around the login cluster. */
.panel,
#auth-panel,
#login-form,
.stack:not(.sheet) {
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}


.stack { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.field {
  display: block;
  width: 100%;
}
.field input {
  width: 100%;
  height: 56px;
  border: 1.5px solid #e4bc62;
  border-radius: 16px;
  background: var(--field);
  color: #f7ead0;
  padding: 0 18px;
  font-size: 15px;
  outline: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 7px 1px rgba(232, 190, 80, 0.5),
    0 0 18px 2px rgba(200, 150, 40, 0.22),
    inset 0 1px 0 rgba(255, 236, 180, 0.5);
}
.field input::placeholder { color: rgba(200, 196, 186, 0.72); }
.field input:focus {
  border-color: #f3d58a;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 10px 2px rgba(242, 210, 120, 0.6),
    0 0 22px 3px rgba(200, 150, 40, 0.28),
    inset 0 1px 0 rgba(255, 236, 180, 0.6);
}

.btn-gold {
  appearance: none;
  width: calc(100% + 42px);
  margin-left: -21px;
  height: auto;
  aspect-ratio: 768 / 133;
  border: 0;
  cursor: pointer;
  color: #fff8ee;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 17px;
  text-indent: 0.16em;
  border-radius: 0;
  position: relative;
  background-color: transparent;
  background-image: url("/assets/login-btn.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  box-shadow: none;
  filter: drop-shadow(0 0 10px rgba(232, 190, 80, 0.55));
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-gold::before,
.btn-gold::after { content: none; display: none; }
.btn-gold.slim {
  letter-spacing: 0.06em;
  text-indent: 0;
  font-size: 15px;
  width: 100%;
  margin-left: 0;
  height: auto;
}
.btn-gold.start { margin-top: 14px; letter-spacing: 0.06em; text-indent: 0; }
.btn-gold:active {
  filter: brightness(0.94) drop-shadow(0 0 10px rgba(232, 190, 80, 0.55));
  transform: translateY(1px);
}

.btn-line {
  appearance: none;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--line);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.line-icon {
  width: 26px;
  height: 26px;
  display: block;
  flex: none;
  object-fit: contain;
}
.line-mark { display: none; }
.btn-dark {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(30, 22, 14, 0.9);
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(30, 22, 14, 0.9);
  color: var(--gold);
  cursor: pointer;
}

.row-links {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px 0;
}
.text-link {
  background: none;
  border: 0;
  color: rgba(244, 231, 197, 0.9);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  align-self: center;
}
.agree {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  padding: 0 2px;
}
.agree input { margin-top: 2px; flex: none; accent-color: var(--gold); }
.agree a { color: var(--gold); }
.hint { color: #f3c27a; font-size: 12px; min-height: 0; }

/* .stack / .home 的 display:flex 会盖掉 UA 对 hidden 属性的 display:none，必须强制隐藏 */
[hidden] {
  display: none !important;
}

.code-row { display: flex; gap: 8px; }
.grow { flex: 1; }

.sheet {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 12px 16px;
  backdrop-filter: blur(8px);
}

.home { display: flex; flex-direction: column; gap: 10px; }
.welcome { font-size: 13px; color: var(--muted); text-align: center; }
.ref-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(8px);
}
.ref-label { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.ref-row { display: flex; gap: 8px; align-items: center; }
.ref-val {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--gold);
  word-break: break-all;
}
.ref-val.link { font-size: 11px; color: var(--ink); }
.subs { list-style: none; font-size: 12px; color: var(--muted); }
.subs li { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }

.langs {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  padding: 8px 0 2px;
}
.langs a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  text-decoration: none;
  color: #f6e7c4;
  font-size: 14px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1.5px solid #e0b54a;
  background: rgba(12, 10, 8, 0.88);
  box-shadow: 0 0 8px rgba(232, 190, 80, 0.22);
}
.langs a.on {
  background: linear-gradient(180deg, rgba(232, 197, 107, 0.32), rgba(80, 55, 16, 0.62));
  border-color: #f0cc6a;
  color: #fff4d4;
}

dialog {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #16110c;
  color: var(--ink);
  width: min(92vw, 420px);
  padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,0.65); }
dialog article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
dialog h2 { font-size: 16px; font-weight: 700; }
#doc-close {
  background: none;
  border: 0;
  color: var(--gold);
  cursor: pointer;
}
.doc-body { padding: 14px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; max-height: 60vh; overflow: auto; }

@media (min-width: 900px) {
  html, body { overflow: auto; }
  body {
    background: url("/assets/bg-pc.jpg") center center / cover no-repeat #050403;
  }
  .stage {
    max-width: none;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px 24px;
  }
  .panel, .home {
    width: min(340px, 28vw);
    margin-top: calc(100vh * 544 / 1008 + 16px);
    padding-bottom: 0;
  }
  .langs {
    width: min(340px, 28vw);
    margin-top: 8px;
    padding-top: 4px;
    gap: 8px;
  }
  .stack { gap: 7px; }
  .field input {
    height: 46px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid rgba(196, 168, 96, 0.5);
    background: rgba(8, 6, 5, 0.88);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.4),
      0 0 5px rgba(180, 140, 50, 0.16),
      inset 0 1px 0 rgba(255, 230, 170, 0.2);
  }
  .field input:focus {
    border-color: rgba(220, 190, 110, 0.75);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.4),
      0 0 8px rgba(210, 170, 80, 0.28),
      inset 0 1px 0 rgba(255, 230, 170, 0.28);
  }
  .btn-gold {
    width: calc(100% + 36px);
    margin-left: -18px;
    height: auto;
    font-size: 16px;
  }
  .btn-line {
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
  }
  .line-icon { width: 22px; height: 22px; }
  .agree { font-size: 10px; }
  .text-link { font-size: 13px; }
  .langs a {
    padding: 8px 4px;
    font-size: 13px;
    border-radius: 12px;
  }
}
