:root {
  --landscape-width: round(60vh, 1px);
}

* {
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: 100%;
}

body {
  position: relative;
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  background-color: rgb(52, 50, 51);
  font-family: Verdana;
  user-select: none;
  -webkit-user-select: none;
}

p {
  margin-top: 1em;
}

.error {
  color: white;
  font-size: 1vh;  
}

#header {
  height: 4vh;
  margin: 0.5vh;
  background-image: url(header.png);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

#menu {
  width: 4vh;
  height: 4vh;
  color: rgb(252, 250, 251);
  font-size: 4vh;
  line-height: 4vh;
  text-align: center;
  cursor: pointer;
}

#menu:active {
  color: rgb(152, 150, 151);
}

#container {
  display: flex;
  align-items: center;
  overflow-x: hidden;
  overflow-y: hidden;
  height: calc(100% - 5vh);
  scroll-snap-type: x mandatory;
  transition: opacity 0.1s;
}

/* Styles for touch devices */
@media (pointer: coarse) {
  #container {
    overflow-x: scroll;
  }
}

.fade-out {
  opacity: 0;
}

.page {
  width: 100vw;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  user-select: none;
}

.contents-page {
  width: 100vw;
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;  
  pointer-events: all;
}

.contents-page h1 {
  font-weight: normal;
  font-size: 2.5vh;
  color: rgb(252, 250, 251);
  line-height: 250%;
  cursor: pointer;
}

.contents-page h1:active {
  color: rgb(152, 150, 151);
}

.spirits-contents-page {
  width: calc(100vw - 4vh);
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  padding: 2vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  text-shadow: 1px 0px 1px black;
}

.top-gradient {
  background: linear-gradient(rgba(52, 50, 51, 1), rgba(52, 50, 51, 0));
  height: 4vh;
  position: absolute;
  width: 100%;
  top: 0px;
}

.fader-top {
  pointer-events: none;
  position: absolute;
  width: calc(100vw - 4vh);
  height: 25vh;
  top: 0px;
  background: linear-gradient(rgb(52, 50, 51, 1), rgb(52, 50, 51, 0));
  opacity: 0;
}

.fader-bottom {
  pointer-events: none;
  position: absolute;
  width: calc(100vw - 4vh);
  height: 25vh;
  bottom: 0px;
  background: linear-gradient(rgb(52, 50, 51, 0), rgb(52, 50, 51, 1));
  opacity: 1;
}

.spirits-contents-page h1 {
  font-weight: normal;
  font-size: 3vh;
  color: rgb(252, 250, 251);
  padding-bottom: 4vh;
  text-align: center;
}

.spirits-contents-page h2 {
  font-weight: normal;
  font-size: 2.4vh;
  color: rgb(252, 250, 251);
  padding-bottom: 2vh;
  cursor: pointer;
  text-align: center;
}

.spirits-contents-page h2:active {
  color: rgb(152, 150, 151);
}

.spirits-contents-page img {
  position: absolute;
  z-index: -1;
  opacity: 0.5;
  mix-blend-mode: color-dodge;  
}

.section-page {
  width: calc(100vw - 4vh);
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  padding: 2vh;
  display: flex;
  justify-content: center;
  color: rgb(252, 250, 251);
  font-size: 2vh;
  line-height: 1.4;
}

.section-page-sub {
  width: 100%;
}

.section-page .logo {
  height: 15vh;
  background-image: url(logo.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 10vh;
}

.section-page h1 {
  font-weight: normal;
  font-size: 2.6vh;
  line-height: 1.4;
  margin-bottom: 1em;
}

.na-page {
  width: calc(100vw - 4vh);
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  margin: 2vh;
  color: rgb(252, 250, 251);
  font-size: 1.8vh;
  line-height: 1.4;
  overflow-y: scroll;
}
.na-page p {
  margin-top: 0;
}
.na-page .title {
  font-size: 2.5vh;
  margin-top: 1.3vh;
}
.na-page .title:first-of-type {
  margin-top: 0;
}
.na-page .subtitle {
  font-size: 1.8vh;
}
.na-page .price {
  font-size: 1.8vh;
}

.other-page {
  width: calc(100vw - 4vh);
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  padding: 2vh;
  color: rgb(252, 250, 251);
  font-size: 1.8vh;
  line-height: 1.4;
  overflow-y: scroll;
}
.other-page p {
  margin-top: 0;
}
.other-page .title {
  font-size: 2vh;
  margin-top: 1.3vh;
  text-align: center;
}
.other-page .title:first-of-type {
  margin-top: 0;
}
.other-page .price {
  font-size: 1.8vh;
  text-align: center;
}

.spirits-page {
  width: calc(100vw - 4vh);
  height: calc(100% - 4vh - env(safe-area-inset-bottom));
  padding: 2vh;
  color: rgb(252, 250, 251);
  font-size: 1.8vh;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.spirits-page h1 {
  font-weight: normal;
  font-size: 2.6vh;
  line-height: 1.4;
  margin-bottom: 1em;
}
.spirits-page div {
  overflow-y: scroll;
  pointer-events: auto;
  flex-grow: 1;
}
.spirits-page table {
  width: 100%;
  border-collapse: collapse;
}
.spirits-page table tr td {
  vertical-align: top;
  border: 0.5em solid transparent;
}
.spirits-page table tr:first-child td {
  border-top: none;
}
.spirits-page table tr td:first-child {
  border-left: none;
}
.spirits-page table tr td:last-child {
  border-right: none;
  text-align: right;
}

.page img {
  width: calc(100vw - 2px);
  padding-left: 1px;
  padding-right: 1px;
  height: 100%;
  object-fit: cover;
}

.page-header {
  width: 100vw;
  position: absolute;
}
.page-header .title {
  font-size: 3vh;
  line-height: 3.5vh;
}
.page-header .subtitle {
  font-size: 1.8vh;
  line-height: 3vh;
}
.page-header .price {
  font-size: 2vh;
  line-height: 3vh;
}
.page-header-gradient {
  background: linear-gradient(rgba(52, 50, 51, 0.8), rgba(52, 50, 51, 0));
  height: 4vh;
}
.page-header-body {
  background: linear-gradient(rgba(52, 50, 51, 1), rgba(52, 50, 51, 0.8));
  color: rgb(252, 250, 251);
  padding: 2vh;
  text-align: center;
}

.page-footer {
  width: 100vw;
  position: absolute;
  bottom: 0px;
}
.page-footer-gradient {
  background: linear-gradient(rgba(52, 50, 51, 0), rgba(52, 50, 51, 0.8));
  height: 4vh;
}
.page-footer-body {
  padding: 2vh;
  background: linear-gradient(rgba(52, 50, 51, 0.8), rgba(52, 50, 51, 0.8));
  color: rgb(252, 250, 251);
  font-size: 2vh;
  line-height: 1.4;
  padding-bottom: max(2vh, env(safe-area-inset-bottom));
}
.page-footer-body p {
    margin-top: 0.5em;
}


/* Styles for portrait mode */
@media screen and (orientation: landscape) {
  html {
    width: var(--landscape-width);
    margin-left: calc(50% - var(--landscape-width) / 2);
    background-color: #222222;
  }
  
  body {
    width: var(--landscape-width);
  }
  
  .page {
      width: var(--landscape-width);
  }
  
  .contents-page {
      width: var(--landscape-width);
  }

  .spirits-contents-page {
      width: calc(var(--landscape-width) - 4vh);
  }

  .spirits-contents-page .menu {
      width: calc(var(--landscape-width) - 4vh);
  }

  .spirits-contents-page .fader-top {
      width: calc(var(--landscape-width) - 4vh);
  }

  .spirits-contents-page .fader-bottom {
      width: calc(var(--landscape-width) - 4vh);
  }

  .section-page {
    width: calc(var(--landscape-width) - 4vh);
  }

  .na-page {
    width: calc(var(--landscape-width) - 4vh);
  }

  .other-page {
    width: calc(var(--landscape-width) - 4vh);
  }

  .spirits-page {
    width: calc(var(--landscape-width) - 4vh);
  }

  .page img {
    width: calc(var(--landscape-width) - 2px);
  }

  .page-header {
    width: var(--landscape-width);
  }

  .page-footer {
    width: var(--landscape-width);
  }
}
