* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f1f6f1;
  color: #123d2c;
  font-family: "DM Sans", sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
header {
  background: white;
  min-height: 88px;
  border-bottom: 1px solid #dce8dd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px max(24px, calc((100vw - 1200px) / 2));
  gap: 20px;
}
.brand {
  display: flex;
  gap: 10px;
  font-family: Outfit, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand b {
  color: #429844;
}
.brand small {
  display: block;
  font:
    10px "DM Sans",
    sans-serif;
  letter-spacing: 2.2px;
  margin-top: 5px;
}
.brandmark {
  background: #0a5539;
  color: #f7d466;
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 27px;
}
.logos {
  display: flex;
  align-items: center;
  gap: 26px;
}
.logos img {
  width: 100px;
  height: 39px;
  object-fit: contain;
}
.logos .area {
  height: 55px;
  width: 62px;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 28px 24px;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #4d8656;
}
h1 {
  font:
    600 27px Outfit,
    sans-serif;
  margin: 6px 0 0;
}
.quiet {
  border: 1px solid #cadccd;
  border-radius: 9px;
  background: transparent;
  color: #255c40;
  padding: 9px 13px;
}
.game-shell {
  overflow: hidden;
  background: #074b35;
  border: 5px solid #074b35;
  border-radius: 20px;
  box-shadow: 0 18px 50px #164d3020;
}
.hud {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  color: #fff;
}
.hud small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #abd0b4;
  margin-bottom: 4px;
}
.hud strong {
  font:
    600 23px Outfit,
    sans-serif;
}
.hud em {
  font:
    400 14px "DM Sans",
    sans-serif;
  color: #b8d8ba;
}
.gold {
  color: #ffd36b;
}
.level {
  text-align: center;
}
.level strong {
  font-size: 18px;
}
.hud-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.hud-right > span {
  color: #fb987b;
  font-size: 20px;
  letter-spacing: 2px;
}
.hud button {
  border: 1px solid #54836b;
  background: #1b6249;
  border-radius: 9px;
  width: 35px;
  height: 35px;
  color: #fff;
  font-size: 19px;
}
.viewport {
  height: 480px;
  position: relative;
  overflow: hidden;
  background: #b9e5c9;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.location-chip {
  position: absolute;
  left: 22px;
  top: 18px;
  background: #ffffffda;
  padding: 8px 13px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  color: #28623e;
  pointer-events: none;
}
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #073e30dd, #074b3530);
  display: flex;
  align-items: center;
  padding: 45px;
  color: white;
}
.overlay.hidden {
  display: none;
}
.intro {
  max-width: 540px;
}
.pill {
  font-size: 10px;
  letter-spacing: 2px;
  color: #e0efaa;
  border: 1px solid #d4e8a766;
  border-radius: 20px;
  padding: 8px 12px;
}
h2 {
  font:
    700 46px/1.08 Outfit,
    sans-serif;
  letter-spacing: -1px;
  margin: 24px 0 15px;
}
h2 span {
  color: #ffdd7d;
}
.intro p {
  font-size: 15px;
  line-height: 1.7;
  color: #e0eee1;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: #ffdc79;
  border: 0;
  border-bottom: 4px solid #c3963e;
  border-radius: 12px;
  padding: 16px 24px;
  font-weight: 800;
  color: #224a2e;
  margin-top: 24px;
  box-shadow: 0 6px 20px #0002;
}
.primary:hover {
  background: #ffe5a0;
  transform: translateY(-1px);
}
.intro > small {
  display: block;
  font-size: 11px;
  color: #d0e2ce;
  margin-top: 19px;
}
.game-bottom {
  height: 57px;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 8px 20px;
  color: #c8e0c7;
}
.game-progress {
  width: 180px;
  flex-shrink: 0;
}
.game-progress > span {
  font-size: 9px;
  letter-spacing: 1px;
}
.game-progress > div {
  height: 4px;
  border-radius: 10px;
  background: #398366;
  margin-top: 6px;
}
.game-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: #f9d572;
  border-radius: 10px;
}
.hint {
  font-size: 12px;
  flex: 1;
}
.game-bottom .quiet {
  color: #d5e8cc;
  border-color: #448466;
  font-size: 21px;
  padding: 2px 9px;
}
.controls {
  display: none;
}
.under {
  display: flex;
  justify-content: space-between;
  color: #748276;
  font-size: 11px;
  margin: 16px 4px 28px;
}
kbd {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid #cfdbd0;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: white;
  margin: 0 3px;
  font: 10px sans-serif;
}
.collection {
  background: #fff;
  border: 1px solid #dbe6dc;
  border-radius: 16px;
  padding: 23px;
}
.collection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.collection-title h3 {
  font:
    600 21px Outfit,
    sans-serif;
  margin: 5px 0;
}
.collection-title > span {
  font-size: 12px;
  color: #66816c;
}
#inventory {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 9px;
}
.item {
  text-align: center;
  border: 1px solid #e4eadf;
  border-radius: 9px;
  padding: 8px 2px;
  background: #f7f9f4;
  position: relative;
}
.item img {
  height: 65px;
  width: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.3;
}
.item.active {
  background: #fff9e6;
  border-color: #e8ce7d;
}
.item.active img {
  filter: none;
  opacity: 1;
}
.item span {
  display: block;
  font-size: 11px;
  color: #6c7c6c;
  margin-top: 3px;
}
.item.active span {
  color: #745619;
  font-weight: 700;
}
footer {
  text-align: center;
  color: #7d907f;
  font-size: 11px;
  padding: 26px;
}
footer span {
  margin: 0 10px;
}
#toast {
  position: absolute;
  left: 50%;
  top: 65px;
  transform: translateX(-50%);
  background: #074b35ed;
  color: #ffe092;
  padding: 10px 18px;
  border-radius: 30px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  font-size: 14px;
  transition: opacity 0.2s;
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 32px;
  max-width: 450px;
  width: 90%;
  color: #17452f;
}
dialog::backdrop {
  background: #032b21b9;
}
dialog h2 {
  font-size: 31px;
}
dialog p {
  font-size: 15px;
  line-height: 1.6;
}
.close {
  position: absolute;
  right: 15px;
  top: 12px;
  background: none;
  border: 0;
  font-size: 28px;
  color: #487655;
}
.game-shell:fullscreen {
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.game-shell:fullscreen .viewport {
  flex: 1;
  height: auto;
}
.game-shell:fullscreen .controls {
  display: flex;
}
@media (max-width: 700px) {
  header {
    padding: 12px 16px;
    min-height: 72px;
  }
  .brand {
    font-size: 12px;
    letter-spacing: 0.5px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .brandmark {
    font-size: 20px;
    padding: 8px;
  }
  .logos {
    gap: 8px;
  }
  .logos img {
    width: 49px;
    height: 28px;
  }
  .logos .area {
    width: 35px;
    height: 38px;
  }
  main {
    padding: 20px 12px;
  }
  .topline {
    margin-bottom: 16px;
  }
  h1 {
    font-size: 21px;
    max-width: 260px;
  }
  .topline .quiet span {
    display: none;
  }
  .eyebrow {
    font-size: 9px;
  }
  .game-shell {
    border-width: 4px;
    border-radius: 16px;
  }
  .hud {
    height: 74px;
    padding: 10px 12px;
  }
  .hud small {
    font-size: 8px;
    letter-spacing: 0.7px;
  }
  .hud strong {
    font-size: 20px;
  }
  .level strong {
    font-size: 13px;
  }
  .hud-right {
    gap: 5px;
  }
  .hud-right > span {
    font-size: 14px;
    letter-spacing: 0;
  }
  .hud button {
    width: 28px;
    height: 30px;
    font-size: 16px;
  }
  .viewport {
    height: 420px;
  }
  .location-chip {
    left: 12px;
    top: 12px;
    font-size: 10px;
  }
  .overlay {
    padding: 24px;
    background: linear-gradient(90deg, #063d30ec, #074b3560);
  }
  h2 {
    font-size: 35px;
  }
  .intro p {
    font-size: 13px;
  }
  .intro > small {
    font-size: 10px;
    line-height: 1.6;
  }
  .pill {
    font-size: 8px;
  }
  .primary {
    padding: 14px 19px;
    font-size: 14px;
  }
  .game-bottom {
    padding: 8px 12px;
    height: 43px;
    gap: 10px;
  }
  .game-progress {
    width: 130px;
  }
  .hint {
    font-size: 9px;
  }
  .controls {
    display: flex;
    padding: 12px 13px 15px;
    align-items: center;
    justify-content: space-between;
    background: #06432f;
    border-top: 1px solid #36715a;
    user-select: none;
    touch-action: none;
  }
  .dpad {
    display: flex;
    gap: 10px;
  }
  .controls button {
    touch-action: none;
    border: 1px solid #5a8a6e;
    border-bottom: 4px solid #214b38;
    background: #317454;
    color: #fff;
    border-radius: 14px;
    width: 59px;
    height: 54px;
    font-size: 20px;
  }
  .controls button:active,
  .controls button.pressed {
    background: #75a55b;
    transform: translateY(2px);
  }
  .controls #jump {
    width: 102px;
    background: #f8d474;
    color: #17442d;
    border-color: #cfaa52;
  }
  .controls b {
    font-size: 11px;
  }
  .controls > span {
    font-size: 8px;
    letter-spacing: 1px;
    color: #8db89e;
  }
  .under {
    margin: 12px 4px 23px;
    font-size: 10px;
  }
  .under > span:first-child {
    display: none;
  }
  .collection {
    padding: 16px;
  }
  .collection-title h3 {
    font-size: 18px;
  }
  .collection-title > span {
    font-size: 10px;
  }
  #inventory {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }
  .item img {
    height: 52px;
  }
  .item span {
    font-size: 9px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  header,
  .topline,
  .collection,
  .under,
  footer {
    display: none;
  }
  main {
    padding: 0;
  }
  .game-shell {
    border: 0;
    border-radius: 0;
  }
  .hud {
    height: 47px;
  }
  .viewport {
    height: calc(100dvh - 90px);
  }
  .game-bottom {
    height: 43px;
  }
  .controls {
    position: absolute;
    bottom: 47px;
    left: 15px;
    right: 15px;
    background: transparent;
    border: 0;
    padding: 0;
    pointer-events: none;
  }
  .controls button {
    pointer-events: auto;
    opacity: 0.85;
  }
  .controls > span {
    display: none;
  }
  .overlay {
    padding: 15px 35px;
  }
  h2 {
    font-size: 28px;
    margin: 15px 0;
  }
  .intro p,
  .intro > small,
  .pill {
    display: none;
  }
  .primary {
    margin-top: 12px;
  }
}

/* Bootstrap integration: retain the game theme after Bootstrap Reboot. */
body {
  line-height: 1.35;
}
button:focus-visible {
  outline: 3px solid #e6b64e;
  outline-offset: 3px;
}
