:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: #f3f5f8;
  color: #17212b;
  --auth-void: #f3f5f8;
  --auth-panel: #fff;
  --auth-table-blue: #8fb7d6;
  --auth-line: #c7ad78;
  --auth-gold: #936b2d;
  --auth-gold-strong: #6f4d16;
  --auth-player: #2867b5;
  --auth-banker: #c64f5d;
  --auth-tie: #2e8b61;
  --auth-focus: #235ba7;
  --auth-text: #17212b;
  --auth-muted: #5d6875;
  --auth-danger: #8d2430;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--auth-void);
  color: var(--auth-text);
}

button,
input {
  font: inherit;
}

.player-auth-background,
.player-auth-scene,
.player-auth-shade {
  position: fixed;
  inset: 0;
}

.player-auth-background {
  z-index: 0;
  overflow: hidden;
  background: var(--auth-table-blue);
}

.player-auth-scene {
  opacity: 0;
  animation: player-auth-scene-cycle 30s linear infinite;
}

.player-auth-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.78) contrast(0.94) brightness(0.98);
}

.player-auth-scene--a {
  opacity: 0.52;
  animation-delay: 0s;
}

.player-auth-scene--b {
  animation-delay: 10s;
}

.player-auth-scene--c {
  animation-delay: 20s;
}

.player-auth-shade {
  background: linear-gradient(
    90deg,
    rgb(243 245 248 / 0.3) 0%,
    rgb(243 245 248 / 0.54) 48%,
    rgb(243 245 248 / 0.76) 100%
  );
}

.player-auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  grid-template-rows: auto 1fr auto;
  gap: 32px 7vw;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}

.player-auth-brand {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
}

.player-auth-mark {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.player-auth-brand-copy {
  display: grid;
  gap: 3px;
}

.player-auth-brand strong {
  color: var(--auth-text);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.player-auth-brand small {
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.player-auth-card {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  width: 100%;
  padding: clamp(30px, 4vw, 52px);
  border: 1px solid rgb(147 107 45 / 0.34);
  border-top: 3px solid var(--auth-line);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 24px 70px rgb(46 58 72 / 0.2);
}

.player-auth-kicker {
  margin: 0 0 14px;
  color: var(--auth-player);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.player-auth-card h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(31px, 4vw, 44px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.player-auth-description {
  margin: 14px 0 28px;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.7;
}

.player-auth-notice,
.player-auth-error {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--auth-gold);
  border-radius: 0 8px 8px 0;
  background: rgb(147 107 45 / 0.1);
  color: var(--auth-text);
  font-size: 14px;
  line-height: 1.55;
}

.player-auth-error {
  border-left-color: var(--auth-banker);
  background: rgb(198 79 93 / 0.12);
  color: var(--auth-danger);
}

.player-auth-form,
.player-auth-field {
  display: grid;
}

.player-auth-form {
  gap: 20px;
}

.player-auth-field {
  gap: 8px;
}

.player-auth-field span {
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 650;
}

.player-auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #cbd3dd;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--auth-text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.player-auth-field input:hover {
  border-color: #8d99a6;
}

.player-auth-field input:focus-visible {
  border-color: var(--auth-focus);
  box-shadow: 0 0 0 3px rgb(35 91 167 / 0.18);
  background: #fff;
}

.player-auth-requirement {
  margin: -8px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.5;
}

.player-auth-submit {
  min-height: 52px;
  margin-top: 6px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: #17212b;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease, opacity 150ms ease;
}

.player-auth-submit:hover {
  background: var(--auth-player);
}

.player-auth-submit:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 3px;
}

.player-auth-submit:active {
  transform: translateY(1px);
}

.player-auth-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.player-auth-dialog {
  width: min(calc(100% - 32px), 420px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--auth-panel);
  color: var(--auth-text);
  box-shadow: 0 24px 70px rgb(23 33 43 / 0.28);
}

.player-auth-dialog::backdrop {
  background: rgb(23 33 43 / 0.55);
}

.player-auth-dialog-content {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.player-auth-dialog h2,
.player-auth-dialog p {
  margin: 0;
}

.player-auth-dialog h2 {
  font-size: 24px;
  line-height: 1.35;
}

.player-auth-dialog p {
  color: var(--auth-muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.player-auth-dialog-confirm {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--auth-gold-strong);
  border-radius: 8px;
  background: var(--auth-gold-strong);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.player-auth-dialog-confirm:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 3px;
}

.player-auth-secondary-link {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--auth-player);
  text-underline-offset: 4px;
}

.player-auth-secondary-link:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 3px;
}

.player-auth-support {
  margin: 24px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.player-auth-footer {
  grid-column: 1;
  align-self: end;
  color: var(--auth-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.auth-rotation-paused .player-auth-scene,
.player-auth-page:has(.player-auth-form:focus-within) .player-auth-scene {
  animation-play-state: paused;
}

@keyframes player-auth-scene-cycle {
  0%, 30% { opacity: 0.52; }
  33.333%, 96.666% { opacity: 0; }
  100% { opacity: 0.52; }
}

@media (max-width: 900px) {
  .player-auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
    gap: 24px;
  }
}

@media (max-width: 699px) {
  .player-auth-shade {
    background: linear-gradient(
      180deg,
      rgb(243 245 248 / 0.58) 0%,
      rgb(243 245 248 / 0.72) 100%
    );
  }

  .player-auth-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .player-auth-brand {
    min-height: 48px;
  }

  .player-auth-mark {
    width: 52px;
    height: 52px;
  }

  .player-auth-card {
    width: min(100%, 460px);
    margin: auto;
    padding: 28px 22px;
  }

  .player-auth-card h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .player-auth-footer {
    align-self: center;
  }
}

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

  .player-auth-scene {
    animation: none;
    opacity: 0;
  }

  .player-auth-scene--a {
    opacity: 1;
  }
}
