@charset "UTF-8";
/* ============================================================
   CSS カスタムプロパティ
   ============================================================ */
:root {
  --header-h: 60px;
  --footer-h: 60px;
}

@media screen and (max-width: 1000px) {
  :root {
    --header-h: 80px;
  }
}
/* ============================================================
   site-wide の main { display:grid } を上書き
   ============================================================ */
main {
  display: block;
  padding-top: 0 !important;
}

/* ============================================================
   リセット・基本設定
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  font-family: "Noto Sans JP", sans-serif;
  overflow-x: hidden;
}

/* ============================================================
   ゲーム中：ヘッダー・フッター非表示・ゲームエリア全画面化
   ============================================================ */
body.game-active header,
body.game-active footer {
  display: none;
}
body.game-active #game-section {
  height: 100dvh;
}

/* ============================================================
   ゲームセクション（夜空）
   ============================================================ */
#game-section {
  position: relative;
  overflow: hidden;
  height: calc(100dvh - var(--header-h) - var(--footer-h));
  min-height: 480px;
  background: #0d1b3e;
  touch-action: none;
}

/* PixiJS canvas — 透過背景でゲームセクション全体を覆う */
canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
}

/* ============================================================
   星空（CSS アニメーション）
   ============================================================ */
#star-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.12;
    transform: scale(0.7);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}
/* ============================================================
   スタートセクション（ページレイアウト）
   ============================================================ */
#start-section {
  max-width: 560px;
  margin: 32px auto;
  padding: 0 8px 10px;
}

/* カード外枠（h1 が端まで伸びるよう padding なし・overflow hidden） */
.game-intro-box {
  background: #fdf9f2;
  border: 1px solid #b8a070;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* h1 より下のコンテンツに padding */
.intro-body {
  padding: 0 22px 24px;
}

/* パンくずリスト */
.intro-body .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin-bottom: 0.6em;
  font-size: 16px;
  color: #666;
}
@media (max-width: 1000px) {
  .intro-body .breadcrumb {
    padding-top: 10px !important;
  }
}
.intro-body .breadcrumb li:not(:last-of-type)::after {
  content: "》";
  margin: 0 0.4em;
  color: #aaa;
}

/* パンくずナビ — モバイルでは box の padding がないため内側で余白確保 */
.game-intro-box > .section {
  padding: 0.6em 14px 0;
  font-size: 13px;
  background: none !important;
  box-shadow: none;
}

/* ============================================================
   h1 — kimariji.html の .section h1 に合わせたスタイル
   ============================================================ */
.game-title {
  font-family: "noto-sans-pro", sans-serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  border-top: 3px solid #b82343;
  border-bottom: 3px solid #b82343;
  background: #fff;
  padding: 1rem 0.5rem 0.75rem;
  margin: 0 0 0.8em;
}

/* ============================================================
   ゲームオーバー後スコア表示
   ============================================================ */
#game-result {
  text-align: center;
  padding: 10px 0 14px;
  border-bottom: 1px solid #e0d0b0;
  margin-bottom: 12px;
}

.score-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 2px;
  font-family: "Noto Sans JP", sans-serif;
}

#final-score-display {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 2.2em;
  font-weight: 700;
  color: #C2435D;
  letter-spacing: 0.05em;
}

/* ============================================================
   ルール説明 — #karuta_ul に合わせたスタイル
   ============================================================ */
.rules-list {
  list-style: disc;
  margin-bottom: 1em;
  font-size: 1rem;
  color: #333;
}

.rules-list li {
  padding-left: 25px;
  background: url(../img/sakura.svg);
  background-position: 0 6px;
  background-size: 1em;
  background-repeat: no-repeat;
  line-height: 1.8;
  font-size: 1em;
  margin-bottom: 0.5em;
}

/* ============================================================
   操作説明ボックス
   ============================================================ */
.how-to-box {
  font-size: 12px;
  color: #555;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.how-to-box > div {
  margin-bottom: 3px;
}

.how-to-box > div:last-child {
  margin-bottom: 0;
}

.key {
  display: inline-block;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  color: #444;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

/* ============================================================
   難易度セレクター
   ============================================================ */
/* ============================================================
   五色百人一首 色プルダウン
   ============================================================ */
.color-section {
  margin-bottom: 16px;
}

.color-select {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 240px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: "Noto Sans JP", sans-serif;
  color: #333;
  background: #fff;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  cursor: pointer;
  -webkit-appearance: auto;
     -moz-appearance: auto;
          appearance: auto;
}

/* ============================================================
   出題された札テーブル
   ============================================================ */
#shown-cards-section {
  margin-top: 20px;
  border-top: 1px solid #e0d0b0;
  padding-top: 14px;
}

.shown-cards-heading {
  font-size: 13px;
  font-weight: bold;
  color: #B82343;
  margin-bottom: 8px;
  text-align: center;
}

.shown-cards-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.shown-cards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: pre-line;
}
.shown-cards-table th, .shown-cards-table td {
  border: 1px solid #e0d8c8;
}
.shown-cards-table th {
  background: #f7f1e0;
  padding: 6px 8px;
  text-align: center;
  color: #333;
  font-weight: bold;
  white-space: nowrap;
}
.shown-cards-table td {
  padding: 6px 8px;
  vertical-align: top;
  line-height: 1.6;
}
.shown-cards-table td:nth-child(1) {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.shown-cards-table td:nth-child(2), .shown-cards-table td:nth-child(3) {
  text-align: center;
  white-space: nowrap;
  color: #333;
  font-size: 12px;
  vertical-align: middle;
}

.result-correct {
  color: #1e8c4a;
}

.result-missed {
  color: #c0392b;
}

#result-summary {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  color: #333;
}

.mode-section {
  margin-bottom: 16px;
}

.mode-btn {
  padding: 8px 16px;
  margin: 0 5px;
  background: #ecf0f1;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: all 0.3s;
}
.mode-btn.selected {
  background: #2980b9;
  color: white;
  border-color: #2980b9;
}
.mode-btn:hover:not(.selected) {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 上の句モード（PC）— 文字が入る幅に */
#kimari-area.kami-mode {
  width: -moz-fit-content;
  width: fit-content;
  max-width: 96vw;
}

#choices-wrap.kami-mode .choice-btn {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  text-align: center;
  padding: 10px 20px;
  white-space: nowrap;
}

.diff-section {
  margin-bottom: 16px;
}

.diff-label {
  font-size: 13px;
  color: #555;
  font-weight: bold;
  margin-bottom: 7px;
  text-align: center;
}

.diff-row {
  display: flex;
  justify-content: center;
}

/* 難易度ボタン — karuta-taisen-pro .difficulty-btn に合わせる */
.diff-btn {
  padding: 8px 16px;
  margin: 0 5px;
  background: #ecf0f1;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: all 0.3s;
}

.diff-btn.selected {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}

.diff-btn:hover:not(.selected) {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   はじめるボタン — karuta-taisen-pro #cpu_battle_button に合わせる
   ============================================================ */
.action-btn {
  display: block;
  margin: 0 auto;
  background-color: #b82343;
  padding: 6px 20px;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.15s;
}

.action-btn:hover {
  opacity: 0.85;
}

/* もう一度ボタン — karuta-taisen-pro .btn-return に合わせる */
.action-btn-retry {
  display: block;
  margin: 12px auto 0;
  padding: 12px 24px;
  background: #b82343;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: opacity 0.15s;
}

.action-btn-retry:hover {
  opacity: 0.85;
}

.hidden {
  display: none !important;
}

/* ============================================================
   ゲームオーバーメッセージ
   ============================================================ */
#gameover-msg {
  position: absolute;
  inset: 0;
  width: -moz-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: fit-content;
  margin: auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: "Noto Serif JP", serif;
  font-size: min(2.8rem, 10.5dvh);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 0 18px rgba(100, 160, 255, 0.9), 2px 2px 6px rgba(0, 0, 0, 0.9), -1px -1px 4px rgba(0, 0, 0, 0.7);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}

/* ============================================================
   クリアメッセージ
   ============================================================ */
#clear-msg {
  position: absolute;
  inset: 0;
  width: -moz-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: fit-content;
  margin: auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: "Noto Serif JP", serif;
  font-size: min(2.8rem, 10.5dvh);
  font-weight: 700;
  color: #f0d060;
  letter-spacing: 0.1em;
  text-shadow: 0 0 24px rgb(255, 200, 0), 0 0 8px rgba(255, 160, 0, 0.8), 2px 2px 6px rgba(0, 0, 0, 0.9);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}

/* ============================================================
   札エリア
   ============================================================ */
#card-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* 札（カード）— デフォルト: 601〜1000px 幅、50:72 比率 */
.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 158px;
  background: #fff;
  border: 7px solid #2d6a2d;
  border-radius: 0;
  box-shadow: 3px 5px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  pointer-events: none;
  opacity: 0;
}

/* 縦書きテキスト */
.card-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: "Noto Serif JP", serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a0f05;
  line-height: 1.35;
  letter-spacing: 0.04em;
  white-space: pre-wrap;
  text-align: left;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card.targeted {
  border-color: #c2435d;
  border-width: 7px;
  box-shadow: 3px 5px 14px rgba(0, 0, 0, 0.5), 0 0 18px rgba(194, 67, 93, 0.65);
}

/* 大きい札 — デスクトップ（>1000px）50:72 = 140×202 */
@media screen and (min-width: 1001px) {
  .card {
    width: 140px;
    height: 202px;
  }
  .card-text {
    font-size: 24px;
    line-height: 1.32;
  }
  #start-section {
    max-width: 820px;
  }
  .game-intro-box {
    width: 800px;
    padding: 1.5em 1em 1em 1em;
  }
  .game-intro-box > .section {
    background: none;
    box-shadow: none;
  }
  .game-intro-box > .section li {
    font-size: 16px;
    line-height: 1.8;
  }
  /* PC では box に padding があるので nav の追加余白は不要 */
  .game-intro-box > .section {
    padding: 0;
    font-size: 13px;
  }
}
/* ============================================================
   危険ライン
   ============================================================ */
#danger-line {
  position: absolute;
  bottom: 34px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent 0%, rgba(255, 60, 60, 0.6) 12%, rgba(255, 60, 60, 0.6) 88%, transparent 100%);
  z-index: 15;
  pointer-events: none;
}

/* ============================================================
   プレイヤー（台座）
   ============================================================ */
#player {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 110px;
  height: 22px;
  background: linear-gradient(180deg, #8b6914 0%, #5c4209 100%);
  border-radius: 4px;
  border: 1.5px solid #c49a28;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 220, 80, 0.4);
  z-index: 20;
  cursor: none;
}

#player-guide {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  width: 1px;
  height: 55vh;
  background: linear-gradient(to top, rgba(220, 180, 60, 0.35) 0%, transparent 100%);
  pointer-events: none;
}

/* ============================================================
   決まり字ボタン・タイマーバー
   ============================================================ */
#kimari-area {
  position: absolute;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 30;
  width: min(96vw, 400px);
}

#timer-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  display: none;
}

#timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: #4caf50;
  transition: background 0.4s;
}

#choices-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  width: 100%;
}

.choice-btn {
  padding: 11px 16px;
  font-family: "Noto Serif JP", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #1a0f05;
  background: linear-gradient(160deg, #fdf8ee 0%, #f0e8cc 100%);
  border: 2px solid #b8a070;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, box-shadow 0.08s, border-color 0.1s, background 0.1s;
  text-align: center;
}

.choice-btn:active {
  transform: scale(0.97);
}

.choice-btn.selected {
  border-color: #f0c030;
  background: linear-gradient(160deg, #fffae0 0%, #f5e080 100%);
  box-shadow: 0 4px 16px rgba(200, 150, 0, 0.5), 0 0 0 3px rgba(240, 190, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.choice-btn.wrong-flash {
  border-color: #e53935;
  background: linear-gradient(160deg, #ffebee 0%, #ffcdd2 100%);
  box-shadow: 0 4px 12px rgba(200, 0, 0, 0.4), 0 0 0 3px rgba(220, 50, 50, 0.3);
}

/* ============================================================
   スコア・コンボ UI
   ============================================================ */
#ui {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  z-index: 40;
  pointer-events: none;
}

#score-display {
  font-size: 16px;
  font-weight: 700;
  color: rgba(220, 200, 150, 0.9);
  letter-spacing: 0.05em;
}

#score {
  font-size: 20px;
  color: #f0d060;
}

#combo-display {
  font-size: 18px;
  font-weight: 700;
  color: #f0d060;
  text-shadow: 0 0 12px rgba(240, 180, 0, 0.8);
  letter-spacing: 0.1em;
}

/* ============================================================
   レスポンシブ — スマホ（≤600px）: 札 100×144px
   ============================================================ */
@media (max-width: 600px) {
  .card {
    width: 100px;
    height: 144px;
  }
  .card-text {
    font-size: 18px;
    line-height: 1.35;
  }
  #player {
    width: 100px;
    height: 18px;
    bottom: 10px;
  }
  #danger-line {
    bottom: 30px;
  }
  #kimari-area {
    bottom: 96px;
    width: min(96vw, 340px);
  }
  .choice-btn {
    font-size: 18px;
    padding: 10px 12px;
    letter-spacing: 0.08em;
  }
  #start-section {
    margin: 16px auto;
  }
  /* 上の句モード（スマホ）— 画面幅いっぱいに */
  #kimari-area.kami-mode {
    width: 96vw;
  }
  #choices-wrap.kami-mode .choice-btn {
    white-space: normal;
  }
}/*# sourceMappingURL=kimariji-hanabi.css.map */