:root {
  --bg-dark: #0b0f19;
  --bg-surface: #151d2f;
  --bg-card: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-gold: #fbbf24;
  --accent-purple: #c084fc;
  --accent-red: #f87171;
  --accent-blue: #38bdf8;
  --accent-green: #4ade80;

  --card-width: clamp(62px, 6vw, 94px);
  --card-aspect: 2 / 3;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100dvh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(126, 34, 206, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(2, 132, 199, 0.08) 0%, transparent 50%);
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================
   ヘッダー
   ============================ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.4rem, 1.2dvh, 0.8rem) 1.2rem;
  background-color: rgba(21, 29, 47, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-sub {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent-purple);
  margin-left: 0.2rem;
}

.round-badge, .trick-badge {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.round-badge span, .trick-badge span {
  color: var(--text-main);
  font-weight: bold;
}

/* 契約バナー */
.contract-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 0.3rem 1.2rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.15);
  font-size: 0.8rem;
}

.contract-shinigami {
  color: var(--text-muted);
}

.contract-partner {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.partner-status-tag {
  background-color: #334155;
  color: #cbd5e1;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #475569;
}

.partner-status-tag.loyal {
  background-color: rgba(22, 163, 74, 0.3);
  color: #86efac;
  border-color: var(--accent-green);
}

.partner-status-tag.betrayed {
  background-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
  border-color: var(--accent-red);
}

/* ボタン群 */
.btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #7e22ce, #9333ea);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9333ea, #a855f7);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #334155;
}

/* ============================
   円卓バトルフィールド
   ============================ */
.battlefield-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 0.4rem 0.8rem;
  background: radial-gradient(ellipse at 50% 45%, #151d32 0%, #0d1322 60%, #080c16 100%);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  margin: 0.3rem 0.6rem;
  min-height: 320px;
}

/* 卓の中央案内バナー */
.table-center {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.center-banner {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.lead-suit-indicator span {
  font-weight: bold;
}

.turn-indicator {
  font-weight: bold;
}

/* ============================
   座席配置レイアウト
   ============================ */
.table-seats {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.seat {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
  transition: all 0.3s ease;
}

/* 4人配置 */
.layout-4p .seat-top {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
}
.layout-4p .seat-top .seat-played-card {
  margin-top: 6px;
}

.layout-4p .seat-left {
  top: 44%;
  left: 12px;
  transform: translateY(-50%);
  flex-direction: row;
}
.layout-4p .seat-left .seat-played-card {
  margin-left: 10px;
}

.layout-4p .seat-right {
  top: 44%;
  right: 12px;
  transform: translateY(-50%);
  flex-direction: row-reverse;
}
.layout-4p .seat-right .seat-played-card {
  margin-right: 10px;
}

.layout-4p .seat-bottom {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}
.layout-4p .seat-bottom .seat-played-card {
  margin-bottom: 6px;
}

/* 5人配置 */
.layout-5p .seat-top-left {
  top: 10px;
  left: 32%;
  transform: translateX(-50%);
  flex-direction: column;
}
.layout-5p .seat-top-left .seat-played-card {
  margin-top: 6px;
}

.layout-5p .seat-top-right {
  top: 10px;
  left: 68%;
  transform: translateX(-50%);
  flex-direction: column;
}
.layout-5p .seat-top-right .seat-played-card {
  margin-top: 6px;
}

.layout-5p .seat-left {
  top: 44%;
  left: 10px;
  transform: translateY(-50%);
  flex-direction: row;
}
.layout-5p .seat-left .seat-played-card {
  margin-left: 8px;
}

.layout-5p .seat-right {
  top: 44%;
  right: 10px;
  transform: translateY(-50%);
  flex-direction: row-reverse;
}
.layout-5p .seat-right .seat-played-card {
  margin-right: 8px;
}

.layout-5p .seat-bottom {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}
.layout-5p .seat-bottom .seat-played-card {
  margin-bottom: 6px;
}

/* プレイヤーボックス */
.seat-player-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
  min-width: 140px;
  transition: all 0.25s ease;
}

.seat-player-box.is-turn {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
  transform: scale(1.04);
}

.seat-player-box.is-shinigami {
  border-color: var(--accent-purple);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), var(--bg-surface));
}

.seat-player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seat-player-name {
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.seat-player-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

/* 卓上に出されたカード枠 */
.seat-played-card {
  min-width: 86px;
  min-height: 125px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.seat-played-card .game-card {
  animation: cardPlace 0.25s ease-out;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  cursor: default;
}

@keyframes cardPlace {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* トリック獲得時のカード吸い込みアニメーション */
.seat-played-card.fly-to-winner {
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
  pointer-events: none;
}

/* 吹き出し（セリフ） */
.speech-bubble {
  position: absolute;
  background: #1e1b4b;
  color: #e0e7ff;
  border: 1px solid #818cf8;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: bold;
  white-space: nowrap;
  max-width: 280px;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
  z-index: 30;
  pointer-events: none;
  animation: bubblePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubblePop {
  0% { transform: scale(0.4) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.seat-top .speech-bubble {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
}
.seat-left .speech-bubble {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
}
.seat-right .speech-bubble {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
}
.seat-bottom .speech-bubble {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
}
.layout-5p .seat-top-left .speech-bubble {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
}
.layout-5p .seat-top-right .speech-bubble {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
}

/* 最下部プレイヤーセクション */
.bottom-player-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background-color: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 0.4rem 1rem 0.6rem 1rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  z-index: 10;
}

.bottom-player-section .player-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 相方覚醒カットイン演出 */
.cutin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: cutinFadeIn 0.3s ease;
}

.cutin-overlay.hidden {
  display: none;
}

@keyframes cutinFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.cutin-content {
  background: linear-gradient(135deg, #1e1136, #0f172a);
  border: 2px solid #a855f7;
  border-radius: var(--radius-lg);
  padding: 1.8rem 2.5rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.5), inset 0 0 20px rgba(168, 85, 247, 0.2);
  max-width: 500px;
  width: 90vw;
  animation: cutinZoom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cutinZoom {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.cutin-badge {
  font-size: 0.9rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
}

.cutin-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 0.8rem auto;
  border: 3px solid #fbbf24;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
  background-image: url('../assets/characters_sheet.jpg');
  background-size: 400% 300%;
}

.cutin-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.4rem;
}

.cutin-card-box {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 0.8rem;
}

.cutin-stance {
  font-size: 1.15rem;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  margin-bottom: 0.8rem;
}

.cutin-stance.loyal {
  color: #4ade80;
  border: 1px solid #22c55e;
}

.cutin-stance.betrayed {
  color: #f87171;
  border: 1px solid #ef4444;
}

.cutin-quote {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.4;
}

.player-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
}

.player-avatar {
  font-size: 1.3rem;
}

.role-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
}

.role-badge.shinigami {
  border-color: var(--accent-purple);
  background-color: rgba(126, 34, 206, 0.25);
  color: #e9d5ff;
}

.player-harvest-box {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.player-score-badge {
  font-size: 0.85rem;
  background-color: var(--bg-card);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

.player-score-badge strong {
  color: var(--accent-gold);
  font-size: 1rem;
}

/* 手札コンテナ */
.hand-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.2rem, 0.6vw, 0.6rem);
  overflow-x: auto;
  padding: 0.6rem 0.2rem;
  scrollbar-width: thin;
}

/* ============================
   スプライトシート（アバター＆カードアート）
   ============================ */
.char-avatar-img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-image: url('../assets/characters_sheet.jpg');
  background-size: 400% 300%;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.char-avatar-lg {
  width: 68px;
  height: 68px;
}

/* 4列×3行の切り出し座標 */
.avatar-apprentice { background-position: 0% 0%; }
.avatar-ash        { background-position: 33.33% 0%; }
.avatar-elise      { background-position: 66.66% 0%; }
.avatar-luna       { background-position: 100% 0%; }

.avatar-vera       { background-position: 0% 50%; }
.avatar-gilbert    { background-position: 33.33% 50%; }
.avatar-balthazar  { background-position: 66.66% 50%; }
.avatar-felix      { background-position: 100% 50%; }

.avatar-cain       { background-position: 0% 100%; }
.avatar-darius     { background-position: 33.33% 100%; }
.avatar-morgiana   { background-position: 66.66% 100%; }
.avatar-shinigami  { background-position: 100% 100%; }

/* カードアートワーク（横5枚の切り出し） */
.card-illustration {
  width: 100%;
  flex: 1;
  min-height: 46px;
  max-height: 64px;
  background-image: url('../assets/cards_sheet.jpg?v=6');
  background-size: 500% 100%;
  background-repeat: no-repeat;
  border-radius: 4px;
  margin: 3px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.card-ill-blue   { background-position: 0% 0%; }
.card-ill-green  { background-position: 25% 0%; }
.card-ill-yellow { background-position: 50% 0%; }
.card-ill-red    { background-position: 75% 0%; }
.card-ill-back   { background-position: 100% 0%; }

/* ============================
   カードコンポーネント
   ============================ */
.game-card {
  width: var(--card-width);
  aspect-ratio: var(--card-aspect);
  background-color: #1e293b;
  border-radius: var(--radius-sm);
  border: 2px solid #475569;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.game-card.playable:hover {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

.game-card.disabled {
  filter: grayscale(0.8) opacity(0.4);
  cursor: not-allowed;
}

.game-card.suit-blue {
  border-color: var(--accent-blue);
  background: linear-gradient(145deg, #0f2744, #1e293b);
}

.game-card.suit-green {
  border-color: var(--accent-green);
  background: linear-gradient(145deg, #133320, #1e293b);
}

.game-card.suit-yellow {
  border-color: var(--accent-gold);
  background: linear-gradient(145deg, #382c0f, #1e293b);
}

.game-card.suit-red {
  border-color: var(--accent-red);
  background: linear-gradient(145deg, #3d1515, #1e293b);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-value {
  font-size: clamp(0.9rem, 1.4vw, 1.2rem);
  font-weight: 900;
}

.card-icon {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.card-center {
  text-align: center;
  font-size: clamp(0.65rem, 0.9vw, 0.8rem);
  font-weight: bold;
  line-height: 1.2;
}

.card-bottom {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  display: flex;
  justify-content: flex-end;
}

.skull-badge {
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
}

/* ============================
   フッター・ログ
   ============================ */
.app-footer {
  padding: 0.4rem 1.2rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.log-banner {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ============================
   ネイティブダイアログ（Modal）
   ============================ */
dialog.modal {
  margin: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  color: var(--text-main);
  padding: 1.8rem;
  max-width: 550px;
  width: 90vw;
  box-shadow: var(--shadow-main);
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--accent-gold);
}

.modal-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.player-count-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.btn-select {
  padding: 0.8rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select.active {
  border-color: var(--accent-purple);
  background-color: rgba(126, 34, 206, 0.2);
  color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

.ai-preset-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.btn-preset {
  padding: 0.6rem 0.8rem;
  background-color: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preset.active {
  border-color: var(--accent-purple);
  background-color: rgba(126, 34, 206, 0.2);
  color: #fff;
  font-weight: bold;
}

/* ビッドモーダル特有 */
.modal-bid {
  max-width: 800px;
  width: 95vw;
}

.modal-section-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: #cbd5e1;
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}

.modal-hand-preview {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 6px;
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  scrollbar-width: thin;
}

.preview-card {
  width: 52px;
  min-width: 52px;
  height: 80px;
  background-color: #1e293b;
  border-radius: 6px;
  border: 2px solid #475569;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  user-select: none;
}

.preview-card.suit-blue   { border-color: #3b82f6; }
.preview-card.suit-green  { border-color: #10b981; }
.preview-card.suit-yellow { border-color: #f59e0b; }
.preview-card.suit-red    { border-color: #ef4444; }

.preview-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.preview-card .card-illustration {
  min-height: 24px;
  max-height: 30px;
  margin: 1px 0;
  border-radius: 2px;
}

.preview-card-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  padding: 1px 0;
  color: #fca5a5;
  line-height: 1;
}

.preview-card-bottom.no-skull {
  color: #64748b;
}

/* ビッドボタン群 */
.current-bid-info {
  background-color: var(--bg-card);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  text-align: center;
}

.bid-number-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.btn-bid-num {
  padding: 0.6rem;
  background-color: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-bid-num:hover {
  background-color: #7e22ce;
  border-color: var(--accent-purple);
}

/* 契約ドロップダウン */
.contract-select-wrap {
  margin-bottom: 1rem;
}

.contract-dropdown {
  width: 100%;
  padding: 0.8rem;
  background-color: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

/* 忠誠 vs 寝返り モーダル */
.modal-decision {
  max-width: 620px;
}

.decision-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.decision-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.decision-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.loyal-box:hover {
  border-color: var(--accent-purple);
  background-color: rgba(126, 34, 206, 0.15);
}

.betray-box:hover {
  border-color: var(--accent-red);
  background-color: rgba(220, 38, 38, 0.15);
}

.decision-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.decision-card p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* 結果テーブル */
#dialog-round-result {
  max-width: 760px;
}

.result-summary-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.summary-judge {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  text-align: center;
}

.summary-judge.achieved {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #4ade80;
}

.summary-judge.failed {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}

.table-container {
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.result-table th, .result-table td {
  padding: 0.6rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.result-table th:first-child, .result-table td:first-child {
  text-align: left;
}

.result-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.result-table td.score-pos {
  color: #4ade80;
  font-weight: bold;
}

.result-table td.score-neg {
  color: #f87171;
  font-weight: bold;
}

.result-table td.score-zero {
  color: #94a3b8;
}

.result-table td.score-total {
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.95rem;
}

.podium-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.podium-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.podium-item.rank-1 {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), var(--bg-card));
}

.modal-rules .rules-body {
  max-height: 55dvh;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  padding-right: 0.5rem;
}

.modal-rules h3 {
  font-size: 0.95rem;
  color: var(--accent-purple);
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

.modal-rules ul {
  padding-left: 1.2rem;
}

.modal-card-list {
  max-width: 720px;
}

.card-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  max-height: 60dvh;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.suit-table-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem;
}

.suit-table-title {
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mini-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 3px;
}

.mini-card-row:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.03);
}

.mini-skull-0 { color: #64748b; }
.mini-skull-1 { color: #cbd5e1; }
.mini-skull-2 { color: #facc15; font-weight: bold; }
.mini-skull-3 { color: #f87171; font-weight: bold; }

@keyframes cardDrop {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================
   オープニング・対戦設定画面
   ============================ */
.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(1rem, 3vh, 2.5rem) 1rem;
  background-color: #07090e;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.opening-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opening-backdrop {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 15%, rgba(147, 51, 234, 0.22) 0%, transparent 65%),
    radial-gradient(circle at 80% 85%, rgba(2, 132, 199, 0.12) 0%, transparent 55%),
    radial-gradient(circle at 20% 75%, rgba(220, 38, 38, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #07090e 0%, #0d121f 50%, #07090e 100%);
  pointer-events: none;
  z-index: -1;
}

.opening-content {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: auto 0;
}

/* タイトルヘッダー */
.opening-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.opening-logo-icon {
  font-size: clamp(3rem, 7vw, 4.2rem);
  line-height: 1;
  filter: drop-shadow(0 0 25px rgba(192, 132, 252, 0.75));
  animation: pulseSkull 3s ease-in-out infinite;
  margin-bottom: 0.2rem;
}

@keyframes pulseSkull {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.6)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 35px rgba(248, 113, 113, 0.85)); }
}

.opening-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 30px rgba(192, 132, 252, 0.5);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.8rem;
}

.opening-title-en {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.35em;
  color: var(--accent-purple);
  font-weight: 700;
}

.opening-subtitle {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  color: #e2e8f0;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.opening-lore {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  color: var(--text-muted);
  font-style: italic;
  max-width: 650px;
}

/* メイン設定パネル */
.opening-panel {
  width: 100%;
  background: rgba(21, 29, 47, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(192, 132, 252, 0.15);
  padding: clamp(1.2rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.setup-section {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.setup-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setup-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.step-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: #0b0f19;
  font-size: 0.8rem;
  font-weight: 900;
}

/* 人数選択カード */
.setup-btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.btn-setup-card {
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
}

.btn-setup-card:hover {
  background: rgba(45, 60, 85, 0.8);
  border-color: #64748b;
  transform: translateY(-2px);
}

.btn-setup-card.active {
  background: rgba(126, 34, 206, 0.2);
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.btn-setup-card.active::after {
  content: "✔";
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--accent-gold);
  font-weight: bold;
  font-size: 1.1rem;
}

.btn-setup-card .card-icon {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent-purple);
}

.btn-setup-card .card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.btn-setup-card .card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* AI選択モードタブ */
.ai-mode-tabs {
  display: flex;
  background: rgba(11, 15, 25, 0.6);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.btn-mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mode-tab:hover {
  color: var(--text-main);
}

.btn-mode-tab.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* プリセット選択グリッド */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}

.preset-card {
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

.preset-card:hover {
  background: rgba(45, 60, 85, 0.7);
  border-color: #64748b;
  transform: translateY(-2px);
}

.preset-card.active {
  background: rgba(88, 28, 135, 0.25);
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
}

.preset-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #b45309;
  color: #fef3c7;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 9999px;
}

.preset-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.preset-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.preset-members {
  font-size: 0.7rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 0.2rem;
}

/* カスタム直接指名ビュー */
.custom-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(11, 15, 25, 0.6);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-top: 0.7rem;
  margin-bottom: 0.6rem;
  border-left: 3px solid var(--accent-gold);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-mode-status {
  display: inline-block;
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  margin-right: 0.5rem;
}

.badge-mode-status.custom {
  background: rgba(251, 191, 36, 0.2);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.custom-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.custom-char-card {
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.custom-char-card:hover {
  background: rgba(45, 60, 85, 0.85);
  border-color: #64748b;
  transform: translateY(-2px);
}

.custom-char-card.selected {
  background: rgba(126, 34, 206, 0.25);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.custom-char-card.selected::before {
  content: "✔ 参加";
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-gold);
  color: #0b0f19;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
}

.custom-char-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-top: 4px;
}

.custom-char-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.custom-char-title {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.custom-char-style {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.4);
}

.custom-char-quote {
  font-size: 0.65rem;
  color: #cbd5e1;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

/* アクションボタン */
.opening-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.btn-start-game {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(135deg, #7e22ce 0%, #b91c1c 100%);
  color: #fff;
  border: 2px solid #c084fc;
  border-radius: 9999px;
  padding: clamp(0.8rem, 2vh, 1.1rem) 2rem;
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(126, 34, 206, 0.6), 0 0 25px rgba(248, 113, 113, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.btn-start-game:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 35px -5px rgba(126, 34, 206, 0.8), 0 0 35px rgba(248, 113, 113, 0.6);
  border-color: #fbbf24;
}

.btn-start-game:active {
  transform: translateY(1px) scale(0.99);
}

.btn-start-icon {
  font-size: 1.4rem;
}

.opening-sub-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.opening-footer {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
}

/* 画面設定・ズームボタン */
.btn-zoom {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-zoom:hover {
  background: rgba(45, 60, 85, 0.85);
  border-color: #64748b;
}

.btn-zoom.active {
  background: rgba(126, 34, 206, 0.3);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.btn-res {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-res:hover {
  background: rgba(45, 60, 85, 0.85);
  border-color: #64748b;
}

.btn-res.active {
  background: rgba(126, 34, 206, 0.3);
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

/* ===================================================
   1366 × 768 / ノートPC環境 最適化レスポンシブスタイル
   =================================================== */
@media (max-height: 820px), (max-width: 1400px) and (max-height: 880px) {
  :root {
    --card-width: clamp(58px, 5.6vw, 80px);
    --card-aspect: 2 / 2.9;
  }

  /* ヘッダーのスリム化 */
  .app-header {
    padding: 0.25rem 0.8rem;
  }
  .logo {
    font-size: 1.15rem;
  }
  .logo-icon {
    font-size: 1.15rem;
  }
  .round-badge, .trick-badge {
    padding: 0.18rem 0.5rem;
    font-size: 0.7rem;
  }
  .contract-banner {
    padding: 0.15rem 0.8rem;
    font-size: 0.72rem;
  }
  .app-header .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  /* バトルフィールドテーブルの最適化 */
  .battlefield-table {
    margin: 0.2rem 0.6rem;
    padding: 0.2rem 0.5rem;
    min-height: unset;
  }

  /* 卓上の中央案内バナー */
  .center-banner {
    padding: 0.25rem 0.8rem;
    font-size: 0.78rem;
    gap: 0.8rem;
  }

  /* 座席プレイヤーボックスのスリム化 */
  .seat-player-box {
    padding: 0.2rem 0.45rem;
    gap: 0.45rem;
    min-width: 110px;
  }
  .char-avatar-img {
    width: 44px;
    height: 44px;
  }
  .seat-player-name {
    font-size: 0.75rem;
  }
  .seat-player-stats {
    font-size: 0.65rem;
  }

  /* 卓上に出されたカード枠 */
  .seat-played-card {
    min-width: 64px;
    min-height: 92px;
  }
  .seat-played-card .game-card {
    transform: scale(0.92);
  }

  /* 4人配置の座席位置微調整 */
  .layout-4p .seat-top { top: 4px; }
  .layout-4p .seat-left { left: 8px; top: 46%; }
  .layout-4p .seat-right { right: 8px; top: 46%; }
  .layout-4p .seat-bottom { bottom: 4px; }

  /* 5人配置の座席位置微調整 */
  .layout-5p .seat-top-left { top: 4px; left: 30%; }
  .layout-5p .seat-top-right { top: 4px; left: 70%; }
  .layout-5p .seat-left { left: 6px; top: 46%; }
  .layout-5p .seat-right { right: 6px; top: 46%; }
  .layout-5p .seat-bottom { bottom: 4px; }

  /* 最下部プレイヤー手札セクション */
  .bottom-player-section {
    padding: 0.2rem 0.8rem 0.35rem 0.8rem;
    gap: 0.2rem;
  }
  .bottom-player-section .char-avatar-img {
    width: 38px;
    height: 38px;
  }
  .player-name {
    font-size: 0.85rem;
  }
  .player-harvest-box, .player-score-badge {
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
  }

  /* 手札コンテナ */
  .hand-container {
    gap: clamp(2px, 0.45vw, 6px);
    padding: 0.35rem 0.1rem;
  }

  /* カードコンポーネント */
  .game-card {
    padding: 0.25rem 0.3rem;
  }
  .card-illustration {
    min-height: 30px;
    max-height: 46px;
    margin: 2px 0;
  }
  .card-top-info, .card-bottom-info {
    font-size: 0.75rem;
  }
  .card-rank {
    font-size: 0.95rem;
  }

  /* オープニング画面のフィット */
  .opening-screen {
    padding: 0.8rem 0.8rem;
  }
  .opening-content {
    gap: 0.8rem;
  }
  .opening-logo-icon {
    font-size: 2.5rem;
  }
  .opening-title {
    font-size: 2.2rem;
  }
  .opening-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
  }
  .opening-lore {
    font-size: 0.78rem;
  }
  .opening-panel {
    padding: 1rem 1.4rem;
    gap: 1rem;
  }
  .setup-section {
    gap: 0.45rem;
  }
  .setup-label {
    font-size: 0.95rem;
  }
  .btn-setup-card {
    padding: 0.6rem 0.8rem;
  }
  .btn-setup-card .card-title {
    font-size: 1rem;
  }
  .btn-setup-card .card-desc {
    font-size: 0.72rem;
  }
  .preset-card {
    padding: 0.6rem 0.8rem;
  }
  .preset-name {
    font-size: 0.9rem;
  }
  .preset-desc {
    font-size: 0.7rem;
  }
  .custom-char-grid {
    max-height: 250px;
  }
  .custom-char-card {
    padding: 0.45rem;
  }
  .btn-start-game {
    padding: 0.65rem 1.8rem;
    font-size: 1.15rem;
  }

  /* モーダルの高さ調整 */
  .modal-content {
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.2rem;
  }
}
