* {
  box-sizing: border-box;
}

:root {
  --window-bg: #e7e7e7;
  --window-blue: #0b4f26;
  --border-dark: #555;
  --border-light: #fff;
  --text: #171717;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--text);
}

body {
  overflow: hidden;
  background: #151515;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  padding: 8px 14px;
  color: #111;
  background: #e5e5e5;
  border: 2px outset white;
  font-size: 13px;
}

button:active:not(:disabled) {
  border-style: inset;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.screen {
  position: fixed;
  inset: 0;
}

.retro-window {
  background: var(--window-bg);
  border: 3px outset #fff;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.35);
}

.window-titlebar {
  min-height: 29px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: #0b4f26;
  font-size: 13px;
  font-weight: bold;
}

.window-symbol {
  color: white;
}

.window-content {
  padding: 22px;
  text-align: center;
}

.window-content h1 {
  font-size: 25px;
  margin: 10px 0 18px;
}

.window-content p {
  line-height: 1.5;
}

.opening-screen,
#virus-screen,
#welcome-screen,
#edition-screen,
#outfit-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.opening-screen,
#virus-screen,
#welcome-screen,
#edition-screen,
#outfit-screen {
  background-image: url("images/opening-background.jpg");
}

.opening-window {
  width: min(420px, 92vw);
  position: relative;
}

.opening-image {
  display: block;
  width: 90px;
  height: 75px;
  object-fit: contain;
  margin: 0 auto 12px;
}

.opening-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px auto;
  max-width: 260px;
}

#not-sure-button {
  position: fixed;
  left: 50%;
  top: calc(50% + 149px);
  transform: translateX(-50%);
  width: 260px;
  height: 36px;
  min-width: 260px;
  min-height: 36px;
  max-width: 105px;
  max-height: 36px;
  white-space: nowrap;
  z-index: 100;
}

.virus-image {
  width: min(240px, 70vw);
  max-height: 240px;
  object-fit: contain;
}

.human-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 25px 0;
  font-size: 14px;
}

.edition-options {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.edition-card {
  width: 170px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  font-weight: bold;
}

.edition-card img {
  width: 140px;
  height: 170px;
  object-fit: contain;
}

.edition-card.selected,
.outfit-card.selected {
  outline: 3px solid #0b4f26;
  background: #cbdcff;
}

.outfit-options {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 15px;
  margin: 20px 0;
}

.outfit-card {
  width: 155px;
  padding: 8px;
}

.outfit-card img {
  width: 100%;
  height: 210px;
  object-fit: contain;
}

.outfit-card span {
  display: block;
  padding: 8px 0;
  font-size: 12px;
}

/* GAME */

#game-screen {
  display: flex;
  flex-direction: column;
  background: #111;
}

.game-topbar {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 12px;
  background: #dedede;
  border-bottom: 3px outset white;
  z-index: 10;
}

.game-logo {
  font-size: 12px;
  font-weight: bold;
}

.topbar-buttons {
  display: flex;
  gap: 8px;
}

.topbar-buttons button {
  padding: 7px 10px;
  font-size: 11px;
}

#game-world {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #202020;
}

#world-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#world-objects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-object {
  position: absolute;
  z-index: 4;
  width: 100px;
  height: 125px;
  object-fit: contain;
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.15s;
  user-select: none;
}

.world-object:hover {
  filter: brightness(1.12);
}

.world-object.missing-image {
  visibility: hidden;
}

.character {
  position: absolute;
  bottom: 9%;
  left: 27%;
  height: 48%;
  width: auto;
  max-width: 24%;
  display: flex;
  align-items: end;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.character img {
  max-height: 300px;
  max-width: 300px;
  object-fit: contain;
}

#nata-character {
  left: 85%;
  pointer-events: auto;
  cursor: pointer;
}

#nata-character img {
  pointer-events: auto;
  cursor: pointer;
}

#sister-character {
  left: 63%;
}

.character.far-away {
  left: 72%;
  height: 28%;
}

.navigation-controls {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 5;
}

.navigation-controls button {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  font-size: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
}

.location-label {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  z-index: 4;
}

#collection-counter {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  gap: 12px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #777;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
}

/* WINDOWS AND OVERLAYS */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.55);
}

/* Dialogue is deliberately near the bottom of the screen. */

.dialogue-overlay {
  align-items: flex-end;
  padding: 15px 15px 18px;
}

.dialogue-window {
  width: min(650px, 96vw);
}

.close-window {
  padding: 2px 7px;
  font-size: 12px;
  color: #111;
}

.dialogue-content {
  padding: 14px 20px 16px;
}

.speaker-area {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 105px;
}

.speaker-area img {
  flex: 0 0 auto;
  width: 95px;
  height: 105px;
  object-fit: contain;
}

.speaker-text-area {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.speaker-area strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

#dialogue-text {
  white-space: pre-line;
  line-height: 1.5;
  font-size: 14px;
  margin: 0;
}

.dialogue-choices {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.interaction-window,
.puzzle-window {
  width: min(470px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

#interaction-image,
#puzzle-image {
  display: block;
  width: auto;
  max-width: 90%;
  max-height: 220px;
  object-fit: contain;
  margin: 0 auto 15px;
}

#interaction-description {
  white-space: pre-line;
}

#interaction-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

#interaction-controls input,
#puzzle-answer {
  width: min(260px, 90%);
  padding: 10px;
  border: 2px inset #ddd;
}

.collection-window {
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
}

.collection-counts {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 12px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.collection-entry {
  text-align: center;
  font-size: 11px;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid #aaa;
}

.collection-entry img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}

.album-window {
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
}

.album-content {
  padding: 20px;
}

.album-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  min-height: 340px;
}

.album-photo {
  text-align: center;
  padding: 8px;
  background: #f6f0e5;
  border: 1px solid #c1b49e;
}

.album-photo img {
  width: 100%;
  height: 145px;
  object-fit: contain;
}

.album-photo p {
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  min-height: 18px;
}

.album-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.rock-slots,
.rock-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.rock-slot {
  width: 110px;
  height: 120px;
  border: 2px dashed #777;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rock-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.rock-options button {
  width: 90px;
  height: 90px;
}

.rock-options img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#puzzle-feedback,
#rock-feedback {
  min-height: 22px;
  font-size: 13px;
  font-weight: bold;
}

.story-thought {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 85%);
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #777;
  text-align: center;
  line-height: 1.6;
  z-index: 5;
  pointer-events: auto;
}

.story-thought button {
  display: block;
  margin: 18px auto 0;
}

@media (max-width: 600px) {
  .game-logo {
    font-size: 9px;
  }

  .game-topbar {
    padding: 5px;
  }

  .topbar-buttons {
    gap: 4px;
  }

  .topbar-buttons button {
    padding: 6px 5px;
    font-size: 9px;
  }

  #collection-counter {
    gap: 5px;
    font-size: 9px;
    padding: 5px;
  }

  .character {
    height: 37%;
  }

  .world-object {
    width: 75px;
    height: 95px;
  }

  .speaker-area {
    gap: 10px;
  }

  .speaker-area img {
    width: 75px;
    height: 90px;
  }

  .dialogue-content {
    padding: 10px;
  }

  #dialogue-text {
    font-size: 12px;
  }

  .dialogue-choices {
    gap: 6px;
  }

  .dialogue-choices button {
    font-size: 10px;
    padding: 7px;
  }

  .album-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .album-photo img {
    height: 100px;
  }

  .rock-slot {
    width: 85px;
    height: 100px;
  }

  .rock-options button {
    width: 75px;
    height: 75px;
    padding: 5px;
  }
}

/* FAMILY CHARACTERS */

.world-object.family-character {
  width: 130px;
  height: 190px;
  object-fit: contain;
  z-index: 2;
}

@media (max-width: 600px) {
  .world-object.family-character {
    width: 95px;
    height: 145px;
  }
}

/* Layout for the matching game HTML */

#game-world {
  min-height: 0;
}

#world-background {
  z-index: 0;
}

#world-objects {
  z-index: 4;
}

#location-label {
  z-index: 6;
}

#collection-counter {
  z-index: 6;
}

.navigation-controls {
  z-index: 7;
}

.character {
  z-index: 3;
}

#nata-character {
  z-index: 3;
}

.dialogue-overlay {
  z-index: 100;
}

.overlay:not(.dialogue-overlay) {
  z-index: 90;
}

.dialogue-window {
  width: min(760px, 96vw);
}

.dialogue-content {
  text-align: left;
}

.speaker-area {
  align-items: center;
}

.speaker-area img {
  object-fit: contain;
}

.dialogue-choices button {
  min-width: 115px;
}

.window-content > img {
  object-fit: contain;
}

.collection-window,
.album-window {
  max-height: 90vh;
}

.collection-window .window-content,
.album-window .window-content {
  overflow-y: auto;
}

.outfit-window {
  max-height: 94vh;
  overflow-y: auto;
}

#rock-options button {
  display: flex;
  align-items: center;
  justify-content: center;
}

#rock-options img {
  width: 100%;
  height: 100%;
}

.answer-label {
  display: block;
  margin: 12px 0 6px;
}

#puzzle-answer {
  display: block;
  width: min(300px, 90%);
  margin: 0 auto;
}

#puzzle-feedback,
#rock-feedback {
  min-height: 22px;
}

@media (max-width: 600px) {
  #collection-counter {
    bottom: 5px;
    max-width: 96vw;
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }

  .dialogue-window {
    width: 96vw;
  }

  .speaker-area {
    align-items: flex-start;
  }

  .dialogue-choices {
    justify-content: stretch;
  }

  .dialogue-choices button {
    flex: 1 1 100%;
  }
}

/* =================================
   RESTART BUTTON
   ================================= */

.restart-game-button {
 position: fixed;
 
  top: 7px;
  left: 1080px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.331);
  font-size: 12px;
  z-index: 4;
}

.restart-game-button:hover {
  background: #d5e8fa;
}

.restart-game-button:active {
  border-style: inset;
}

/* =================================
   RESTART CONFIRMATION
   ================================= */

.restart-confirmation {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.55);
}

.restart-confirmation.hidden {
  display: none;
}

.restart-book {
  width: min(90%, 430px);

  background: var(--window-bg);
  border: 3px outset #fff;
  border-radius: 0;

  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.35);

  font-family: Arial, sans-serif;
  color: #171717;
  overflow: hidden;

  padding: 0;
  text-align: center;
}

/* Window title bar */

.restart-book h2 {
  margin: 0;
  min-height: 29px;
  padding: 5px 8px;

  display: flex;
  align-items: center;

  color: white;
  background: #0b4f26;

  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-align: left;
}

/* Window message */

.restart-book p {
  padding: 22px;
  margin: 0;

  font-size: 14px;
  line-height: 1.5;
}

/* Buttons */

.restart-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;

  padding: 0 20px 20px;
}

.restart-buttons button {
  min-width: 95px;
  padding: 7px 14px;

  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #171717;

  background: var(--window-bg);
  border: 3px outset #fff;
  border-radius: 0;

  cursor: pointer;
}

.restart-buttons button:hover {
  background: #d5e8fa;
}

.restart-buttons button:active {
  border-style: inset;
}

#animal-squirrel {
  width: 100px;
  height: 100px;
  rotate: 90deg;
}

#acorn-main {
  width: 50px;
  height: 50px;
  rotate: 70deg;
}

#animal-fox {
  width: 220px;
  height: 220px;
}

#animal-rabbit {
  width: 90px;
  height: 90px;
}

#animal-deer {
  width: 200px;
  height: 200px;
}

#animal-hedgehog {
  width: 60px;
  height: 60px;
}

#animal-owl {
  width: 130px;
  height: 130px;
}

#animal-raccoon {
  width: 130px;
  height: 130px;
}

#animal-bird {
  width: 60px;
  height: 60px;
}

#animal-frog {
  width: 50px;
  height: 50px;
}

#note-play-1 {
  width: 60px;
  height: 60px;
}

#note-play-2 {
  width: 100px;
  height: 100px;
}

#note-play-3 {
  width: 50px;
  height: 50px;
  rotate: 70deg;
}

#note-play-4 {
  width: 50px;
  height: 50px;
}

#note-play-5 {
  width: 60px;
  height: 60px;
}

#note-play-6 {
  width: 60px;
  height: 60px;
}

#flower-1 {
  width: 60px;
  height: 70px;
}

#flower-2 {
  width: 100px;
  height: 100px;
}

#flower-3 {
  width: 60px;
  height: 70px;
}

#flower-5 {
  width: 150px;
  height: 150px;
}

#flower-6 {
  width: 60px;
  height: 60px;
}

#flower-7 {
  width: 100px;
  height: 100px;
}

#flower-8 {
  width: 90px;
  height: 90px;
}

#phone-main {
  width: 70px;
  height: 70px;
  rotate: 30deg;
}

#note-house-1 {
  width: 60px;
  height: 60px;
  rotate: 24deg;
}

#note-house-2 {
  width: 70px;
  height: 70px;
  rotate: 35deg;
}

#note-house-3 {
  width: 100px;
  height: 100px;
  rotate: 102deg;
}

#note-house-4 {
  width: 85px;
  height: 85px;
  rotate: 8deg;
}

#clock-main {
  width: 106px;
  height: 106px;
}

#rocket-main {
  width: 60px;
  height: 60px;
  rotate: 5deg;
}

#braille-main {
  width: 300px; 
  height: 300px;
  rotate: 5deg;
}

#pot-main {
  width: 70px;
  height: 70px;
}

#teaCup-main {
  width: 70px;
  height: 70px;
}

#paperPiece-3 {
  width: 40px;
  height: 40px;
}

#paperPiece-4 {
  width: 40px;
  height: 40px;
}

#paperPiece-1 {
  width: 40px;
  height: 40px;
}

#paperPiece-2 {
  width: 40px;
  height: 40px;
}

#apple-main {
  width: 40px;
  rotate: 30deg;
}

#bottle-main {
  height: 80px;
  rotate: -50deg;
}

#teaCake-main {
  width: 250px;
}