/* キホンスワイプ Web 版。iPhone アプリと同じ、暗い地に章の色のグラデーション・黄色の強調 */
:root {
  --bg: #000;
  --ink: #fff;
  --sub: rgba(255, 255, 255, .72);
  --dim: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .18);
  --yellow: #ffd95a;
  --good: #40cc85;
  --bad: #ff6b6b;
  --cat: #4d54cc;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }

.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 20px; padding: 14px 28px;
  background: rgba(0, 0, 0, .7); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--yellow); margin-left: 4px; }
.modes { display: flex; gap: 6px; }
.modes button { background: var(--dim); border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; color: var(--sub); }
.modes button.on { background: var(--yellow); color: #000; }
.stats { margin-left: auto; color: var(--sub); font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats b { color: var(--ink); }

.stage { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 28px; justify-content: center; padding: 28px; }
@media (max-width: 1100px) { .stage { grid-template-columns: minmax(0, 760px); } .side { order: 2; } }
@media (max-width: 700px) { .bar { flex-wrap: wrap; padding: 12px 16px; } .stats { margin-left: 0; } .stage { padding: 16px; } }

.card { border-radius: 24px; padding: 32px 36px 28px; min-height: 70vh;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 85%, transparent), #000 72%); }
.card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 800; color: var(--sub); }
.chip { background: rgba(255, 255, 255, .16); color: var(--ink); border-radius: 999px; padding: 4px 10px; }
.again { color: var(--yellow); }
.q { font-size: 20px; font-weight: 700; line-height: 1.7; white-space: pre-wrap; margin: 0 0 18px; }
.q.long { font-size: 16px; }
.q .fig { margin: 14px 0; padding: 12px 16px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .3); font-size: 15px; font-weight: 500; overflow-x: auto; }
.q .fig:last-child { margin-bottom: 0; }
.q .fig figcaption { margin-bottom: 6px; font-size: 13px; font-weight: 800; color: var(--yellow); }
.q .fig.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; white-space: pre; }
.q .fig.mono figcaption { font-family: inherit; }
pre.code { background: rgba(0, 0, 0, .45); border-radius: 14px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
pre.code .ln { color: rgba(255, 255, 255, .35); user-select: none; display: inline-block; width: 2.2em; }
.choices { display: grid; gap: 10px; }
.dunno { display: block; width: 100%; margin-top: 10px; padding: 12px; background: none; border: 0; color: var(--sub); font-weight: 700; font-size: 14px; }
.dunno:hover { color: var(--ink); }
.choice { display: flex; gap: 14px; align-items: baseline; text-align: left; width: 100%; background: rgba(255, 255, 255, .1);
  border: 1px solid transparent; border-radius: 14px; padding: 14px 16px; font-size: 16px; font-weight: 600; line-height: 1.55; }
.choice:hover:not([disabled]) { border-color: var(--line); background: rgba(255, 255, 255, .15); }
.choice .mark { font-weight: 900; color: var(--sub); min-width: 1.4em; }
.choice .key { margin-left: auto; font-size: 12px; color: rgba(255, 255, 255, .4); }
.choice[disabled] { cursor: default; opacity: .5; }
.choice.right { background: var(--good); color: #000; opacity: 1; }
.choice.wrong { background: var(--bad); color: #000; opacity: 1; }
.choice.right .mark, .choice.wrong .mark, .choice.right .key, .choice.wrong .key { color: rgba(0, 0, 0, .6); }
.result { margin-top: 20px; background: rgba(0, 0, 0, .35); border-radius: 16px; padding: 16px 18px; }
.result .verdict { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.result .verdict.ok { color: var(--good); }
.result .verdict.ng { color: var(--bad); }
.result .exp { line-height: 1.8; color: var(--ink); white-space: pre-wrap; }
.result .src { margin-top: 10px; font-size: 12px; color: var(--sub); }
.next { margin-top: 18px; width: 100%; border: 0; border-radius: 14px; padding: 15px; font-weight: 900; font-size: 16px; background: var(--yellow); color: #000; }
.empty { color: var(--sub); line-height: 1.8; }

.side { display: flex; flex-direction: column; gap: 16px; }
.panel { background: #111; border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.panel h2 { font-size: 14px; margin: 0 0 12px; color: var(--sub); }
.cat { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.cat .row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.cat .row span:last-child { color: var(--sub); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 99px; background: var(--dim); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; width: 0; }
.meter i.miss { opacity: .35; }
.push { margin-left: auto; }
.note { font-size: 12px; color: var(--sub); line-height: 1.7; margin: 0 0 10px; }
.synccode { font: 900 26px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; color: var(--yellow); margin: 6px 0 12px; }
details summary { font-size: 12px; color: var(--sub); cursor: pointer; margin-bottom: 8px; }
#join { display: flex; gap: 6px; }
#join input { flex: 1; min-width: 0; background: #000; color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 700 14px ui-monospace, monospace; text-transform: uppercase; }
#join button { background: var(--dim); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.keys p { font-size: 13px; color: var(--sub); margin: 0; line-height: 2; }
kbd { background: var(--dim); border-radius: 6px; padding: 2px 7px; font: 700 12px ui-monospace, monospace; color: var(--ink); }

.tools { display: flex; gap: 6px; }
.tool { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 800; color: var(--ink); }
.tool:hover { background: rgba(0, 0, 0, .55); }

/* 力だめし */
.ctitle { font-size: 24px; font-weight: 900; margin: 0 0 12px; }
.cnote { font-size: 14px; color: var(--sub); line-height: 1.8; margin: 0 0 14px; }
.cscore { margin-bottom: 16px; }
.cscore .row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; font-weight: 800; }
.cscore b { font-size: 28px; color: var(--bad); font-variant-numeric: tabular-nums; }
.cscore b.pass { color: var(--good); }
.cscore .sub { color: var(--sub); font-size: 13px; }
.cscore .up { color: var(--good); } .cscore .down { color: var(--bad); }
.cmeter { position: relative; height: 10px; border-radius: 99px; background: var(--dim); }
.cmeter i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--yellow); }
.cmeter em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 16px; font-variant-numeric: tabular-nums; }
.ctable th, .ctable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.ctable th:first-child, .ctable td:first-child { text-align: left; }
.ctable th { color: var(--sub); font-weight: 700; }
.ctable tr.sum td { font-weight: 900; border-bottom: 0; }
.cstart { margin-top: 20px; }
.cprog { height: 4px; border-radius: 99px; background: var(--dim); margin: -6px 0 18px; overflow: hidden; }
.cprog i { display: block; width: 0; height: 100%; background: var(--yellow); }
.choice.picked { border-color: var(--yellow); background: rgba(255, 217, 90, .18); }
.cnav { display: flex; gap: 8px; margin-top: 18px; }
.tool[disabled] { opacity: .35; cursor: default; }
