:root {
  color-scheme: dark;
  --gold: #f4b84a;
  --gold-bright: #ffd675;
  --panel: rgba(5, 5, 5, 0.30);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: #f5f1e8;
  font-family: Georgia, "Times New Roman", serif;
}

body {
  min-height: 100vh;
}

/* PAGE 1 */

.entry-stage {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: clamp(22px, 5vw, 80px) clamp(22px, 5vw, 80px) clamp(34px, 7vh, 64px);
  background:
    linear-gradient(
      90deg,
      rgba(0,0,0,.84) 0%,
      rgba(0,0,0,.60) 32%,
      rgba(0,0,0,.12) 62%,
      rgba(0,0,0,.03) 100%
    ),
    url("ApocalypticEntry2.png") center / cover no-repeat;
}

.gauntlet {
  width: min(640px, 92vw);
  margin: 0 auto;
  padding: clamp(22px, 3.5vw, 38px);
  background: var(--panel);
  border: 1px solid rgba(255,214,117,.42);
  backdrop-filter: blur(2px);
  text-align: center;
}

.gauntlet h1 {
  margin: 0 0 18px;
  color: #fff3d2;
  font-size: clamp(0.9rem, 3vw, 2.6rem);
  line-height: .95;
}

.gauntlet p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  margin-left: auto;
  margin-right: auto;
}

.challenge {
  margin-top: 24px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(1rem, 1.6vw, 1.5rem) !important;
  font-weight: 700;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.fta-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid rgba(255,214,117,.65);
  color: #fff6df;
  background: rgba(17,12,8,.88);
  text-decoration: none;
  text-transform: uppercase;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  letter-spacing: .1em;
}

.fta-button-primary {
  color: #211005;
  background: linear-gradient(180deg, #ffd06c, #d77a22);
}

/* PAGE 2 */

.journey-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
}

.journey-stage {
  position: relative;
  width: min(100vw, calc(100vh * 1.7739), 1670px);
  aspect-ratio: 1670 / 942;
  background:
    url("AshDeck_ The_Survival_Journey.png")
    center / contain no-repeat;
}

.card-play-zone {
  position: absolute;
  left: 31%;
  top: 77%;
  width: 38%;
  height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.play-flash {
  padding: 10px 22px;
  border: 2px solid #fff1b7;
  color: #211005;
  background: linear-gradient(180deg, #ffe89b, #e7972f);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  animation: playpulse 1.2s ease-in-out infinite;
}

.journey-continue {
  position: absolute;
  right: 2.2%;
  bottom: 2.4%;
}

@keyframes playpulse {
  0%, 100% {
    opacity: .72;
    transform: scale(.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (max-width: 700px) {
  .entry-stage {
    align-items: end;
    padding: 18px;
    background-position: 58% center;
  }

  .gauntlet {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .play-flash {
    animation: none;
  }
}

/* Explicit Gauntlet placement under portal */
.entry-stage {
  position: relative;
}

.entry-stage .gauntlet {
  position: absolute;
  left: 50%;
  top: calc(56% - 96px);
  transform: translateX(-50%);
  width: min(1080px, 96vw);
  background: rgba(5, 5, 5, 0.24);
}

@media (max-width: 700px) {
  .entry-stage .gauntlet {
    top: 54%;
    width: 92vw;
  }
}

/* Page 2: PLAY pinned to sun emblem on cards */
.card-play-zone {
  left: 50%;
  top: 87%;
  width: clamp(76px, 7vw, 112px);
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.play-flash {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 50%;
  font-size: clamp(.72rem, 1vw, 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Exact registration: PLAY over printed sun circle */
.card-play-zone {
  left: 61.9%;
  top: 90.2%;
  width: 4.8%;
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.play-flash {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  box-sizing: border-box;
  font-size: clamp(.58rem, .78vw, .88rem);
}

/* Match the sun emblem's perspective on the tilted card */
.card-play-zone {
  width: 4.8%;
  height: 2.9%;
  aspect-ratio: auto;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-7deg);
}

.play-flash {
  border-radius: 50%;
}

/* Fine registration to printed card sun */
.card-play-zone {
  left: 61.4%;
  top: 90.4%;
  width: 4.8%;
  height: 3.7%;
  transform: translate(-50%, -50%) rotate(-7deg);
}

/* Make PLAY stand out against the gold sun beneath it */
.play-flash {
  color: #fff;
  background: rgba(12, 12, 12, 0.88);
  border: 2px solid #fff4c7;
  box-shadow:
    0 0 8px rgba(255,255,255,.9),
    0 0 18px rgba(255,70,25,.85);
  text-shadow: 0 1px 2px #000;
}

/* PLAY button: bright white with portal-blue lettering */
.play-flash {
  color: #2f8fff;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid #dff3ff;
  box-shadow:
    0 0 8px rgba(255,255,255,.95),
    0 0 18px rgba(80,170,255,.95),
    0 0 28px rgba(40,120,255,.55);
  text-shadow: 0 1px 1px rgba(0,0,0,.15);
}

/* PLAY sun: slightly taller + white rays */
.card-play-zone {
  height: 4.2%;
}

.play-flash {
  position: relative;
  overflow: visible;
}

.play-flash::before {
  content: "";
  position: absolute;
  inset: -22% -12%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255,255,255,.92) 0deg 7deg,
      transparent 7deg 22deg
    );
  opacity: .75;
  z-index: -1;
  -webkit-mask: radial-gradient(ellipse at center,
    transparent 0 43%,
    #000 44% 63%,
    transparent 64% 100%);
  mask: radial-gradient(ellipse at center,
    transparent 0 43%,
    #000 44% 63%,
    transparent 64% 100%);
}

/* PLAY sun refinement: fuller ellipse + longer rays */
.card-play-zone {
  width: 5.1%;
  height: 4.6%;
}

.play-flash::before {
  inset: -30% -18%;
  opacity: .82;
}

/* Tapered sun rays instead of rectangular-looking segments */
.play-flash::before {
  inset: -34% -22%;
  border-radius: 50%;

  background:
    repeating-conic-gradient(
      from -3deg,
      rgba(255,255,255,.98) 0deg 3deg,
      rgba(255,255,255,.45) 3deg 5deg,
      transparent 5deg 20deg
    );

  -webkit-mask:
    radial-gradient(
      ellipse at center,
      transparent 0 48%,
      #000 50% 100%
    );

  mask:
    radial-gradient(
      ellipse at center,
      transparent 0 48%,
      #000 50% 100%
    );

  opacity: .9;
}

/* RUN AWAY PAGE */
.runaway-stage {
  min-height: 100vh;
  position: relative;
  background:
    linear-gradient(
      90deg,
      rgba(0,0,0,.08) 0%,
      rgba(0,0,0,.08) 48%,
      rgba(0,0,0,.44) 72%,
      rgba(0,0,0,.62) 100%
    ),
    url("Running_from_the_Rift.png") center / cover no-repeat;
}

.runaway-box {
  position: absolute;
  right: 5%;
  top: 22%;
  width: min(520px, 42vw);
  padding: 30px 34px;
  text-align: center;
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(2px);
}

.runaway-box h1 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.runaway-box p {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

.runaway-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 700px) {
  .runaway-box {
    right: 4%;
    left: 4%;
    top: auto;
    bottom: 5%;
    width: auto;
  }
}

/* Living flame title v2 */
#gauntlet-title {
  position: relative;
  display: inline-block;
  isolation: isolate;
  overflow: visible;

  color: #fff2b0;
  text-shadow:
    0 0 2px #fff,
    0 0 7px #ffd000,
    0 0 14px #ff6400,
    0 -3px 20px rgba(255,40,0,.75);
}

#gauntlet-title::before,
#gauntlet-title::after {
  content: "";
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: 55%;
  height: 85%;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(ellipse at 8% 100%,  #fff7a0 0 5%, #ffad00 8%, #ff3900 18%, transparent 29%),
    radial-gradient(ellipse at 24% 100%, #fff7a0 0 6%, #ffc000 9%, #ff4100 20%, transparent 32%),
    radial-gradient(ellipse at 41% 100%, #fff7a0 0 5%, #ff9d00 8%, #ff2c00 18%, transparent 30%),
    radial-gradient(ellipse at 59% 100%, #fff7a0 0 6%, #ffc000 9%, #ff4600 21%, transparent 33%),
    radial-gradient(ellipse at 76% 100%, #fff7a0 0 5%, #ffac00 8%, #ff3200 19%, transparent 30%),
    radial-gradient(ellipse at 93% 100%, #fff7a0 0 6%, #ffc000 9%, #ff4300 20%, transparent 32%);

  transform-origin: 50% 100%;
  filter: blur(1.3px);
  animation: ftaFireDance .34s ease-in-out infinite alternate;
}

#gauntlet-title::after {
  opacity: .55;
  filter: blur(6px);
  transform: scaleY(1.18);
  animation-duration: .53s;
}

@keyframes ftaFireDance {
  0%   { transform: scaleY(.86) skewX(-2deg) translateY(2px); }
  35%  { transform: scaleY(1.08) skewX(1deg) translateY(-2px); }
  70%  { transform: scaleY(.94) skewX(-1deg) translateY(1px); }
  100% { transform: scaleY(1.16) skewX(2deg) translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  #gauntlet-title::before,
  #gauntlet-title::after {
    animation: none;
  }
}

/* SVG fire INSIDE the FLASHES TO ASHES lettering */
#gauntlet-title {
  color: transparent !important;
  text-shadow: none !important;

  width: min(900px, 90vw);
  height: auto;
  aspect-ratio: 1200 / 180;

  margin-left: auto;
  margin-right: auto;

  background:
    url("fta-fire-title.svg?v=3") center / contain no-repeat !important;

  animation: none !important;
  filter: none !important;
}

#gauntlet-title::before,
#gauntlet-title::after {
  content: none !important;
}

/* Fire title sizing correction */
#gauntlet-title {
  display: block !important;
  width: min(560px, 82vw) !important;
  height: 72px !important;
  aspect-ratio: auto !important;

  margin: 0 auto 8px !important;
  padding: 0 !important;

  background-size: contain !important;
  background-position: center !important;
}

/* Fire title anti-clipping fix */
#gauntlet-title {
  width: min(640px, 88vw) !important;
  height: 68px !important;
  background-size: 94% 100% !important;
  background-repeat: no-repeat !important;
}

/* PLAY refinement: a little bigger + pointed rays */
.card-play-zone {
  width: 5.8%;
  height: 5.2%;
}

.play-flash::before {
  content: "";
  position: absolute;
  inset: -42% -28%;
  background: rgba(255,255,255,.98);
  opacity: .95;
  z-index: -1;
  filter: drop-shadow(0 0 5px rgba(255,255,255,.95));

  clip-path: polygon(
    50% 0%,
    56% 18%,
    74% 5%,
    62% 25%,
    88% 16%,
    68% 35%,
    100% 50%,
    68% 65%,
    88% 84%,
    62% 75%,
    74% 95%,
    56% 82%,
    50% 100%,
    44% 82%,
    26% 95%,
    38% 75%,
    12% 84%,
    32% 65%,
    0% 50%,
    32% 35%,
    12% 16%,
    38% 25%,
    26% 5%,
    44% 18%
  );
}

/* PLAY tune: slightly bigger + black lettering */
.card-play-zone {
  width: 6.2%;
  height: 5.6%;
}

.play-flash {
  color: #111 !important;
  text-shadow: none !important;
}

/* Index dialogue vertical tightening */
.entry-stage .gauntlet {
  padding-top: clamp(11px, 1.7vw, 19px);
  padding-bottom: clamp(12px, 1.8vw, 20px);
}

.entry-stage .gauntlet h1 {
  margin-bottom: 9px;
}

.entry-stage .gauntlet p {
  margin: 5px 0;
  line-height: 1.28;
}

.entry-stage .gauntlet .challenge {
  margin-top: 8px;
  margin-bottom: 6px;
}

/* Index dialogue: move down about 1/4 inch */
.entry-stage .gauntlet {
  top: calc(56% - 72px);
}


/* INDIEDB FLOATING BADGE */
.entry-stage {
  position: relative;
}

#ftaIndieDBBadge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 50;
  display: block;
  width: 42px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

#ftaIndieDBBadge img {
  display: block;
  width: 42px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* FTA_GAUNTLET_LEGAL_FOOTER_V3 */
.fta-legal-footer {
  box-sizing: border-box;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 60;

  width: max-content;
  max-width: calc(100% - 110px);
  padding: 0;

  color: #e9d5a1;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.045em;
  text-align: center;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

@media (max-width: 600px) {
  .fta-legal-footer {
    bottom: 16px;
    max-width: calc(100% - 28px);
    font-size: 11px;
    letter-spacing: 0.015em;
  }
}

/* FTA SCREENSHOT POPUP V1 � EXISTING LAYOUT UNCHANGED */
.journey-screenshots {
  position: absolute;
  right: 2.2%;
  bottom: 2.4%;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 11px;
  cursor: pointer;
  transform: translateX(calc(-100% - 12px));
}

.fta-screenshots-dialog {
  width: min(480px, calc(100vw - 24px));
  max-width: 480px;
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 12px;
  border: 1px solid rgba(255,214,117,.65);
  background: #110c08;
  color: #fff6df;
  overflow: auto;
}

.fta-screenshots-dialog::backdrop {
  background: rgba(0,0,0,.65);
}

.fta-screenshots-dialog img {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.fta-screenshots-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.fta-screenshots-actions button {
  cursor: pointer;
}

#ftaScreenshotCount {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}
