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

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

.dcc {
  /* 温かみのある色変数 */
  --primary: #ff8f00;          /* 明るいオレンジ */
  --primary-light: #ffb74d;    /* 薄いオレンジ */
  --primary-dark: #e65100;     /* 濃いオレンジ */
  --success: #4caf50;          /* 温かみのある緑 */
  --danger: #f44336;           /* 温かみのある赤 */
  --warning: #ffc107;          /* 温かい黄色 */
  --background: #fff8e1;       /* クリーム色の背景 */
  --surface: #ffffff;          /* 白いサーフェス */
  --text: #3e2723;             /* 温かい茶色テキスト */
  --text-light: #8d6e63;       /* 薄い茶色 */
  --border: #ffe0b2;           /* 薄いオレンジボーダー */
  --shadow: 0 4px 6px -1px rgba(255, 143, 0, 0.15);
  
  /* サイド幅を可変に */
  --side: clamp(160px, 18vw, 240px);
  
  /* 子供向けフォント */
  font-family: 'Comic Sans MS', '游ゴシック', 'Yu Gothic', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 50%, #ffcc02 100%);
  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(255, 143, 0, 0.2), 0 10px 10px -5px rgba(255, 143, 0, 0.1);
  overflow: visible;
  width: 100%;
  max-width: clamp(960px, 92vw, 1280px);
  display: flex;
  flex-direction: column;
  border: 3px solid var(--primary-light);
}

.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(255, 143, 0, 0.15);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
  border: 2px solid var(--border);
}

/* 左ステータスカード */
.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(255, 143, 0, 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(255, 193, 7, 0.1), transparent 60%),
              radial-gradient(120px 60px at 120% 120%, rgba(255, 143, 0, 0.1), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

/* 温かみのあるカラーバンド */
.dcc .dcc-card.dcc-band-0  { background: linear-gradient(135deg, #fff, #e1f5fe); border-color: #81d4fa; }
.dcc .dcc-card.dcc-band-1  { background: linear-gradient(135deg, #fff, #e8f5e8); border-color: #a5d6a7; }
.dcc .dcc-card.dcc-band-2  { background: linear-gradient(135deg, #fff, #fff3e0); border-color: #ffcc02; }
.dcc .dcc-card.dcc-band-3  { background: linear-gradient(135deg, #fff, #fce4ec); border-color: #f8bbd9; }
.dcc .dcc-card.dcc-band-4  { background: linear-gradient(135deg, #fff, #f3e5f5); border-color: #ce93d8; }
.dcc .dcc-card.dcc-band-5  { background: linear-gradient(135deg, #fff, #e0f2f1); border-color: #80cbc4; }
.dcc .dcc-card.dcc-band-6  { background: linear-gradient(135deg, #fff, #f1f8e9); border-color: #aed581; }
.dcc .dcc-card.dcc-band-7  { background: linear-gradient(135deg, #fff, #fdf2e9); border-color: #ffab91; }
.dcc .dcc-card.dcc-band-8  { background: linear-gradient(135deg, #fff, #fff8e1); border-color: #fff176; }
.dcc .dcc-card.dcc-band-9  { background: linear-gradient(135deg, #fff, #f9fbe7); border-color: #dcedc1; }
.dcc .dcc-card.dcc-band-10 { background: linear-gradient(135deg, #fff, #fff3e0); border-color: #ffb74d; }
.dcc .dcc-card.dcc-band-11 { background: linear-gradient(135deg, #fff, #efebe9); border-color: #bcaaa4; }
.dcc .dcc-card.dcc-band-12 { background: linear-gradient(135deg, #fff, #e8eaf6); border-color: #9fa8da; }

.dcc .dcc-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(255, 143, 0, 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(--warning), #ff8f00);
  color: white;
  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: 2px 2px 4px rgba(0, 0, 0, 0.3);
  border: 3px solid #fff;
  box-shadow: 0 6px 12px rgba(255, 193, 7, 0.4);
}

.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.2) 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, #fff8e1, #fff3e0);
  border-radius: 20px;
  box-shadow: inset 0 4px 8px rgba(255, 143, 0, 0.1);
  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(--primary), var(--primary-dark));
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.dcc .dcc-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(255, 143, 0, 0.3);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.dcc .dcc-btn-secondary {
  background: linear-gradient(135deg, var(--surface), #fff8e1);
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}

.dcc .dcc-btn-secondary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  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(255, 143, 0, 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);