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

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

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

.s360-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;
}

/* ── ヘッダー ── */
.s360-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;
}
.s360-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: s360-shine 3s infinite;
  pointer-events: none;
}
@keyframes s360-shine { 0% { left:-100%; } 100% { left:100%; } }

.s360-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);
}
.s360-badge-sum {
  font-size: clamp(10px, 1.4vw, 13px);
  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;
}
.s360-badge-sum.success { background: var(--accent); color: var(--main-dark); }

/* ── キャンバス ── */
.s360-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;
}
.s360-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;
}
.s360-canvas-wrap canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none; cursor: default;
}

/* ── 角バッジ：右上オーバーレイ ── */
.s360-angle-badges {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; flex-direction: column;
  gap: 4px; z-index: 3;
  pointer-events: none;
}
.s360-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;
}
.s360-abadge.collected { border-color: currentColor; transform: scale(1.06); }
.s360-abadge-a { color: var(--s360-ca); }
.s360-abadge-b { color: var(--s360-cb); }
.s360-abadge-c { color: var(--s360-cc); }
.s360-abadge-d { color: var(--s360-cd); }
.s360-abadge-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── 成功オーバーレイ ── */
.s360-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;
}
.s360-success-overlay.show { opacity: 1; pointer-events: auto; }
.s360-success-title { font-size: clamp(20px,4vw,26px); font-weight:900; color:var(--main); }
.s360-success-sub   { font-size: clamp(13px,2vw,16px); font-weight:600; color:var(--text); }
.s360-success-eq {
  font-size: clamp(13px,2vw,17px); 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);
}
.s360-success-note { font-size: clamp(10px,1.5vw,13px); color:var(--text-light); }

/* ── ヒントバー ── */
.s360-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);
}

/* ── ボタン行 ── */
.s360-btn-row {
  flex-shrink: 0;
  display: flex; gap: 6px; align-items: stretch;
}
.s360-btn, .s360-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;
}
.s360-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);
}
.s360-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);
}
.s360-btn-outline {
  background: var(--base); color: var(--main);
  border: 2px solid var(--main);
  box-shadow: 0 2px 8px rgba(30,58,95,0.10);
}
.s360-btn-outline:hover {
  background: var(--main); color: var(--accent-light);
  transform: translateY(-2px);
}
.s360-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);
}
.s360-mode-btn:hover { border-color: var(--accent); color: var(--main); }
.s360-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);
}
.s360-btn:active, .s360-mode-btn:active { transform: scale(.96) !important; }
.s360-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* ── 統計 ── */
.s360-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;
}
.s360-stats span { display:flex; align-items:center; gap:4px; }
.s360-stats b    { color:var(--main); font-size:clamp(12px,1.5vw,14px); font-weight:900; }

@media (max-width: 768px) { .s360-wrap { gap: 5px; padding: 6px 48px; } }
@media (max-width: 480px) { .s360-wrap { gap: 4px; padding: 5px 36px; } }
