/* Layout for each screen. Colours and shared pieces live in base.css. */

.screen {
  display: none;
}

.screen.is-active {
  animation: screen-fade 0.28s ease-out both;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100dvh;
  padding: calc(22px + env(safe-area-inset-top)) 14px calc(26px + env(safe-area-inset-bottom));
}

/* Going on to a later screen: it slides in from the right. Going back: from the left. */
.screen.is-active[data-enter='forward'] {
  animation: screen-forward 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.screen.is-active[data-enter='back'] {
  animation: screen-back 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The four tab-bar screens leave room for the bar at the bottom. */
.screen[data-screen='today'].is-active,
.screen[data-screen='shop'].is-active,
.screen[data-screen='settings'].is-active {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

@keyframes screen-fade {
  from {
    opacity: 0;
  }
}

@keyframes screen-forward {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
}

@keyframes screen-back {
  from {
    opacity: 0;
    transform: translateX(-36px);
  }
}

/* ---------- Tap to begin ---------- */

.screen[data-screen='gate'].is-active {
  padding: 0;
}

.gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.gate__mark {
  width: 64px;
  height: 64px;
  border: 2px solid var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 26px var(--glow), inset 0 0 18px var(--glow);
  animation: gate-pulse 2.2s ease-in-out infinite;
}

.gate__title {
  margin-right: -0.34em; /* balances the trailing letter-spacing so it sits centred */
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--glow);
}

.gate__prompt {
  margin-right: -0.36em;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  animation: gate-blink 1.8s ease-in-out infinite;
}

@keyframes gate-pulse {
  50% {
    box-shadow: 0 0 44px var(--glow), inset 0 0 26px var(--glow);
  }
}

@keyframes gate-blink {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Setup ---------- */

.weeks-readout {
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: var(--fill);
}

.weeks-readout strong {
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 0 12px var(--glow);
}

/* ---------- Today ---------- */

.today-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.today-goal {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.today-goal__label {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.all-clear {
  font-weight: 600;
}

/* ---------- Quest rows (Setup and Today) ---------- */

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-list:empty {
  display: none;
}

.quest {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 6px 12px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, transparent), rgba(0, 0, 0, 0.35));
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
}

.quest--tickable {
  grid-template-columns: auto 1fr auto;
  gap: 4px 6px;
  padding: 12px 2px 12px 4px;
}

.quest__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.quest__name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.quest__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Time left, "Cleared" or "Deadline passed", sitting after the deadline. */
.quest__status {
  color: color-mix(in srgb, var(--text) 55%, var(--accent));
}

.quest__penalty {
  color: var(--text-dim);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.quest__late {
  color: var(--danger);
}

/* The done tick: a diamond that fills in. */
.quest__tick {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.quest__tick::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: background 0.2s, box-shadow 0.2s;
}

.quest.is-done .quest__tick {
  cursor: default;
}

.quest.is-done .quest__tick::before {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

.quest.is-done {
  border-color: var(--line);
}

.quest.is-done .quest__name {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--line);
}

.quest.is-done .quest__cleared {
  color: var(--text);
  text-shadow: 0 0 10px var(--glow);
}

.quest--upcoming {
  opacity: 0.55;
}

/* ---------- Penalty Zone ---------- */

.screen[data-screen='penalty'].is-active {
  background: radial-gradient(130% 60% at 50% 0%, #4a0009 0%, #170003 48%, #000 100%);
  --week-lived: #4d1a20;
  --week-left: #ffd9dc;
  --week-now: #ffffff;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fact__value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.fact__note {
  color: var(--text-dim);
  font-size: 15px;
}

/* The penalty task itself: the one thing to do. */
.fact--main {
  padding: 12px;
  background: var(--fill-strong);
  border: 1px solid var(--accent);
  box-shadow: 0 0 16px var(--glow);
}

.fact--main .fact__value {
  font-size: 26px;
  font-weight: 700;
  text-shadow: 0 0 14px var(--glow);
}

.weeks-grid {
  display: block;
  width: 100%;
  margin: 4px 0;
}

.quote {
  margin: 4px 0 0;
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--accent);
}

.quote blockquote {
  margin: 0;
  font-size: 20px;
  font-style: italic;
  line-height: 1.3;
}

.quote figcaption {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quote figcaption::before {
  content: '— ';
}

/* Stays at the bottom of the screen so the way out is always in reach. */
.penalty-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0 -14px calc(-26px - env(safe-area-inset-bottom));
  padding: 26px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, #000 34%);
  text-align: center;
}

/* ---------- Settings: Proof Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery:empty {
  display: none;
}

.gallery__tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gallery__photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery__photo--none {
  cursor: default;
}

.gallery__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__caption {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.photo-view__img {
  display: block;
  width: 100%;
  max-height: 60dvh;
  object-fit: contain;
  background: #000;
}

/* ---------- Today: level, XP and coins ---------- */

.hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, #000), #010204);
  border: 1px solid var(--line-soft);
  border-top-color: var(--line);
}

.hud__label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hud__level {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.hud__level-num {
  font-size: 34px;
  font-weight: 700;
  text-shadow: 0 0 14px var(--accent);
}

.hud__xp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hud__xp-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}

.hud__bar {
  height: 8px;
  background: #000;
  border: 1px solid var(--line-soft);
}

.hud__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.6s ease-out;
}

.hud__coins {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 24px;
  font-weight: 700;
}

/* ---------- Today: the right-hand side of a quest row ---------- */

.quest__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
}

.quest__side .icon-btn {
  width: 34px;
  height: 30px;
  font-size: 20px;
}

.quest__focus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 56px;
  margin: 0 6px 0 0;
  padding: 7px 6px 5px;
  background: #000;
  border: 1px solid color-mix(in srgb, var(--ember) 55%, transparent);
  border-radius: 2px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 10px color-mix(in srgb, var(--ember) 30%, transparent);
  cursor: pointer;
}

.quest__focus svg {
  width: 20px;
  height: 20px;
  fill: var(--ember);
  filter: drop-shadow(0 0 5px var(--ember));
}

.quest__focus:active {
  transform: scale(0.95);
}

/* ---------- Focus ---------- */

.screen[data-screen='focus'].is-active {
  position: relative;
  gap: 0;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.focus__back {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  left: 6px;
  width: 48px;
  height: 48px;
  background: none;
  border: 0;
  color: #4a4a4a;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.focus__quest {
  flex: none;
  margin: 0;
  padding: calc(13dvh + env(safe-area-inset-top)) 28px 0;
  font-size: clamp(28px, 8.6vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-shadow: 0 0 26px color-mix(in srgb, var(--ember) 55%, transparent);
  overflow-wrap: anywhere;
}

.focus__fire {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
}

.focus__done {
  flex: none;
  margin: 0 22px calc(26px + env(safe-area-inset-bottom));
  border-color: #2a2a2a;
  color: #b9b9b9;
}

/* ---------- Today: how the day is going, and the check-in ---------- */

.today-greeting {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 0 18px var(--glow);
}

.today-day {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: -8px;
}

.today-progress {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
  border-left: 2px solid var(--accent);
}

.today-progress__pips {
  display: flex;
  gap: 7px;
  padding: 2px 0 2px 2px;
}

.today-progress__pips:empty {
  display: none;
}

.today-progress__text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.today-progress__next {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.today-day .tile {
  min-width: 100px;
}

/* One quote a day, at the foot of Today. */
.daily-quote {
  margin: 4px 0 0;
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--line);
}

.daily-quote blockquote {
  margin: 0;
  color: color-mix(in srgb, var(--text) 86%, var(--accent));
  font-size: 18px;
  font-style: italic;
  line-height: 1.3;
}

.daily-quote figcaption {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.daily-quote figcaption::before {
  content: '— ';
}

.today-total {
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-align: center;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 6px 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, #000), #000);
  border: 1px solid var(--line-soft);
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
}

.tile:active {
  transform: scale(0.97);
}

.tile:disabled {
  opacity: 0.45;
  cursor: default;
}

.tile:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.tile__name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tile__note {
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Shop ---------- */

.shop-coins {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--gold);
  font-size: 24px;
  font-weight: 700;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), rgba(0, 0, 0, 0.35));
  border: 1px solid var(--line-soft);
}

.shop-item__art {
  width: 60px;
  height: 84px;
  object-fit: contain;
}

.shop-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shop-item__name {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
}

.shop-item__owned {
  color: var(--text-dim);
  font-size: 14px;
}

.shop-item__buy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  justify-content: center;
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.04em;
}

/* Not enough coins yet: still tappable, so the Shop can say what is missing. */
.shop-item__buy.is-short {
  opacity: 0.45;
}

.name-sheet__art {
  align-self: center;
  width: 110px;
  height: 170px;
  object-fit: contain;
}

/* ---------- Battleground ---------- */

.screen[data-screen='battleground'].is-active {
  position: relative;
  justify-content: space-between;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.battle__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.battle__top,
.battle__bottom {
  position: relative; /* above the canvas */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
}

.battle__top {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent);
}

.battle__top .eyebrow {
  flex: 1;
  color: var(--text);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-align: right;
}

.battle__bottom {
  justify-content: flex-end;
  padding: 12px 14px calc(84px + env(safe-area-inset-bottom));
}

/* Darkness closing in at the edges of the scene. A layer over the canvas, so the
   canvas does not have to repaint it sixty times a second. */
.screen[data-screen='battleground']::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 62% at 50% 55%, transparent 48%, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.battle__bottom .system-line {
  flex: 1;
  color: var(--text-dim);
  font-size: 16px;
  text-shadow: none;
}

.battle__bottom .system-line:empty {
  visibility: hidden;
}

/* ---------- Intro ---------- */

.screen[data-screen='intro'].is-active {
  padding: 0;
}

/* perspective is what makes things seem to fly toward you out of the dark */
.intro {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0;
  color: var(--text);
  perspective: 700px;
  cursor: pointer;
}

.intro__mark {
  width: 150px;
  height: 150px;
  mix-blend-mode: screen; /* the drawing's black background lets the glow behind show through */
  animation: intro-mark 0.8s cubic-bezier(0.16, 1, 0.3, 1.06) both;
}

/* The flash as the mark lands. */
.intro__burst {
  position: absolute;
  top: calc(50% - 68px);
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 40px 10px var(--glow), inset 0 0 30px var(--glow);
  opacity: 0;
  animation: intro-burst 0.9s 0.7s ease-out both;
}

.intro__title {
  display: flex;
  margin-right: -0.3em;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 0 22px var(--glow);
  transform-style: preserve-3d;
}

.intro__title span {
  display: inline-block;
  animation: intro-letter 0.55s calc(0.78s + var(--i) * 0.055s) cubic-bezier(0.16, 1, 0.3, 1.1) both;
}

.intro__tag {
  margin-right: -0.3em;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: intro-tag 0.7s 1.55s ease-out both;
}

@keyframes intro-mark {
  from {
    opacity: 0;
    filter: blur(14px) brightness(3);
    transform: translateZ(-1500px) rotateX(75deg) rotateZ(-140deg);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes intro-burst {
  from {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(22);
  }
}

@keyframes intro-letter {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateZ(-500px) translateY(26px) rotateX(-80deg);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes intro-tag {
  from {
    opacity: 0;
    letter-spacing: 0.9em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.3em;
  }
}

/* ---------- Level 0 demo ---------- */

.demo-card {
  flex: 1;
}

.demo-card .system-line {
  font-size: 19px;
}

/* A framed example with a "Sample" tag, so nobody mistakes it for their own data. */
.demo-sample {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 12px 14px;
  border: 1px dashed var(--line);
}

.demo-sample--dark {
  padding: 0;
  background: #000;
}

.demo-sample__tag {
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 1;
  padding: 1px 8px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.demo-fire {
  display: block;
  width: 100%;
  height: 250px;
}

.demo-gains {
  justify-content: center;
}

.demo-army {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.demo-army img {
  width: 78px;
  height: 122px;
}

/* ---------- Settings: accent colour ---------- */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 2px;
}

.swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--swatch);
  border: 2px solid #000;
  border-radius: 2px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--swatch) 60%, transparent);
  cursor: pointer;
}

.swatch[aria-checked='true'] {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.swatch:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ---------- Today: a quest feeling its deadline ---------- */

/* The bar along the bottom of an open quest, draining toward the deadline. */
.quest__timebar {
  grid-column: 1 / -1;
  height: 2px;
  margin: 4px 8px 0 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.quest__timebar span {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width 1s linear;
}

/* The last hour: amber. */
.quest[data-urgency='soon'] {
  border-left-color: var(--ember);
}

.quest[data-urgency='soon'] .quest__status,
.quest[data-urgency='near'] .quest__status,
.quest[data-urgency='critical'] .quest__status {
  color: var(--ember);
}

.quest[data-urgency='soon'] .quest__timebar span {
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
}

/* The last ten minutes: red, and breathing. */
.quest[data-urgency='near'],
.quest[data-urgency='critical'] {
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
  border-left-color: var(--danger);
  animation: quest-heat 1.8s ease-in-out infinite;
}

.quest[data-urgency='near'] .quest__status,
.quest[data-urgency='critical'] .quest__status {
  color: var(--danger);
  font-size: 17px;
  text-shadow: 0 0 12px var(--danger);
}

.quest[data-urgency='near'] .quest__timebar span,
.quest[data-urgency='critical'] .quest__timebar span {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

/* The last minute: the same, twice as fast. */
.quest[data-urgency='critical'] {
  animation-duration: 0.7s;
}

@keyframes quest-heat {
  50% {
    background-color: color-mix(in srgb, var(--danger) 16%, transparent);
    box-shadow: 0 0 22px -4px var(--danger);
  }
}

/* A number in the header kicking when it changes. */
.is-bumped {
  animation: bump 0.5s cubic-bezier(0.2, 1.8, 0.4, 1);
}

@keyframes bump {
  30% {
    transform: scale(1.5);
    filter: brightness(1.8);
  }
}

/* ---------- Penalty Zone: it arrives with a flash ---------- */

.screen[data-screen='penalty'].is-active::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 5;
  background: var(--danger);
  pointer-events: none;
  animation: penalty-flash 1s ease-out both;
}

@keyframes penalty-flash {
  0% { opacity: 0.85; }
  18% { opacity: 0.2; }
  30% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* ---------- The quick intro, for a returning player ---------- */

.intro.is-quick .intro__mark {
  animation-duration: 0.45s;
}

.intro.is-quick .intro__title span {
  animation-duration: 0.35s;
  animation-delay: calc(0.2s + var(--i) * 0.025s);
}

.intro.is-quick .intro__burst {
  animation-delay: 0.3s;
}

.intro.is-quick .intro__tag {
  display: none;
}
