:root {
  --max-width: 980px;
  --gap: 16px;
  --radius: 12px;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --link: #2563eb;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body.no-scroll {
  overflow: hidden;
}

/* レイアウト */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

/* ヘッダー */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: var(--header-height);
  padding: 0 16px;
  margin: 0 auto;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.brand a {
  display: block;
  text-decoration: none;
}

.brand img {
  height: 32px;
  width: auto;
  display: block;
}

/* PC向けナビ（デフォルト） */
.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.nav a:hover {
  text-decoration: underline;
}

/* カード */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* 入力UI */
input[type="text"] {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}

/* 通常ボタン（メニュー以外） */
button:not(.menu-toggle) {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111827;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:not(.menu-toggle):hover {
  opacity: 0.9;
}

/* コード表示用（もし使うなら） */
.pre {
  background: #0b1020;
  color: #e5e7eb;
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
}

/* 表（対戦カード・結果が想定） */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 700;
}

/* フッター */
.footer {
  margin-top: 24px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
}

.footer-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ここから：ハンバーガー（≡→×） */
.menu-toggle {
  /* PCでは非表示，スマホで表示 */
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);

  position: relative;
  z-index: 1101;
}

.menu-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 0 auto;
  transition: background 220ms ease;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition:
    transform 220ms ease,
    top 220ms ease,
    bottom 220ms ease;
}

.menu-icon::before {
  top: -7px;
}

.menu-icon::after {
  bottom: -7px;
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* overlay（暗幕） */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 900;
}

/* スマホ向け：右からスライドするメニュー */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  /* スマホ時はヘッダーに「トップ」を出さず，ドロワーに格納する想定 */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(80vw, 320px);
    background: var(--card);
    border-left: 1px solid var(--border);
    padding: 16px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    z-index: 1000;
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  .nav.active {
    transform: translateX(0);
  }

  .menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: -16px -16px 0 -16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
  }

  .menu-title {
    margin: 0;
  }
}

.menu-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.menu-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.menu-item {
  display: block;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.menu-item.is-current {
  color: var(--muted);
  pointer-events: none; /* クリック不可 */
  background: rgba(0, 0, 0, 0.03);
}
.menu-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.menu-close {
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}
