@media (max-width: 845px) {
  #game { font-size: 0.8em; }
}
@media (max-width: 720px) {
  #game { font-size: 0.6em; }
}
@media (max-width: 540px) {
  #game { font-size: 0.3em; }
}

.ratio-wrapper { position: relative; }
.ratio-content {
  position: absolute;
  top: 0px; bottom: 0px; right: 0px; left: 0px;
  width: 100%; height: 100%;
  box-sizing: border-box;
}
.ratio-wrapper:before {
  content: '';
  display: block;
}

.ratio3-2:before { padding-top: 62.5%; }
.ratio5-4:before { padding-top: 80%; }

main > div {
  max-width: 640px;
  width: 100%;
  margin: auto;
  overflow: hidden;
}

#game { padding: 0px; background-color: black; }

#game > div {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#game h1 {
  color: rgb(255,200,170);
  font-family: "Rye", Serif;
  font-weight: lighter;
  text-align: center;
}

.white_black { color: white; background-color: black; }

.black_white { color: black; background-color: white; }

#game ul {
  margin-left: 0px;
  padding-left: 1.5em;
  list-style-position: inside;
}

#game ol {
  list-style-type: decimal;
  margin-left: 0px;
  padding-left: 4em;
  list-style-position: inside;
}

#tombstone {
  background-image: url("./img/tombstone.webp");
  background-size: contain;
}

#game > div p {
  margin: 0.2em;
}

ul.plain_list { list-style-type: none; }
ul.square_list { list-style-type: square; }

ol.col2 span, ul.col2 span {
  float: right;
  margin-left: 2em;
}

#game div.uncentered_content {
  position: relative;
  display: flex;
  flex-direction: column;
}

#game div.centered_content {
  position: relative;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.spacer{ flex-grow: 1; }

#game * { font-family: 'Press Start 2P', monospace; }

#game .prompt {
  margin-top: auto;
  text-align: center;
  padding: 0.5em 0 1em 0;
}

#Game table {
  font-size: inherit;
  color: inherit;
  margin-top: 1em;
  font-weight: inherit;
  border-spacing: 2.5em 0.5em;
}

#game table th {
  font-weight: inherit;
}

#topTen table {
  text-align: center;
}

#matt_intro { flex-direction: row !important;}

#matt_img {
  background-image: url("./img/matt.webp");
  background-size: contain;
  background-repeat: no-repeat;
  flex: 1;
  height: 50%;
  align-self: center;
}

#matt_img + div { flex: 3; }

#mattstore { flex-direction: row !important; }

#mattstoreitem {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mattstoreitem > div:nth-of-type(2) {
    display: flex;
    align-items: flex-start;
    width:100%;
}

#mattstoreitem > div:nth-of-type(1) {
    display: flex;
    align-items: flex-start;
    width:100%;
}

#mattstore ol span, #check_supplies ul span {
  float: right; margin-left: 2em;
}

#conditions {
  width: 95%;
  color: black;
  background-color: white;
  margin: 2%;
  padding: 2%;
}

#AlertBox, .AlertBox {
  position: absolute;
  word-wrap: break-word;
  z-index : 1;
  width: 60%;
  top: 40%;
  left: 50%;
  transform: translate(-50%,-50%);
  padding: 0.2em;
  margin: auto;
  border: 0.6em solid white;
  border-radius : 10px;
  background-color : black;
}

#DialogBox {
  position: relative;
  word-wrap: break-word;
  z-index: 1;
  height: 95%;
  width: 95%;
  /*top: -100%;*/
  padding: 0.2em;
  margin: auto;
  border: 0.6em solid white;
  border-radius: 10px;
  background-color: black;
}

#journey #animation {
  background-color: black;
  height: 30%;
  position: relative;
}

#bg {
  top: 0px;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url('./img/bg_grass');
}

#journey div { width: 100%; }

#journey #ground {
  background-color: #04B600;
  height: 20%;
}

#journey #status {
  text-align: center;
  height: 50%;
}

#oxen {
  position: absolute;
  right: 7%;
  bottom: 0px;
  height: 55%;
}

img.text_decoration {
  width: 80%;
  padding: 0.5em 0;
  margin: 0 auto;
  display: block;
}

img.text_decoration:nth-of-type(2) {
  margin-top: auto;
}

img.text_decoration ~ * {
  width: 80%;
}

#store_image {
  width: 30%;
  padding: 5%;
}

.red_line {
  width: 100%;
  height: 5px;
  background-color: red;
  border: 0px;
  border-radius: 1px;
}

#blue_line {
  width: 91.5%;
  height: 5px;
  background-color: cyan;
  border: 0px;
  border-radius: 1px;
}

#family {
  width: 100%;
  height: 50%;
}

#landmark {
  position: absolute;
  bottom: 0;
  height: 35%;
  transition: right 1s linear 0s;
}

#game div#river_crossing {
  position: absolute;
  --river-start: -40;
  --river-end: 75;
  --river-angle: 152;
  background: linear-gradient(calc(var(--river-angle) * 1deg), #FFBA96FF 0%, #FFBA96FF calc(var(--river-start) * 1%), #41B3FAFF calc(var(--river-start) * 1%), #41B3FAFF calc(var(--river-end) * 1%), #FFBA96FF calc(var(--river-end) * 1%), #FFBA96FF 100%);
  width: 50%;
  height: 50%;
  top: 25%;
  left: 25%;
}

#river_wake {
  position: absolute;
  --wake-end: 0;
  --wake-angle: 15;
  background: linear-gradient(calc(var(--wake-angle) * 1deg), #41B3FAFF 0%, #41B3FAFF calc(var(--wake-end) * 1%), #00000000 calc(var(--wake-end) * 1%), #00000000 100%);
  width: 100%;
  height: 100%;
}

#map { background-image: url("img/map.webp"); }

#msg {
  width: 40%;
  position: absolute;
  text-align: center;
  top: 30%;
  word-wrap: break-word;
}

#hunter {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    transform: translate(-50%, -50%) scale(2.0, 2.0);
}

.animal, .scenery {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    transform:scale(2.0, 2.0);
}

.img-fliph {
    transform:scale(-2.0, 2.0);
}

#river {
  position: absolute;
  --river-start: 30;
  --river-end: 70;
  --river-angle: 158;
  background: linear-gradient(calc(var(--river-angle) * 1deg), #FFBA96FF 0%, #FFBA96FF calc(var(--river-start) * 1%), #41B3FAFF calc(var(--river-start) * 1%), #41B3FAFF calc(var(--river-end) * 1%), #FFBA96FF calc(var(--river-end) * 1%), #FFBA96FF 100%);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.raft, .rock, .landing {
  transform: scale(2);
  transform-origin: 0 0;
  position: absolute;
}
