﻿body {
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  /* min-height: 1080px;
  min-width: 1920px; */
  min-height: 100vh;
  min-width: 100vw;
  background-color: #333;
  color: #fff;
  overflow: auto;
}

body.zoomed {
  overflow: hidden;
}

:root {
  --accent: #288d1f;
  --accent-highlight: #3ec428;
  --accent-shadow: #1e6117;
  --text-muted: rgba(255, 255, 255, 0.72);
  --surface-border: rgba(255, 255, 255, 0.12);
  --appW: 1920px;
  --appH: 1080px;
}

#fit {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ここだけ置き換え（または追記） */
#app {
  position: relative;
  width: var(--appW, 1920px);
  height: var(--appH, 1080px);
  transform-origin: center center;
  transform: none;
  transition: transform 0.2s ease-out;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

/* きつい画面用：余白を少し詰める */
#app.compact #hud {
  height: 64px;
  padding: 8px 12px;
}
#app.compact #game-screen {
  padding: 12px;
  padding-top: 76px;
}
#app.compact .board {
  gap: 14px;
  padding: 14px;
  margin-bottom: 18px;
}
#app.compact .hand {
  gap: 14px;
  margin: 12px auto;
}
#app.compact .action-button {
  font-size: 32px;
  padding: 16px 28px;
}
#app.compact #game-info {
  font-size: 21px;
}
#app.compact .area-title,
#app.compact .game-message,
#app.compact .result-info {
  font-size: 24px;
}
#app.compact .captured-container {
  bottom: 8px;
  left: 12px;
  right: 12px;
  gap: 16px;
}

/* ==== Help Modal ==== */
#help-modal {
  position: absolute;
  inset: 0;
  display: none; /* JSでflexに切替 */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100000; /* 充分に上へ（HUDより上） */
}

#help-modal[aria-hidden="false"] {
  display: flex;
}

#help-modal .modal-content {
  width: min(900px, calc(var(--appW, 1920px) * 0.48));
  max-width: calc(100% - 48px);
  max-height: min(calc(var(--appH, 1080px) * 0.8), calc(100% - 48px));
  overflow: auto;
  background: #1d1d1d;
  color: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  line-height: 1.6;
  word-break: break-word; /* はみ出し防止（URL/長文対策） */
}

.help-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

#help-close {
  padding: 10px 22px;
  font-size: 24px;
  border-radius: 14px;
}

.sofume-logo {
  width: 300px;
  height: 200px;
  background-image: url("./logo/SofumeLogo_WhiteTextAlpha_1920x1080.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  display: inline-block;
}

/* ==== Report Modals ==== */
#report-destination-modal,
#report-confirm-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100001;
}

#report-destination-modal[aria-hidden="false"],
#report-confirm-modal[aria-hidden="false"] {
  display: flex;
}

#report-destination-modal .modal-content,
#report-confirm-modal .modal-content {
  width: min(420px, calc(var(--appW, 1920px) * 0.22));
  max-width: calc(100% - 32px);
  background: #1d1d1d;
  color: #fff;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

#report-destination-modal h2 {
  font-size: 30px;
}

#report-confirm-modal h2 {
  font-size: 30px;
}

.report-destination-message,
.report-confirm-message {
  margin: 12px auto 20px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 90%;
}

.report-destination-message {
  font-size: 16px;
}

.report-confirm-message {
  font-size: 16px;
}

.report-destination-actions,
.report-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.report-destination-actions .action-button {
  flex: 1 1 220px;
  min-width: 220px;
  font-size: 26px;
  padding: 12px 28px;
}

#report-destination-close.action-button {
  font-size: 26px;
  padding: 12px 28px;
  margin-top: 12px;
}

.report-confirm-actions .action-button {
  font-size: 26px;
  padding: 12px 28px;
}

/* モーダルを開いている間はページスクロールを止める */
body.modal-open {
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
}

/* --- タイトル画面 --- */
#title-screen {
  background-image: url("./images/Back_title.png");
  background-size: cover;
  background-position: center;
  padding: calc(var(--appH, 1080px) * 0.2) 0;
  justify-content: space-around;
}

.game-logo {
  background-image: url("./images/Title_transparency.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 655px;
  aspect-ratio: 4093 / 2894;
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 18px 42px;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-highlight), var(--accent));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  margin: 16px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  box-shadow: 0 18px 35px rgba(40, 141, 31, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.action-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 22px 40px rgba(40, 141, 31, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-button:active {
  transform: translateY(1px);
  filter: brightness(0.97);
  box-shadow: 0 12px 22px rgba(40, 141, 31, 0.35);
}

.action-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

.action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.credits {
  position: absolute;
  bottom: calc(var(--appH, 1080px) * 0.02);
  font-size: 20px;
  margin-right: 40px;
  color: rgba(255, 255, 255, 0.7);
}

/* --- 回戦数選択画面 --- */
#rounds-screen {
  background-image: url("./images/Back_1.png");
  background-size: cover;
  background-position: center;
}

#rounds-screen h2 {
  font-size: 38px;
}

.round-buttons-container {
  display: flex;
  gap: 32px;
  margin-top: 20px;
}

/* --- 上部HUDバー（点数・ラウンド・ヘルプ） --- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10;
}

#game-info {
  font-size: 24px;
}
#game-info .game-stat {
  font-weight: 600;
}

#hud .hud-buttons {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#hud .action-button {
  font-size: 22px;
  padding: 10px 16px;
  border-radius: 10px;
}

.yaku-assist-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 240px;
  position: relative;
}

#yaku-assist-toggle {
  min-width: 180px;
}

.toggle-button {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toggle-button:is([aria-pressed="true"], .is-active) {
  background: linear-gradient(135deg, #ffe082, #ffca28);
  color: #2a1c00;
  border-color: rgba(255, 202, 40, 0.8);
  box-shadow: 0 0 10px rgba(255, 202, 40, 0.45);
}

.toggle-button[aria-pressed="false"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

#yaku-hint-box {
  display: none;
  min-width: 240px;
  background: rgba(18, 18, 18, 0.92);
  color: #ffe082;
  font-weight: 600;
  font-size: 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 235, 59, 0.6);
  padding: 8px 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  text-align: right;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  pointer-events: none;
}

/* --- ゲーム画面 --- */
#game-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  padding-top: 90px; /* HUD分下げる */
}

.main-game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding-bottom: calc(var(--appH, 1080px) * 0.15 + 24px);
  min-height: 0;
}

/* --- テキスト類 --- */
.area-title {
  font-size: 28px;
  margin: 10px 0;
}
.game-message {
  font-size: 24px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  bottom: calc(var(--appH, 1080px) * 0.15 + 40px);
  text-align: center;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  pointer-events: none; /* 下の操作を邪魔しない */
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 600px;
  width: max-content;
}

.game-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.result-info {
  font-size: 28px;
}

/* --- 盤面・手札 --- */
.board {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 19px;
  border: 2px dashed #999;
  padding: 19px;
  background-color: rgba(0, 0, 0, 0.2);
  min-height: calc(var(--appH, 1080px) * 0.15);
  margin-top: 12px;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

/* ボードの横に山札を配置 */
.board-and-deck {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 12px;
  box-sizing: border-box;
  scrollbar-gutter: stable both-edges; /* スクロールバー出現時の幅ぶれ防止 */
}

.board-and-deck > * {
  flex-shrink: 0; /* 横幅が足りないときも縮めず、ボード側だけをスクロールさせる */
}

.draw-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.draw-preview.visible {
  opacity: 1;
  transform: translateY(0);
}

.draw-label {
  font-size: 16px;
  opacity: 0.85;
}

.deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}

#draw-preview-image,
#deck-image {
  width: 106px;
  aspect-ratio: 660 / 1080;
  height: auto;
  border: 1px solid #333;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.draw-preview img {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.draw-preview.visible img.preview-ready {
  opacity: 1;
}

.draw-preview img:not([src]) {
  opacity: 0;
}

#deck-count {
  font-size: 20px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: 12px;
}

/* 縮小レイアウト時の山札サイズ */
#app.size-small #deck-image {
  width: 80px;
}
#app.size-tiny #deck-image {
  width: 64px;
}

#app.size-small #draw-preview-image {
  width: 80px;
}
#app.size-tiny #draw-preview-image {
  width: 64px;
}

.hand {
  display: flex;
  justify-content: center;
  gap: 19px;
  margin: 16px auto;
  position: relative;
  z-index: 2;
}

/* --- 固定配置: 手札・場札・山札・引いた札のエリア高さを確保 --- */
/* 手札が空でもエリアが潰れないよう最小高さを設定 */
.hand {
  min-height: 160px;
}
#app.size-small .hand {
  min-height: 135px;
}
#app.size-tiny .hand {
  min-height: 110px;
}

/* 山札/引いた札の表示が無いタイミングでも縦位置を維持 */
#draw-preview-area,
#deck-area {
  min-height: 180px; /* 札1枚相当の高さ+ラベル余白 */
}
#app.size-small #draw-preview-area,
#app.size-small #deck-area {
  min-height: 150px;
}
#app.size-tiny #draw-preview-area,
#app.size-tiny #deck-area {
  min-height: 120px;
}

/* --- カード --- */
.card {
  width: 106px;
  aspect-ratio: 660 / 1080;
  height: auto;
  background-color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 14px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  padding: 19px;
}

.card.selectable {
  border-color: #288d1f;
  box-shadow: 0 0 0 4px #288d1f, 0 0 16px rgba(40, 141, 31, 0.75);
  transform: translateY(-8px);
}

.card.selectable:hover {
  transform: translateY(-12px);
}

/* 画面が小さいとき：親 #app にクラスを付けて一括で小さくする */
#app.size-small .card {
  width: 80px;
  font-size: 16px;
}
#app.size-small .captured-row .card {
  width: 48px;
  height: 71px;
  font-size: 12px;
}

#app.size-tiny .card {
  width: 64px;
  font-size: 13px;
}
#app.size-tiny .captured-row .card {
  width: 40px;
  height: 62px;
  font-size: 11px;
}

.card:hover {
  transform: translateY(-10px);
}

.card.back {
  background-image: url("./images/back.png");
}

/* --- アクションボタン --- */
.player-controls-container {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.player-area {
  width: 100%;
}

.player-hand-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 180px;
  margin-bottom: 8px;
  min-height: 72px;
  box-sizing: border-box;
}

.player-hand-header .area-title {
  margin: 0;
  text-align: center;
}

.action-buttons-container {
  position: fixed;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10000;
}

.action-dialog {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 40px 50px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-width: 400px;
}

.action-dialog::after {
  content: "";
  position: absolute;
  top: 80px;
  left: 50px;
  right: 50px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.action-message {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  padding-bottom: 24px;
  text-align: center;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0.85;
}

.action-buttons-group {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.action-buttons-container .action-button {
  pointer-events: auto;
  width: 180px;
  padding: 12px 32px;
  font-size: 27px;
  font-weight: 700;
  background: linear-gradient(135deg, #3ec428, #288d1f);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  white-space: nowrap;
}

.action-buttons-container .action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.action-buttons-container .action-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.declaration-panel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 55%;
  height: 12%;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: none; /* Allow clicking through if empty/transparent parts */
}

.declaration-panel > * {
  pointer-events: auto;
}

.declaration-card {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 16px;
  box-sizing: border-box;
  align-items: center;
}

.declaration-heading {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted);
  grid-column: 1;
  grid-row: 1;
  white-space: nowrap;
}

.declaration-status {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
  min-width: auto;
  flex-shrink: 0;
  text-align: left;
  grid-column: 1;
  grid-row: 2;
  line-height: 1.2;
  white-space: nowrap;
}

.declaration-detail {
  font-size: 16px;
  line-height: 1.4;
  grid-column: 2;
  grid-row: 1 / -1; /* Span both rows */
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.declaration-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.declaration-detail li {
  margin: 0;
  white-space: nowrap;
}

.declaration-total {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent-highlight);
}

.declaration-base {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

#app.compact .declaration-panel {
  max-height: 180px;
}

#app.size-small .declaration-panel {
  max-height: 150px;
}

#app.size-tiny .declaration-panel {
  max-height: 120px;
}

.captured-player,
.captured-cpu {
  width: 20%;
  pointer-events: auto;
}

/* 相手の持ち札エリアを少し中央側へ */
.captured-cpu {
  margin-right: 20px; /* わずかに内側へ */
}

.captured-container {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  height: 280px; /* Fixed height to prevent movement */
  pointer-events: none;
}

.captured-player h3,
.captured-cpu h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.captured-cards-container {
  border: 1px solid #ccc;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.1);
  min-height: calc(var(--appH, 1080px) * 0.1);
  width: 100%;
}

.captured-row {
  display: flex;
  flex-wrap: wrap;
}

.captured-row .card {
  width: 54px;
  height: 88px;
}

/* --- リザルト画面 --- */
#result-screen {
  background-image: url("./images/Result.png");
  background-size: cover;
  background-position: center;
  align-items: flex-start; /* 左寄せ */
  text-align: left; /* テキスト左揃え */
  padding-left: 5%; /* 左側に余白 */
}

#result-screen .action-button {
  font-size: 36px;
  padding-left: 5%;
}

/* --- ゲームプレイ背景 --- */
#game-screen {
  background-image: url("./images/Back_1.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.title-main-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: calc(var(--appH, 1080px) * 0.02);
}

#title-screen .title-secondary-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: calc(var(--appH, 1080px) * 0.01);
}
#title-screen .title-secondary-actions .action-button {
  margin: 16px 8px;
  min-width: 280px;
}

#result-screen h2 {
  font-size: 64px;
  margin-bottom: calc(var(--appH, 1080px) * 0.03);
  text-shadow: 2px 2px 4px #000;
}

.result-actions {
  margin-top: calc(var(--appH, 1080px) * 0.05);
}

/* --- カード情報ボックス --- */
#card-info-box {
  position: fixed;
  top: 0;
  left: 0;
  transform: none;
  width: min(320px, calc(var(--appW, 1920px) * 0.18));
  max-width: calc(100% - 32px);
  padding: 24px 28px;
  background: linear-gradient(
    145deg,
    rgba(18, 18, 18, 0.92),
    rgba(32, 32, 32, 0.82)
  );
  color: #fff;
  border-radius: 28px;
  text-align: center;
  z-index: 9999;
  font-size: 26px;
  pointer-events: none;
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#card-info-box p {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

#card-info-box p:first-child {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-highlight);
}

#card-info-box p:nth-child(2) {
  font-size: 28px;
  color: #fff;
}

#card-info-box p:last-child {
  font-size: 24px;
}

/* ==== リンク色をボタンと統一 ==== */
a {
  color: #288d1f;
  text-decoration: underline;
}

a:visited {
  color: #288d1f;
}

a:hover {
  opacity: 0.8; /* 少し薄くしてクリック感 */
}

/* ==== Tutorial Styles ==== */
#tutorial-overlay {
  position: absolute; /* fixed -> absolute (#app内配置のため) */
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none; /* 下の要素をクリックできるようにする */
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#tutorial-overlay.position-top {
  justify-content: flex-start;
  padding-top: 120px; /* HUDの下あたり */
}

#tutorial-overlay.position-bottom {
  justify-content: flex-end;
  padding-bottom: 100px; /* 手札の上あたり（少し広めに） */
}

#tutorial-overlay.position-bottom .tutorial-message-box {
  margin-bottom: 0;
}

#tutorial-overlay.position-top-left {
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 100px;
  padding-left: 40px;
}

.tutorial-message-box {
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid var(--accent-highlight);
  border-radius: 16px;
  padding: 24px 32px;
  max-width: 600px;
  width: 90%;
  color: #fff;
  text-align: center;
  pointer-events: auto; /* メッセージボックスは操作可能 */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 20%; /* 画面中央より少し上に配置 */
}

.tutorial-text {
  font-size: 22px;
  line-height: 1.6;
  margin-bottom: 20px;
}

#tutorial-next-btn {
  font-size: 20px;
  padding: 10px 24px;
  min-width: 120px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tutorial-highlight {
  position: relative;
  z-index: 100000 !important; /* オーバーレイより上に表示 */
  box-shadow: 0 0 0 4px #ffeb3b, 0 0 20px rgba(255, 235, 59, 0.8) !important;
  animation: pulseHighlight 1.5s infinite;
  transition: all 0.3s ease;
}

@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 0 4px #ffeb3b, 0 0 20px rgba(255, 235, 59, 0.8);
  }
  50% {
    box-shadow: 0 0 0 6px #ffeb3b, 0 0 30px rgba(255, 235, 59, 1);
  }
  100% {
    box-shadow: 0 0 0 4px #ffeb3b, 0 0 20px rgba(255, 235, 59, 0.8);
  }
}

/* チュートリアル中はハイライト以外の要素を少し暗くする（オプション） */
body.tutorial-active #app::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99998;
  pointer-events: none;
}
