:root {
  --color-bg: #EDE6DD;
  --color-fg: #121922;
  --button-color: #5AB35A;
  --button-shadow-color: #4B964B;
  --button-secondary-color: #B1B3B1;
  --button-secondary-shadow-color: #949694;
}

* {
  box-sizing: border-box;
}

html, body, main, #loading {
  margin: 0px;
  padding: 0px;
  height: 100%;
  width: 100%;
  min-height: 100%;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  color: var(--color-fg);
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("/assets/Backgrounds/background_book-paper.png");
  background-size: cover;
}

main > div {
  width: 600px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  background-image: url("/assets/Backgrounds/rocks-bg.png");
  color: white;
  padding: 1em 4em;
  padding-bottom: 3em;
}

main > div > section {
  text-align: center;
}

main > div > section:nth-child(2) {
  height: 350px;
  flex-grow: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-height: 600px) {
  main > div {
    align-self: start;
  }
}

button, .button {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  border: 0px;
  color: var(--color-fg);
  background-color: var(--button-color);
  border-bottom: 4px solid var(--button-shadow-color);
  font-size: 1.5em;
  border-radius: 6px;
  min-width: 15ch;
  text-align: center;
  padding: 0.25em 0.5em;
}

button.secondary, .button.secondary {
  color: var(--color-fg);
  background-color: var(--button-secondary-color);
  border-bottom: 4px solid var(--button-secondary-shadow-color);
}

button:active, .button:active{
  border-bottom: none !important;
  transform: translateY(2px);
  margin-top: 4px;
}

button:disabled, .button:disabled {
  opacity: 0.5;
}

input {
  width: 100%;
  max-width: 40ch;
  border: 2px solid silver;
  border-radius: 6px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.5em;
  padding: 0.25em 0.5em;
}

textarea {
  width: 40ch;
  border: 2px solid silver;
  border-radius: 6px;
  overflow-y: hidden;
  padding: 0.5em;
  font-family: Helvetica, Arial, sans-serif;
}

#modal {
  position: fixed;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.25);
}

#modal > div {
  display: block;
  background-color: white;
  max-width: 95%;
  padding: 2em;
  border-radius: 6px;
  box-shadow: 0px 0px 10px #888;
}

.emotion-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.emotion-selector .emotion {
  margin: 0.25em;
}

:root {
  --water-line-x: 0px;
  --water-line-y: 0px;
  --water-line-offset: 0ms;
}

.water-line {
  z-index: 0;
  background-position: 26px;
  background-image: url(/assets/water_line_sprite.png);
  width: 26px;
  height: 308px;
  position: absolute;
  animation-name: water-line;
  background-repeat: no-repeat;
  animation-duration: 1.5s;
  animation-timing-function: steps(11);
  animation-fill-mode: forwards;
  left: var(--water-line-x);
  top: var(--water-line-y);
  animation-delay: var(--water-line-offset);
  margin-top: -154px;
  margin-left: -13px;
  transform: rotate(105deg);
}

@keyframes water-line {
  from { background-position: 0px; margin-left: 50px; margin-top: 50px; }
  to { background-position: -286px; margin-left: -50px; margin-top: -50px; }
}

.leaf-container {
  z-index: 2;
}

.leaf-parts {
  margin-top: -100px;
  margin-bottom: -100px;
}

.leaf {
  background-repeat: no-repeat;
  animation-duration: 1.5s;
  animation-timing-function: steps(10);
  animation-iteration-count: infinite;
  display: flex;
  justify-content: center;
  align-items: center;
}

:root {
  --leaf-1-width: 220px;
  --leaf-1-height: 380px;
  --leaf-1-multiple: calc(var(--leaf-1-width) * 10);
  --leaf-1-offset-x: -5px;
  --leaf-1-offset-y: 25px;
}

.leaf-1 {
  animation-name: leaf-sprite-1;
  background-image: url(/assets/leaf_1_ripple_sprite.png);
  background-size: var(--leaf-1-multiple);
  width: var(--leaf-1-width);
  height: var(--leaf-1-height);
}

.leaf-1 svg {
  margin-left: var(--leaf-1-offset-x);
  margin-top: var(--leaf-1-offset-y);
}

@keyframes leaf-sprite-1 {
  from { background-position: 0px; }
  to { background-position: calc(var(--leaf-1-multiple) * -1); }
}

.leaf svg {
}

:root {
  --leaf-stem-color: #737A72;
  --leaf-light-color: #ADB3AC;
  --leaf-dark-color: #969C95;
}

.leaf svg .stem {
  fill: var(--leaf-stem-color) !important;
}

.leaf svg .gradient-start {
  stop-color: var(--leaf-dark-color) !important;
}

.leaf svg .gradient-end {
  stop-color: var(--leaf-light-color) !important;
}

.leaf {
  display: flex;
  flex-direction: column;
}

.leaf span:nth-child(2) {
  margin-top: -1em;
}

.animation-create {
    animation: animation-create 4s forwards;
}

.animation-create .leaf-shadow {
  display: none;
}

.animation-create .leaf {
  background: none;
}

@keyframes animation-create {
    from { transform: rotate(0deg) scale(4); }
    to { transform: rotate(360deg) scale(1); }
}

.animation-on-stream {
  animation: animation-bobbing 5s infinite;
}

@keyframes animation-bobbing {
    from { transform: translateY(-10px); }
    50% { transform: translateY(10px); }
    to { transform: translateY(-10px); }
}

.animation-on-stream .leaf-container {
  animation: animation-turning 7s infinite;
}

@keyframes animation-turning {
    from { transform: rotate(-100deg) translateX(-10px); }
    50% { transform: rotate(-80deg) translateX(10px); }
    to { transform: rotate(-100deg) translateX(-10px); }
}

.end-fade-in {
  opacity: 0;
  animation: animation-end-fade-in 5s forwards;
}

@keyframes animation-end-fade-in {
    from { opacity: 0; }
    90% { opacity: 0; }
    to { opacity: 1; }
}

.app-button {
  display: block;
}

.app-button.apple {
  overflow: hidden;
  border-radius: 13px;
  width: 250px;
  height: 83px;
  display: inline-block;
}

.app-button img {
  width: 282px;
}

.app-button.apple img {
  border-radius: 13px;
  width: 250px;
  height: 83px;
}

/* loading spinner */

#loading {
  display: flex;
  justify-content: center;
  align-items: center;
}

#loading div {
  animation: spin 0.33s linear infinite;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  border: 3px solid transparent;
  border-left: 3px solid silver;
  border-right: 3px solid silver;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

