@font-face {
  font-family: Fredoka;
  font-display: swap;
  src: url("../assets/fonts/fredoka.ttf");
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: Fredoka, system-ui, sans-serif;
  color: #fff;
  background: #493d81;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 4px solid #fff6a5;
  outline-offset: 2px;
}
.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: auto;
  background: #85c9d8 url("../assets/images/day.jpg") center/cover no-repeat;
}
.screen.active {
  display: block;
}
.screen:before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(#456ea72b, #42307465);
  pointer-events: none;
}
.screen > * {
  position: relative;
}
.panel {
  background: linear-gradient(145deg, #665797f8, #393b79f7);
  border: 4px solid #f5ddff;
  border-radius: 27px;
  box-shadow:
    0 7px 0 #3c306ba8,
    0 16px 30px #38275b70;
}
.loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 92%);
  padding: 28px;
  text-align: center;
}
.loading img {
  width: 115px;
  height: 120px;
  object-fit: contain;
  animation: bob 1.2s ease-in-out infinite;
}
.loading h1 {
  font-size: 37px;
  line-height: 1;
  color: #fff1b7;
  margin: 10px;
}
.loading em,
.homecard em {
  font-style: normal;
  color: #ffc5e4;
}
.loading p {
  color: #eee8ff;
}
.loadingbar {
  height: 19px;
  background: #2e285d;
  border: 2px solid #f4dcff;
  border-radius: 20px;
  overflow: hidden;
}
.loadingbar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffe38c, #ff9eae, #bba9ff);
}
.loading b {
  display: block;
  margin-top: 7px;
}
@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}
.top,
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 4%;
  max-width: 1400px;
  margin: auto;
}
.tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  background: #4f4687e3;
  border: 2px solid #f1ddff;
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff5cc;
}
header h2 {
  margin: 0;
  text-align: center;
  font-size: 26px;
}
.small {
  min-height: 46px;
  padding: 7px 16px;
  border: 3px solid #fff9e5;
  border-radius: 15px;
  background: linear-gradient(#fffdf6, #e0d4fa);
  box-shadow: 0 5px #6e61a6;
  color: #5e538d;
  font-weight: 700;
  font-size: 16px;
}
.btn {
  min-height: 54px;
  padding: 10px 15px;
  border: 3px solid #fff8ed;
  border-radius: 17px;
  box-shadow:
    inset 0 4px #ffffff78,
    0 6px 0 #50487f,
    0 10px 18px #261b5670;
  font-size: 18px;
  font-weight: 700;
  color: #505079;
}
.btn:active,
.small:active,
.level:active,
.arrow:active {
  transform: translateY(4px);
  box-shadow: 0 2px #554783;
}
.orange {
  background: linear-gradient(#ffe9a6, #ffb978);
  color: #78523a;
}
.blue {
  background: linear-gradient(#c3eeff, #8ac9f0);
}
.green {
  background: linear-gradient(#d0f4c1, #9bd9b8);
}
.pink {
  background: linear-gradient(#ffdae9, #f4abc9);
  color: #79536a;
}
.purple {
  background: linear-gradient(#e7bfff, #a88aec);
  color: #fff;
  text-shadow: 0 2px #7860a4;
}
.homebody {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: min(1060px, 92%);
  margin: 3vh auto;
}
.cover {
  width: min(40vw, 400px);
  aspect-ratio: 1;
  border: 7px solid #fff5ed;
  border-radius: 32px;
  overflow: hidden;
  box-shadow:
    0 9px #8974a6,
    0 20px 30px #34234880;
  transform: rotate(-2deg);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.homecard {
  width: 510px;
  padding: 30px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: #c5f5f4;
}
.homecard h1 {
  font-size: clamp(54px, 6vw, 72px);
  line-height: 0.92;
  margin: 16px 0 12px;
  color: #fff0ae;
  text-shadow: 0 4px #6d589c;
}
.homecard h1 em {
  display: block;
}
.homecard p,
.panel p {
  font-size: 18px;
  line-height: 1.35;
  color: #f3edff;
}
.wide {
  width: 100%;
  font-size: 22px;
}
.menubtns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 15px;
}
.menubtns .btn {
  font-size: 15px;
  padding: 7px 4px;
}
.foot {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.09em;
  margin-top: 18px;
  color: #e6dbf8;
}
.levelpanel,
.howpanel,
.settingspanel {
  width: min(850px, 94%);
  margin: 12px auto;
  text-align: center;
  padding: 23px;
}
.panel h2 {
  font-size: 29px;
  margin: 7px;
}
.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px;
}
.paging b {
  min-width: 120px;
}
.small:disabled {
  opacity: 0.5;
}
#levelGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.level {
  min-height: 73px;
  background: linear-gradient(#e7d9fc, #b8a6e9);
  border: 3px solid white;
  border-radius: 16px;
  box-shadow: 0 4px #6c5d9d;
  color: #5e528c;
  font-weight: 700;
}
.level b {
  font-size: 24px;
  display: block;
}
.level small {
  font-size: 13px;
}
.level:disabled {
  background: #9992ad;
  color: #e7e2ef;
  opacity: 0.8;
}
.levelpanel p {
  font-size: 14px;
}
.howgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.howgrid article {
  background: #38336db8;
  border: 2px solid #b5a7e0;
  border-radius: 16px;
  text-align: left;
  padding: 13px;
}
.howgrid article > b {
  font-size: 26px;
  color: #ffe490;
}
.howgrid h3 {
  margin: 5px 0;
}
.howgrid p {
  font-size: 14px;
  margin: 0;
}
.settingspanel {
  max-width: 450px;
}
.settingspanel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #34306baa;
  border-radius: 15px;
  padding: 12px;
  margin: 12px 0;
}
.compact {
  min-height: 42px;
  font-size: 15px;
}
.screen#game {
  overflow: hidden;
  transition: background-image 0.3s;
}
.screen#game.night {
  background-image: url("../assets/images/night.jpg");
}
.screen#game:before {
  background: linear-gradient(#294a6d1a, #3e30714d);
}
.gamehead {
  height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  background: #514b85ed;
  border-bottom: 3px solid #e3d4f4;
}
.gametitle {
  text-align: center;
  min-width: 170px;
}
.gametitle small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #e3d4fa;
}
.gametitle b {
  font-size: 21px;
}
.inventory {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff3d6;
  border: 2px solid white;
  border-radius: 30px;
  padding: 3px 10px;
  color: #7e6d86;
}
.inventory span {
  font-size: 10px;
  font-weight: 700;
}
.inventory b {
  font-size: 21px;
  color: #dc8c51;
}
.gamearea {
  height: calc(100% - 62px);
  width: min(1180px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns:
    minmax(0, min(850px, calc((100vh - 190px) * 1.4), calc(100% - 225px)))
    210px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 10px;
}
.objective {
  grid-column: 1/-1;
  text-align: center;
  background: #574d88ed;
  border: 2px solid #f2dcff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 4px #49396c99;
}
.objective b {
  display: block;
  font-size: 18px;
  color: #ffefad;
}
.objective span {
  font-size: 13px;
  display: block;
  color: #f5efff;
}
.island-area {
  grid-column: 1;
  grid-row: 2;
  aspect-ratio: 7/5;
  width: 100%;
  max-height: calc(100vh - 175px);
  position: relative;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  width: 100%;
  height: 100%;
  gap: 0;
  filter: drop-shadow(0 10px 10px #31325d50);
}
.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile img.platform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.tile img.object {
  position: absolute;
  width: 57%;
  height: 65%;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 3px 2px #51417180);
}
.tile img.hero {
  width: 72%;
  height: 77%;
  z-index: 4;
  filter: drop-shadow(0 4px 3px #3c2b6080);
}
.tile img.cottage {
  width: 77%;
  height: 80%;
}
.tile .marker {
  position: absolute;
  z-index: 5;
  bottom: 3px;
  background: #594d86eb;
  border-radius: 9px;
  padding: 1px 6px;
  font-size: clamp(7px, 0.9vw, 11px);
  font-weight: 700;
}
.tile .landing {
  position: absolute;
  z-index: 1;
  inset: 14%;
  border: 3px dashed #fafff6cc;
  border-radius: 27%;
  pointer-events: none;
}
.tile.hinted:after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 5%;
  border: 5px solid #fff18d;
  border-radius: 22%;
  animation: glow 1s infinite;
}
.tile.ghost {
  opacity: 0.55;
}
.tile:disabled {
  cursor: default;
}
.tile.empty {
  pointer-events: none;
}
.worldbadge,
.steps {
  position: absolute;
  z-index: 6;
  background: #514680e9;
  border: 2px solid #f2e3ff;
  border-radius: 20px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 4px #4c3b7580;
}
.worldbadge {
  top: 0;
  left: 0;
}
.steps {
  bottom: 0;
  right: 0;
}
@keyframes glow {
  50% {
    filter: brightness(1.35);
    transform: scale(0.92);
  }
}
.tools {
  grid-column: 2;
  grid-row: 2;
  padding: 14px;
  background: #514a86ee;
  border: 3px solid #f0dfff;
  border-radius: 21px;
  box-shadow: 0 6px #423c73aa;
}
.worldinfo {
  background: #ffffff20;
  border-radius: 12px;
  padding: 7px;
  text-align: center;
  margin: 9px 0;
  font-weight: 700;
  color: #fff4ba;
}
.tools > .btn {
  width: 100%;
  margin: 5px 0;
  font-size: 16px;
  min-height: 48px;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 150px;
  margin: 12px auto;
}
.arrow {
  min-width: 42px;
  height: 42px;
  border: 3px solid white;
  border-radius: 12px;
  background: linear-gradient(#fff4df, #ead4b6);
  box-shadow: 0 4px #765d89;
  color: #675780;
  font-size: 18px;
  font-weight: 700;
}
.extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.extra .btn {
  min-height: 44px;
  font-size: 14px;
  padding: 4px;
}
.note {
  font-size: 11px;
  text-align: center;
  color: #ffe8b2;
  margin-top: 8px;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #2d2159bb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.hidden {
  display: none !important;
}
.modal {
  text-align: center;
  width: min(430px, 100%);
  padding: 22px;
}
.modal img {
  height: 105px;
  width: 105px;
  object-fit: contain;
}
.modal h2 {
  font-size: 32px;
}
.modal p {
  margin: 10px 0;
  font-size: 17px;
}
.stars {
  font-size: 30px;
  color: #ffe78b;
  margin: 7px;
}
.modalbuttons {
  display: grid;
  gap: 10px;
}
@media (max-width: 700px) and (orientation: portrait) {
  .top,
  header {
    padding: 8px 12px;
  }
  header h2 {
    font-size: 20px;
  }
  .tag {
    font-size: 10px;
  }
  .homebody {
    flex-direction: column;
    gap: 10px;
    margin: 0 auto;
  }
  .cover {
    width: min(42vw, 170px);
    height: 145px;
  }
  .homecard {
    width: min(440px, 100%);
    padding: 16px;
  }
  .homecard h1 {
    font-size: clamp(41px, 10vw, 55px);
    margin: 8px 0;
  }
  .homecard h1 em {
    display: inline;
  }
  .homecard p {
    font-size: 15px;
    margin: 10px 0;
  }
  .foot {
    font-size: 9px;
    margin-top: 12px;
  }
  .menubtns .btn {
    font-size: 14px;
  }
  .levelpanel,
  .howpanel,
  .settingspanel {
    padding: 14px;
    margin: 8px auto;
  }
  #levelGrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .level {
    min-height: 60px;
  }
  .howgrid {
    grid-template-columns: repeat(2, 1fr);
    margin: 12px 0;
  }
  .howgrid p {
    font-size: 13px;
  }
  .gamehead {
    height: 54px;
    gap: 8px;
  }
  .gametitle {
    min-width: 115px;
  }
  .gametitle b {
    font-size: 18px;
  }
  .gametitle small {
    font-size: 9px;
  }
  .small {
    min-height: 42px;
    padding: 5px 11px;
  }
  .inventory span {
    font-size: 9px;
  }
  .gamearea {
    height: calc(100% - 54px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 7px;
  }
  .objective {
    width: min(96vw, 600px);
    padding: 5px;
  }
  .objective b {
    font-size: 15px;
  }
  .objective span {
    font-size: 12px;
  }
  .island-area {
    width: min(96vw, calc((100dvh - 315px) * 1.4));
    max-height: calc(100dvh - 315px);
  }
  .tile .marker {
    font-size: 7px;
  }
  .worldbadge,
  .steps {
    font-size: 9px;
    padding: 4px 7px;
  }
  .tools {
    width: min(96vw, 600px);
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    align-items: center;
  }
  .tools .eyebrow,
  .worldinfo,
  .note {
    display: none;
  }
  .tools > .btn {
    margin: 0;
    min-height: 45px;
    font-size: 14px;
    padding: 4px;
  }
  .tools #flip {
    grid-column: 1;
    grid-row: 1;
  }
  .tools #peek {
    grid-column: 2;
    grid-row: 1;
  }
  .pad {
    grid-column: 3;
    grid-row: 1/3;
    width: 100%;
    max-width: 112px;
    margin: 0 auto;
    gap: 3px;
  }
  .arrow {
    min-width: 0;
    height: 33px;
    border-width: 2px;
    border-radius: 9px;
    font-size: 13px;
  }
  .extra {
    grid-column: 1/3;
    grid-row: 2;
    gap: 6px;
  }
  .extra .btn {
    min-height: 39px;
  }
}
@media (max-width: 360px) and (orientation: portrait) {
  .gamehead {
    gap: 4px;
  }
  .gametitle {
    min-width: 82px;
  }
  .gametitle small {
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  .gametitle b {
    font-size: 16px;
  }
  .gamehead .small {
    font-size: 14px;
    min-width: 0;
    padding: 5px 8px;
  }
  .inventory {
    padding: 2px 6px;
    gap: 4px;
  }
  .inventory span {
    font-size: 8px;
  }
  .inventory b {
    font-size: 18px;
  }
  .tools > .btn {
    font-size: 12px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .gamehead {
    height: 46px;
  }
  .gamehead .small {
    min-height: 37px;
  }
  .gametitle b {
    font-size: 16px;
  }
  .gamearea {
    height: calc(100% - 46px);
    grid-template-columns: minmax(
        0,
        min(calc((100vh - 58px) * 1.4), calc(100% - 190px))
      ) 180px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .objective {
    grid-column: 2;
    grid-row: 1;
    padding: 3px;
  }
  .objective b {
    font-size: 12px;
  }
  .objective span {
    font-size: 10px;
  }
  .island-area {
    grid-column: 1;
    grid-row: 1/3;
    max-height: calc(100vh - 58px);
  }
  .tools {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    padding: 7px;
  }
  .tools .eyebrow,
  .worldinfo,
  .note {
    display: none;
  }
  .tools > .btn {
    min-height: 32px;
    margin: 2px 0;
    padding: 3px;
    font-size: 12px;
  }
  .pad {
    width: 115px;
    gap: 3px;
    margin: 4px auto;
  }
  .arrow {
    height: 31px;
    min-width: 0;
    font-size: 12px;
  }
  .extra .btn {
    min-height: 31px;
    font-size: 12px;
  }
}
.btn.hintflip {
  outline: 4px solid #fff38d;
  animation: glow 1s infinite;
}
.inventory {
  white-space: nowrap;
  flex-shrink: 0;
}
.worldbadge,
.steps {
  display: none;
}
.arrow img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.board.flipping {
  animation: flipIsland 0.42s ease-out;
}
@keyframes flipIsland {
  0% {
    transform: scaleX(0.1);
    opacity: 0.45;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .gamehead {
    gap: 5px;
  }
  .gametitle {
    min-width: 0;
  }
  .gametitle b {
    font-size: 16px;
    white-space: nowrap;
  }
  .inventory span {
    font-size: 8px;
  }
  .inventory b {
    font-size: 17px;
  }
  .gamehead .small {
    padding: 5px 9px;
    font-size: 14px;
  }
  .arrow img {
    width: 12px;
    height: 12px;
  }
}
@media (max-width: 360px) and (orientation: portrait) {
  .gametitle b {
    font-size: 14px;
  }
  .gametitle small {
    font-size: 7px;
  }
  .gamehead {
    gap: 4px;
  }
  .inventory {
    padding: 3px 5px;
  }
  .inventory b {
    font-size: 15px;
  }
}
/* Polished, readable controls with local high-resolution PNG artwork. */
.uiicon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 5px;
  filter: drop-shadow(0 2px 1px #4c3a6b66);
}
.btn {
  transition:
    filter 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.btn:hover,
.small:hover,
.arrow:hover,
.level:not(:disabled):hover {
  filter: brightness(1.09);
}
.btn:disabled {
  opacity: 0.6;
  filter: saturate(0.6);
}
.homecard .wide .uiicon {
  width: 38px;
  height: 38px;
}
.menubtns .uiicon {
  width: 26px;
  height: 26px;
  margin-right: 3px;
}
.objective .mission {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.mission span {
  background: #332d69a8;
  color: #f4e8ff;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 700;
  border: 1px solid #dac9f77a;
  border-radius: 12px;
  padding: 2px 8px;
}
.mission span.legend {
  color: #fff2bd;
}
.tile .gem {
  animation: gemFloat 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 8px #fff591) !important;
}
.tile .hero {
  animation: heroLand 0.25s ease-out;
}
.tile .cottage {
  filter: drop-shadow(0 4px 3px #493370aa);
}
.tile:has(.cottage) .marker {
  font-size: clamp(7px, 0.8vw, 10px);
  background: #473e7ae8;
}
.rewardstar {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px #533c5b);
  animation: starEnter 0.4s ease both;
}
.rewardstar:nth-child(2) {
  animation-delay: 0.12s;
}
.rewardstar:nth-child(3) {
  animation-delay: 0.24s;
}
.rewardstar.unearned {
  filter: grayscale(1);
  opacity: 0.28;
}
.modal img.rewardstar {
  width: 58px;
  height: 58px;
}
.modal {
  animation: modalEnter 0.3s ease-out;
}
.stars {
  min-height: 0;
  line-height: 1;
}
.tile .landing {
  border-color: #ffffffeb;
  box-shadow:
    0 0 5px #5a4b9b99,
    inset 0 0 5px #5a4b9b77;
}
.hintflip {
  animation: glow 1s infinite;
}
@keyframes gemFloat {
  50% {
    transform: translateY(-5%) scale(1.05);
  }
}
@keyframes heroLand {
  0% {
    transform: translateY(-16%) scale(0.9);
  }
  75% {
    transform: translateY(3%) scale(1.03);
  }
  100% {
    transform: none;
  }
}
@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
}
@keyframes starEnter {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-35deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .objective .mission {
    margin-top: 3px;
    gap: 4px;
  }
  .mission span {
    font-size: 9px;
    padding: 2px 6px;
  }
  .uiicon {
    width: 25px;
    height: 25px;
    margin-right: 3px;
  }
  .tools > .btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .extra .btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .extra .uiicon {
    width: 23px;
    height: 23px;
  }
  .island-area {
    width: min(96vw, calc((100dvh - 330px) * 1.4));
    max-height: calc(100dvh - 330px);
  }
}
@media (max-width: 360px) and (orientation: portrait) {
  .uiicon {
    width: 20px;
    height: 20px;
  }
  .menubtns .uiicon {
    width: 19px;
    height: 19px;
  }
  .mission span {
    font-size: 8px;
  }
  .objective b {
    font-size: 13px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .uiicon {
    width: 19px;
    height: 19px;
    margin-right: 2px;
  }
  .mission span {
    font-size: 8px;
    padding: 1px 4px;
  }
  .objective .mission {
    margin-top: 2px;
    gap: 2px;
  }
  .mission .legend {
    display: none;
  }
  .tools > .btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .extra .btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.board.invalid {
  animation: invalidNudge 0.3s ease;
}
@keyframes invalidNudge {
  25% {
    transform: translateX(-5px);
  }
  65% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* The next step is always visible while Guide is on. */
.arrow.guided {
  outline: 3px solid #ffe66f;
  box-shadow:
    0 0 12px 4px #ffef9d,
    0 4px #765d89;
  animation: guidePulse 1s ease-in-out infinite;
}
.btn.hintflip {
  box-shadow:
    0 0 14px 5px #fff19a,
    0 5px #67528b;
}
.other-crystal {
  position: absolute;
  z-index: 3;
  inset: 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 4px #29134f);
}
.other-crystal img {
  width: 53%;
  height: 62%;
  object-fit: contain;
  opacity: 0.65;
}
.other-crystal b {
  display: block;
  white-space: nowrap;
  background: #50468de8;
  color: #fff9d4;
  border: 1px solid #f8eaff;
  border-radius: 8px;
  font-size: clamp(6px, 0.65vw, 9px);
  padding: 1px 4px;
  line-height: 1.05;
}
.tile.empty .other-crystal img {
  opacity: 0.8;
}
.tile .gem {
  filter: drop-shadow(0 0 12px #fff5a1) !important;
  animation: gemFloat 1.8s ease-in-out infinite;
}
.tile.hinted:after {
  border-color: #fff48b;
  box-shadow:
    0 0 12px 4px #fff1a3,
    inset 0 0 7px #ffed6b;
}
.extra #hint[aria-pressed="true"] {
  box-shadow:
    inset 0 4px #ffffff78,
    0 0 0 2px #fff3ab,
    0 5px #50487f;
}
@keyframes guidePulse {
  50% {
    filter: brightness(1.2);
  }
}
.tile .marker {
  color: #fff9e9;
  text-shadow: 0 1px #40315d;
}
.other-crystal b {
  font-size: clamp(8px, 0.8vw, 10px);
  padding: 2px 4px;
  box-shadow: 0 2px 4px #38205a75;
}
.other-crystal img {
  animation: gemFloat 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 7px #ffe078);
}
.btn.hintflip {
  animation: flipGlow 1s ease-in-out infinite;
}
@keyframes flipGlow {
  50% {
    filter: brightness(1.18);
    box-shadow:
      0 0 20px 7px #fff8be,
      0 5px #67528b;
  }
}
.sidechip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.sidechip img {
  height: 18px;
  width: 18px;
  object-fit: contain;
}
.sidechip b {
  font: inherit;
}
.worldinfo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.worldinfo img {
  height: 27px;
  width: 27px;
  object-fit: contain;
}
.tools #flip {
  min-height: 56px;
  font-size: 20px;
}
.tools #flip .uiicon {
  width: 40px;
  height: 40px;
}
.other-crystal b {
  font-size: clamp(9px, 0.9vw, 11px);
  min-width: 30px;
  text-align: center;
}
@media (max-width: 700px) and (orientation: portrait) {
  .tools #flip {
    grid-column: 1/3;
    grid-row: 1;
    min-height: 48px;
    font-size: 18px;
  }
  .tools #flip .uiicon {
    width: 32px;
    height: 32px;
  }
  .sidechip img {
    width: 15px;
    height: 15px;
  }
  .extra {
    grid-column: 1/3;
    grid-row: 2;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .tools #flip {
    min-height: 39px;
    font-size: 15px;
  }
  .tools #flip .uiicon {
    width: 26px;
    height: 26px;
  }
  .sidechip img {
    width: 12px;
    height: 12px;
  }
}
.objective .mission .sidechip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
@media (max-width: 700px) and (orientation: portrait) {
  .worldinfo {
    display: none;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .worldinfo {
    display: none;
  }
}

/* Icons, level stars and footer details */
.ic {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.level small .ic {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: -2px;
}
.level small.mini {
  display: flex;
  justify-content: center;
  gap: 2px;
}
.level small.mini img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.level small.mini img.off {
  filter: grayscale(1) brightness(0.55);
  opacity: 0.7;
}
.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 700px) and (orientation: portrait) {
  .gamehead .small .lbl {
    display: none;
  }
  .gamehead .small .ic {
    margin: 0;
  }
}
.ic.r {
  margin: 0 0 0 6px;
}
/* Short screens (landscape phones, small laptops): every menu fits without scrolling. */
@media (max-height: 560px) {
  .top,
  header {
    padding: 6px 3%;
  }
  header h2 {
    font-size: 20px;
  }
  .small {
    min-height: 34px;
    padding: 3px 12px;
    font-size: 14px;
  }
  .tag {
    font-size: 10px;
    padding: 5px 10px;
  }
  .homebody {
    gap: 18px;
    margin: 0 auto;
  }
  .cover {
    width: min(36vw, 58vh);
    border-width: 5px;
    border-radius: 22px;
  }
  .homecard {
    width: min(480px, 56vw);
    padding: 14px 18px;
  }
  .homecard h1 {
    font-size: clamp(30px, 9vh, 46px);
    margin: 6px 0 4px;
  }
  .homecard p,
  .panel p {
    font-size: 14px;
    margin: 4px 0 8px;
  }
  .eyebrow {
    font-size: 10px;
  }
  .homecard .wide {
    min-height: 44px;
    font-size: 16px;
  }
  .homecard .wide .uiicon {
    width: 28px;
    height: 28px;
  }
  .menubtns {
    margin-top: 8px;
  }
  .menubtns .btn {
    min-height: 40px;
    font-size: 14px;
  }
  .menubtns .uiicon {
    width: 20px;
    height: 20px;
  }
  .foot {
    margin-top: 8px;
  }
  .levelpanel,
  .howpanel,
  .settingspanel {
    margin: 4px auto;
    padding: 8px 12px;
  }
  .panel h2 {
    font-size: 20px;
    margin: 2px 0;
  }
  .paging {
    margin: 6px;
  }
  #levelGrid {
    gap: 6px;
  }
  .level {
    min-height: 50px;
  }
  .level b {
    font-size: 18px;
  }
  .levelpanel > p {
    display: none;
  }
  .howgrid {
    margin: 8px 0;
  }
  .howgrid article {
    padding: 8px;
  }
  .howgrid article > b {
    font-size: 18px;
  }
  .howgrid h3 {
    font-size: 14px;
    margin: 2px 0;
  }
  .howgrid p {
    font-size: 12px;
  }
  .howpanel .btn {
    min-height: 40px;
  }
  .settingspanel > div {
    padding: 6px 10px;
    margin: 6px 0;
  }
}
@media (max-height: 400px) {
  .homecard p {
    display: none;
  }
  .homecard h1 {
    font-size: 26px;
  }
  .homecard {
    padding: 10px 16px;
  }
  .homecard .wide,
  .menubtns .btn {
    min-height: 36px;
  }
  .levelpanel .eyebrow,
  .levelpanel h2 {
    display: none;
  }
  .level {
    min-height: 40px;
  }
  .level b {
    font-size: 16px;
  }
  .level small.mini img,
  .level small .ic {
    width: 12px;
    height: 12px;
  }
  .howpanel .howgrid p {
    font-size: 11px;
  }
  .howgrid article {
    padding: 5px 7px;
  }
  .howgrid article > b {
    display: none;
  }
  .howpanel h2 {
    font-size: 17px;
  }
  .howpanel .btn {
    min-height: 34px;
  }
}
@media (max-width: 360px) {
  .paging {
    gap: 6px;
  }
  .paging b {
    min-width: 0;
    font-size: 14px;
  }
  .paging .small {
    padding: 3px 8px;
  }
}
@media (max-width: 360px) and (min-height: 401px) {
  .cover {
    width: min(46vw, 30vh);
  }
  .homebody {
    gap: 10px;
    margin: 0 auto;
  }
  .homecard {
    padding: 14px;
  }
  .homecard h1 {
    font-size: 38px;
    margin: 6px 0;
  }
  .homecard p {
    font-size: 14px;
  }
  .foot {
    margin-top: 10px;
  }
  .levelpanel {
    padding: 10px;
  }
  #levelGrid {
    gap: 6px;
  }
  .level {
    min-height: 56px;
  }
  .howgrid {
    gap: 6px;
    margin: 10px 0;
  }
  .howgrid article {
    padding: 8px;
  }
  .howgrid p {
    font-size: 12px;
  }
  .howgrid article > b {
    font-size: 20px;
  }
}
@media (max-width: 360px) and (max-height: 620px) and (min-height: 401px) {
  .cover {
    display: none;
  }
  .level {
    min-height: 46px;
  }
  .howgrid article > b {
    display: none;
  }
  .howgrid article {
    padding: 6px 8px;
  }
  .howgrid h3 {
    font-size: 14px;
  }
  .howpanel h2 {
    font-size: 20px;
  }
}
/* End of style.css */
