@charset "utf-8";

/* ========== Reset & Base ========== */
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  overflow-y: scroll;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Kosugi Maru", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background-color: #fffef5;
  background-image: radial-gradient(circle at 25% 25%, rgba(230, 230, 23, 0.35) 8%, transparent 12%), radial-gradient(circle at 75% 75%, rgba(230, 230, 23, 0.35) 8%, transparent 12%);
  background-size: 22px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Header（全幅ストライプ） ========== */
header {
  position: relative;
  width: 100%;
  margin: 0;
  background-image: repeating-linear-gradient(135deg, transparent, transparent 10px, #7ee617 10px, #7ee617 20px);
  background-color: #fff;
  border-bottom: 4px solid #00e667;
}

/* ヘッダー内コンテンツをメインと同じ幅に揃える */
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

header h1 {
  max-width: 280px;
  margin: 0 auto;
  padding: 8px 0;
  text-align: center;
}

header h1 a {
  display: block;
  text-decoration: none;
}

header h1 img {
  display: block;
  width: 100%;
  height: auto;
}

/* ========== ページ枠（ナビ＋メインを同じ幅・同じ左右線で揃える） ========== */
.page-frame {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.85);
  border-left: 4px solid #00e667;
  border-right: 4px solid #00e667;
}

/* ========== Site Navigation ========== */
.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 4px;
  margin: 0;
  background: transparent;
}

.site-nav .nav-btn {
  display: inline-block;
  padding: 8px 22px;
  background: #fff;
  color: #00b050;
  border: 2px solid #00e667;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: bold;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}

.site-nav .nav-btn:hover {
  background: #e8ffe8;
  transform: translateY(-1px);
}

.site-nav .nav-btn.current {
  background: #00e667;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 180, 80, 0.35);
}

/* ========== Ponna Ticker（吹き出し） ========== */
.ponna-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 16px 4px;
  padding: 0;
}

.ticker-face {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  position: relative;
}

.ticker-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ticker-face-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff8fab;
  font-weight: bold;
  font-size: 1.2rem;
}

.ticker-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid #00e667;
  border-radius: 16px;
  padding: 8px 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  min-height: 42px;
  display: flex;
  align-items: center;
}

/* 吹き出しのしっぽ（左＝顔側） */
.ticker-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 10px 8px 0;
  border-color: transparent #00e667 transparent transparent;
}

.ticker-bubble::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 6px 0;
  border-color: transparent #fff transparent transparent;
}

.ticker-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.ticker-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  line-height: 1.4;
  transform: translateX(110%);
  opacity: 0;
}

/* 右から勢いよく入って左端で停止 */
.ticker-text.is-in {
  animation: tickerSlideIn 0.85s cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
}

.ticker-text.is-out {
  animation: tickerFadeOut 0.28s ease forwards;
}

@keyframes tickerSlideIn {
  0% {
    transform: translateX(110%);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  70% {
    transform: translateX(-4%);
  }
  85% {
    transform: translateX(2%);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes tickerFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-12%);
  }
}

/* ========== Main ========== */
#mainbox {
  position: relative;
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 8px 16px 24px;
  text-align: center;
  background: transparent;
  border: none;
}

#contentsbox {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* ========== Section Headers ========== */
.gamelist h2,
.charalist h2 {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 10px 28px;
  background-color: #00e667;
  border-radius: 16px; /* 999px → 16px でボタン感を軽減 */
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  box-shadow: none; /* 影を削除 */
  letter-spacing: 0.05em;
}

/* ========== Footer ========== */
footer {
  position: relative;
  margin: 0 auto;
  padding: 16px 0 20px;
  width: 100%;
  font-size: 14px;
  text-align: center;
  color: #4b4b4b;
  border-top: 4px solid #00e667;
  background-color: #997766;
}

footer .footer-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px;
}

footer .mutual-link {
  margin: 0 auto 8px;
  padding: 0;
  list-style: none;
  text-align: center;
}

footer .mutual-link li {
  display: inline-block;
  margin: 0 8px 8px 0;
}

footer .copyright {
  display: inline-block;
  margin: 0;
  background-color: #fff;
  color: #555;
  border: 2px solid #00e667;
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.85rem;
}

footer .copyright small {
  font-size: inherit;
}

/* ========== Responsive (common) ========== */

@media screen and (max-width: 768px) {
  .header-inner {
    padding: 0 12px;
  }

  header h1 {
    max-width: 240px;
    padding: 6px 0;
  }

  .page-frame {
    border-left-width: 3px;
    border-right-width: 3px;
  }

  .ponna-ticker {
    margin: 8px 12px 2px;
    gap: 8px;
  }

  .ticker-face {
    width: 42px;
    height: 42px;
  }

  .ticker-text {
    font-size: 0.88rem;
  }

  .site-nav {
    gap: 8px;
    padding: 10px 12px 4px;
  }

  .site-nav .nav-btn {
    padding: 7px 16px;
    font-size: 0.9rem;
  }

  #mainbox {
    padding: 6px 12px 20px;
  }

  .gamelist h2,
  .charalist h2,
  .news-section h2,
  .about-section h2 {
    font-size: 1.15rem;
    padding: 8px 22px;
    margin-bottom: 12px;
  }
}

@media screen and (max-width: 520px) {
  .header-inner {
    padding: 0 10px;
  }

  header h1 {
    max-width: 200px;
    padding: 5px 0;
  }

  .page-frame {
    border-left: none;
    border-right: none;
  }

  .ponna-ticker {
    margin: 6px 10px 2px;
    gap: 6px;
  }

  .ticker-face {
    width: 36px;
    height: 36px;
  }

  .ticker-bubble {
    padding: 6px 10px;
    min-height: 36px;
    border-radius: 12px;
  }

  .ticker-text {
    font-size: 0.8rem;
  }

  .site-nav {
    padding: 8px 8px 2px;
    gap: 5px;
    flex-wrap: wrap;
  }

  .site-nav .nav-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  #mainbox {
    padding: 4px 10px 16px;
  }

  .gamelist h2,
  .charalist h2,
  .news-section h2,
  .about-section h2 {
    font-size: 1.05rem;
    padding: 7px 18px;
    margin: 4px 0 10px;
  }

  footer {
    padding: 14px 0 16px;
  }

  footer .copyright {
    padding: 5px 14px;
    font-size: 0.8rem;
  }
}

/* iPhone SE幅（375px）でもナビ3つが1段に収まるよう調整 */
@media screen and (max-width: 400px) {
  .site-nav {
    padding: 8px 6px 2px;
    gap: 4px;
  }

  .site-nav .nav-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }
}

@media screen and (max-width: 360px) {
  header h1 {
    max-width: 170px;
  }

  .gamelist h2,
  .charalist h2,
  .news-section h2,
  .about-section h2 {
    font-size: 0.95rem;
  }

  .site-nav .nav-btn {
    padding: 5px 6px;
    font-size: 0.72rem;
  }
}

/* ========== 戻るボタン（about / news / terms / privacy 共通） ========== */
.about-back {
  margin: 28px 0 8px;
  text-align: center;
}

.about-back a {
  display: inline-block;
  padding: 8px 22px;
  background: #fff;
  color: #00b050;
  border: 2px solid #00e667;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: bold;
  transition:
    background 0.15s,
    transform 0.15s;
}

.about-back a:hover,
.about-back a:focus {
  background: #e8ffe8;
  color: #007a3d;
  text-decoration: none;
}

/* ========== A11y: focus & reduced motion ========== */
.site-nav .nav-btn:focus-visible,
a.game-card:focus-visible,
a.game-card-link:focus-visible,
.about-back a:focus-visible,
.footer-links a:focus-visible,
.news-more-btn:focus-visible,
.news-link a:focus-visible {
  outline: 3px solid #00b050;
  outline-offset: 2px;
}

.footer-links {
  margin: 0 auto 10px;
  padding: 0;
  text-align: center;
  font-size: 0.9rem;
}

.footer-links a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.footer-links a:hover {
  color: #e8ffe8;
}

.footer-sep {
  margin: 0 0.15em;
  color: #fff;
}

@media screen and (max-width: 600px) {
  .footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    justify-items: center;
    align-items: center;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
    font-size: 0.85rem;
  }

  .footer-sep {
    display: none;
  }

  .footer-links a {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-text.is-in,
  .ticker-text.is-out {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  a.game-card,
  a.game-card-link,
  .chara-card,
  .site-nav .nav-btn {
    transition: none !important;
  }
}

/* logo img: keep aspect, max width via header h1 */
header h1 img {
  max-width: 100%;
  height: auto;
}
