/* =========================
   共通CSS（common.css）
   index / mainframe 共通骨格
========================= */

/* =========================
   共通バーサイズ定義（★追加）
========================= */
:root {
  --topbar-height: 56px;
  --topbar-max-width: 1100px;
}

/* =========================
   リセット
========================= */
html {
  overflow-y: scroll;
  /* 常にスクロールバー領域を確保（ガタツキ防止） */
  scrollbar-gutter: stable;
  /* モダンブラウザ向け：スクロールバーの有無に関わらずスペースを確保 */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #222;
  text-align: center;
}

/* =========================
   3カラム共通レイアウト
========================= */
.three-col {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  margin-top: 5px;
  flex-wrap: nowrap;
}

/* =========================
   左右広告（枠は1つ）
========================= */
.side-ad {
  width: 352px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 広告画像の共通安全設定 */
.side-ad img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* =========================
   中央コンテナ（共通）
========================= */
.center-area,
.typing-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* =========================
   中央カード（共通）
========================= */
.center-card {
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #ddd;
  padding: 12px;
}

/* キーボードを包む外側の枠（二重枠の原因）を透明にする */
.center-card.keyboard-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
}

/* =========================
   共通ボタン
========================= */
.btn {
  display: block;
  width: 280px !important;
  padding: 12px 12px 12px 25px !important;
  margin: 10px 0 !important;
  /* Forces onto left side */
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #ffffff;
  font-size: 17px;
  text-decoration: none;
  color: #000000;
  text-align: left !important;
}

.btn:hover {
  background: #ffff66;
}

/* 強調ボタン */
.btn.primary {
  background: #2196F3;
  color: #ffffff;
  border-color: #2196F3;
}

.btn.primary:hover {
  background: #1976D2;
}

/* =========================
   共通ナビゲーション
========================= */
:root {
  --nav-primary: #2563eb;
  --nav-text-main: #1e293b;
  --nav-text-sub: #64748b;
  --nav-border: #e2e8f0;
}

.nav {
  background: #ffffff !important;
  height: 50px !important;
  border-bottom: 1px solid var(--nav-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.nav a {
  color: var(--nav-text-sub) !important;
  text-decoration: none !important;
  margin: 0 15px !important;
  font-size: 1rem !important;
  transition: color 0.2s !important;
  font-weight: 600 !important;
  border: none !important;
  background: none !important;
  display: inline !important;
}

.nav a:hover {
  color: var(--nav-primary) !important;
}

#visit-counter {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
  margin-left: 15px !important;
  font-weight: normal !important;
}

@media (max-width: 600px) {
  .nav {
    flex-wrap: wrap;
    height: auto !important;
    padding: 10px 0 !important;
  }

  .nav a {
    margin: 5px 8px !important;
    font-size: 0.75rem !important;
  }
}

/* 無効ボタン */
.btn.disabled {
  background: #f0f0f0;
  color: #999;
  pointer-events: none;
  border-color: #ddd;
}

/* =========================
   共通タイトル
========================= */
.card-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #00796b;
  text-align: center;
}

/* =========================
   レスポンシブ（最低限）
========================= */
@media (max-width: 768px) {
  .three-col {
    flex-direction: column;
    align-items: center;
  }

  .side-ad {
    width: 100%;
    align-items: center;
  }
}