@import url("./quokka-doors-v29.css");

/* v32 challenge-mode additions: gentle bottom-sheet quiz + retry control. */
body.quokka-challenge-open {
  overflow: hidden;
}

.quokka-challenge-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 22px 0;
  background: rgba(3, 14, 24, 0);
  backdrop-filter: blur(0);
  transition: background-color .65s ease, backdrop-filter .65s ease;
}

.quokka-challenge-overlay.is-visible {
  background: rgba(3, 14, 24, .54);
  backdrop-filter: blur(2px);
}

.quokka-challenge-card {
  width: min(760px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 16px clamp(22px, 4vw, 34px) 28px;
  border: 3px solid #0b2235;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: #fffdf7;
  box-shadow: 0 -18px 55px rgba(0, 0, 0, .24);
  color: #102a3d;
  transform: translateY(108%);
  opacity: .98;
  transition: transform .9s cubic-bezier(.16,.82,.24,1), opacity .55s ease;
  will-change: transform;
}

.quokka-challenge-overlay.is-visible .quokka-challenge-card {
  transform: translateY(0);
  opacity: 1;
}

.quokka-challenge-grabber {
  width: 58px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(11,34,53,.24);
}

.quokka-challenge-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 5px 9px;
  border: 2px solid #0b2235;
  border-radius: 999px;
  background: #f2d58b;
  color: #0b2235;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .07em;
}

.quokka-challenge-card h2 {
  margin: 0 0 12px;
  color: #071826;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.08;
}

.quokka-challenge-question {
  margin: 0 0 18px;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  font-weight: 700;
  line-height: 1.4;
}

.quokka-challenge-answers {
  display: grid;
  gap: 10px;
}

.quokka-challenge-answer,
.quokka-challenge-close {
  width: 100%;
  border: 2px solid #173b52;
  border-radius: 11px;
  background: #fff;
  color: #102a3d;
  font: inherit;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.quokka-challenge-answer { padding: 13px 14px; }

.quokka-challenge-answer:hover:not(:disabled),
.quokka-challenge-answer:focus-visible:not(:disabled) {
  background: #f6edd4;
  outline: 3px solid rgba(183, 137, 54, .28);
  outline-offset: 2px;
}

.quokka-challenge-answer:disabled { cursor: default; opacity: .7; }
.quokka-challenge-answer.is-correct { border-color: #167347; background: #e8f7ee; opacity: 1; }
.quokka-challenge-answer.is-wrong { border-color: #9b2d25; background: #fff0ed; opacity: 1; }

.quokka-challenge-feedback {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-weight: 750;
}
.quokka-challenge-feedback.is-correct { color: #12613b; }
.quokka-challenge-feedback.is-wrong { color: #7c251f; }

.quokka-challenge-close {
  margin-top: 14px;
  padding: 12px 14px;
  background: #0b2235;
  color: #fff;
  text-align: center;
}
.quokka-challenge-close:hover,
.quokka-challenge-close:focus-visible {
  background: #173b52;
  outline: 3px solid rgba(183, 137, 54, .35);
  outline-offset: 2px;
}

.quokka-challenge-retry-wrap {
  display: flex;
  justify-content: center;
  margin: .35rem auto .7rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.quokka-challenge-retry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .68rem 1rem;
  border: 2px solid #0b2235;
  border-radius: 999px;
  background: #f2d58b;
  color: #0b2235;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(3,14,24,.08);
}

.quokka-challenge-retry-button:hover,
.quokka-challenge-retry-button:focus-visible {
  background: #f1c95f;
  outline: 3px solid rgba(183,137,54,.25);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .quokka-challenge-overlay { padding: 12px 10px 0; }
  .quokka-challenge-card {
    width: 100%;
    max-height: 86vh;
    padding: 14px 16px 22px;
    border-radius: 20px 20px 0 0;
  }
  .quokka-challenge-answer { padding: 12px; font-size: .94rem; }
  .quokka-challenge-retry-wrap { margin: .25rem auto .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .quokka-challenge-overlay,
  .quokka-challenge-card { transition-duration: .2s !important; }
}


/* ============================================================
   v35 challenge guidance + CTA placement + homepage reward claim
   ============================================================ */

.quokka-challenge-scroll-hint {
  width: min(820px, calc(100% - 32px));
  margin: .55rem auto 1.15rem;
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  border: 1px solid rgba(11,34,53,.16);
  border-left: 5px solid #b78936;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffdf7 0%, #fbf4df 100%);
  color: #173b52;
  box-shadow: 0 8px 22px rgba(3,14,24,.07);
}

.quokka-challenge-hint-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #030e18;
  color: #f1d18a;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  animation: quokka-scroll-nudge 1.35s ease-in-out infinite;
}

.quokka-challenge-hint-copy {
  min-width: 0;
  display: grid;
  gap: .12rem;
  text-align: left;
}

.quokka-challenge-hint-label {
  color: #8a641f;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.quokka-challenge-hint-copy strong {
  color: #030e18;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.03rem;
  line-height: 1.2;
}

.quokka-challenge-hint-copy > span:last-child {
  color: #52616c;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
}

@keyframes quokka-scroll-nudge {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

.quokka-pre-adventure-cta {
  width: min(760px, calc(100% - 32px));
  margin: .65rem auto .8rem;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
  text-align: center;
  border-top: 1px solid rgba(3,14,24,.1);
  border-bottom: 1px solid rgba(3,14,24,.1);
}

.quokka-pre-adventure-cta .button-note {
  margin: 0;
  max-width: 390px;
  font-size: .82rem;
}

.quokka-home-reward {
  width: min(720px, 100%);
  margin: 0 auto 1rem;
  padding: .7rem .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  flex-wrap: wrap;
  border: 2px solid #0b2235;
  border-radius: 14px;
  background: #eef6f1;
  color: #0b2235;
  box-shadow: 0 6px 16px rgba(3,14,24,.08);
}

.quokka-home-reward[hidden] {
  display: none !important;
}

.quokka-home-reward-message {
  font-weight: 850;
  text-align: center;
}

.quokka-resource-notice .quokka-challenge-question {
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  .quokka-challenge-scroll-hint {
    width: calc(100% - 20px);
    margin: .4rem auto .9rem;
    padding: .72rem .75rem;
    gap: .7rem;
  }

  .quokka-challenge-hint-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .quokka-challenge-hint-copy strong {
    font-size: .97rem;
  }

  .quokka-challenge-hint-copy > span:last-child {
    font-size: .81rem;
  }

  .quokka-pre-adventure-cta {
    width: calc(100% - 20px);
    margin: .45rem auto .6rem;
    padding: .75rem .6rem;
  }

  .quokka-pre-adventure-cta .trial-cta,
  .quokka-pre-adventure-cta .trial-button {
    width: 100%;
  }

  .quokka-home-reward {
    margin-bottom: .75rem;
    padding: .65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quokka-challenge-hint-icon { animation: none !important; }
}

/* ============================================================
   v34 reward pill is the claim control
   ============================================================ */

[data-door-progress].is-reward-ready,
.quokka-home-reward-pill.is-reward-ready {
  cursor: pointer;
  background: #030e18 !important;
  color: #f1d18a !important;
  border-color: #030e18 !important;
  box-shadow: 0 6px 16px rgba(3,14,24,.16);
  font: inherit;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

[data-door-progress].is-reward-ready:hover,
[data-door-progress].is-reward-ready:focus-visible,
.quokka-home-reward-pill.is-reward-ready:hover,
.quokka-home-reward-pill.is-reward-ready:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(3,14,24,.2);
  outline: 3px solid rgba(212,175,55,.35);
  outline-offset: 2px;
}

.quokka-home-reward {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.quokka-home-reward-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 38px;
  padding: .45rem .8rem;
  border: 1px solid rgba(212,175,55,.55);
  border-radius: 999px;
  text-align: center;
  white-space: normal;
}


/* ============================================================
   v35 brief red alert pulse when chaos notifications begin
   ============================================================ */

.quokka-chaos-layer.is-alerting::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(196, 23, 23, .48);
  opacity: 0;
  animation: quokka-red-alert-pulse .92s ease-out both;
}

@keyframes quokka-red-alert-pulse {
  0%   { opacity: 0; }
  12%  { opacity: .82; }
  30%  { opacity: 0; }
  48%  { opacity: .62; }
  68%  { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .quokka-chaos-layer.is-alerting::before {
    animation: quokka-red-alert-pulse .7s ease-out both !important;
  }
}


/* ============================================================
   v36 reward chooser — supplied artwork with accessible hit areas
   ============================================================ */

.quokka-reward-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3,14,24,.78);
  backdrop-filter: blur(4px);
}

.quokka-reward-choice-overlay.is-open {
  display: flex;
}

body.quokka-reward-choice-open {
  overflow: hidden;
}

.quokka-reward-choice-card {
  position: relative;
  width: min(760px, 100%, calc((100vh - 40px) * 2));
}

.quokka-reward-choice-art {
  position: relative;
  width: 100%;
}

.quokka-reward-choice-art img {
  display: block;
  width: 100%;
  height: auto;
}

.quokka-reward-choice-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: #030e18;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(3,14,24,.2);
}

.quokka-reward-choice-hit {
  position: absolute;
  z-index: 2;
  top: 24%;
  bottom: 7%;
  width: 45%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}

.quokka-reward-choice-find {
  left: 3%;
}

.quokka-reward-choice-fly {
  right: 3%;
}

.quokka-reward-choice-hit:focus-visible,
.quokka-reward-choice-close:focus-visible {
  outline: 4px solid #f1d18a;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .quokka-reward-choice-overlay {
    padding: 10px;
  }

  .quokka-reward-choice-card {
    width: min(760px, 100%, calc((100vh - 20px) * 2));
  }

  .quokka-reward-choice-close {
    top: 4px;
    right: 4px;
    width: 38px;
    height: 38px;
  }
}

/* Transparent reward selector artwork */
.quokka-reward-choice-card{
  background:transparent;
  border:0;
  box-shadow:none;
}
.quokka-reward-choice-art{
  background:transparent;
}

/* Use the close X embedded in transparent_game_selector.png */
.quokka-reward-choice-close{
  color:transparent;
  background:transparent;
  border:0;
  box-shadow:none;
  width:10%;
  height:13%;
  top:17%;
  right:7%;
  border-radius:50%;
}
.quokka-reward-choice-close:focus-visible{
  outline:3px solid #fff;
  outline-offset:3px;
  box-shadow:0 0 0 3px rgba(3,14,24,.7);
}


/* Small homepage note: challenge mode is optional. */
.quokka-challenge-optional-helper {
  margin: .25rem auto .65rem;
  color: #66727b;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}


/* ============================================================
   Collapsible challenge quiz bottom sheet
   ============================================================ */

.quokka-challenge-sheet-header {
  width: 100%;
  margin: -4px 0 10px;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  color: #102a3d;
  cursor: ns-resize;
  touch-action: none;
  text-align: center;
}

.quokka-challenge-sheet-header .quokka-challenge-grabber {
  display: block;
  margin: 0 auto 8px;
}

.quokka-challenge-sheet-label {
  display: block;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.quokka-challenge-sheet-action {
  display: block;
  margin-top: 2px;
  color: #66727b;
  font-size: .72rem;
  font-weight: 650;
}

.quokka-challenge-sheet-body {
  display: block;
}

.quokka-challenge-overlay.is-collapsed {
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

.quokka-challenge-overlay.is-collapsed .quokka-challenge-card {
  pointer-events: auto;
  transform: translateY(calc(100% - 84px));
  max-height: none;
  overflow: hidden;
  box-shadow: 0 -8px 24px rgba(0,0,0,.18);
}

.quokka-challenge-card.is-collapsed .quokka-challenge-sheet-body {
  visibility: hidden;
  pointer-events: none;
}

.quokka-challenge-card.is-collapsed .quokka-challenge-sheet-header {
  margin-bottom: 0;
}

@media (max-width: 620px) {
  .quokka-challenge-overlay.is-collapsed .quokka-challenge-card {
    transform: translateY(calc(100% - 78px));
  }
}


/* ============================================================
   One-time challenge completion / games unlocked announcement
   ============================================================ */

.quokka-games-unlocked {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  background: rgba(3,14,24,.28);
  transition: opacity .18s ease;
}

.quokka-games-unlocked.is-visible {
  opacity: 1;
}

.quokka-games-unlocked-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.98) 0 10%, rgba(242,213,139,.9) 24%, rgba(183,137,54,.42) 52%, rgba(3,14,24,0) 78%);
  animation: quokka-unlock-flash 1.15s ease-out both;
}

.quokka-games-unlocked-message {
  position: relative;
  z-index: 1;
  min-width: min(88vw, 520px);
  padding: 1.25rem 1.5rem 1.4rem;
  border: 3px solid #f2d58b;
  border-radius: 20px;
  background: #030e18;
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transform: scale(.78);
  opacity: 0;
  animation: quokka-unlock-pop .95s cubic-bezier(.2,.9,.24,1.2) .08s both;
}

.quokka-games-unlocked-message span {
  display: block;
  color: #f2d58b;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: clamp(.95rem, 2.5vw, 1.15rem);
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quokka-games-unlocked-message strong {
  display: block;
  margin-top: .15rem;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: .95;
}

@keyframes quokka-unlock-flash {
  0% { opacity: 0; transform: scale(.7); }
  18% { opacity: 1; transform: scale(1); }
  45% { opacity: .72; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(1.28); }
}

@keyframes quokka-unlock-pop {
  0% { opacity: 0; transform: scale(.72) translateY(18px); }
  58% { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .quokka-games-unlocked-flash,
  .quokka-games-unlocked-message {
    animation: none !important;
  }
  .quokka-games-unlocked-message {
    opacity: 1;
    transform: none;
  }
}


/* Keep programmatic dialog focus invisible; keyboard focus remains visible on controls. */
.quokka-reward-choice-card:focus {
  outline: none;
}


/* Keep the homepage challenge banner flush beneath the site header
   and tighten the gap before the next homepage section. */
.quokka-door-section {
  padding-top: 0 !important;
  padding-bottom: 1.4rem !important;
}


@media (max-width: 700px) {
  .quokka-challenge-optional-helper {
    font-size: clamp(.5rem, 2.3vw, .66rem);
    letter-spacing: -.02em;
    white-space: normal;
    max-width: calc(100% - 24px);
  }
}


/* Reduce the visual gap between the challenge cards and the homepage hero. */
#short-version.quick-hero {
  padding-top: 43px !important;
}

@media (max-width: 1100px) {
  #short-version.quick-hero {
    padding-top: 36px !important;
  }
}

@media (max-width: 680px) {
  #short-version.quick-hero {
    padding-top: 29px !important;
  }
}
