html[data-access-stage="loading"] #shell,
html[data-access-stage="terms"] #shell,
html[data-access-stage="auth"] #shell {
  visibility: hidden;
}

#shell {
  min-height: 100dvh;
}

#gameAccessGate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  color: #f7efe3;
  background:
    radial-gradient(circle at 50% 12%, rgba(206, 158, 67, .18), transparent 34%),
    linear-gradient(145deg, #201d19, #121212 68%);
}

#gameAccessGate[hidden],
.gameAccessStage[hidden],
#gameAccessRetry[hidden] {
  display: none !important;
}

html[data-access-stage="claim"] #gameAccessGate,
html[data-access-stage="paused"] #gameAccessGate {
  background: rgba(20, 18, 16, .72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gameAccessCard {
  width: min(460px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 30px 28px;
  border: 1px solid rgba(226, 186, 104, .35);
  border-radius: 28px;
  text-align: center;
  background: rgba(31, 29, 26, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .08);
}

.gameAccessMark {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 24px;
  color: #211a11;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #f2cf77, #bd812d);
  box-shadow: 0 12px 28px rgba(218, 166, 65, .25);
}

.gameAccessCard h1 {
  margin: 0 0 9px;
  font: 800 1.42rem/1.2 system-ui, sans-serif;
}

.gameAccessCard p {
  color: #c8baaa;
  font: 500 .94rem/1.55 system-ui, sans-serif;
}

.gameAccessStage { margin-top: 16px; }
.gameAccessPulse { width: 46px; height: 6px; margin: 20px auto; overflow: hidden; border-radius: 999px; background: #443a2d; }
.gameAccessPulse::after { content: ''; display: block; width: 45%; height: 100%; border-radius: inherit; background: #dfaf52; animation: accessLoad 1.1s ease-in-out infinite alternate; }
.gameAccessCheck { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 17px 0 8px; color: #f7efe3; text-align: left; font: 600 .9rem/1.45 system-ui, sans-serif; }
.gameAccessCheck input { width: 20px; height: 20px; margin-top: 1px; accent-color: #d9a342; }
.gameAccessLegal { margin-top: 9px !important; font-size: .82rem !important; }
.gameAccessLegal a { color: #f0c76e; font-weight: 800; }
.gameAccessActions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 17px; }
.gameAccessForm { display: grid; gap: 9px; margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(242, 207, 119, .18); text-align: left; }
.gameAccessForm label { color: #c8baaa; font: 800 .8rem/1.3 system-ui, sans-serif; }
.gameAccessInput { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #675a48; border-radius: 13px; color: #f7efe3; background: #24211d; font: inherit; }
.gameAccessButton,
.gameAccessLink { display: inline-flex; min-height: 44px; padding: 10px 16px; align-items: center; justify-content: center; border: 0; border-radius: 999px; color: #201a12; background: linear-gradient(135deg, #f0c76e, #c88b32); font: 800 .9rem/1 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.gameAccessButtonSecondary,
.gameAccessLink { color: #f0c76e; background: #3a3125; }
.gameAccessButton:disabled { cursor: not-allowed; opacity: .48; }
.gameAccessButton:focus-visible,
.gameAccessLink:focus-visible,
.gameAccessInput:focus-visible,
.gameAccessCheck input:focus-visible,
.gameAccessCard:focus-visible { outline: 3px solid #f0c76e; outline-offset: 3px; }
#gameAccessStatus { min-height: 1.45em; margin-top: 14px; color: #c8baaa; font-weight: 700; }
.gameAccessExit { margin-top: 15px; }

.homeReturnLink {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 199, 110, .38);
  border-radius: 999px;
  color: #f7e8c5;
  background: rgba(24, 22, 19, .82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font: 800 .78rem/1 system-ui, sans-serif;
  text-decoration: none;
}

.homeReturnLink:hover { background: rgba(58, 47, 33, .92); }
.homeReturnLink:focus-visible { outline: 3px solid #f0c76e; outline-offset: 3px; }
.homeReturnLink::before { content: '←'; margin-right: 7px; font-size: 1rem; }

@keyframes accessLoad { from { transform: translateX(-10%); } to { transform: translateX(130%); } }

@media (max-width: 640px) {
  #gameAccessGate { padding: 12px; }
  .gameAccessCard { max-height: calc(100dvh - 24px); padding: 24px 18px; border-radius: 22px; }
  .homeReturnLink { min-width: 42px; padding: 0 12px; font-size: 0; }
  .homeReturnLink::before { margin-right: 0; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gameAccessPulse::after { animation: none; transform: translateX(55%); }
}
