/* "Chíp săn chữ" (#wordsky, #wordsky/<n>): the cloud map and the game stage. The sky, the HUD
   chips and the clue card keep the app's fixed illustration colours in both themes (like the
   app); the cards and the side panels follow the page theme. */

.wordsky-map-screen,
.wordsky-play {
  --ws-ink: #233046;
  --ws-teal: #0e8c7e;
  --ws-gold: #ffc93c;
  --ws-gold-deep: #e09a12;
  --ws-heart: #ff5a6e;
  --ws-good: #2bb673;
  --ws-chip: #ffffff;
  --ws-height: calc(100dvh - var(--header-h, 64px));
  font-family: var(--font-app);
}

/* The map: phones give it the whole space under the app bar (no tab bar); wide screens drop the
   footer and the page padding so it can be as tall as the window. */
@media (max-width: 767px) {
  .app-shell:has(.wordsky-map-screen) .sidebar {
    display: none;
  }
  .app-shell:has(.wordsky-map-screen) .workspace {
    padding-bottom: 0;
  }
  main:has(> .wordsky-map-screen) {
    padding: 0;
    min-height: 0;
  }
}
@media (min-width: 768px) {
  main:has(> .wordsky-map-screen) {
    max-width: none;
    padding: 12px 20px 0;
    min-height: 0;
  }
  .app-shell:has(.wordsky-map-screen) .app-footer {
    display: none;
  }
  .wordsky-map-screen {
    --ws-height: calc(100dvh - var(--header-h, 64px) - 24px);
  }
}

/* A level has the whole window (wordsky-focus on <html>, plus the browser's fullscreen when a
   click started it): the app's bars step aside and the game lies over the page. */
.wordsky-focus .app-shell .sidebar,
.wordsky-focus .app-shell .topbar,
.wordsky-focus .app-shell .app-footer {
  display: none;
}
.wordsky-focus,
.wordsky-focus body {
  overflow: hidden;
}

/* The app's glassy chip (HudSurface): a white-to-ice fill, a bright edge and a soft shadow. */
.wordsky-glass {
  background: linear-gradient(#fff, #f1f6ff);
  border: 1px solid #fff;
  box-shadow: 0 2px 10px #23304654;
  color: var(--ws-ink);
}

/* ---------- the map ---------- */

.wordsky-map-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: var(--ws-height);
  min-height: 420px;
}
.wordsky-map-col {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #2b1d5e;
}
.wordsky-map-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  outline: none;
}
.wordsky-map {
  position: relative;
  width: 100%;
  /* The living layer hangs past the window and follows the scroll: clipped here, it can never
     push the map's end further down (each scroll would otherwise grow it into empty sky). */
  overflow: hidden;
  overflow: clip;
}
.wordsky-map-tiles canvas {
  position: absolute;
  left: 0;
  display: block;
}
/* The living layer: a window-sized canvas the script keeps over the part of the map on screen. */
.wordsky-map-life {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  pointer-events: none;
  will-change: transform;
}
.wordsky-land {
  position: absolute;
  top: 112px;
  left: 50%;
  width: 300px;
  margin-left: -150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.wordsky-land img {
  width: 300px;
  height: auto;
  animation: wordsky-float 2.4s ease-in-out infinite alternate;
}
.wordsky-land-chip,
.wordsky-sign,
.wordsky-map-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 24px;
  color: var(--ws-ink);
  font-family: var(--font-app-bold);
  font-size: 0.8rem;
  line-height: 1.2;
}
.wordsky-land-chip {
  background: #ffffffe0;
}
.wordsky-land-chip .mi {
  width: 14px;
  height: 14px;
}
.wordsky-land.is-reached .wordsky-land-chip {
  background: var(--ws-gold);
}
.wordsky-signs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wordsky-sign {
  position: absolute;
  right: 16px;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  white-space: nowrap;
}
.wordsky-sign.is-left {
  right: auto;
  left: 16px;
}
/* "Tầng 11–20" over the band's name: two short lines fit beside a cloud near the middle. */
.wordsky-sign-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.wordsky-sign-text span {
  color: var(--ws-teal);
  font-family: var(--font-app);
}
/* The band's own sky, as a little swatch. */
.wordsky-swatch {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
}
.wordsky-clouds {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* A level's cloud: its picture (drawn once by the script, the open one glowing and pulsing) behind
   the number; each cloud bobs on its own beat (an animation on `translate`). */
.wordsky-cloud {
  position: absolute;
  top: 0;
  left: 0;
  width: 104px;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 40px;
  background: none;
  color: var(--ws-teal);
  cursor: pointer;
  font: 1.4rem/1 var(--font-app-bold);
  display: grid;
  place-items: center;
}
.wordsky-cloud::before {
  content: "";
  position: absolute;
  inset: -34px;
  /* Its picture (open, locked or current, in its level's shape), set on the button as --look. */
  background: var(--look) center / 100% 100% no-repeat;
  pointer-events: none;
}
.wordsky-cloud.is-current::before {
  animation: wordsky-cloud-pulse 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.wordsky-cloud.is-locked {
  color: #23304666;
  cursor: default;
}
.wordsky-cloud:focus-visible {
  outline: 3px solid var(--ws-gold);
  outline-offset: 2px;
}
.wordsky-cloud-number {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: -8px;
}
.wordsky-cloud-number .mi {
  width: 14px;
  height: 14px;
  color: #23304659;
}
.wordsky-cloud-stars {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
}
.wordsky-star {
  display: inline-flex;
  color: #ffffffb3;
}
.wordsky-star .mi {
  width: 16px;
  height: 16px;
}
.wordsky-star:nth-child(2) .mi {
  width: 20px;
  height: 20px;
}
.wordsky-star.is-on {
  color: var(--ws-gold);
}
.wordsky-map-chip {
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 58px;
  pointer-events: none;
  will-change: transform;
}
.wordsky-map-stars {
  position: absolute;
  top: 12px;
  right: 12px;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.9rem;
}
.wordsky-map-stars .mi {
  width: 20px;
  height: 20px;
  color: var(--ws-gold);
}
.wordsky-map-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.wordsky-map-cta > * {
  pointer-events: auto;
}
.wordsky-map-hint:empty {
  display: none;
}
.wordsky-map-hint {
  margin: 0;
  padding: 8px 16px;
  border-radius: 24px;
  background: #1f2a2ae6;
  color: #fff;
  font-size: 0.9rem;
}
/* The one thing to press: it breathes gently. */
.wordsky-map-cta .wordsky-play-link {
  min-width: 236px;
  animation: wordsky-breathe 1.05s ease-in-out infinite alternate;
}

/* The game's own button (the app's GameButton): a glossy gold capsule sitting on a darker lip,
   pressing down onto it; a band of light runs across it now and then. */
.wordsky-game-button {
  --lip: 5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 55px;
  margin-bottom: var(--lip);
  padding: 0 26px 0 14px;
  border: 1.5px solid #ffffff73;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #ffffff73 0%, #ffffff00 50%) top / 100% 100% no-repeat,
    linear-gradient(180deg, #ffd84d, #ffa21f);
  box-shadow: 0 var(--lip) 0 #d9740a, 0 calc(var(--lip) + 4px) 10px #23304640;
  color: #5a3300;
  font: 1.15rem/1 var(--font-app-bold);
  text-decoration: none;
  text-shadow: 0 2px 0 #d9740a59;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.wordsky-game-button::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% 0;
  width: 46px;
  background: linear-gradient(90deg, #fff0, #ffffff8c, #fff0);
  transform: translateX(-80px) rotate(20deg);
  animation: wordsky-shine 3.4s linear infinite;
  pointer-events: none;
}
.wordsky-game-button:active {
  transform: translateY(var(--lip));
  box-shadow: 0 0 0 #d9740a, 0 3px 6px #23304640;
}
.wordsky-game-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.wordsky-game-button.is-rose {
  border-color: #ffffff80;
  background:
    linear-gradient(180deg, #ffffff73 0%, #ffffff00 50%) top / 100% 100% no-repeat,
    linear-gradient(180deg, #ffa3b1, #f0506a);
  box-shadow: 0 var(--lip) 0 #bf334d, 0 calc(var(--lip) + 4px) 10px #23304640;
  color: #fff;
  text-shadow: 0 2px 0 #bf334d59;
}
.wordsky-game-button.is-rose:active {
  box-shadow: 0 0 0 #bf334d, 0 3px 6px #23304640;
}
.wordsky-game-button.is-rose .wordsky-game-disc {
  box-shadow: inset 0 0 0 2px #bf334d40;
  color: #f0506a;
}
.wordsky-game-disc {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px #d9740a40;
  color: #ffa21f;
}
.wordsky-game-disc .mi {
  width: 22px;
  height: 22px;
}
@keyframes wordsky-shine {
  0%,
  55% {
    transform: translateX(-80px) rotate(20deg);
  }
  100% {
    transform: translateX(420px) rotate(20deg);
  }
}

/* Mầm on the starting hill, waving, with a bubble over its head. */
.wordsky-cheer {
  position: absolute;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.wordsky-cheer-bubble {
  position: relative;
  margin-bottom: 8px;
  padding: 7px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f1f6ff);
  box-shadow: 0 3px 8px #23304633;
  color: var(--ws-teal);
  font: 0.95rem/1.2 var(--font-app-bold);
  white-space: nowrap;
  animation: wordsky-cheer-in 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 700ms backwards, wordsky-cheer-float 1.6s ease-in-out 1.2s infinite alternate;
  transform-origin: 50% 100%;
}
.wordsky-cheer-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  margin-left: -8px;
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: #f1f6ff;
}
.wordsky-cheer-mam {
  width: 64px;
}
@keyframes wordsky-cheer-in {
  from {
    opacity: 0;
    transform: scale(0);
  }
}
@keyframes wordsky-cheer-float {
  from {
    translate: 0 -2px;
  }
  to {
    translate: 0 2px;
  }
}
.wordsky-map-panel {
  display: none;
}

/* Wide screens: the map in a rounded column beside a panel of progress, bands and how to play. */
@media (min-width: 1024px) {
  .wordsky-map-screen {
    grid-template-columns: minmax(360px, 520px) minmax(280px, 340px);
    justify-content: center;
    gap: 24px;
  }
  .wordsky-map-col {
    border-radius: var(--md-radius-xl, 24px);
    box-shadow: var(--md-card-shadow);
  }
  .wordsky-map-cta .wordsky-play-link {
    display: none;
  }
  .wordsky-panel-card .wordsky-game-button {
    width: 100%;
  }
  .wordsky-map-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 16px;
  }
}

/* ---------- panels (map and stage) ---------- */

.wordsky-panel-card {
  padding: 18px 20px;
}
.wordsky-eyebrow {
  margin: 0 0 8px;
  color: var(--md-on-surface-variant, var(--muted));
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wordsky-panel-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--md-on-surface-variant, var(--muted));
}
.wordsky-panel-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.wordsky-panel-stats strong {
  color: var(--md-on-surface, var(--ink));
  font-size: 1.5rem;
  margin-right: 2px;
}
.wordsky-panel-stats .mi {
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--ws-gold-deep);
}
.wordsky-panel-next {
  margin: 14px 0 10px;
  font-family: var(--font-app-bold);
  font-size: 1.1rem;
}
.wordsky-panel-next span {
  color: var(--md-primary, var(--teal));
}
.wordsky-panel-card .button {
  width: 100%;
  justify-content: center;
}
.wordsky-panel-note {
  margin: 0;
  color: var(--md-on-surface-variant, var(--muted));
  font-size: 0.92rem;
}
.wordsky-tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.wordsky-tiers li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--md-radius-m, 12px);
}
.wordsky-tiers li.is-current {
  background: var(--md-primary-container, var(--mint));
}
.wordsky-tier-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #0001;
}
.wordsky-howto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  text-align: left;
}
.wordsky-howto li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}
.wordsky-howto-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--md-primary-container, var(--mint));
  color: var(--md-primary, var(--teal));
}
.wordsky-howto-icon .mi {
  width: 22px;
  height: 22px;
}
.wordsky-eagle-mini {
  width: 36px;
  height: 36px;
}

/* ---------- a level in play ---------- */

.wordsky-play {
  position: fixed;
  inset: 0;
  z-index: 40;
}
/* The sky edge to edge (the tier's gradient under its canvas); the game (HUD, clue, field) in a
   phone-shaped column down the middle. */
.wordsky-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #8ed0ff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.wordsky-sky,
.wordsky-fx {
  position: absolute;
  inset: 0;
  display: block;
}
/* The effects over the game (a hit's red glow, the clouds parting): white until the first frame
   of the curtain, so a new level never flashes before it. */
.wordsky-fx {
  z-index: 4;
  pointer-events: none;
}
.wordsky-fx.is-covered {
  background: #fff;
}
.wordsky-column {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  height: 100%;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.wordsky-hud {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}
.wordsky-chip-button {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wordsky-chip-button .mi {
  width: 24px;
  height: 24px;
}
.wordsky-hud-level,
.wordsky-hearts {
  border-radius: 24px;
}
.wordsky-hud-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  min-width: 0;
}
.wordsky-hud-title {
  font-size: 0.75rem;
  line-height: 1.25;
  white-space: nowrap;
  color: #233046a6;
}
.wordsky-hud-title strong {
  font-family: var(--font-app-bold);
  font-size: 0.875rem;
  color: var(--ws-ink);
}
.wordsky-hud-dot {
  margin: 0 3px;
}
/* Ten segments for the ten gates: gold once opened, the current one wider and pulsing teal. */
.wordsky-progress {
  display: flex;
  gap: 3px;
}
.wordsky-progress span {
  width: 11px;
  height: 6px;
  border-radius: 3px;
  background: #23304624;
  transition:
    background-color 0.35s ease,
    width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wordsky-progress .is-current {
  width: 16px;
  background: var(--ws-teal);
  animation: wordsky-gate-pulse 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.wordsky-progress .is-done {
  background: var(--ws-gold);
}
.wordsky-hearts {
  display: flex;
  gap: 3px;
  padding: 10px;
}
.wordsky-heart {
  position: relative;
  display: inline-flex;
  color: #23304647;
  transition: color 0.25s ease;
}
.wordsky-heart.is-on {
  color: var(--ws-heart);
}
.wordsky-heart .mi {
  width: 20px;
  height: 20px;
}
.wordsky-heart-puff {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  pointer-events: none;
}
/* The gate's clue: it turns over to the English word (a shine runs across it) and back. */
.wordsky-clue {
  position: relative;
  margin: 0 16px;
  border-radius: 24px;
  overflow: hidden;
}
.wordsky-clue-face {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 8px 12px;
}
.wordsky-clue-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, #fff0 calc(50% - 70px), #ffffffbf 50%, #fff0 calc(50% + 70px));
  opacity: 0;
  pointer-events: none;
}
.wordsky-clue-badge {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(#ffd45e, #e09a12);
  color: #fff;
}
.wordsky-clue-badge.is-open {
  background: linear-gradient(#5bd69a, #1e9e63);
}
.wordsky-clue-badge .mi {
  width: 20px;
  height: 20px;
}
.wordsky-clue-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.wordsky-clue-text strong {
  font-family: var(--font-app-bold);
  font-size: 1.375rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wordsky-clue-text strong[lang="en"] {
  color: var(--ws-teal);
}
.wordsky-clue-label {
  color: #23304699;
  font-size: 0.8125rem;
}
.wordsky-clue-text strong + span {
  color: #233046bf;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wordsky-speak {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #0e8c7e1f;
  color: var(--ws-teal);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wordsky-speak .mi {
  width: 24px;
  height: 24px;
}
.wordsky-field {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  cursor: grab;
}
.wordsky-field:active {
  cursor: grabbing;
}
.wordsky-field-canvas {
  position: absolute;
  inset: 0;
  display: block;
}
/* "Tầng 12 · Khó", springing in while the level's first gate drops in. */
.wordsky-banner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.wordsky-banner-card {
  padding: 12px 30px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
}
.wordsky-banner.is-shown .wordsky-banner-card {
  opacity: 1;
}
.wordsky-banner strong {
  font-family: var(--font-app-bold);
  font-size: 1.75rem;
  line-height: 1.25;
}
.wordsky-tier-pill {
  padding: 3px 12px;
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-app-bold);
  font-size: 0.875rem;
}

/* Cards over the stage: how to play, the helper's question, pause, the level's end. Each lies on
   its own layer (the old one fades out under the new): a dimmed screen, the card centred on it. */
.wordsky-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.wordsky-overlay[hidden] {
  display: none;
}
.wordsky-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.wordsky-layer.is-closing {
  pointer-events: none;
}
.wordsky-scrim {
  position: absolute;
  inset: 0;
  background: #0b15308c;
}
.wordsky-confetti {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.wordsky-card-place {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.wordsky-card {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border-radius: 28px;
  background: var(--md-surface, #fff);
  color: var(--md-on-surface, var(--ink));
  box-shadow: 0 12px 40px #0b153059;
  text-align: center;
}
/* The card's little sky in the level's colours, the art standing on a cloud. */
.wordsky-card-sky {
  position: relative;
  height: 126px;
}
.wordsky-card-sky canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.wordsky-card-land {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 118px;
  height: auto;
  margin-left: -59px;
}
.wordsky-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 20px;
}
.wordsky-card h2 {
  margin: 0;
  font-family: var(--font-app-bold);
  font-size: 1.5rem;
  line-height: 1.3;
}
.wordsky-card p {
  margin: 0;
  color: var(--md-on-surface-variant, var(--muted));
}
.wordsky-card-body .button {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  font-size: 1rem;
}
.wordsky-card-body .wordsky-game-button {
  width: 100%;
}
.wordsky-card-body .button.text {
  width: auto;
  min-height: 44px;
  color: var(--md-primary, var(--teal));
}
/* A cleared level's three big glossy stars, the middle one raised (drawn in canvases). */
.wordsky-big-stars {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
}
.wordsky-big-star {
  position: relative;
  width: 60px;
  height: 60px;
  margin-top: 18px;
}
.wordsky-big-star:nth-child(2) {
  width: 78px;
  height: 78px;
  margin-top: 0;
}
.wordsky-big-star canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.wordsky-big-star:first-child .wordsky-star-art {
  transform: rotate(-14deg);
}
.wordsky-big-star:last-child .wordsky-star-art {
  transform: rotate(14deg);
}
.wordsky-big-star .wordsky-burst {
  inset: -45px;
  width: auto;
  height: auto;
}
.wordsky-finale-title {
  margin: 0;
  font: 1.35rem/1.3 var(--font-app-bold);
}

/* The cleared card's title on a gold ribbon across the foot of its sky. */
.wordsky-card.has-ribbon .wordsky-card-body {
  padding-top: 42px;
}
.wordsky-ribbon {
  position: absolute;
  left: 50%;
  bottom: -34px;
  width: min(340px, 94%);
  height: 62px;
  transform: translateX(-50%);
  z-index: 1;
}
.wordsky-ribbon canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.wordsky-card .wordsky-ribbon h2 {
  --ink: #a35a00;
  position: relative;
  margin: 0;
  padding: calc(62px * 0.42 - 15px) 54px 0;
  color: #fff;
  font: 1.35rem/30px var(--font-app-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* A dark outline round white letters, like a game's title. */
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink);
}
.wordsky-card .wordsky-ribbon.is-rose h2 {
  --ink: #9c2338;
}
.wordsky-card .wordsky-ribbon.is-sky h2 {
  --ink: #1a5a94;
}
@media (max-width: 340px) {
  .wordsky-card .wordsky-ribbon h2 {
    font-size: 1.1rem;
  }
}

/* The way on, as pictures: round glossy balls on their lips, the next level biggest. */
.wordsky-result-buttons {
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
}
.wordsky-round {
  --size: 58px;
  --lip: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--md-on-surface, var(--ink));
  font: 0.875rem/1.2 var(--font-app-bold);
  text-decoration: none;
  cursor: pointer;
}
.wordsky-round.is-big {
  --size: 80px;
}
.wordsky-round-face {
  position: relative;
  width: var(--size);
  height: var(--size);
  margin-bottom: var(--lip);
  border: 1.5px solid #ffffff80;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 68% 41% at 50% 24%, #ffffff73, #fff0 100%),
    linear-gradient(180deg, var(--face-top), var(--face-bottom));
  box-shadow: 0 var(--lip) 0 var(--lip-color), 0 calc(var(--lip) + 3px) 8px #23304640;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.wordsky-round-face canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.wordsky-round:active .wordsky-round-face {
  transform: translateY(var(--lip));
  box-shadow: 0 0 0 var(--lip-color), 0 3px 6px #23304640;
}
.wordsky-round:focus-visible {
  outline: none;
}
.wordsky-round:focus-visible .wordsky-round-face {
  outline: 3px solid var(--ws-gold);
  outline-offset: 3px;
}
.wordsky-round.is-green {
  --face-top: #86e57f;
  --face-bottom: #2fb34c;
  --lip-color: #1e8436;
}
.wordsky-round.is-sky {
  --face-top: #7fd3ff;
  --face-bottom: #2e8fe0;
  --lip-color: #1c64a8;
}
.wordsky-round.is-rose {
  --face-top: #ffa3b1;
  --face-bottom: #f0506a;
  --lip-color: #bf334d;
}
.wordsky-round.is-orange {
  --face-top: #ffc27a;
  --face-bottom: #ff8a1f;
  --lip-color: #c85f05;
}

/* Bác Đại Bàng's two choices: pale 3D tiles with a picture on each. */
.wordsky-help-choices {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wordsky-tile {
  --lip: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--lip);
  padding: 12px 10px 14px;
  border: 1.5px solid #ffffffb3;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--face-top), var(--face-bottom));
  box-shadow: 0 var(--lip) 0 var(--lip-color), 0 calc(var(--lip) + 3px) 8px #23304633;
  color: var(--tile-ink);
  font: inherit;
  cursor: pointer;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.wordsky-tile:active:not(:disabled) {
  transform: translateY(var(--lip));
  box-shadow: 0 0 0 var(--lip-color), 0 3px 6px #23304633;
}
.wordsky-tile:disabled {
  opacity: 0.5;
  cursor: default;
}
.wordsky-tile:focus-visible {
  outline: 3px solid var(--ws-gold);
  outline-offset: 3px;
}
.wordsky-tile strong {
  margin-top: 6px;
  font: 1rem/1.25 var(--font-app-bold);
}
.wordsky-tile span {
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0.7;
}
.wordsky-tile.is-gold {
  --face-top: #fff8dd;
  --face-bottom: #ffe08f;
  --lip-color: #e2ab3b;
  --tile-ink: #5a3300;
}
.wordsky-tile.is-sky {
  --face-top: #eaf6ff;
  --face-bottom: #addcff;
  --lip-color: #5da4dd;
  --tile-ink: #123a5e;
}
.wordsky-tile-art {
  display: block;
  width: 96px;
  height: 70px;
}

.wordsky-card-caption {
  font-size: 0.8125rem;
}
.wordsky-card-words {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wordsky-card-words button,
.wordsky-opened button {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--md-radius-m, 12px);
  background: var(--md-surface-variant, #e7eeec);
  color: var(--md-on-surface, var(--ink));
  padding: 8px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font: inherit;
}
.wordsky-card-words strong,
.wordsky-opened strong {
  font-family: var(--font-app-bold);
  color: var(--md-primary, var(--teal));
}
.wordsky-card-words span,
.wordsky-opened span {
  font-size: 0.8125rem;
  color: var(--md-on-surface-variant, var(--muted));
}
.wordsky-side {
  display: none;
}
.wordsky-side-title {
  margin: 0;
  font-family: var(--font-app-bold);
  font-size: 1.6rem;
}
.wordsky-side-gate {
  margin: 2px 0 14px;
  color: var(--md-on-surface-variant, var(--muted));
}
.wordsky-side-actions {
  display: grid;
  gap: 8px;
}
.wordsky-opened {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wordsky-opened button {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
}
.wordsky-opened button .mi {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  width: 20px;
  height: 20px;
  color: var(--md-primary, var(--teal));
}

/* Wide screens: a panel of the level, the words opened and tips floats at the right, over the sky. */
@media (min-width: 1100px) {
  .wordsky-side {
    position: absolute;
    top: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 3;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
  }
  .wordsky-side .web-card {
    box-shadow: 0 4px 18px #0000001f;
  }
}

/* A level not yet open (a typed URL). */
.wordsky-locked {
  display: grid;
  place-items: center;
  min-height: 60vh;
}
.wordsky-locked .web-card {
  max-width: 420px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.wordsky-locked h2 {
  margin: 0;
}
.wordsky-locked-chip {
  width: 120px;
  height: 96px;
}

@keyframes wordsky-float {
  from {
    transform: translateY(-6px);
  }
  to {
    transform: translateY(6px);
  }
}
@keyframes wordsky-cloud-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}
@keyframes wordsky-gate-pulse {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
@keyframes wordsky-breathe {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.025);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wordsky-land img,
  .wordsky-cloud.is-current::before,
  .wordsky-progress .is-current,
  .wordsky-map-cta .wordsky-play-link,
  .wordsky-game-button::after,
  .wordsky-cheer-bubble {
    animation: none;
  }
  .wordsky-game-button::after {
    display: none;
  }
  .wordsky-progress span,
  .wordsky-heart {
    transition: none;
  }
}

/* The card takes focus itself for touch and mouse players: no ring on it. */
.wordsky-card:focus {
  outline: none;
}
