:root {
  color-scheme: dark;
  font:
    15px/1.45 ui-rounded,
    'SF Pro Rounded',
    system-ui,
    sans-serif;
  color: #f4ecdf;
  background: #1a1220;
  --panel: #1d1526f2;
  --line: #45365a;
  --muted: #a99bbd;
  --gold: #ffd84a;
  --ember: #ff7a3d;
  --gem: #4fe3f0;
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: #1a1220;
}
#game {
  display: block;
  width: 100vw;
  height: 100dvh;
  outline: none;
  touch-action: none;
  cursor: pointer;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.muted {
  color: var(--muted);
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
  padding: 0;
}
h1 {
  font-size: 44px;
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 3px 0 #a8431a;
}
h2 {
  font-size: 26px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
.primary,
.ghost {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 800;
  border-radius: 12px;
}
.primary {
  color: #2a1408;
  background: linear-gradient(#ffe27a, #ffb93d);
  border: 0;
  box-shadow: 0 3px 0 #a8621a;
}
.ghost {
  background: #ffffff0d;
  border: 1px solid var(--line);
}
.link {
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  background: none;
  border: 0;
}
.row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.switches {
  justify-content: center;
  gap: 18px;
}
.switches .link {
  min-height: 32px;
}

/* A gem, the game's coin. */
.gem {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--gem);
  border: 2px solid #0b5560;
  transform: rotate(45deg);
}
.gems {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.gems.big {
  font-size: 20px;
}

/* Over the course while it's played. */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.bar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar > * {
  flex: none;
}
.round {
  width: 44px;
  height: 44px;
  font-weight: 900;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: auto;
}
.where {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 12px 8px;
  background: var(--panel);
  border-radius: 12px;
}
.where .label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track {
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  background: #ffffff1f;
  border-radius: 3px;
}
.track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
}
.tally,
.bar .gems {
  height: 44px;
  padding: 0 14px;
  background: var(--panel);
  border-radius: 12px;
}
.tally {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 900;
}
.chain {
  padding: 1px 8px;
  font-size: 15px;
  color: #2a1408;
  background: var(--gold);
  border-radius: 8px;
}
.boss {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top, 0px)) + 54px);
  left: 50%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  font-weight: 900;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 14px;
  transform: translateX(-50%);
}
.boss span + span {
  letter-spacing: 3px;
  color: var(--gold);
}
.hint,
.banner {
  position: absolute;
  left: 50%;
  max-width: calc(100% - 32px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 0 #000a;
  transform: translate(-50%, -50%);
}
.banner {
  top: 30%;
  font-size: clamp(24px, 6vw, 52px);
  color: var(--gold);
}
.hint {
  top: 24%;
  width: max-content;
  padding: 8px 14px;
  font-size: clamp(15px, 2.6vw, 20px);
  background: #000a;
  border-radius: 12px;
}

/* The cards: the title, the courses, the talons, a pause and the end of a course. */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: #0b0612b0;
}
#title.overlay {
  background: #0b061266;
}
.card {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(400px, 100%);
  padding: 24px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px #000a;
}
.card.wide {
  width: min(720px, 100%);
}
.lede {
  font-size: 17px;
}

/* A dragon's picture, in its chunky pixels. */
.dragon {
  width: 128px;
  height: 112px;
  image-rendering: pixelated;
}
.dragon.small {
  width: 64px;
  height: 56px;
}

/* The journey: a strip of each land under its own sky, its six courses along a path, and its
   guardian at the end of it. */
.lands {
  display: grid;
  gap: 10px;
  width: 100%;
}
.land {
  position: relative;
  overflow: hidden;
  padding: 10px 12px 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.land.shut {
  filter: saturate(0.35) brightness(0.7);
}
.land .name {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  background: #000a;
  border-radius: 10px;
}
.path {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 0 6px;
}
.path::before {
  position: absolute;
  right: 70px;
  bottom: 38px;
  left: 20px;
  content: '';
  border-top: 4px dotted #ffffffb0;
}
.level {
  position: relative;
  display: grid;
  flex: none;
  place-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  background: #1d1526;
  border: 3px solid #ffffffd0;
  border-radius: 50%;
}
.level:nth-child(even) {
  margin-bottom: 20px;
}
.level small {
  font-size: 9px;
  letter-spacing: 0;
  color: var(--gold);
}
.level.done {
  border-color: var(--gold);
}
.level.next {
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px #ffd84a66,
    0 0 18px var(--gold);
}
.level.boss {
  width: 60px;
  height: 60px;
}
.land .dragon.small {
  flex: none;
  align-self: flex-end;
}
.land .floor {
  height: 12px;
  margin: 0 -12px;
}

.rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  width: 100%;
}
.talon {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px;
  background: #ffffff0d;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.talon.flying {
  border-color: var(--gold);
}
.talon .pair {
  display: flex;
  align-items: center;
  justify-content: center;
}
.talon .picture {
  width: 130px;
  height: 52px;
}
.talon .stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  font-size: 11px;
  text-align: left;
  color: var(--muted);
}
.talon .stats b {
  display: block;
  height: 6px;
  background: var(--ember);
  border-radius: 3px;
}

.stars {
  display: flex;
  gap: 6px;
  font-size: 44px;
  line-height: 1;
  color: #ffffff26;
}
.stars .on {
  color: var(--gold);
  text-shadow: 0 2px 0 #a8621a;
}
.goals {
  display: grid;
  gap: 2px;
  list-style: none;
  text-align: left;
}
.goals li::before {
  display: inline-block;
  width: 1.4em;
  content: '·';
  color: var(--muted);
}
.goals li.met::before {
  content: '★';
  color: var(--gold);
}
.sum {
  font-size: 22px;
  font-weight: 900;
}

@media (max-width: 520px) {
  .bar {
    gap: 6px;
  }
  .where .label {
    font-size: 10px;
  }
  .tally {
    padding: 0 10px;
    font-size: 18px;
  }
  .bar .gems {
    padding: 0 10px;
  }
  h1 {
    font-size: 38px;
  }
}
