:root{
  --bg:#0b1220;
  --panel:rgba(255,255,255,.05);
  --panel2:rgba(255,255,255,.03);
  --text:#e5e7eb;
  --muted:#a3aab7;
  --border:rgba(255,255,255,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;

  --primary:#60a5fa;
  --ok:#34d399;
  --ng:#fb7185;
  --warn:#fbbf24;
}

/* =====================
   Base
===================== */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height:1.6;
  background:
    radial-gradient(1100px 600px at 20% 10%, #14213d 0%, var(--bg) 55%, #060a12 100%);

  display:flex;
  flex-direction:column;
  min-height:100vh;
}

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Skip link */
.skip-link{
  position:absolute;
  left:-999px;
}
.skip-link:focus{
  left:14px;
  top:14px;
  padding:10px 12px;
  background:#fff;
  color:#000;
  border-radius:12px;
  z-index:9999;
}

/* =====================
   Layout
===================== */
.container{
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
}

.main{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:12px 0;
}

/* =====================
   Header
===================== */
.site-header{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.75);
  border-bottom:1px solid var(--border);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-mark{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
}
.brand-title{ font-weight:800; }
.brand-sub{
  font-size:12px;
  color:var(--muted);
}

/* top nav */
.top-nav{
  display:flex;
  gap:14px;
}
.top-nav a{
  padding:8px 12px;
  border-radius:999px;
  color:var(--text);
}
.top-nav a:hover{
  background: rgba(255,255,255,.08);
  text-decoration:none;
}

/* ===== DigiNavi banner ONLY (white button) ===== */
.site-link{
  display:inline-flex;
  align-items:center;
  padding:8px 16px;
  border-radius:999px;
  background:#ffffff;                 /* ← ここだけ白 */
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 4px 14px rgba(0,0,0,.18);
}
.site-link:hover{
  background:#f5f5f5;
  text-decoration:none;
}
.site-link img{
  height:28px;
  width:auto;
  display:block;
}

@media (max-width:720px){
  .brand-sub{ display:none; }
}
@media (max-width:560px){
  .top-nav{ display:none; }
  .site-link img{ height:24px; }
}

/* =====================
   Typography
===================== */
.h2{ font-size:16px; margin:0; }
.muted{ color:var(--muted); }
.small{ font-size:12px; }

/* =====================
   Help bar（ダークのまま）
===================== */
.helpbar{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  padding-bottom:2px;
}
.help{ flex-shrink:0; }

.help summary{
  cursor:pointer;
  font-weight:700;
  padding:8px 14px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid var(--border);
}
.help summary:hover{
  background: rgba(255,255,255,.12);
}
.help-body{
  margin-top:10px;
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
}

/* =====================
   Practice Grid
===================== */
#practice{
  flex:1;
  min-height:0;
}
.grid{
  display:grid;
  grid-template-columns:360px 1fr;
  gap:14px;
  height:100%;
  min-height:0;
}
@media (max-width:980px){
  .grid{ grid-template-columns:1fr; }
}

/* =====================
   Cards
===================== */
.card{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow:var(--shadow);
  overflow:hidden;
  min-height:0;
}
.card-head{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.card-body{
  padding:12px 14px;
  min-height:0;
}
aside.card .card-body{
  overflow:auto;
}

/* =====================
   Stage menu（ダークのまま）
===================== */
.menu{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:8px;
}
.stage-btn{
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid var(--border);
  cursor:pointer;
}
.stage-btn:hover{
  background:rgba(255,255,255,.14);
}
.stage-btn[aria-pressed="true"]{
  background:rgba(96,165,250,.18);
  border-color:rgba(96,165,250,.8);
}

.menu-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* =====================
   Buttons（ダーク）
===================== */
.btn{
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{ background:rgba(255,255,255,.14); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.btn-primary{
  background:rgba(96,165,250,.25);
  border-color:rgba(96,165,250,.6);
}
.btn-danger{
  background:rgba(251,113,133,.25);
  border-color:rgba(251,113,133,.6);
}
.btn-ghost{
  background:transparent;
}

/* =====================
   Play area
===================== */
.card-play{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.card-play .card-body{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:0;
}

.play-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.stats{
  display:flex;
  gap:10px;
}
.stat{
  min-width:90px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
}
.stat-label{ font-size:12px; color:var(--muted); }
.stat-value{ font-size:16px; font-weight:800; }

.instruction{
  padding:10px 12px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.25);
  background:rgba(255,255,255,.05);
}

/* 見切れ防止 */
.play-wrap{
  flex:1;
  min-height:260px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.15);
  background:
    radial-gradient(420px 240px at 10% 0%, rgba(96,165,250,.18), transparent 60%),
    radial-gradient(380px 240px at 85% 30%, rgba(52,211,153,.12), transparent 60%),
    rgba(255,255,255,.02);
  overflow:hidden;
}
.play-area{
  position:relative;
  height:100%;
  user-select:none;
}

.play-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-shrink:0;
}

/* =====================
   Game objects
===================== */
.target{
  position:absolute;
  width:56px;
  height:56px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.25);
  background:rgba(96,165,250,.25);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.target::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 6px rgba(96,165,250,.35);
}

.floating{
  position:absolute;
  font-weight:900;
  pointer-events:none;
}

/* drag */
.drag-item{
  position:absolute;
  width:84px;
  height:84px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  display:grid;
  place-items:center;
  cursor:grab;
}
.drag-item:active{ cursor:grabbing; }
.drag-item .box{
  width:42px;
  height:42px;
  border-radius:12px;
  background:rgba(96,165,250,.45);
}

.dropzone{
  position:absolute;
  width:150px;
  height:150px;
  border-radius:22px;
  border:2px dashed rgba(255,255,255,.25);
  display:grid;
  place-items:center;
  color:var(--muted);
}
.dropzone.active{
  border-color:rgba(52,211,153,.7);
  background:rgba(52,211,153,.18);
  color:var(--text);
}

/* =====================
   Footer
===================== */
.site-footer{
  border-top:1px solid var(--border);
  background:rgba(11,18,32,.75);
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 0;
}
.footer-title{ font-weight:800; }
.footer-sub{ font-size:12px; }
.footer-right{
  display:flex;
  gap:14px;
}
