/* しば田さんのおやつキャッチ — すべて .wsg 配下に閉じ込めてテーマと干渉しないようにする */
.wsg{
  --wsg-ink:#2b2118; --wsg-shiba:#d9843a; --wsg-cream:#fff7ea; --wsg-ok:#2f8f5b; --wsg-ng:#d2423a;
  --wsg-panel:#fffaf1; --wsg-muted:#7a6a58; --wsg-gold:#e8a917;
  --wsg-display:"Dela Gothic One","Hiragino Sans","Yu Gothic",sans-serif;
  --wsg-body:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Yu Gothic",sans-serif;
  width:100%; max-width:440px; margin:24px auto; color:var(--wsg-ink); font-family:var(--wsg-body);
  display:flex; flex-direction:column; gap:12px; color-scheme:light;
}
.wsg *, .wsg *::before, .wsg *::after{ box-sizing:border-box; }
.wsg [hidden]{ display:none !important; }
.wsg-hud{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:0 4px; }
.wsg-score{ font-family:var(--wsg-display); font-size:26px; line-height:1; font-variant-numeric:tabular-nums; }
.wsg-score small{ display:block; font-family:var(--wsg-body); font-weight:700; font-size:12px; color:var(--wsg-muted); letter-spacing:.08em; margin-bottom:2px; }
.wsg-lives{ font-size:22px; letter-spacing:2px; }
.wsg-best{ font-size:12px; color:var(--wsg-muted); text-align:right; font-weight:700; line-height:1.3; }
.wsg-best b{ font-family:var(--wsg-display); font-weight:400; font-size:16px; color:var(--wsg-ink); font-variant-numeric:tabular-nums; }

.wsg-stage{ position:relative; width:100%; aspect-ratio:2/3; border-radius:18px; overflow:hidden; background:#bfe3ef;
  box-shadow:0 0 0 4px var(--wsg-ink), 0 10px 0 4px #b9945c; }
/* ドラッグ操作用の設定はゲーム画面（canvas）だけにかけ、入力欄には効かせない */
.wsg canvas{ display:block; width:100%; height:100%; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.wsg-entry input{ user-select:text; -webkit-user-select:text; }

.wsg-ov{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  padding:18px; background:rgba(255,248,235,.94); text-align:center; overflow:auto; touch-action:auto; }
.wsg-h{ font-family:var(--wsg-display) !important; font-weight:400 !important; font-size:clamp(24px,7vw,32px) !important;
  line-height:1.15 !important; margin:0 !important; padding:0 !important; border:0 !important; background:none !important; color:var(--wsg-ink) !important; text-wrap:balance; }
.wsg-h::before, .wsg-h::after{ display:none !important; }
.wsg-h span{ color:var(--wsg-shiba); }
.wsg-ov p{ margin:0; font-weight:500; line-height:1.6; max-width:30ch; font-size:14px; }

.wsg-legend{ display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; max-width:340px; }
.wsg-legend > div{ background:var(--wsg-panel); border:2px solid var(--wsg-ink); border-radius:12px; padding:8px 10px; text-align:left; }
.wsg-legend h3{ margin:0 0 4px !important; padding:0 !important; border:0 !important; background:none !important; font-size:13px !important; letter-spacing:.08em; font-family:var(--wsg-body) !important; }
.wsg-legend h3::before, .wsg-legend h3::after{ display:none !important; }
.wsg-legend h3.ok{ color:var(--wsg-ok) !important; } .wsg-legend h3.ng{ color:var(--wsg-ng) !important; }
.wsg-legend ul{ margin:0 !important; padding:0 !important; list-style:none !important; font-size:13px; line-height:1.7; font-weight:700; }
.wsg-legend li{ margin:0 !important; padding:0 !important; border:0 !important; }
.wsg-legend li::before{ display:none !important; }

.wsg-row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.wsg button{ font:inherit; cursor:pointer; }
.wsg-go, .wsg-sub{ font-family:var(--wsg-display) !important; border:3px solid var(--wsg-ink) !important; border-radius:999px !important;
  box-shadow:0 5px 0 var(--wsg-ink) !important; line-height:1.2 !important; text-transform:none !important; }
.wsg-go{ font-size:20px !important; padding:11px 28px !important; background:var(--wsg-shiba) !important; color:var(--wsg-cream) !important; }
.wsg-sub{ font-size:15px !important; padding:9px 18px !important; background:var(--wsg-panel) !important; color:var(--wsg-ink) !important; }
.wsg-go:active, .wsg-sub:active{ transform:translateY(3px); box-shadow:0 2px 0 var(--wsg-ink) !important; }
.wsg-sub:disabled{ opacity:.5; cursor:default; }
.wsg button:focus-visible, .wsg input:focus-visible{ outline:3px solid #1d6fa3; outline-offset:3px; }

.wsg-hint{ font-size:12px; color:var(--wsg-muted); }
.wsg-result{ font-family:var(--wsg-display); font-size:44px; line-height:1; font-variant-numeric:tabular-nums; }
.wsg-lesson{ background:var(--wsg-panel); border:2px solid var(--wsg-ng); border-radius:12px; padding:8px 12px; font-size:13px; font-weight:700; max-width:320px; line-height:1.6; }
.wsg-lesson a{ color:var(--wsg-ng); }

.wsg-entry{ display:flex; flex-direction:column; gap:6px; width:100%; max-width:300px; margin:0; }
.wsg-entry label{ font-size:12px; font-weight:700; color:var(--wsg-muted); }
.wsg-entry-row{ display:flex; gap:8px; }
.wsg-entry input{ flex:1; min-width:0; font-family:var(--wsg-display) !important; font-size:22px !important; letter-spacing:.18em; text-align:center;
  text-transform:uppercase; padding:6px 8px !important; border:3px solid var(--wsg-ink) !important; border-radius:12px !important;
  background:#fff !important; color:var(--wsg-ink) !important; box-shadow:none !important; height:auto !important; }
.wsg-msg{ font-size:12px; font-weight:700; min-height:1.4em; }
.wsg-msg.err{ color:var(--wsg-ng); } .wsg-msg.ok{ color:var(--wsg-ok); }

.wsg-myrank{ font-weight:900; font-size:15px; color:var(--wsg-shiba); }
.wsg-rank{ list-style:none !important; margin:0 !important; padding:0 !important; width:100%; max-width:320px; display:flex; flex-direction:column; gap:4px; counter-reset:none; }
.wsg-rank li{ display:grid; grid-template-columns:2.2em 1fr auto; align-items:center; gap:8px; margin:0 !important; padding:6px 12px !important;
  background:var(--wsg-panel); border:2px solid var(--wsg-ink); border-radius:10px; font-weight:700; font-size:14px; text-align:left; }
.wsg-rank li::before{ display:none !important; }
.wsg-rank .n{ font-family:var(--wsg-display); font-size:15px; }
.wsg-rank .nm{ font-family:var(--wsg-display); letter-spacing:.12em; font-size:16px; min-width:0; }
.wsg-rank .sc{ font-family:var(--wsg-display); font-variant-numeric:tabular-nums; font-size:16px; }
.wsg-rank li:nth-child(1){ background:#ffe7a3; } .wsg-rank li:nth-child(2){ background:#eef0f2; } .wsg-rank li:nth-child(3){ background:#f6d6bd; }
.wsg-rank li.me{ outline:3px solid var(--wsg-shiba); outline-offset:1px; }
.wsg-rank li.wsg-empty{ display:block; text-align:center; font-weight:500; color:var(--wsg-muted); }

.wsg-pad{ display:none; gap:10px; }
.wsg-pad button{ flex:1; font-family:var(--wsg-display) !important; font-size:22px !important; padding:10px 0 !important; border-radius:14px !important;
  border:3px solid var(--wsg-ink) !important; background:var(--wsg-panel) !important; color:var(--wsg-ink) !important; box-shadow:0 4px 0 var(--wsg-ink) !important;
  touch-action:none; }
.wsg-pad button:active{ transform:translateY(2px); box-shadow:0 2px 0 var(--wsg-ink) !important; }
@media (pointer:coarse){ .wsg-pad{ display:flex; } }

/* v1.0.1：ライフ（NG）と、おとした数（OK） */
.wsg-status{ display:flex; flex-direction:column; align-items:center; gap:3px; }
.wsg-lives{ line-height:1; }
.wsg-miss{ display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; color:var(--wsg-muted); letter-spacing:.04em; }
.wsg-dots{ display:flex; gap:4px; }
.wsg-dots i{ width:10px; height:10px; border-radius:50%; border:2px solid var(--wsg-ink); background:var(--wsg-panel); display:block; }
.wsg-dots i.on{ background:var(--wsg-shiba); }
.wsg-ov p b{ color:var(--wsg-ng); }
.wsg-lesson.is-miss{ border-color:var(--wsg-shiba); }
