/* アーチェリー・ルールチャレンジ（/manabu/）。標的の色は実物に合わせ、明るい・暗い画面で変えない */
.g-wrap { max-width: 760px; margin: 0 auto; }
#game { min-height: 520px; scroll-margin-top: 80px; }
.g-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.g-pad { padding: 18px; }
.g-btn { font: inherit; font-weight: 700; font-size: 15px; border-radius: 10px; padding: 12px 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.4; touch-action: manipulation; }
.g-btn:hover { border-color: var(--navy); }
.g-btn.pri { background: var(--red); border-color: var(--red); color: #fff; }
.g-btn.pri:hover { background: var(--red-hover); border-color: var(--red-hover); }
.g-btn[disabled] { opacity: .45; cursor: not-allowed; }
.g-row { display: flex; gap: 10px; flex-wrap: wrap; }
.g-row > .g-btn { flex: 1 1 auto; }

/* レベル選択 */
.g-levels { display: grid; gap: 12px; }
.g-level { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.g-level:hover:not([disabled]) { border-color: var(--navy); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.g-level[disabled] { opacity: .5; cursor: not-allowed; }
.lv-badge { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; line-height: 1.1; text-align: center; box-shadow: inset 0 0 0 4px rgba(255,255,255,.35); }
.lv1 { background: #2a9fd6; color: #fff; } .lv2 { background: #e2353f; color: #fff; } .lv3 { background: #f3d23a; color: #1b1608; } .lv4 { background: #1b2436; color: #f3d23a; box-shadow: inset 0 0 0 4px #f3d23a; }
.g-level h3 { font-size: 17px; font-weight: 900; }
.g-level p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.g-level .best { font-family: var(--f-num); font-weight: 700; font-size: 22px; text-align: center; min-width: 44px; }
.g-level .best small { display: block; font-family: var(--f-body); font-size: 11px; color: var(--muted); font-weight: 500; }
.g-level .lock { font-size: 12px; color: var(--muted); }
.g-tools { display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.g-tools button { font: inherit; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px 0; }

/* 説明画面 */
.g-intro h2 { font-size: 22px; font-weight: 900; margin: 6px 0 8px; }
.g-intro .role { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--chip-bg); }
.g-intro ul { margin: 12px 0 18px; padding-left: 1.2em; font-size: 15px; }
.g-intro li { margin: 4px 0; }
.g-intro .how { font-size: 14px; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }

/* ゲーム上部の表示 */
.g-hud { display: flex; gap: 8px 14px; align-items: center; padding: 10px 14px; background: var(--navy-deep); color: var(--on-navy); font-size: 13px; flex-wrap: wrap; }
.g-hud b { font-weight: 900; }
.g-hud .sp { margin-left: auto; }
.g-hud .sc { font-family: var(--f-num); font-size: 20px; font-weight: 700; color: #f3d23a; }
.g-hud .combo { font-family: var(--f-num); font-weight: 700; color: #ffb3bf; }
.g-lives { display: inline-flex; gap: 3px; align-items: center; }
.g-lives i { display: inline-block; width: 13px; height: 18px; border-radius: 2px; background: rgba(255,255,255,.18); }
.g-lives i.yc.on { background: #f3d23a; }
.g-lives i.heart { width: auto; height: auto; background: none; font-style: normal; font-size: 17px; line-height: 1; color: rgba(255,255,255,.25); }
.g-lives i.heart.on { color: #ff5a6e; }
.g-lives .lbl { margin-right: 4px; color: var(--on-navy-muted); }
.g-mute { font: inherit; font-size: 12px; background: rgba(255,255,255,.1); color: var(--on-navy); border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer; }

/* クイズ */
.g-timer { height: 6px; background: var(--chip-bg); }
.g-timer i { display: block; height: 100%; width: 100%; background: #2a9fd6; transform-origin: left; }
.g-timer i.low { background: #e2353f; }
.g-q { padding: 16px 18px 20px; }
.g-q .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--chip-bg); margin-bottom: 8px; }
.g-scene { font-size: 15px; background: var(--bg); border-left: 4px solid var(--gold); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.g-ask { font-size: 18px; font-weight: 900; line-height: 1.55; margin: 6px 0 14px; }
.g-opts { display: grid; gap: 8px; }
.g-opts.ox { grid-template-columns: 1fr 1fr; }
.g-opt { font: inherit; text-align: left; font-size: 15px; font-weight: 500; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.5; touch-action: manipulation; }
.g-opt:hover:not([disabled]) { border-color: var(--navy); }
.g-opts.ox .g-opt { text-align: center; font-size: 30px; font-weight: 900; padding: 10px; }
.g-opt .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; margin-right: 8px; vertical-align: 1px; }
.g-opt.ok { border-color: #1f8a4c; background: #e5f4ec; color: #14532d; }
.g-opt.ng { border-color: #c8102e; background: #fde8eb; color: #7f0a1d; }
.g-opt[disabled] { cursor: default; }
.g-exp { margin-top: 14px; border-radius: 10px; padding: 14px; background: var(--bg); border: 1px solid var(--line); }
.g-exp .verdict { font-size: 18px; font-weight: 900; }
.g-exp .verdict.ok { color: #1f8a4c; } .g-exp .verdict.ng { color: #c8102e; }
.g-exp p { font-size: 14px; margin-top: 6px; }
.g-exp .ref { font-size: 12px; color: var(--muted); }
.g-exp .g-btn { margin-top: 12px; width: 100%; }

/* 標的面と拡大鏡 */
.g-vis { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: start; margin-bottom: 12px; }
.g-vis.solo { grid-template-columns: minmax(0, 340px); justify-content: center; }
.g-vis .face { width: 100%; height: auto; display: block; border-radius: 8px; }
.g-lens { text-align: center; font-size: 12px; color: var(--muted); }
.g-lens svg { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--navy); background: #d9cfb4; display: block; margin: 0 auto 4px; }
.g-lens .empty { width: 150px; height: 150px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; margin: 0 auto 4px; padding: 16px; line-height: 1.5; }
svg .arw { cursor: pointer; }
svg .arw.sel .nock { stroke: #fff; stroke-width: .5; }
@media (max-width: 520px) { .g-vis { grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; } .g-lens svg, .g-lens .empty { width: 118px; height: 118px; } }

/* 初級：射場 */
.g-range { position: relative; background: linear-gradient(#bfe0f5, #e3f1fa 38%, #8cbf6a 38%, #6fa652); padding: 12px; user-select: none; -webkit-user-select: none; touch-action: none; }
.g-dos { display: flex; align-items: center; gap: 10px; background: #111a2b; color: #fff; border-radius: 10px; padding: 8px 12px; width: max-content; max-width: 100%; }
.lamps { display: flex; flex-direction: column; gap: 3px; background: #000; padding: 4px; border-radius: 6px; }
.lamps i { width: 14px; height: 14px; border-radius: 50%; background: #333; display: block; }
.lamps i.r.on { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; } .lamps i.y.on { background: #ffd23a; box-shadow: 0 0 10px #ffd23a; } .lamps i.g.on { background: #35e07a; box-shadow: 0 0 10px #35e07a; }
.lamps.flash i.r { animation: g-flash .3s steps(2) infinite; }
@keyframes g-flash { 50% { background: #333; box-shadow: none; } }
.g-clock { font-family: var(--f-num); font-size: 34px; font-weight: 700; min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.g-clock.y { color: #ffd23a; } .g-clock.r { color: #ff5a5a; }
.g-whis { font-size: 13px; font-weight: 700; color: #ffd23a; min-height: 1.4em; }
.g-wind { position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.85); color: #1b2436; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; text-align: center; }
.g-wind .flag { display: block; font-size: 18px; line-height: 1; }
.g-sight { position: relative; width: min(100%, 360px); margin: 10px auto 0; aspect-ratio: 1; touch-action: none; cursor: crosshair; }
.g-sight svg { width: 100%; height: 100%; display: block; }
.g-arrows-left { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.g-arrows-left i { width: 8px; height: 28px; border-radius: 2px; background: #1b2436; position: relative; }
.g-arrows-left i::before { content: ""; position: absolute; left: -2px; right: -2px; top: 0; height: 9px; background: #e2353f; border-radius: 2px 2px 0 0; }
.g-arrows-left i.used { opacity: .2; }
.g-draw { display: block; width: 100%; margin-top: 10px; padding: 16px; font-size: 17px; }
.g-draw.on { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.g-hold { height: 6px; background: rgba(0,0,0,.15); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.g-hold i { display: block; height: 100%; width: 0; background: #1f8a4c; }
.g-hold i.tired { background: #e2353f; }
.g-msg { padding: 12px 18px; font-size: 15px; min-height: 3.4em; border-top: 1px solid var(--line); }
.g-msg b { font-weight: 900; }
.g-overlay { position: absolute; inset: 0; background: rgba(15,21,34,.72); display: grid; place-items: center; padding: 14px; z-index: 3; }
.g-overlay .g-box { width: min(100%, 520px); max-height: 100%; overflow: auto; }

/* 初級：得点とスコアカード */
.g-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.g-keys button { font: inherit; font-family: var(--f-num); font-weight: 700; font-size: 20px; padding: 8px 0; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.g-keys button:hover { border-color: var(--navy); }
.g-keys .kx, .g-keys .k10, .g-keys .k9 { background: #f3d23a; color: #1b1608; border-color: #e0bd1c; }
.g-keys .k8, .g-keys .k7 { background: #e2353f; color: #fff; border-color: #c62a33; }
.g-keys .k6, .g-keys .k5 { background: #2a9fd6; color: #fff; border-color: #1f86b7; }
.g-keys .k4, .g-keys .k3 { background: #222; color: #fff; border-color: #000; }
.g-keys .k2, .g-keys .k1 { background: #f7f7f2; color: #1b2436; border-color: #cfcfc6; }
.g-keys .km { background: var(--chip-bg); }
.g-called { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.g-called span { font-family: var(--f-num); font-weight: 700; font-size: 16px; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; background: var(--chip-bg); }
.g-called span.cur { outline: 2px solid var(--red); }
.g-card { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.g-card th, .g-card td { border: 1px solid var(--line); padding: 6px 4px; text-align: center; }
.g-card th { background: var(--bg); font-size: 12px; font-weight: 700; }
.g-slot { font-family: var(--f-num); font-size: 20px; font-weight: 700; min-height: 1.4em; cursor: pointer; }
.g-slot.next { background: #fff7d6; }
.g-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.g-chips button { font: inherit; font-family: var(--f-num); font-weight: 700; font-size: 20px; min-width: 46px; padding: 6px 10px; border-radius: 8px; border: 2px solid var(--navy); background: var(--surface); color: var(--ink); cursor: pointer; }
.g-chips button[disabled] { opacity: .25; }
.g-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.g-fields label { font-size: 12px; font-weight: 700; color: var(--muted); display: grid; gap: 2px; }
.g-fields input { font: inherit; font-family: var(--f-num); font-size: 20px; font-weight: 700; width: 100%; padding: 6px 8px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); text-align: center; }
@media (max-width: 520px) { .g-fields { grid-template-columns: repeat(2, 1fr); } }
.g-fix { font-size: 13px; margin-top: 8px; }
.g-fix li { margin: 3px 0; }
.g-fix .ok { color: #1f8a4c; font-weight: 700; } .g-fix .ng { color: #c8102e; font-weight: 700; }

/* 上級：ＤＯＳ */
.g-field { display: block; width: 100%; height: auto; background: #6fa652; border-radius: 10px; }
.g-dosbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.g-dosbar .grp { font-size: 14px; font-weight: 700; }
.g-whistles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g-whistles button { font: inherit; font-weight: 900; font-size: 15px; padding: 14px 4px; border-radius: 10px; border: 2px solid var(--navy); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.3; touch-action: manipulation; }
.g-whistles button small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.g-whistles button.emg { border-color: #c8102e; color: #c8102e; }
.g-whistles button.hit { background: #e5f4ec; border-color: #1f8a4c; }
.g-whistles button.miss { background: #fde8eb; border-color: #c8102e; }
@media (max-width: 520px) { .g-whistles { grid-template-columns: repeat(2, 1fr); } }
.g-log { margin-top: 10px; font-size: 13px; max-height: 128px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.g-log p { margin: 2px 0; }
.g-log .ok { color: #1f8a4c; font-weight: 700; } .g-log .ng { color: #c8102e; font-weight: 700; } .g-log .ev { font-weight: 700; }
.g-alert { border-radius: 10px; padding: 10px 12px; font-weight: 700; background: #fff3c4; color: #5b4500; margin-top: 8px; min-height: 2.8em; }
.g-alert.emg { background: #c8102e; color: #fff; }

/* 最上級：決勝 */
.g-match { scroll-margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-match .side { text-align: center; }
.g-match .side h4 { font-size: 14px; font-weight: 900; margin: 0 0 4px; }
.g-match .side .pts { font-family: var(--f-num); font-size: 30px; font-weight: 700; }
.g-match .side .ends { font-family: var(--f-num); font-size: 16px; font-weight: 700; min-height: 1.5em; }
.g-match .face { width: 100%; height: auto; border-radius: 8px; }
.g-match .side.a h4 { color: #c8102e; } .g-match .side.b h4 { color: #1f6fd0; }
.g-match .clock20 { font-family: var(--f-num); font-size: 22px; font-weight: 700; }
.g-match .turn { outline: 3px solid #f3d23a; border-radius: 10px; }
.g-board { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.g-board th, .g-board td { border: 1px solid var(--line); padding: 4px; text-align: center; font-family: var(--f-num); font-size: 15px; }
.g-board th { font-family: var(--f-body); font-size: 12px; background: var(--bg); }
.g-lens2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; font-size: 13px; font-weight: 700; }
.g-lens2 svg { width: 100%; max-width: 170px; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--navy); display: block; margin: 0 auto 4px; }

/* 結果 */
.g-result { text-align: center; padding: 26px 18px; }
.g-rank { font-family: var(--f-num); font-size: 84px; font-weight: 700; line-height: 1; margin: 8px 0; }
.g-rank.S { color: #b8963e; } .g-rank.A { color: #c8102e; } .g-rank.B { color: #1f6fd0; } .g-rank.C { color: var(--muted); }
.g-result .title { font-size: 20px; font-weight: 900; }
.g-result .stats { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 14px 0; font-size: 13px; color: var(--muted); }
.g-result .stats b { display: block; font-family: var(--f-num); font-size: 26px; color: var(--ink); }
.g-result .g-row { max-width: 460px; margin: 16px auto 0; }
.g-miss { text-align: left; max-width: 560px; margin: 16px auto 0; font-size: 14px; }
.g-miss h3 { font-size: 15px; font-weight: 900; margin-bottom: 6px; }
.g-miss li { margin: 6px 0; }
.g-miss .ref { font-size: 12px; color: var(--muted); }

.g-note { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.8; }
.g-note a { color: var(--red); }
@media (max-width: 520px) { .g-sight { width: min(100%, 280px); } .g-clock { font-size: 28px; } .g-range { padding: 10px; } .g-draw { padding: 13px; } }
