html {
  min-height: 100%;
  overflow-y: scroll;
  --site-footer-space: 40px;
}

body {
  margin: 0;
  box-sizing: border-box;
  color: #614f3e;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic Pro", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: #c49c78;
  min-height: 100vh;
  padding-bottom: var(--site-footer-space);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
}

a { color: #c26338; }

.site-header,
.site-footer {
  background: #ffe4c9;
  border-color: #614f3e;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid #614f3e;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  box-sizing: border-box;
  min-height: var(--site-footer-space);
  border-top: 2px solid #614f3e;
  padding: 6px 12px;
  text-align: center;
  font-size: 12px;
}

.site-nav {
  max-width: 960px;
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo { line-height: 0; }
.site-logo img { max-width: 100%; height: auto; }

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.site-nav li,
.site-nav a { line-height: 0; }

.site-nav img {
  max-height: 45px;
  width: auto;
}

.page-shell,
.game-shell {
  align-self: start;
  width: min(100% - 24px, 696px);
  margin: 20px auto 40px;
}

.page-shell.wide,
.game-shell {
  width: min(100% - 24px, 980px);
}

.home-shell,
.article-shell {
  width: min(100% - 24px, 1036px);
  display: grid;
  grid-template-columns: minmax(0, 696px) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
  align-content: start;
  justify-content: center;
}

.home-shell {
  gap: 20px;
}

.home-main,
.home-sidebar,
.article-main,
.article-sidebar {
  min-width: 0;
}

.home-shell > .panel + .panel {
  margin-top: 0;
}

.home-shell > .latest-article {
  grid-column: 1;
  grid-row: 1;
  margin-top: 0;
}

.home-sidebar {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}

.home-extra-panel {
  grid-column: 1 / -1;
}

.panel,
.game-page {
  background: #fff2e6;
  border: 1px solid rgba(97, 79, 62, 0.2);
}

.panel + .panel { margin-top: 20px; }

.panel-title {
  background: #614f3e;
  color: #ffe4c9;
  margin: 3px 3px 0;
  padding: 3px 10px;
}

.panel-title h1,
.panel-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: normal;
  text-align: center;
}

.content {
  padding: 16px 28px 24px;
}

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

.content h1,
.content h2,
.content h3 {
  color: #614f3e;
  background: transparent;
}

.content h1 { font-size: 24px; }
.content h2 {
  font-size: 20px;
  border-bottom: 1px solid #614f3e;
}
.content h3 { font-size: 17px; }

.content hr {
  border: 0;
  border-top: 1px solid #614f3e;
  margin: 1.35rem 0;
}

.content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  color: #8c7158;
  background: rgba(255, 228, 201, 0.38);
  border-left: 4px solid rgba(194, 99, 56, 0.55);
}

.content blockquote > :first-child {
  margin-top: 0;
}

.content blockquote > :last-child {
  margin-bottom: 0;
}

.entry-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 28px 0;
  font-size: 13px;
}

.entry-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.entry-date {
  color: #8c7158;
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.article-panel .entry-meta + .content {
  margin: 12px 28px 0;
  padding: 16px 0 24px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(97, 79, 62, 0.5) 0,
    rgba(97, 79, 62, 0.5) 4px,
    transparent 4px,
    transparent 8px
  );
  background-position: top left;
  background-repeat: no-repeat;
  background-size: 100% 1px;
}

.article-footer {
  margin: 0 28px 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(97, 79, 62, 0.28);
}

.article-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
}

.article-pagination-slot {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.article-pagination-slot.is-previous {
  text-align: left;
}

.article-pagination-slot.is-next {
  text-align: right;
}

.article-pagination-link {
  color: #c26338;
  text-decoration: underline;
}

.article-pagination-link:hover {
  color: #8f3f24;
}

.article-pagination-separator,
.article-pagination-missing {
  color: #8c7158;
}

.article-back-to-top {
  color: #c26338;
  text-decoration: underline;
  white-space: nowrap;
}

.entry-list {
  padding: 16px 28px 24px;
}

.entry-row {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
}

.entry-row time,
.entry-category {
  font-size: 13px;
  color: #8c7158;
}

.recent-article-list {
  display: grid;
  gap: 6px;
  padding: 12px 16px 16px;
}

.recent-article-link {
  display: block;
  padding: 6px 8px;
  color: #614f3e;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
}

.recent-article-link:hover,
.recent-article-link:focus {
  background: #ffe4c9;
  border-color: rgba(97, 79, 62, 0.2);
  text-decoration: underline;
}

.recent-article-link.is-current {
  color: #8f3f24;
  font-weight: bold;
  background: #ffe4c9;
  border-color: rgba(97, 79, 62, 0.28);
}

.widget-image {
  margin: 1rem 0;
  text-align: center;
}

.widget-image-align-right,
.widget-image-align-left {
  width: min(40%, 220px);
  margin-top: 0.2rem;
}

.widget-image-align-right {
  float: right;
  margin-left: 28px;
}

.widget-image-align-left {
  float: left;
  margin-right: 28px;
}

.widget-image a {
  display: inline-block;
}

.widget-image-bg {
  display: inline-block;
  box-sizing: border-box;
  padding: var(--widget-image-pad, 0);
  line-height: 0;
  background: var(--widget-image-bg);
}

.widget-image-bg img {
  display: block;
}

.widget-image figcaption {
  font-size: 13px;
  line-height: 1.45;
}

.widget-image img,
.content img {
  max-width: 100%;
  height: auto;
}

.content p:has(> a > img),
.content p:has(> img) {
  text-align: center;
}

.content p:has(> a + a > img) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, min(240px, calc((100% - 12px) / 2))));
  justify-content: center;
  gap: 12px;
  align-items: start;
}

.content p:has(> a + a > img) > a:has(> img) {
  width: 100%;
  line-height: 0;
}

.content p:has(> a + a > img) > a:has(> img) > img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
}

.content p:has(> a + a > img) > br {
  display: none;
}

.content p:has(> a + a > img) > a:has(+ br):not(a + a) {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  max-width: 100%;
  text-align: center;
}

.content p:has(> a + a > img) > a:has(+ br):not(a + a) > img {
  width: auto;
  max-height: none;
}

.widget-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1rem 0;
}

.widget-gallery a { line-height: 0; }

.content .image-block {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 100%;
  margin: 1rem auto;
}
.content .image-block-frame { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; }
.content .image-block-frame img { max-width: 100%; max-height: 100%; height: auto; object-fit: contain; }
.content .image-block.image-position-top-left .image-block-frame { align-items: flex-start; justify-content: flex-start; }
.content .image-block.image-position-top .image-block-frame { align-items: flex-start; justify-content: center; }
.content .image-block.image-position-top-right .image-block-frame { align-items: flex-start; justify-content: flex-end; }
.content .image-block.image-position-left .image-block-frame { align-items: center; justify-content: flex-start; }
.content .image-block.image-position-center .image-block-frame { align-items: center; justify-content: center; }
.content .image-block.image-position-right .image-block-frame { align-items: center; justify-content: flex-end; }
.content .image-block.image-position-bottom-left .image-block-frame { align-items: flex-end; justify-content: flex-start; }
.content .image-block.image-position-bottom .image-block-frame { align-items: flex-end; justify-content: center; }
.content .image-block.image-position-bottom-right .image-block-frame { align-items: flex-end; justify-content: flex-end; }

.content .image-block.align-left { float: left; margin-right: 28px; }
.content .image-block.align-right { float: right; margin-left: 28px; }
.content .image-block figcaption { font-size: 13px; line-height: 1.45; }

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 1rem 0;
}

.image-gallery figure { margin: 0; text-align: center; }
.image-gallery img { width: 100%; height: auto; }

.widget-youtube,
.widget-embed {
  aspect-ratio: 16 / 9;
  margin: 1rem 0;
}

.widget-youtube iframe,
.widget-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed { aspect-ratio: 16 / 9; margin: 1rem 0; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }

.external-link-card,
.game-card-link {
  display: grid;
  gap: 4px;
  margin: 1rem 0;
  padding: 12px 14px;
  border: 1px solid rgba(97, 79, 62, 0.25);
  background: #ffe9d4;
  color: inherit;
  text-decoration: none;
}

.external-link-card small { overflow-wrap: anywhere; opacity: 0.72; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 28px 28px;
}

.game-card {
  border: 1px solid rgba(97, 79, 62, 0.25);
  background: #ffe9d4;
  padding: 12px;
}

.game-card h2 {
  font-size: 18px;
  margin: 8px 0;
}

.game-card img {
  width: 100%;
  height: auto;
  display: block;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 20px;
  align-items: center;
  background: #614f3e;
  color: #ffe4c9;
  padding: 24px;
}

.game-hero h1 { margin: 0 0 8px; }
.game-hero img { width: 100%; height: auto; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platforms span {
  background: #ffe4c9;
  color: #614f3e;
  padding: 2px 8px;
}

.search-box {
  padding: 16px 28px;
}

.site-search .entry-list[hidden] {
  display: none;
}

.site-search .search-results:not([hidden]) {
  padding-top: 0;
}

.search-box input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 8px 10px;
  color: #614f3e;
  background: #fffaf5;
  border: 1px solid #614f3e;
}

.home-sidebar .search-box,
.home-sidebar .entry-list,
.article-sidebar .search-box,
.article-sidebar .entry-list {
  padding-left: 16px;
  padding-right: 16px;
}

.home-sidebar .entry-row,
.article-sidebar .entry-row {
  grid-template-columns: 1fr;
  gap: 0;
}

@media (max-width: 860px) {
  .home-shell,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  html {
    --site-footer-space: 58px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 12px;
  }

  .site-nav ul {
    flex-wrap: wrap;
  }

  .content,
  .entry-list,
  .game-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .widget-image-align-right,
  .widget-image-align-left {
    float: none;
    width: min(70%, 220px);
    margin: 1rem auto;
  }

  .article-panel .entry-meta + .content {
    margin-left: 16px;
    margin-right: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  .article-footer {
    margin-right: 16px;
    margin-left: 16px;
  }

  .entry-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .game-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

}
