html {
  height: 100%;
}

:root {
  --header-height: 56px;
}

body {
  /* 背景画像をCSS変数として定義 */
  --bg-image: url('/static/background.png'); /* PC用の背景 */
  position: relative;
  min-height: 100%;
  margin: 0;
  color: white;
  font-family: 'Arial', sans-serif;
}

/* ::before疑似要素を背景として使用 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* スマートフォン向けのスタイル (画面幅が768px以下の場合に適用) */
@media (max-width: 768px) {
  body {
    --bg-image: url('/static/background1.png');
  }
}

/* ヘッダーとメインコンテンツを縦に並べるコンテナ */
.page-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

/* === 共通ヘッダー === */
.site-header {
  width: 100%;
}

.top-bar {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  color: #c71585;
  font-family: sans-serif;
}

.menu-wrapper {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2147483647; /* Ensure menu button stays above ads */
}

.menu-icon {
  width: 40px;
  height: 40px;
  background-color: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.menu-icon span {
  display: block;
  width: 60%;
  height: 3px;
  background: #fff;
  margin: 3px 0;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(60,60,60,0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  min-width: 260px;
  flex-direction: column;
  z-index: 2147483647; /* Keep menu above high z-index ads */
  font-size: 1.1rem;
  border-radius: 8px;
  /* Allow submenus to extend beyond the parent menu */
  overflow: visible;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.menu-dropdown a {
  display: block;
  padding: 1rem 2rem;
  background-color: #3c3c3c;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-weight: bold;
}

.menu-dropdown a:hover,
.menu-dropdown .menu-item:hover > a {
  background-color: rgba(255,255,255,0.1);
}

.menu-dropdown.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.menu-dropdown .menu-item {
  position: relative;
  display: flex;
  flex-direction: column;
}

.menu-dropdown .submenu {
  display: none;
  flex-direction: column;
  position: static;
}

.menu-dropdown .submenu.open {
  display: flex;
}


.menu-dropdown > a,
.menu-dropdown > .menu-item > a {
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.menu-dropdown > a:last-child,
.menu-dropdown > .menu-item:last-child > a {
  border-bottom: none;
}

.menu-dropdown .submenu a {
  background: rgba(90,90,90,0.95);
  padding-left: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 0.3s ease, transform 0.35s ease;
}

.menu-dropdown .submenu a:hover {
  background-color: rgba(255,255,255,0.1);
}

.menu-dropdown .submenu a:last-child {
  border-bottom: none;
}

.menu-dropdown .submenu.open a {
  opacity: 1;
  transform: translateX(0);
}

.menu-dropdown .submenu.open a:nth-child(1) {
  transition-delay: 0.05s;
}

.menu-dropdown .submenu.open a:nth-child(2) {
  transition-delay: 0.1s;
}

.menu-dropdown .submenu.open a:nth-child(3) {
  transition-delay: 0.15s;
}

.menu-dropdown .submenu.open a:nth-child(4) {
  transition-delay: 0.2s;
}

.menu-dropdown .submenu.open a:nth-child(5) {
  transition-delay: 0.25s;
}

.menu-dropdown .submenu.open a:nth-child(6) {
  transition-delay: 0.3s;
}

.menu-overlay {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2147483646;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.nav-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  background: #2db5eb;
  /*background: linear-gradient(#00a0e0, #006fa5); */
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.nav-bar a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
  font-weight: bold;
}

.nav-bar a:hover {
  background-color: #21597a;
}

/* スマートフォンではヘッダーを非表示 */
@media (max-width: 767px) {
  .nav-bar {
    display: none;
  }
  .menu-dropdown {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: -300px;
    height: calc(100% - var(--header-height));
    width: 260px;
    flex-direction: column;
    transition: left 0.3s ease;
    pointer-events: none;
    border-radius: 0;
    background-color: #000;
    opacity: 1;
    transform: none;
  }
  .menu-dropdown.open {
    left: 0;
    pointer-events: auto;
  }
  .menu-dropdown .menu-item--game,
  .menu-dropdown .menu-link--game,
  .menu-dropdown .submenu-link--game {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .nav-bar .nav-link--game {
    display: none !important;
  }
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}

button, .btn, .nav-bar a {
  transition: all 0.2s ease;
  display: inline-block;
}

button:hover, .btn:hover, .nav-bar a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* メインコンテンツエリア */
.main-content-area {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2% 0;
  box-sizing: border-box;
}