:root {
  --bg: #05070f;
  --glass: rgba(18, 24, 44, 0.6);
  --glass-2: rgba(24, 31, 56, 0.5);
  --glass-border: rgba(130, 170, 255, 0.14);
  --accent: #4f9dff;
  --accent2: #8b5cf6;
  --cyan: #22d3ee;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-feature-settings: "palt";
  letter-spacing: .01em;
}

/* ===== オーロラ + 星屑背景 ===== */
#bg-aurora {
  position: fixed;
  inset: -10%;
  z-index: -3;
  background:
    radial-gradient(50% 45% at 12% 8%, rgba(43,127,255,0.30), transparent 60%),
    radial-gradient(45% 42% at 88% 12%, rgba(139,92,246,0.28), transparent 60%),
    radial-gradient(50% 48% at 75% 92%, rgba(34,211,238,0.20), transparent 60%),
    radial-gradient(42% 40% at 20% 88%, rgba(236,72,153,0.16), transparent 60%);
  filter: blur(30px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(-3%, 3%, 0) scale(1.12) rotate(2deg); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.06) rotate(-1deg); }
}
/* グリッド */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(120,160,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,160,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 35%, transparent 100%);
}
/* きらめく粒子 */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(180,210,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 35% 85%, rgba(180,210,255,.35), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,.3), transparent);
  background-repeat: no-repeat;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from{opacity:.4;} to{opacity:.9;} }

/* ===== ガラスカード ===== */
.glass {
  background: linear-gradient(180deg, var(--glass), var(--glass-2));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 10px 44px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
}
/* ガラス上端のハイライトライン */
.glass::before {
  content:""; position:absolute; inset:0 0 auto 0; height:1px; border-radius:22px 22px 0 0;
  background: linear-gradient(90deg, transparent, rgba(160,190,255,.4), transparent);
  opacity:.6;
}
.glass-hover { transition: transform .3s cubic-bezier(.2,.9,.25,1), box-shadow .3s, border-color .3s; }
.glass-hover:hover {
  transform: translateY(-5px);
  border-color: rgba(130,170,255,0.5);
  box-shadow: 0 18px 60px rgba(43,127,255,0.28), inset 0 1px 0 rgba(255,255,255,0.1);
}

.grad-text {
  background: linear-gradient(100deg,#5aa4ff,#22d3ee 40%,#a78bfa 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===== ボタン ===== */
.btn-primary {
  background: linear-gradient(100deg,#2b7fff,#6d5bff 60%,#8b5cf6);
  color: #fff; border: none; border-radius: 13px; font-weight: 700;
  transition: filter .2s, transform .12s, box-shadow .25s;
  box-shadow: 0 8px 24px rgba(64,110,255,0.4), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content:""; position:absolute; top:0; left:-60%; width:40%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 32px rgba(64,110,255,0.6); }
.btn-primary:hover::after { left: 120%; }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,0.055); color:#cbd5e1;
  border:1px solid rgba(255,255,255,0.13); border-radius:13px; font-weight:600;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.13); color:#fff; border-color: rgba(255,255,255,0.25); }

.input {
  background: rgba(8,12,26,0.75);
  border: 1px solid rgba(130,170,255,0.2);
  border-radius: 13px; color: #f1f5f9;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color:#64748b; }
.input:focus { outline:none; border-color:#5aa4ff; background:rgba(8,12,26,0.9); box-shadow:0 0 0 3px rgba(90,164,255,0.22); }
select.input option { background:#0b1020; }

/* ===== サイドバー ===== */
.nav-item { transition: all .22s cubic-bezier(.2,.9,.25,1); border-radius: 13px; position:relative; }
.nav-item.active {
  background: linear-gradient(100deg, rgba(43,127,255,0.28), rgba(139,92,246,0.16));
  color:#fff; box-shadow: inset 0 0 0 1px rgba(130,170,255,0.35), 0 4px 16px rgba(43,127,255,.2);
}
.nav-item.active::before {
  content:""; position:absolute; left:-5px; top:22%; bottom:22%; width:3px; border-radius:9px;
  background: linear-gradient(#22d3ee,#8b5cf6); box-shadow:0 0 12px rgba(90,164,255,.8);
}
.nav-item:not(.active):hover { background: rgba(255,255,255,0.06); transform:translateX(2px); }

/* ===== プログレスバー ===== */
.progbar { height: 8px; background: rgba(255,255,255,0.07); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.progbar > span { display:block; height:100%; background: linear-gradient(90deg,#22d3ee,#4f9dff,#8b5cf6); border-radius:99px; transition: width .8s cubic-bezier(.2,.9,.25,1); box-shadow:0 0 12px rgba(90,164,255,.6); }

/* リングプログレス */
.ring { transform: rotate(-90deg); }
.ring circle { fill:none; stroke-width:7; stroke-linecap:round; }
.ring .track { stroke: rgba(255,255,255,0.08); }
.ring .fill { stroke: url(#ringgrad); transition: stroke-dashoffset 1s cubic-bezier(.2,.9,.25,1); filter: drop-shadow(0 0 6px rgba(90,164,255,.5)); }

/* ===== バッジ ===== */
.badge { font-size: 11px; padding: 3px 10px; border-radius: 99px; font-weight: 700; display:inline-flex; align-items:center; letter-spacing:.02em; }
.badge-2b { background: rgba(34,211,238,0.14); color:#67e8f9; border:1px solid rgba(34,211,238,0.32); }
.badge-3c { background: rgba(139,92,246,0.16); color:#c4b5fd; border:1px solid rgba(139,92,246,0.34); }
.badge-live { background: rgba(34,197,94,0.16); color:#86efac; border:1px solid rgba(34,197,94,0.38); }
.badge-wait { background: rgba(234,179,8,0.14); color:#fde047; border:1px solid rgba(234,179,8,0.36); }
.badge-done { background: rgba(90,164,255,0.14); color:#93c5fd; border:1px solid rgba(90,164,255,0.36); }

.pulse-dot { width:8px; height:8px; border-radius:99px; background:#22c55e; box-shadow:0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.6);} 70%{box-shadow:0 0 0 9px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* アイコンタイル */
.icon-tile { border-radius:15px; display:flex; align-items:center; justify-content:center; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px rgba(0,0,0,.3); }

/* ===== トースト ===== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display:flex; flex-direction:column; gap:10px; }
.toast { min-width: 260px; padding: 14px 18px; border-radius: 15px; color:#fff; font-weight:600; font-size:14px; box-shadow:0 12px 44px rgba(0,0,0,.5); backdrop-filter: blur(10px); animation: slideIn .35s cubic-bezier(.2,.9,.25,1); border:1px solid rgba(255,255,255,.15); }
.toast.success { background: linear-gradient(100deg,rgba(5,150,105,.92),rgba(16,185,129,.92)); }
.toast.error { background: linear-gradient(100deg,rgba(220,38,38,.92),rgba(239,68,68,.92)); }
.toast.info { background: linear-gradient(100deg,rgba(37,99,235,.92),rgba(59,130,246,.92)); }
@keyframes slideIn { from{opacity:0; transform:translateX(40px) scale(.95);} to{opacity:1; transform:translateX(0) scale(1);} }

.fade-in { animation: fadeIn .45s cubic-bezier(.2,.9,.25,1); }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }
.stagger > * { animation: fadeIn .5s cubic-bezier(.2,.9,.25,1) backwards; }
.stagger > *:nth-child(1){animation-delay:.02s} .stagger > *:nth-child(2){animation-delay:.06s}
.stagger > *:nth-child(3){animation-delay:.1s} .stagger > *:nth-child(4){animation-delay:.14s}
.stagger > *:nth-child(5){animation-delay:.18s} .stagger > *:nth-child(6){animation-delay:.22s}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(130,170,255,0.22); border-radius: 99px; border:2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(130,170,255,0.4); background-clip: padding-box; }

/* モーダル */
.modal-backdrop { position: fixed; inset:0; background: rgba(3,6,16,0.72); backdrop-filter: blur(8px); z-index: 100; display:flex; align-items:center; justify-content:center; padding:16px; animation: fadeIn .22s; }
.modal-card { animation: popIn .32s cubic-bezier(.2,1.1,.3,1); }
@keyframes popIn { from{opacity:0; transform:scale(.92) translateY(12px);} to{opacity:1; transform:scale(1) translateY(0);} }

/* スピナー */
.spinner { width:46px; height:46px; border-radius:50%; border:3px solid rgba(130,170,255,0.18); border-top-color:#5aa4ff; animation: spin 1s linear infinite; box-shadow:0 0 20px rgba(90,164,255,.2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* glow text */
.glow { text-shadow: 0 0 18px rgba(90,164,255,.5); }
