/* =========================================================
   Circle Drawing Challenge (scoped)
   70-25-5: Base(white) / Main(navy) / Accent(gold)
   全て .cdc-root 配下にスコープ
   ========================================================= */

.cdc-root{
  --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;

  --warn:#f59e0b;
  --danger:#ef4444;

  --shadow: 0 4px 20px rgba(30, 58, 95, 0.10);
  --shadow-hover: 0 8px 30px rgba(30, 58, 95, 0.15);

  --cdc-height: 80vh;
  --cdc-max-height: 900px;

  font-family: system-ui, -apple-system, "Segoe UI", Meiryo, sans-serif;
  color: var(--text);
}

.cdc-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  gap: 16px;
  grid-template-columns: 320px 1fr;
}

.cdc-panel{
  background: var(--base);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  overflow: hidden;
  position: relative;
}

.cdc-panel::before{
  content:'';
  position:absolute;
  top:0; left:0; right:0;
  height:4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  pointer-events:none;
}

.cdc-title{
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--main) 0%, var(--main-light) 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cdc-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

/* 2ボタンを同じ横幅に */
.cdc-row-buttons .cdc-btn{
  flex: 1 1 0;
  min-width: 0;
}

.cdc-btn{
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--base-dark);
  color: var(--main);
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.10);
}

.cdc-btn::before{
  content:'';
  position:absolute;
  top:0; left:-100%;
  width:100%; height:100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.16), transparent);
  transition:left 0.5s;
}

.cdc-btn:hover::before{ left:100%; }

.cdc-btn:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(212, 175, 55, 0.55);
}

.cdc-btn-primary{
  background: linear-gradient(135deg, var(--main-light) 0%, var(--main) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.28);
}

.cdc-btn-secondary{
  background: var(--base);
  color: var(--main);
  border: 2px solid rgba(212, 175, 55, 0.65);
}

.cdc-stat{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.cdc-badge{
  background: linear-gradient(135deg, var(--base), var(--base-dark));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cdc-badge:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30,58,95,0.10);
}

.cdc-badge-title{
  font-size: 11px;
  color: var(--text-light);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cdc-big{
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-top: 2px;
}

.cdc-unit{
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

.cdc-score-excellent{ color: var(--accent-dark); }
.cdc-score-good{ color: var(--main-light); }
.cdc-score-average{ color: var(--warn); }
.cdc-score-poor{ color: var(--danger); }

.cdc-readout{
  font-size: 13px;
  color: var(--text);
  background: var(--base-light);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  margin: 12px 0;
}

.cdc-hint{
  font-size: 11px;
  color: var(--text-light);
  background: var(--base-light);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 8px 0;
}

.cdc-history{
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
}

.cdc-progress-bar{
  width: 100%;
  height: 8px;
  background: var(--base-dark);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 0;
  border: 1px solid var(--border);
}

.cdc-progress-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--main-dark), var(--main), var(--accent));
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.cdc-canvas-panel{
  padding: 14px;
}

.cdc-canvas-container{
  height: var(--cdc-height);
  max-height: var(--cdc-max-height);
  min-height: 360px;
  position: relative;
}

.cdc-canvas{
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  touch-action: none;
  cursor: crosshair;
  background: linear-gradient(135deg, var(--base) 0%, var(--base-light) 60%, var(--base-dark) 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 10px rgba(30,58,95,0.10);
}

/* 実績通知 */
.cdc-achievement{
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--main), var(--main-dark));
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(30,58,95,0.25);
  transform: translateX(420px);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  pointer-events: none;
  max-width: 320px;
}

.cdc-achievement.cdc-show{
  transform: translateX(0);
}

@media (max-width: 1000px){
  .cdc-wrap{
    grid-template-columns: 1fr;
  }
  .cdc-canvas-container{
    height: 70vh;
    max-height: 820px;
  }
}

@media (max-width: 600px){
  .cdc-stat{ grid-template-columns: 1fr; }
  .cdc-row{ flex-direction: column; align-items: stretch; }
  .cdc-row-buttons .cdc-btn{ width: 100%; }
}
