/* 約数カードコレクター - 温かみのある色調 */

/* ルートラッパー + リセット */
.dcc,
.dcc * {
  box-sizing: border-box;
}

.dcc {
  /* =========================
     ブランド標準カラー（ネイビー×ゴールド）
     ========================= */
  --base: #FFFFFF;
  --base-light: #FAFAFA;
  --base-dark: #F5F5F5;
  --main: #1e3a5f;
  --main-light: #2d5a8f;
  --main-dark: #0f1e3a;
  --accent: #d4af37;
  --accent-light: #f4cf5f;
  --accent-dark: #b8941f;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --border: #E8E8E8;
  --shadow: 0 4px 20px rgba(30, 58, 95, 0.10);
  --shadow-hover: 0 8px 30px rgba(30, 58, 95, 0.15);

  /* 既存CSS互換（旧変数名 → 新変数） */
  --primary: var(--main);
  --primary-light: var(--main-light);
  --primary-dark: var(--main-dark);
  --warning: var(--accent);
  --background: var(--base-dark);
  --surface: var(--base);

  /* ステータス色（学習ゲーム向け） */
  --success: #10b981;
  --danger: #ef4444;

  /* サイド幅を可変に */
  --side: clamp(160px, 18vw, 240px);

  /* 子供向けフォント */
  font-family: 'Comic Sans MS', '游ゴシック', 'Yu Gothic', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--base) 0%, #F8F9FA 50%, #F0F2F5 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
}

.dcc .dcc-game-container {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(30, 58, 95, 0.18), 0 10px 10px -5px rgba(30, 58, 95, 0.08);
  overflow: hidden;
  width: 100%;
  max-width: clamp(960px, 92vw, 1280px);
  display: flex;
  flex-direction: column;
  border: 3px solid var(--main);
  position: relative;
  background-clip: padding-box;
}

.dcc .dcc-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 20px 16px;
  text-align: center;
  border-radius: 17px 17px 0 0;
}

.dcc .dcc-header h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 900;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

.dcc .dcc-main-content {
  flex: 1;
  min-height: 0;
}

/* 3カラムレイアウト */
.dcc .dcc-layout-3col {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--side);
  gap: 20px;
  padding: 20px;
  background: var(--background);
  border-top: 1px solid var(--border);
}

.dcc .dcc-center {
  min-height: 600px;
}

.dcc .dcc-sidebar .dcc-panel {
  position: sticky;
  top: 20px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(30, 58, 95, 0.15);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
  border: 2px solid var(--border);
}


/* 左サイドバー内タイトル */
.dcc .dcc-sidebar-title{
  margin: 0;
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--primary);
  color: #ffffff;
  text-align: center;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1.2;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.25);
}

/* 左ステータスカード */
.dcc .dcc-sidebar.dcc-left .dcc-info-card {
  background: linear-gradient(135deg, var(--surface), #fff8e1);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(30, 58, 95, 0.1);
  transition: transform 0.2s ease;
}

.dcc .dcc-sidebar.dcc-left .dcc-info-card:hover {
  transform: translateY(-2px);
}

.dcc .dcc-sidebar.dcc-left .dcc-info-card .dcc-label {
  font-size: .9rem;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 600;
}

.dcc .dcc-sidebar.dcc-left .dcc-info-card .dcc-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary-dark);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.dcc .dcc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at -20% -20%, rgba(212, 175, 55, 0.10), transparent 60%),
              radial-gradient(120px 60px at 120% 120%, rgba(30, 58, 95, 0.10), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

/* ブランド配色に合わせたカードのバリエーション（ネイビー×ゴールド） */
.dcc .dcc-card.dcc-band-0,
.dcc .dcc-card.dcc-band-4,
.dcc .dcc-card.dcc-band-8,
.dcc .dcc-card.dcc-band-12 {
  background: linear-gradient(135deg, #FFFFFF, #fffcf5);
  border-color: var(--accent);
}

.dcc .dcc-card.dcc-band-1,
.dcc .dcc-card.dcc-band-5,
.dcc .dcc-card.dcc-band-9 {
  background: linear-gradient(135deg, #FFFFFF, rgba(30, 58, 95, 0.06));
  border-color: var(--main-light);
}

.dcc .dcc-card.dcc-band-2,
.dcc .dcc-card.dcc-band-6,
.dcc .dcc-card.dcc-band-10 {
  background: linear-gradient(135deg, #FFFFFF, rgba(212, 175, 55, 0.08));
  border-color: var(--accent-dark);
}

.dcc .dcc-card.dcc-band-3,
.dcc .dcc-card.dcc-band-7,
.dcc .dcc-card.dcc-band-11 {
  background: linear-gradient(135deg, #FFFFFF, rgba(30, 58, 95, 0.04));
  border-color: var(--main);
}
.dcc .dcc-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(30, 58, 95, 0.3);
  border-color: var(--primary);
}

.dcc .dcc-card:active {
  transform: translateY(-2px) scale(0.98);
}

.dcc .dcc-card.dcc-flash {
  animation: dcc-cardFlash 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  z-index: 20;
}

@keyframes dcc-cardFlash {
  0% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); 
    background: linear-gradient(135deg, #fff3e0, #fff); 
  }
  30% { 
    transform: scale(1.12); 
    box-shadow: 0 0 40px 12px rgba(255, 193, 7, 0.8); 
    background: linear-gradient(135deg, #ffcc02, #fff176); 
  }
  60% { 
    transform: scale(1.04); 
    box-shadow: 0 0 50px 18px rgba(255, 193, 7, 0.5); 
  }
  100% { 
    transform: scale(1); 
    opacity: 0.3; 
    filter: grayscale(1) brightness(0.7); 
  }
}

.dcc .dcc-card.dcc-miss {
  animation: dcc-cardMiss 0.4s ease forwards;
}

@keyframes dcc-cardMiss {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-10px) rotate(-2deg); }
  40% { transform: translateX(10px) rotate(2deg); }
  60% { transform: translateX(-8px) rotate(-1deg); }
  80% { transform: translateX(6px) rotate(1deg); }
}

.dcc .dcc-card.dcc-cleared {
  visibility: hidden;
  pointer-events: none;
}

/* チェックボックスのスタイル */
.dcc input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.dcc label {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.dcc label:hover {
  color: var(--primary-dark);
}

/* レスポンシブ調整 */
@media (max-width: 1024px) {
  .dcc .dcc-layout-3col {
    grid-template-columns: var(--side) 1fr;
  }
  .dcc .dcc-sidebar.dcc-right {
    order: 3;
    grid-column: 1 / -1;
  }
  .dcc .dcc-sidebar.dcc-right .dcc-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .dcc .dcc-layout-3col {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .dcc .dcc-sidebar.dcc-left { order: 2; }
  .dcc .dcc-center { order: 1; }
  .dcc .dcc-sidebar.dcc-right { order: 3; }
  
  .dcc .dcc-header h1 {
    font-size: 1.5rem;
  }
  
  .dcc .dcc-cards-grid {
    padding: 12px;
    gap: 12px;
  }
}

/* 優先度強化（テーマCSSに負けない） */
.entry-content .dcc .dcc-layout-3col {
  grid-template-columns: var(--side) minmax(0, 1fr) var(--side);
}

.entry-content .dcc .dcc-controls.dcc-vertical {
  display: inline-flex;
  width: max-content;
  align-self: center;
}

/* アクセシビリティ対応 */
@media (prefers-reduced-motion: reduce) {
  .dcc * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* フォーカス表示 */
.dcc .dcc-btn:focus,
.dcc .dcc-card:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.dcc input[type="checkbox"]:focus {
  outline: 2px solid var(--primary);
}
}

/* 右ボタン束 */
.dcc .dcc-controls.dcc-vertical {
  display: inline-flex;
  flex-direction: column;
  gap: 14px;
  width: max-content;
  align-items: stretch;
  margin: 0;
}

.dcc .dcc-sidebar.dcc-right .dcc-controls.dcc-vertical {
  align-self: center;
}

.dcc .dcc-controls.dcc-vertical .dcc-btn {
  width: 100%;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .dcc .dcc-sidebar.dcc-right .dcc-controls.dcc-vertical {
    width: 100%;
    align-self: stretch;
  }
  .dcc .dcc-controls.dcc-vertical .dcc-btn {
    white-space: normal;
  }
}

.dcc .dcc-target-display {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: var(--main-dark);
  padding: 18px 14px;
  text-align: center;
  font-size: clamp(1.3rem, 2.8vw, 1.6rem);
  font-weight: 900;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 12px;
  word-break: keep-all;
  line-height: 1.2;
  text-shadow: none;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 18px rgba(212, 175, 55, 0.25);
}

.dcc .dcc-target-display::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.20) 0%, transparent 70%);
  animation: dcc-targetGlow 3s ease-in-out infinite;
}

@keyframes dcc-targetGlow {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

.dcc .dcc-arena {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, var(--base), var(--base-light));
  border-radius: 20px;
  box-shadow: inset 0 2px 8px rgba(30, 58, 95, 0.08);
  min-height: 520px;
  overflow: auto;
  border: 2px solid var(--border);
}

/* ボタンスタイル */
.dcc .dcc-btn {
  padding: 14px 18px;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-align: center;
  min-height: 48px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
  letter-spacing: 0.5px;
}

.dcc .dcc-btn-primary {
  background: linear-gradient(135deg, var(--main-light), var(--main));
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dcc .dcc-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.28);
  background: linear-gradient(135deg, var(--main), var(--main-dark));
}

.dcc .dcc-btn-secondary {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: var(--main-dark);
  border: 2px solid transparent;
}

.dcc .dcc-btn-secondary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--main-dark);
  transform: translateY(-2px);
}

.dcc .dcc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.dcc .dcc-game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(62, 39, 35, 0.95), rgba(141, 110, 99, 0.95));
  color: white;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  z-index: 1000;
  border: 4px solid var(--warning);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dcc .dcc-game-over h2 {
  font-size: 2.8rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.dcc .dcc-game-over p {
  font-size: 1.4rem;
  margin-bottom: 2rem;
}

/* 浮動テキスト */
.dcc .dcc-float {
  position: absolute;
  font-weight: 900;
  font-size: 2.2rem;
  z-index: 100;
  pointer-events: none;
  animation: dcc-floatUp 2.5s ease-out forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.dcc .dcc-float.dcc-good {
  color: var(--success);
  text-shadow: 0 2px 4px rgba(76, 175, 80, 0.4), 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.dcc .dcc-float.dcc-bad {
  color: var(--danger);
  text-shadow: 0 2px 4px rgba(244, 67, 54, 0.4), 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.dcc .dcc-float.dcc-clear {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--warning);
  text-shadow: 0 4px 8px rgba(255, 193, 7, 0.6), 2px 2px 12px rgba(0, 0, 0, 0.4);
  animation: dcc-clearAnimation 4s ease-out forwards;
  z-index: 1000;
}

@keyframes dcc-floatUp {
  0% { transform: translateY(0px) scale(1); opacity: 1; }
  25% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.3); opacity: 0; }
}

@keyframes dcc-clearAnimation {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  85% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.dcc .dcc-score.dcc-glow {
  animation: dcc-scoreGlow 0.6s ease-in-out;
}

@keyframes dcc-scoreGlow {
  from { text-shadow: 0 6px 12px rgba(255, 193, 7, 0.6); }
  to { text-shadow: 0 6px 20px rgba(255, 193, 7, 0.9); }
}

/* ライフ表示 */
.dcc .dcc-lives {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  user-select: none;
  padding: 8px;
  background: linear-gradient(135deg, #fff8e1, #fff);
  border-radius: 12px;
  border: 2px solid var(--border);
}

.dcc .dcc-lives .heart {
  font-size: 28px;
  line-height: 1;
  transition: all 0.3s ease;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.dcc .dcc-lives .dead {
  opacity: 0.3;
  filter: grayscale(1) brightness(0.5);
  transform: scale(0.8);
}

/* カードグリッド */
.dcc .dcc-cards-grid {
  position: relative;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  align-content: start;
  justify-items: stretch;
}

@media (max-width: 1100px) {
  .dcc .dcc-cards-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 860px) {
  .dcc .dcc-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .dcc .dcc-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

.dcc .dcc-card {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #fff8e1);
  border: 3px solid var(--primary-light);
  box-shadow: 0 8px 16px rgba(30, 58, 95, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Comic Sans MS', '游ゴシック', 'Yu Gothic', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 5.5vw, 44px);
  color: var(--primary-dark);
  user-select: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);