/* ==========================================
   sankaku180 CSS
   プレフィックス: s180-
   簡単！ICT活用 ブランドカラー準拠
   縦スクロールなし設計
   ========================================== */

.s180-wrap {
  --main:         #1e3a5f;
  --main-light:   #2d5a8f;
  --main-dark:    #0f1e3a;
  --accent:       #d4af37;
  --accent-light: #f4cf5f;
  --accent-dark:  #b8941f;
  --base:         #FFFFFF;
  --base-light:   #FAFAFA;
  --base-dark:    #F0F2F5;
  --text:         #2C3E50;
  --text-light:   #7F8C8D;
  --border:       #E8E8E8;
  --shadow:       0 4px 20px rgba(30,58,95,0.10);
  --radius:       12px;
  --s180-ca: #E8404A;
  --s180-cb: #2BA84A;
  --s180-cc: #3B6FE0;
}

.s180-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── ラッパー：縦スクロールなし ── */
.s180-wrap {
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: var(--base-dark);
  color: var(--text);
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 120px;
}

/* ── ヘッダー ── */
.s180-header {
  flex-shrink: 0;
  background: var(--main);
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(30,58,95,0.30);
  position: relative;
  overflow: hidden;
}
.s180-header::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.15), transparent);
  animation: s180-shine 3s infinite;
  pointer-events: none;
}
@keyframes s180-shine {
  0%   { left: -100%; }
  100% { left: 100%; }
}
.s180-title {
  font-size: clamp(13px, 2vw, 17px);
  font-weight: 900;
  color: #fff;
  letter-spacing: .03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.s180-badge-sum {
  font-size: clamp(11px, 1.6vw, 14px);
  font-weight: 700;
  background: var(--main-dark);
  color: var(--accent-light);
  border: 2px solid var(--accent);
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .3s, color .3s;
}
.s180-badge-sum.success {
  background: var(--accent);
  color: var(--main-dark);
}

/* ── キャンバス（残り全部） ── */
.s180-canvas-wrap {
  flex: 1;
  min-height: 0;
  background: var(--base);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  overflow: hidden;
  position: relative;  /* バッジのアンカー */
}
.s180-canvas-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  z-index: 2;
}
.s180-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

/* ── 角バッジ：キャンバス右上オーバーレイ ── */
.s180-angle-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}
.s180-abadge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 700;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 2px 8px rgba(30,58,95,0.15);
  white-space: nowrap;
}
.s180-abadge.collected { border-color: currentColor; transform: scale(1.06); }
.s180-abadge-a { color: var(--s180-ca); }
.s180-abadge-b { color: var(--s180-cb); }
.s180-abadge-c { color: var(--s180-cc); }
.s180-abadge-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── 成功オーバーレイ ── */
.s180-success-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.90);
  opacity: 0; pointer-events: none;
  transition: opacity .4s;
  border-radius: var(--radius);
  gap: 8px;
  z-index: 10;
}
.s180-success-overlay.show { opacity: 1; pointer-events: auto; }
.s180-success-title { font-size: clamp(20px,4vw,26px); font-weight:900; color:var(--main); }
.s180-success-sub   { font-size: clamp(13px,2vw,16px); font-weight:600; color:var(--text); }
.s180-success-eq    {
  font-size: clamp(14px,2.5vw,18px); font-weight:900;
  background: linear-gradient(135deg, var(--main-light), var(--main));
  color: var(--accent-light);
  padding: 7px 22px; border-radius: 999px;
  border: 2px solid var(--accent);
}
.s180-success-note { font-size: clamp(10px,1.5vw,13px); color:var(--text-light); }

/* ── ヒントバー ── */
.s180-hint-bar {
  flex-shrink: 0;
  background: var(--base);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: clamp(10px, 1.4vw, 12px);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow);
}

/* ── ボタン行（じぶんで描く含む） ── */
.s180-btn-row {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: stretch;
}

/* 共通ボタン基底 */
.s180-btn,
.s180-mode-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: clamp(11px, 1.5vw, 13px);
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
}

/* メインボタン（ネイビー） */
.s180-btn-primary {
  background: linear-gradient(135deg, var(--main-light), var(--main));
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(30,58,95,0.30);
}
.s180-btn-primary:hover {
  background: linear-gradient(135deg, var(--main), var(--main-dark));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30,58,95,0.40);
}

/* アウトラインボタン */
.s180-btn-outline {
  background: var(--base);
  color: var(--main);
  border: 2px solid var(--main);
  box-shadow: 0 2px 8px rgba(30,58,95,0.10);
}
.s180-btn-outline:hover {
  background: var(--main);
  color: var(--accent-light);
  transform: translateY(-2px);
}

/* じぶんで描くボタン（ゴールドチップ） */
.s180-mode-btn {
  background: var(--base);
  color: var(--text-light);
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(30,58,95,0.08);
}
.s180-mode-btn:hover {
  border-color: var(--accent);
  color: var(--main);
}
.s180-mode-btn.active {
  background: var(--accent);
  color: var(--main-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(212,175,55,0.35);
}

.s180-btn:active,
.s180-mode-btn:active { transform: scale(.96) !important; }
.s180-btn:disabled    { opacity: .35; cursor: default; pointer-events: none; }

/* ── 統計 ── */
.s180-stats {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: clamp(10px,1.3vw,12px);
  color: var(--text-light);
  font-weight: 500;
}
.s180-stats span { display:flex; align-items:center; gap:4px; }
.s180-stats b    { color:var(--main); font-size:clamp(12px,1.5vw,14px); font-weight:900; }

/* ── レスポンシブ ── */
@media (max-width: 768px) {
  .s180-wrap { gap: 5px; padding: 6px 48px; }
}
@media (max-width: 480px) {
  .s180-wrap { gap: 4px; padding: 5px 36px; }
}
