:root {
  --text: #f7fbff;
  --muted: rgba(239, 248, 255, 0.78);
  --glass: rgba(8, 25, 43, 0.56);
  --glass-border: rgba(255, 255, 255, 0.18);
  --green: #5cf573;
  --blue: #46b7ff;
  --warning: #ffcf66;
  --warning-bg: rgba(255, 196, 62, 0.14);
  --warning-border: rgba(255, 208, 102, 0.34);
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  height: 100%;
  background: #0b2235;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b2235;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.background,
.shade {
  position: fixed;
  inset: 0;
}

.background {
  z-index: -3;
  background-image: url("assets/background.svg");
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
  animation: background-breathe 16s ease-in-out infinite alternate;
}

.shade {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 35%, rgba(22, 96, 150, 0.08), transparent 42%),
    linear-gradient(90deg, rgba(4, 17, 31, 0.76) 0%, rgba(5, 24, 42, 0.48) 50%, rgba(4, 17, 31, 0.76) 100%),
    linear-gradient(180deg, rgba(4, 16, 27, 0.14), rgba(3, 14, 24, 0.7));
}

.page-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.3vh, 22px) clamp(12px, 2.6vw, 28px);
}

.hero {
  width: min(920px, 100%);
  max-height: none;
  padding: clamp(18px, 2.2vh, 26px) clamp(18px, 2.8vw, 34px) clamp(16px, 2vh, 22px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  animation: hero-enter 0.55s cubic-bezier(.2,.8,.2,1) both;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  top: -330px;
  left: 50%;
  translate: -50% 0;
  border-radius: 50%;
  background: rgba(87, 245, 118, 0.24);
  filter: blur(75px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  margin: 22px auto 14px;
  padding: 9px 15px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.brand__mark {
  width: 24px;
  height: 32px;
  position: relative;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(61, 255, 100, 0.35));
}

.brand__diamond {
  position: absolute;
  left: 50%;
  width: 17px;
  height: 17px;
  background: linear-gradient(135deg, #a2ff8b, #18c74f 72%);
  transform: translateX(-50%) rotate(45deg) skew(-8deg, -8deg);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.brand__diamond--top { top: 2px; }
.brand__diamond--bottom { bottom: 2px; }

.brand__text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero__content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

h1 span {
  color: var(--green);
  white-space: nowrap;
}

h1 b {
  font-size: 0.63em;
  vertical-align: 0.23em;
}

.game-art {
  width: min(430px, 100%);
  margin: 18px auto 0;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.035));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38), 0 0 28px rgba(70, 183, 255, 0.16);
  transform: translateZ(0);
}

.game-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04) brightness(1.02);
}

.lead {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
  text-wrap: balance;
}

.lead strong {
  color: #fff;
}

.notice {
  width: min(620px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 15px auto 0;
  padding: 13px 16px;
  border: 1px solid rgba(109, 205, 255, 0.24);
  border-radius: 18px;
  color: rgba(242, 249, 255, 0.86);
  background: rgba(37, 126, 187, 0.15);
  text-align: left;
}

.notice--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.notice__icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06233a;
  background: #7cd2ff;
  font-weight: 900;
  font-family: Georgia, serif;
}

.notice__icon--warning {
  color: #2d1800;
  background: var(--warning);
  font-family: inherit;
}

.notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.button {
  min-height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 40px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 850;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button:focus-visible {
  outline: 3px solid rgba(136, 220, 255, 0.9);
  outline-offset: 4px;
}

.button--primary {
  position: relative;
  min-width: 250px;
  overflow: hidden;
  color: #072711;
  background: linear-gradient(135deg, #a7ff9d 0%, #50ef72 52%, #20d755 100%);
  box-shadow:
    0 16px 34px rgba(35, 225, 83, 0.24),
    0 0 24px rgba(94, 245, 115, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.button--primary::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(92, 245, 115, 0.18) 0%, rgba(92, 245, 115, 0.08) 45%, transparent 72%);
  filter: blur(8px);
}

.button--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 36%;
  height: 100%;
  left: -42%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.14) 20%, rgba(255, 255, 255, 0.54) 50%, rgba(255, 255, 255, 0.14) 80%, transparent 100%);
  transform: skewX(-22deg);
  filter: blur(1px);
  animation: button-shine 3.8s cubic-bezier(.4,0,.2,1) infinite;
}

.button--primary:hover {
  box-shadow:
    0 18px 38px rgba(35, 225, 83, 0.3),
    0 0 28px rgba(94, 245, 115, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.button__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding-left: 2px;
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 52, 20, 0.58);
  font-size: 10px;
}

.help {
  margin: 14px 0 0;
  color: rgba(239, 248, 255, 0.62);
  font-size: 13px;
  line-height: 1.4;
}

.status {
  min-height: 18px;
  margin-top: 8px;
  color: #a9ffaf;
  font-size: 13px;
  font-weight: 700;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  color: rgba(238, 247, 255, 0.44);
  font-size: 11px;
  text-align: center;
}

.crystals {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.crystal {
  position: absolute;
  display: block;
  width: clamp(62px, 6vw, 88px);
  height: auto;
  opacity: 0.98;
  filter: drop-shadow(0 12px 28px rgba(46, 255, 87, 0.32));
  animation: crystal-float 7.2s ease-in-out infinite;
  will-change: transform;
}

.crystal--left-1 { left: 1.2%; top: 8%; transform: rotate(-10deg) scale(0.9); }
.crystal--left-2 { left: 3.1%; top: 39%; transform: rotate(8deg) scale(1.14); animation-delay: -2.2s; }
.crystal--left-3 { left: 1.7%; bottom: 8%; transform: rotate(-6deg) scale(0.82); animation-delay: -4.1s; }
.crystal--right-1 { right: 1.2%; top: 9%; transform: rotate(10deg) scale(0.92); animation-delay: -1.1s; }
.crystal--right-2 { right: 3.1%; top: 41%; transform: rotate(-8deg) scale(1.14); animation-delay: -3s; }
.crystal--right-3 { right: 1.7%; bottom: 8%; transform: rotate(7deg) scale(0.84); animation-delay: -5s; }

@keyframes crystal-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -24px; }
}

@keyframes button-shine {
  0%, 58% { left: -42%; opacity: 0; }
  62% { opacity: 1; }
  82% { left: 112%; opacity: 0.95; }
  100% { left: 112%; opacity: 0; }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes background-breathe {
  from { transform: scale(1.03); }
  to { transform: scale(1.075); }
}

@media (max-width: 660px) {
  .page-shell {
    padding: 10px;
  }

  .hero {
    max-height: none;
    padding: 16px 14px 14px;
    border-radius: 24px;
  }

  .brand {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    margin: 14px auto 10px;
  }

  .brand__text {
    font-size: 14px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 42px);
  }

  .game-art {
    width: min(360px, 100%);
    margin-top: 14px;
    border-radius: 18px;
  }

  .game-art img {
    border-radius: 13px;
  }

  .lead {
    margin-top: 14px;
    font-size: 15px;
  }

  .notice {
    gap: 10px;
    margin-top: 12px;
    padding: 11px 12px;
    align-items: flex-start;
  }

  .notice p,
  .help,
  .status {
    font-size: 12px;
  }

  .button {
    width: 100%;
    min-height: 62px;
    padding: 0 26px;
    font-size: 17px;
  }

  .footer {
    margin-top: 0;
    font-size: 10px;
  }

  .crystal {
    width: 56px;
    opacity: 0.9;
  }

  .crystal--left-1,
  .crystal--left-3 { left: -14px; }

  .crystal--right-1,
  .crystal--right-3 { right: -14px; }

  .crystal--left-2,
  .crystal--right-2 { display: none; }
}

@media (max-height: 760px) {
  .brand { margin: 14px auto 10px; }
  .game-art { width: min(370px, 100%); margin-top: 12px; }
  .lead { margin-top: 12px; font-size: 15px; }
  .notice { margin-top: 11px; padding: 11px 13px; }
  .actions { margin-top: 16px; }
  .button { min-height: 60px; font-size: 17px; }
  .help { margin-top: 12px; font-size: 12px; }
  .footer { margin-top: 0; }
  .crystal { width: clamp(54px, 5vw, 74px); }
}

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

/* Fluid phone and tablet layout; content stays reachable on short screens. */
@media (max-width: 660px) {
  .page-shell {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .hero { padding: 16px 14px; }
  .hero__content { width: 100%; min-width: 0; }
  .brand { gap: 8px; margin: 6px auto 14px; padding: 8px; }
  .brand__mark { flex-shrink: 0; }
  .brand__text { font-size: clamp(12px, 3.5vw, 14px); }
  h1 { font-size: clamp(26px, 7.4vw, 42px); line-height: 1.12; }
  .game-art { width: min(300px, 100%); margin-top: 14px; }
  .lead { font-size: 15px; line-height: 1.5; }
  .notice { gap: 9px; padding: 11px; }
  .notice p { font-size: 14px; line-height: 1.45; }
  .help, .status { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  .actions { margin-top: 16px; }
  .button { min-width: 0; min-height: 58px; padding: 12px 16px; }
  .footer { margin-top: 10px; font-size: 11px; }
  .crystal { width: 44px; opacity: 0.55; }
  .background { animation: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .page-shell { padding: 12px; }
  .hero { max-height: none; }
  .game-art { width: min(240px, 100%); }
}

/* ===== Plati Market / Digiseller access gate ===== */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 15, 27, 0.46);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
}

.access-gate__card {
  width: min(520px, 100%);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  background: rgba(8, 25, 43, 0.88);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.access-gate__brand {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: #7dff8c;
  font-size: 38px;
  line-height: 1;
  transform: rotate(45deg);
  filter: drop-shadow(0 7px 18px rgba(92, 245, 115, 0.35));
}

.access-gate__spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: access-spin 0.85s linear infinite;
}

.access-gate__spinner[hidden] { display: none; }

.access-gate h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.access-gate p {
  max-width: 420px;
  margin: 14px auto 0;
  color: rgba(239, 248, 255, 0.72);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: balance;
}

.access-gate__retry {
  min-height: 50px;
  margin-top: 22px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  color: #072711;
  background: linear-gradient(135deg, #a7ff9d, #50ef72 56%, #20d755);
  box-shadow: 0 12px 28px rgba(35, 225, 83, 0.2);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.access-gate__retry[hidden] { display: none; }

body.access-pending .page-shell,
body.access-denied .page-shell,
body.access-error .page-shell {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

body.access-granted .access-gate { display: none; }

body.access-denied .access-gate__brand {
  color: #ff7f96;
  font-size: 34px;
  transform: none;
  filter: drop-shadow(0 7px 18px rgba(255, 82, 116, 0.28));
}

body.access-error .access-gate__brand {
  color: #ffd36a;
  font-size: 34px;
  transform: none;
  filter: drop-shadow(0 7px 18px rgba(255, 211, 106, 0.24));
}

@keyframes access-spin { to { transform: rotate(360deg); } }

@media (max-width: 660px) {
  .access-gate { padding: 14px; }
  .access-gate__card { padding: 28px 20px; border-radius: 24px; }
  .access-gate p { font-size: 14px; }
  .access-gate__retry { width: 100%; }
}
