@keyframes advance {
  000% { right: .9rem }
  050% { right: 1.1rem }
  100% { right: .9rem }
}

@keyframes obfuscated-bgs {
  000% { background-color: #a33 }
  033% { background-color: #3a3 }
  066% { background-color: #33a }
  100% { background-color: #a33 }
}
@keyframes obfuscated-colors {
  000% { color: #a33; }
  033% { color: #3a3; }
  066% { color: #33a; }
  100% { color: #a33; }
}

@keyframes tokimeki-memorial {
  000% { transform: translate(44px, -22px) }
  100% { transform: translate(-44px, 22px) }
}

* {
  border: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  list-style: none;
}

a[href] {
  text-decoration: none;
  color: var(--hl-color);
}
a[href]:hover, a[href]:focus { color: var(--hl-color) }

:root {
  --window-scale: 3;
  --background-color: #101359;
  --color: #eee;
  --hl-color: #54ad2b;
  --focus-color: #214411;
}

html {
  font-family: sans-serif;
  background-color: var(--background-color);
  color: var(--color);
}

#bg {
  width: calc(100% + 264px);
  height: calc(100% + 264px);
  position: fixed;
  top: -132px;
  left: -132px;
  z-index: -1;
  background-image: url(tile.svg);
  animation: tokimeki-memorial 4s linear infinite;
}

#kiosk-walls {
  text-align: center;
}

#kiosk-window-frame {
  margin: 1em 0;
  position: relative;
  display: inline-block;
  background-image: url("art/customer_window_border.svg");
}

#kiosk-window {
  width: calc(952px * 0.25 * var(--window-scale));
  height: calc(552px * 0.25 * var(--window-scale));
  margin: 25px;
  position: relative;
  overflow: hidden;
  background-image: url("scaled_art/trainstation_background_no_border.png");
  background-size: cover;
  background-clip: padding-box;
}

#visitor {
  display: block;
  width: calc(238px * var(--window-scale));
  height: calc(138px * var(--window-scale));
  position: absolute;
  bottom: 0;
  left: 0;
  opacity: 0;
  transform: translate(-100%, 0);
  transition: transform 1s, opacity 1s;
}
#visitor[data-persona] {
  transform: translate(0, 0);
  opacity: 1;
}

#text-box {
  color: black;
  font-size: 2rem;
  width: 800px;
  height: 200px;
  margin: 0 auto;
  position: relative;
  background-image: url("art/text_window_border.svg");
  padding: 2.3rem;
}
#text-box.showing-text::after {
  font-size: 3rem;
  content: "›";
  position: absolute;
  bottom: 1.3rem; 
  animation: advance 1s linear infinite;
  width: 1em;
  text-align: center;
}
#text-box > p > span {
  font-weight: bold;
  color: #a33;
}
#text-box .obfuscated .letter {
  color: green;
  position: relative;
}

#text-box .obfuscated .letter:nth-child(5n+0) { animation: obfuscated-colors 2.0s linear infinite, obfuscated-bgs 1.2s linear infinite; }
#text-box .obfuscated .letter:nth-child(5n+1) { animation: obfuscated-colors 2.5s linear infinite, obfuscated-bgs 1.0s linear infinite; }
#text-box .obfuscated .letter:nth-child(5n+2) { animation: obfuscated-colors 3.0s linear infinite, obfuscated-bgs 0.7s linear infinite; }
#text-box .obfuscated .letter:nth-child(5n+3) { animation: obfuscated-colors 4.5s linear infinite, obfuscated-bgs 0.9s linear infinite; }
#text-box .obfuscated .letter:nth-child(5n+4) { animation: obfuscated-colors 6.5s linear infinite, obfuscated-bgs 0.8s linear infinite; }

#properties {
  display: none;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}
#properties.shown {
  display: block;
}
#property-container {
  border: .3em solid black;
  box-shadow: .6em .6em 0 rgba(0, 0, 0, 0.5);
  background-color: var(--background-color);
  padding: 1em;
  margin: 1em auto;
  width: 20em;
  max-width: 90%;
}
#property-container h2, #property-container li { margin-bottom: .5em }

#back-room {
  display: none;
  position: absolute;
  width: 80vw;
  max-height: 80vh;
  overflow-y: scroll;
  top: 10vh;
  left: 10vw;
  padding: 1em;
  background-color: var(--background-color);
  outline: .3em solid var(--focus-color);
  box-shadow: .6em .6em 0 black;
  z-index: 2;
}
#back-room.shown {
  display: block;
}
#back-room h2, #back-room li { margin-bottom: .5em }
.back-room-door {
  color: white !important;
  font-weight: bold;
  background-color: var(--focus-color);
  padding: .5rem 1rem;
  font-size: 1.1rem;
  border: .3em solid var(--hl-color);
  box-shadow: .4em .4em 0 black;
}
#back-room-exit {
  position: fixed;
  top: 9vh;
  right: 9vw;
}
#back-room-entrance {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
}
.back-room-door:hover, .back-room-door:focus {
  background-color: var(--hl-color);
  border-color: white;
  box-shadow: .2em .2em 0 black;
}
