html {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

a:link {
  color: #ffffff;
}
a:visited {
  color: #ffffff;
}
a:hover {
  color: #89ff89;
}
a:active {
  color: #a8e9a8;
}

p {
  text-indent: 1em;
}

#background{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.layer-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  pointer-events:none;
}

.layer-wrapper > * {
  position: relative;
  pointer-events:auto;
}

h1 {
  margin: 0;
  padding: 0;
}

.header {
  top: 2vh;
  left: 2vh;

  width: fit-content;
  height: fit-content;
  display: inline-block;

  max-width: 30vw;
  max-height: 30vh;
}

.title {
  padding: 0.5em 1em 0.5em 1em;

  border-radius: 1em;
  background: rgba(30,30,80,0.3);

  color: rgba(230,230,230,1);
  text-align: center;
  font-family: serif;
  font-style: normal;
  font-weight: 400;
  text-decoration-style: solid;
}

.title > h1 {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-style: normal;
  font-weight: 100;
  text-decoration-style: solid;
}

.description {
  padding-top: 0.5em;
  padding-bottom: 0.5em;

  margin-top: 1em;
  margin-left: auto;
  margin-right: auto;
  width: 80%;
  border-radius: 1em;
  background: rgba(30,30,80,0.3);
  color: rgba(230,230,230,1);
  text-align: center;
  font-family: serif;
  font-style: normal;
  font-weight: 400;
  text-decoration-style: solid;
}

.tooltip {
  position: absolute;
  padding: 0.5em 1em 0.5em 1em;

  display: flex;
  flex-direction: column;
  
  border-radius: 1em;
  background: rgba(230,230,230,0.7);

  color: rgba(30,30,80,1.0);
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-style: normal;
  font-weight: 100;
  text-decoration-style: solid;
  pointer-events:none;
}

.tooltip.hidden {
  display: none;
}

.tooltip .moment-title {
  padding: 0.5em 2em 0.5em 2em;

  border-radius: 1em;
  background: rgba(30,30,80,0.3);

  color: rgba(230,230,230,1);
  text-align: center;
  font-family: serif;
  font-style: normal;
  font-weight: 400;
  text-decoration-style: solid;
}

.tooltip .date {
  font-size: small;
  font-weight: 100;
  margin-top: 0.5em;
  align-self: center;
}

.content-wrapper {
  width: 70%;
  min-width: 20em;
  max-width: 95%;
  height: 95%;
  margin-left: auto;
  margin-right: auto;
  top: 2.5%;
  padding: 1.5em;
  box-sizing: border-box;
  border-radius: 1em;
  background: rgba(10,10,30,0.7);
  color: rgba(230,230,230,1);
}

.content-wrapper .content {
  width: 100%;
  height: 100%;
  overflow: scroll;
  overflow-x: hidden;
}

.content-wrapper .content .embed:not(:last-child),
.content-wrapper .content a:not(:last-child) > .embed {
  margin-bottom: 0.5em;
}

.content-wrapper .content .embed {
  width: auto;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  max-height: 100%;
}

.content-wrapper .content audio.embed {
  width: 100%;
}


img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
}

.back-button {
  position: absolute;
  top: -0.5em;
  right: -5em;
  width: 5em;
  height: 5em;
  cursor: pointer;
}

.content .moment-info::after {
  clear: both;
  content: "";
  display: block;
}

.content .moment-date {
  font-size: small;
  font-weight: 800;
}

.content .moment-author {
  float: right;
}

/* ---- /pickup/ えらんだ絵 ---- */

.pickup-intro {
  color: rgba(230,230,230,0.9);
}

.pickup-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10em, 1fr));
  gap: 1em;
  margin: 1em 0;
  padding: 0;
  list-style: none;
}

.pickup-list li a {
  display: block;
  text-align: center;
  text-decoration: none;
}

.pickup-list img {
  width: 8em;
  height: 8em;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(30,30,80,0.3);
}

.pickup-title {
  display: block;
  margin-top: 0.5em;
  font-size: small;
  color: rgba(230,230,230,1);
}

.pickup-links,
.shop-links {
  text-align: center;
}

/* ---- /shop/ お店 ---- */

.shop-intro {
  color: rgba(230,230,230,0.9);
}

.shop-list {
  margin: 1em 0;
  padding: 0;
  list-style: none;
}

.shop-list li {
  padding: 0.75em 1em;
  margin-bottom: 0.5em;
  border-radius: 0.5em;
  background: rgba(30,30,80,0.3);
}

.shop-list li a {
  font-size: 1.1em;
  font-weight: bold;
}

.shop-desc {
  display: block;
  margin-top: 0.25em;
  font-size: small;
  color: rgba(230,230,230,0.8);
}

/* ---- moment ページ下部のフッター ---- */

.moment-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5em;
}

.moment-footer-nav a,
.moment-footer-nav span {
  flex: 1 1 auto;
  text-align: center;
}

.moment-footer-prev.disabled,
.moment-footer-next.disabled {
  color: rgba(230,230,230,0.4);
  cursor: default;
}

.moment-footer-links {
  margin-top: 0.5em;
  text-align: center;
  font-size: small;
}

.moment-footer-sep {
  color: rgba(230,230,230,0.6);
  margin: 0 0.3em;
}

/* ---- スマホ対応 (開始値。要調整) ---- */

@media (max-width: 640px) {
  .content-wrapper {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    top: 0;
    padding: 0.9em;
    border-radius: 0;
  }

  .header {
    max-width: 60vw;
  }

  .pickup-list {
    grid-template-columns: repeat(auto-fill, minmax(7em, 1fr));
  }

  .pickup-list img {
    width: 6em;
    height: 6em;
  }

  /* 全幅だと枠外(right:-5em)の×が画面外になるので、内側の右上に出す。 */
  .back-button {
    top: 0.4em;
    right: 0.4em;
    width: 3em;
    height: 3em;
  }

  /* ×ボタンと本文右上(日付・作者など)の重なりを避ける余白。 */
  .content-wrapper .content {
    padding-top: 3em;
    box-sizing: border-box;
  }
}

/* 縦長画面では歯車が上部中央に来るので、タイトルとメニューも中央へ寄せる (#6)。
   条件は Gear の PortraitMaxAspect と揃えてあり、幅ではなくアスペクト比で切り替える
   (スマホを横に倒したときは歯車が左上に戻るので、ヘッダーも左上のままにしたい)。 */
@media (max-aspect-ratio: 1/1) {
  .header {
    left: 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
    /* 上の 60vw だとタイトルが「妖精⊸ロケッ/ト」で折り返してしまうので広げる。 */
    max-width: 90vw;
  }
}
