@font-face {
  font-family: Krabby;
  src: url("../assets/krabby-patty.ttf");
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #62cbd8;
  color: #17303b;
  font-family: Arial, sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 4px solid #fa67af;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#game,
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
header {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.back {
  font-size: 13px;
  letter-spacing: 1px;
  color: #163846;
  text-decoration: none;
  background: #fff7d7;
  border: 2px solid #17303b;
  border-radius: 8px;
  padding: 10px;
  font-weight: 900;
  box-shadow: 3px 3px #17303b;
}
.brand {
  font-family: Krabby, Arial;
  font-size: 24px;
  line-height: 0.9;
  text-align: center;
  text-shadow: 2px 2px #fff8d7;
}
.brand span {
  display: block;
  font-family: Arial;
  font-size: 8px;
  letter-spacing: 3px;
  margin-top: 7px;
}
#pause {
  border: 2px solid #17303b;
  background: #fff7d7;
  border-radius: 8px;
  font-weight: 900;
  font-size: 20px;
  width: 43px;
  height: 40px;
  box-shadow: 3px 3px #17303b;
}
#screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #126d8740;
  backdrop-filter: blur(4px);
  padding: 88px 20px 20px;
}
.card {
  width: 540px;
  max-width: 100%;
  background: #fff8dc;
  border: 3px solid #17303b;
  border-radius: 20px;
  padding: 28px 36px;
  box-shadow: 8px 8px #17303b;
  transform: rotate(-1deg);
  text-align: center;
}
.eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}
h1 {
  font-family: Krabby, Arial, sans-serif;
  font-size: 46px;
  line-height: 1;
  margin: 18px 0 12px;
  letter-spacing: 1px;
}
h1 em {
  color: #fa638c;
  font-style: normal;
  font-size: 64px;
  text-shadow: 3px 3px #17303b;
}
p {
  font-size: 15px;
  line-height: 1.5;
}
.instructions {
  text-align: left;
  display: grid;
  gap: 11px;
  margin: 23px 0;
}
.instructions span {
  font-size: 12px;
}
.instructions b {
  margin: 0 7px 0 10px;
}
#start {
  font-family: Krabby, Arial;
  font-size: 24px;
  border: 2px solid #17303b;
  border-radius: 9px;
  background: #ffe63f;
  box-shadow: 4px 4px #17303b;
  padding: 14px 26px;
  width: 100%;
}
#start:disabled {
  opacity: 0.6;
  cursor: wait;
}
.small {
  font-size: 11px;
  min-height: 16px;
  margin-bottom: 8px;
}
.home {
  color: #17303b;
  font-size: 11px;
}
#hud {
  pointer-events: none;
}
.mission {
  position: absolute;
  top: 90px;
  left: 24px;
  background: #fff8dcee;
  border: 2px solid #17303b;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 4px 4px #17303b;
  display: grid;
  gap: 6px;
  max-width: 310px;
}
.mission strong {
  font-family: Krabby, Arial;
  font-size: 22px;
}
.mission #count {
  font-size: 11px;
  font-weight: 900;
  color: #5a6b4a;
  letter-spacing: 1px;
}
.status {
  position: absolute;
  top: 92px;
  right: 24px;
  display: grid;
  gap: 10px;
  background: #fff8dcee;
  border: 2px solid #17303b;
  border-radius: 10px;
  padding: 10px 14px;
}
#stars {
  color: #f5a500;
  letter-spacing: 4px;
  font-size: 28px;
  text-shadow: 1px 1px #17303b;
}
.status label {
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
meter {
  width: 90px;
  height: 14px;
}
#prompt {
  position: absolute;
  top: 220px;
  left: 24px;
  max-width: 310px;
  border: 2px solid #17303b;
  border-radius: 9px;
  background: #fff8dc;
  padding: 12px 20px;
  font-weight: 900;
  font-size: 14px;
  white-space: normal;
  box-shadow: 3px 3px #17303b;
}
#prompt:empty {
  display: none;
}
.legend {
  position: absolute;
  bottom: 23px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: #17303b;
  text-shadow: 1px 1px #fff8dc;
}
.legend b {
  margin-left: 18px;
}
#toast {
  position: absolute;
  top: 215px;
  left: 50%;
  transform: translateX(-50%);
  background: #17303bee;
  color: #fff8dc;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  padding: 12px 20px;
  max-width: 90%;
}
#toast:empty {
  display: none;
}
#touch {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 22px;
  right: 22px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.dpad {
  display: grid;
  grid-template: repeat(2, 52px) / repeat(3, 52px);
  gap: 5px;
}
.dpad .up {
  grid-area: 1/2;
}
.dpad .left {
  grid-area: 2/1;
}
.dpad .down {
  grid-area: 2/2;
}
.dpad .right {
  grid-area: 2/3;
}
#touch button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  border: 2px solid #17303b;
  border-radius: 12px;
  background: #fff8dcbb;
  font-weight: 900;
  font-size: 20px;
  color: #17303b;
  box-shadow: 2px 3px #17303b;
}
#touch button:active,
#touch button.active {
  background: #ffe63f;
  transform: translateY(2px);
}
.actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.actions button {
  width: 65px;
  height: 55px;
  font-size: 11px !important;
}
.actions #touch-e {
  height: 72px;
  width: 72px;
  font-size: 26px !important;
  background: #ffe63f;
}
#webgl-error {
  position: absolute;
  inset: 30%;
  background: #fff8dc;
  padding: 25px;
  z-index: 10;
}
@media (pointer: coarse) {
  #touch {
    display: flex;
  }
  .legend {
    display: none;
  }
}
@media (max-width: 600px) {
  header {
    top: 14px;
    left: 14px;
    right: 14px;
  }
  .brand {
    font-size: 20px;
  }
  .back {
    font-size: 10px;
  }
  .card {
    padding: 20px;
    box-shadow: 5px 5px #17303b;
  }
  h1 {
    font-size: 34px;
  }
  h1 em {
    font-size: 49px;
  }
  .instructions {
    gap: 10px;
    margin: 18px 0;
  }
  .instructions span {
    font-size: 11px;
  }
  .instructions b {
    margin: 0 4px;
  }
  .mission {
    left: 14px;
    top: 76px;
    padding: 10px;
    max-width: 220px;
  }
  .mission strong {
    font-size: 18px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .status {
    right: 14px;
    top: 76px;
    padding: 7px;
  }
  #stars {
    font-size: 22px;
  }
  .status label {
    font-size: 9px;
  }
  meter {
    width: 55px;
  }
  #toast {
    top: 190px;
    font-size: 12px;
  }
  .legend {
    font-size: 8px;
    letter-spacing: 0;
  }
  .legend b {
    margin-left: 6px;
  }
  #prompt {
    top: 310px;
    left: 14px;
    max-width: calc(100% - 28px);
    font-size: 11px;
    padding: 10px;
  }
  #screen {
    padding-top: 74px;
  }
}
@media (max-height: 620px) {
  .card {
    padding: 14px 24px;
  }
  .instructions {
    margin: 10px 0;
    gap: 7px;
  }
  h1 {
    font-size: 29px;
    margin: 10px 0;
  }
  h1 em {
    font-size: 42px;
  }
  p {
    margin: 8px 0;
  }
  #start {
    padding: 9px;
  }
  .small {
    margin: 6px 0;
  }
  .brand {
    display: none;
  }
}
#minimap {
  position: absolute;
  bottom: 64px;
  left: 24px;
  width: 145px;
  height: 145px;
  border: 2px solid #17303b;
  border-radius: 14px;
  box-shadow: 3px 3px #17303b;
}
@media (pointer: coarse) {
  #minimap {
    width: 105px;
    height: 105px;
    bottom: auto;
    top: 190px;
    left: 14px;
  }
}
@media (max-height: 600px) {
  #minimap {
    width: 90px;
    height: 90px;
    top: auto;
    bottom: 155px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card {
    transform: none;
  }
}

#escape {
  font-size: 9px;
  font-weight: 800;
  max-width: 145px;
}

@media (max-width: 600px) {
  #escape {
    max-width: 90px;
    font-size: 8px;
    line-height: 1.35;
  }
}
