:root {
  --bg: #0d0b1a;
  --panel: #17142b;
  --line: #2c2750;
  --grid: #26223f;
  --text: #ece9ff;
  --muted: #9a94c4;
  --accent: #f090af;
  --accent-2: #7ecef4;
  --brand: linear-gradient(90deg, #e55d87, #5fc3ef); /* りおチャンネルのボタンと同じ */
  --brand-ink: #251249;
  --high: #ffb84d;
  --low: #5cc8ff;
  --live: #f090af;
  --cal: #6f6a8f;
  --hit: #7be3a8;
  --miss: #ff8a8a;
  --warn: #ffcf5c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 85% -10%, #e55d8726 0%, transparent 45%) fixed,
    radial-gradient(ellipse at 10% -10%, #5fc3ef1f 0%, transparent 40%) fixed,
    radial-gradient(ellipse at 50% -20%, #2a1f55 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.7 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
a { color: var(--accent); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
code.wrap { word-break: break-all; }
[hidden] { display: none !important; }

.testbar {
  background: #1c1733; color: var(--muted); text-align: center;
  font-size: 12px; padding: 4px 16px; border-bottom: 1px solid var(--line);
}

header.site {
  max-width: 880px; margin: 0 auto; padding: 16px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
}
.logo { color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 10px; }
.logo-text { display: flex; flex-direction: column; }
.logo-rio { width: 44px; height: 44px; border-radius: 50%; flex: none; border: 2px solid transparent;
  background: var(--brand) border-box; }
.logo-text > span span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
nav a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
nav a.on, nav a:hover { color: var(--text); border-image: var(--brand) 1; }

main { max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }
footer.site {
  max-width: 880px; margin: 0 auto; padding: 24px 16px 48px;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
}
footer.site p { margin: 4px 0; }
footer .warn { color: var(--warn); font-weight: 700; }

h1 { font-size: 24px; line-height: 1.4; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 8px; }
.note { color: var(--muted); font-size: 14px; }
.error { color: var(--miss); font-weight: 700; text-align: center; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin: 16px 0;
}
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(24px, 6vw, 36px); }
.hero p { color: var(--muted); }

/* --- 挑戦 --- */
.stage { text-align: center; padding: 16px 0; }
.orb {
  width: 180px; height: 180px; margin: 8px auto 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #4a3e86, #1b1636 70%);
  box-shadow: 0 0 40px #3b2f7a88, inset 0 0 30px #00000066;
  font-size: 88px; font-weight: 800; color: #ffffffcc;
  transition: box-shadow .4s, background .4s;
}
.orb.high { background: radial-gradient(circle at 35% 30%, #ffd58a, #7a4a00 75%); color: #fff; }
.orb.low { background: radial-gradient(circle at 35% 30%, #a8e6ff, #004a75 75%); color: #fff; }
.orb.high[data-phase="sampling"] { animation: pulse-high 1s ease-in-out infinite; }
.orb.low[data-phase="sampling"] { animation: pulse-low 1s ease-in-out infinite; }
@keyframes pulse-high { 50% { box-shadow: 0 0 80px var(--high); } }
@keyframes pulse-low { 50% { box-shadow: 0 0 80px var(--low); } }

.lead { font-size: 18px; }
.target-label { font-size: 28px; font-weight: 800; margin: 0; }
button {
  font: inherit; color: var(--text); background: #2a2450; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 16px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.big {
  font-size: 20px; font-weight: 800; padding: 14px 40px; border-radius: 999px;
  background: var(--brand); border: none; color: var(--brand-ink);
  box-shadow: 0 6px 24px #e55d8740;
}
button.link { background: none; border: none; color: var(--accent); padding: 0 4px; text-decoration: underline; font-size: inherit; }
button.hold {
  width: min(100%, 360px); padding: 28px 16px; font-size: 18px; font-weight: 700;
  border-radius: 20px; user-select: none; -webkit-user-select: none; touch-action: none;
  -webkit-touch-callout: none;
}
button.hold.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin: 20px auto 0; max-width: 360px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--brand); }

.scale { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.scale button, .scale label {
  touch-action: manipulation;
  min-width: 56px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center;
  font-size: 20px; font-weight: 700; line-height: 1.2;
  background: #2a2450; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.scale small { font-size: 11px; font-weight: 400; color: var(--muted); }
.scale label input { position: absolute; opacity: 0; pointer-events: none; }
.scale label:has(input:checked), .scale button.on { border-color: var(--accent); background: #4a2550; }
.scale button.on:disabled { opacity: 1; }
.intro-save { min-width: 120px; }

.verdict { font-size: 24px; font-weight: 800; }
.verdict.hit { color: var(--hit); }
.verdict.miss { color: var(--miss); }
dl.result {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px;
  max-width: 640px; margin: 16px auto;
}
dl.result div { background: #0f0c22; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
dl.result dt { color: var(--muted); font-size: 12px; }
dl.result dd { margin: 0; font-weight: 700; }
.hash code { word-break: break-all; }

/* --- 集計 --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; }
.tile { background: #0f0c22; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.tile .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--muted); font-size: 13px; }
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--brand); }
.chart { width: 100%; height: 280px; display: block; }
.chart.small { height: 200px; }
.legend { font-size: 13px; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin: 0 4px 0 12px; }
.sw.live { background: var(--live); }
.sw.cal { background: var(--cal); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.tbl th, .tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: end; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: start; }
.tbl td.sig { color: var(--warn); font-weight: 700; }

/* --- フォーム・文章 --- */
.form label { display: block; margin: 8px 0; }
.form input[name=nickname] {
  display: block; width: 100%; max-width: 320px; margin-top: 4px; padding: 8px 10px;
  font: inherit; color: var(--text); background: #0f0c22; border: 1px solid var(--line); border-radius: 8px;
}
fieldset { border: none; padding: 0; margin: 12px 0; }
.form .scale { justify-content: flex-start; }
.prose blockquote { margin: 8px 0; padding: 8px 16px; border-inline-start: 3px solid var(--accent); background: #0f0c22; border-start-end-radius: 8px; border-end-end-radius: 8px; }
.prose li { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; }
}

/* --- 上部の乱数（表示用） --- */
.live { border-bottom: 1px solid var(--line); background: #08061299; padding: 6px 16px 4px; }
.live-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.live-dot {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--miss);
  display: inline-flex; align-items: center; gap: 5px;
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--miss);
  animation: live-blink 1.2s ease-in-out infinite;
}
@keyframes live-blink { 50% { opacity: .25; } }
.live-bits {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; display: flex; justify-content: flex-end;
  font: 14px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; color: #5a5480;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%);
  mask-image: linear-gradient(90deg, transparent, #000 25%);
}
.live-bits b { font-weight: 400; color: var(--accent); }
.live-status { max-width: 880px; margin: 0 auto; font-size: 11px; color: var(--muted); }
.live.paused .live-dot, .live.idle .live-dot { color: var(--muted); }
.live.paused .live-dot::before, .live.idle .live-dot::before { background: var(--muted); animation: none; }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }

/* --- 指示とスタート --- */
.howto { text-align: start; max-width: 480px; margin: 16px auto 20px; padding-inline-start: 1.4em; }
.howto li { margin: 6px 0; }
.countdown { font-size: 64px; font-weight: 800; line-height: 1; margin: 12px 0; font-variant-numeric: tabular-nums; }

/* --- 結果 --- */
.verdict { font-size: 40px; margin: 0; line-height: 1.2; }
.r-sub { font-size: 18px; font-weight: 700; margin: 4px 0 16px; }
.counts { display: flex; justify-content: center; gap: 12px; }
.count {
  flex: 1; max-width: 200px; padding: 10px 8px; border-radius: 14px;
  background: #0f0c22; border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; line-height: 1.2;
}
.count .d { font-size: 13px; color: var(--muted); }
.count .d .w { display: none; }
.count .n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.count .u { font-size: 12px; color: var(--muted); }
.count.want { border-color: var(--accent); }
.count.want .d { color: var(--accent); font-weight: 700; }
.count.want .d .w { display: inline; }
.r-diff { margin: 10px 0 20px; font-weight: 700; }

.gauge { max-width: 480px; margin: 0 auto; padding-top: 18px; }
.gauge-track {
  position: relative; height: 34px; border-radius: 17px;
  background: linear-gradient(90deg, #ff8a8a33, #0f0c22 35%, #0f0c22 65%, #7be3a833);
  border: 1px solid var(--line);
}
/* -4〜+4 のうち -2〜+2（偶然でもよくある範囲） */
.gauge-zone {
  position: absolute; top: 0; bottom: 0; left: 25%; right: 25%;
  background: #ffffff10; border-left: 1px dashed var(--muted); border-right: 1px dashed var(--muted);
  display: flex; align-items: flex-end; justify-content: center;
}
.gauge-zone span {
  position: absolute; bottom: 100%; padding-bottom: 3px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}  /* 帯の中に置くと丸い印に隠れるので、帯の上に出す */
.gauge-center { position: absolute; top: 4px; bottom: 4px; left: 50%; width: 1px; background: var(--muted); }
.gauge-marker {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 12px #fff8; transition: left .8s cubic-bezier(.2, .8, .2, 1);
}
.gauge-marker.hit { background: var(--hit); box-shadow: 0 0 14px var(--hit); }
.gauge-marker.miss { background: var(--miss); box-shadow: 0 0 14px var(--miss); }
.gauge-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.r-rarity { margin: 12px 0 8px; }
.r-detail { margin: 8px auto 20px; max-width: 640px; text-align: start; }
.r-detail summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; }

/* --- スクロールを減らす --- */
body.in-trial .hero, body.in-trial #belief { display: none; }
.stage { padding: 8px 0; scroll-margin-top: 8px; }
.orb { width: 140px; height: 140px; font-size: 68px; margin: 4px auto 12px; }
.orb[data-phase="result"] { display: none; }
.verdict { font-size: 32px; }
.r-sub { margin: 2px 0 10px; }
.r-diff { margin: 6px 0 12px; }
.r-rarity { margin: 8px 0 4px; font-size: 14px; }
.r-detail { margin: 4px auto 12px; }
.howto { margin: 10px auto 14px; }
.countdown { font-size: 52px; margin: 4px 0; }
@media (max-width: 600px) {
  .hero { padding: 12px 0 0; }
  .hero h1 { font-size: 22px; margin-bottom: 4px; }
  .hero p { font-size: 14px; margin: 4px 0; }
  .hero br { display: none; }
  header.site { padding: 8px 16px; gap: 4px 16px; }
  .logo { font-size: 16px; }
  nav { font-size: 13px; gap: 2px 10px; }
  .orb { width: 110px; height: 110px; font-size: 54px; }
  .target-label { font-size: 24px; }
  .lead { font-size: 16px; margin: 8px 0; }
  .howto { font-size: 14px; }
  button.big { font-size: 18px; padding: 12px 36px; }
  button.hold { padding: 22px 16px; }
  .count { padding: 6px; }
  .count .n { font-size: 24px; }
  .verdict { font-size: 28px; }
  .r-sub { font-size: 16px; }
  .live { padding: 4px 16px 2px; }
  .live-bits { font-size: 12px; }
  .live-status { font-size: 10px; }
  .card { padding: 16px; }
}

/* 準備 → 測定でボタンの位置を動かさない（各行の高さを固定） */
.run .target-label { height: 1.4em; line-height: 1.4em; margin: 0; overflow: hidden; }
.run .countdown { height: 64px; line-height: 64px; margin: 4px 0; font-size: 52px; }
.run .countdown.now { font-size: 36px; color: var(--accent); }
.run .lead {
  height: 3.4em; margin: 0 0 8px; line-height: 1.7;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 600px) {
  .run .countdown { height: 56px; line-height: 56px; font-size: 46px; }
  .run .countdown.now { font-size: 30px; }
}
h3 { font-size: 16px; margin: 20px 0 6px; }
select {
  font: inherit; color: var(--text); background: #2a2450; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; max-width: 100%;
}

/* --- ブロック（レア度の色） --- */
:root { --r-common: #9a94c4; --r-rare: #5cc8ff; --r-epic: #c9a2ff; --r-legend: #ffb84d; }
.badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid currentColor; line-height: 1.6;
}
.badge.r-common { color: var(--r-common); }
.badge.r-rare { color: var(--r-rare); }
.badge.r-epic { color: var(--r-epic); }
.badge.r-legend { color: var(--r-legend); background: rgba(255, 184, 77, .12); }
.stars { color: var(--warn); letter-spacing: 2px; }
.block-earned { margin: 4px 0 12px; }
.rarity-counts { margin: 12px 0; }
.block-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.block-card {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: #0f0c22; border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.block-card:hover { border-color: var(--accent); }
.block-card.r-rare { border-color: rgba(92, 200, 255, .5); }
.block-card.r-epic { border-color: rgba(201, 162, 255, .7); }
.block-card.r-legend { border-color: var(--r-legend); box-shadow: 0 0 16px rgba(255, 184, 77, .25); }
.block-card .no { font-size: 13px; color: var(--muted); }
.block-card .badge { align-self: flex-start; }
.block-card .t { font-size: 20px; font-weight: 800; }
.block-card .d { font-size: 12px; color: var(--muted); }
.block-card .stars { min-height: 1em; font-size: 13px; }
/* 成功・失敗のしるし（ブロック帳・証明書・一覧・最近の試行で共通） */
.block-card .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px; }
.oc {
  display: inline-block; font-size: 12px; font-weight: 700; white-space: nowrap;
  padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor;
}
.oc.hit { color: var(--hit); }
.oc.miss { color: var(--miss); }
.oc.draw { color: var(--muted); }
.block-cert .oc { font-size: 16px; padding: 2px 12px; vertical-align: middle; margin-inline-start: 6px; }
.block-cert .block-no { font-size: 28px; font-weight: 800; margin: 0; }
.block-cert.r-legend { border-color: var(--r-legend); box-shadow: 0 0 24px rgba(255, 184, 77, .2); }
.block-cert .block-rarity { margin: 4px 0 12px; font-size: 18px; }
.block-cert .stars { font-size: 20px; }
a.button {
  display: inline-block; color: var(--text); background: #2a2450; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 16px; text-decoration: none;
}
a.button:hover { border-color: var(--accent); }
.history { padding-inline-start: 20px; }
.pager { display: flex; justify-content: space-between; }
code.code { font-size: 16px; padding: 4px 8px; background: #0f0c22; border-radius: 6px; user-select: all; }
.form label.check { display: flex; gap: 8px; align-items: center; }
.form input[name=code] {
  display: block; width: 100%; max-width: 360px; margin-top: 4px; padding: 8px 10px;
  font: inherit; color: var(--text); background: #0f0c22; border: 1px solid var(--line); border-radius: 8px;
}
p.warn { color: var(--warn); }
.tbl.anchors td, .tbl.anchors th { text-align: start; white-space: normal; }

/* --- 国・地域の地図 --- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.seg button { padding: 6px 12px; font-size: 14px; }
.seg button[aria-selected="true"] { border-color: var(--accent); background: #4a2550; }
.map-wrap { position: relative; }
.map svg { display: block; width: 100%; height: auto; }
.map path { stroke: var(--panel); stroke-width: .6; transition: fill .2s; }
.map path:hover { stroke: var(--text); stroke-width: 1; }
.map-tip {
  position: absolute; z-index: 2; max-width: 230px; padding: 8px 10px; font-size: 13px; line-height: 1.5;
  background: #0f0c22; border: 1px solid var(--line); border-radius: 8px; pointer-events: none;
}
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.map-table { margin-top: 8px; }
.blocks-tbl td.owner { text-align: start; max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
.blocks-tbl .badge { font-size: 12px; padding: 0 8px; }
.blocks-tbl td.hash { text-align: start; color: var(--muted); }

/* --- わかりやすい説明 --- */
.steps { list-style: none; padding: 0; margin: 14px auto 6px; max-width: 520px; text-align: start; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; background: rgba(23, 20, 43, .7); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; color: var(--text); }
.steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #1a1033; display: grid; place-items: center; font-size: 15px; }
.hero p.small { font-size: 14px; }
.summary { background: #0f0c22; border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; margin: 4px 0 14px; }
.summary-k { margin: 0; font-size: 13px; color: var(--muted); }
.summary-v { margin: 4px 0; font-size: 18px; font-weight: 700; line-height: 1.5; }
details.plain { margin-top: 10px; }
details.plain summary { cursor: pointer; color: var(--accent); }
details.plain ul { padding-inline-start: 1.2em; }
.glossary dt { font-weight: 700; margin-top: 10px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); }
@media (max-width: 600px) {
  .steps li { font-size: 14px; padding: 6px 10px; }
  .summary-v { font-size: 16px; }
}
.prep-bits { height: 1.6em; margin: 0 auto 8px; max-width: 480px; overflow: hidden; }

/* --- 横棒・ランキング --- */
.hbars { display: grid; gap: 6px; margin: 8px 0; }
.hbar { display: grid; grid-template-columns: 8.5em 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar-k { color: var(--text); white-space: nowrap; }
.hbar-track { height: 14px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.hbar-v { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.tbl.rank td.name { text-align: start; white-space: normal; }
.tbl.rank tr.me td, .tbl.rank tr.me th { color: var(--accent); font-weight: 700; }
@media (max-width: 600px) { .hbar { grid-template-columns: 7em 1fr auto; font-size: 13px; } }
.blocks-tbl td.flag { text-align: center; font-size: 18px; line-height: 1; }
.logo .logo-sub { display: block; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-top: 2px; }
@media (max-width: 600px) { .logo .logo-sub { font-size: 12px; } }

/* --- 言語の切り替え --- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-switch { margin-inline-start: auto; }
.lang-switch select { font-size: 13px; padding: 4px 8px; }

/* --- 右から左に書く言語（アラビア語） ---
   左右の意味が決まっているもの（メーター・進み具合・乱数の流れ・グラフ・地図・ハッシュ）は、左から右のまま */
.gauge, .progress, .bar, .live-bits, .chart, .map-wrap, code, .hbar-track { direction: ltr; }
[dir="rtl"] .tbl td, [dir="rtl"] .hbar-v { unicode-bidi: plaintext; }

/* --- りおチャンネルの飾り（メインサイトの斜めの線と点） --- */
header.site { position: relative; }
.hero { position: relative; overflow-x: clip; }
.hero::before, .hero::after {
  content: ""; position: absolute; height: 3px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffffffb0);
}
.hero::before { width: 38%; top: 10px; inset-inline-end: 0; transform: rotate(-6deg); }
.hero::after { width: 9px; height: 9px; border-radius: 50%; background: #fff; top: 4px; inset-inline-end: 0; opacity: .8; }
.hero h1 { background: linear-gradient(90deg, #fff 30%, #f8c4d6 70%, #bfe6fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { background-image: radial-gradient(#ffffff0d 1px, transparent 1.4px); background-size: 8px 8px; }
footer.site a.ch { display: inline-flex; align-items: center; gap: 6px; }
footer.site a.ch img { width: 22px; height: 22px; border-radius: 50%; }
[dir="rtl"] .hero::before { transform: rotate(6deg); }

/* --- 曜日・時間ごとのグラフ --- */
.tc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tc-tabs button { font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.tc-tabs button.on { border-color: var(--accent); background: #4a2550; }
.time-card h3 { font-size: 14px; color: var(--muted); margin: 12px 0 4px; font-weight: 400; }
.tc-plot, .tc-axis { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2px; }
.tc-plot { height: 110px; position: relative; border-bottom: 1px solid var(--line); }
.tc-plot.div { border-bottom: 0; }
.tc-plot.div::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--muted); opacity: .5; }
.tc-col { position: relative; height: 100%; padding: 0; border: 0; border-radius: 4px; background: none; min-width: 0; cursor: pointer; }
.tc-col:hover, .tc-col.on { background: #ffffff12; }
.tc-bar { position: absolute; left: 50%; width: min(64%, 28px); transform: translateX(-50%); min-height: 2px; }
.tc-bar.n { bottom: 0; background: var(--accent-2); border-radius: 4px 4px 0 0; }
.tc-bar.up { bottom: 50%; background: var(--hit); border-radius: 4px 4px 0 0; }
.tc-bar.dn { top: 50%; background: var(--miss); border-radius: 0 0 4px 4px; }
.tc-axis span { font-size: 11px; color: var(--muted); text-align: center; overflow: visible; white-space: nowrap; }
.tc-read { min-height: 1.5em; font-size: 14px; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.countdown .cd-k { font-size: 18px; font-weight: 700; color: var(--muted); margin-inline-end: 10px; vertical-align: middle; }

/* トップの機械のイラスト（static/rng-machine.svg。中で数字とランプが動く） */
.hero-machine { display: block; width: 220px; height: auto; margin: 4px auto 8px; }
@media (max-width: 600px) { .hero-machine { width: 160px; margin: 0 auto 4px; } }

/* --- 論文（/paper） --- */
.paper-draft { background: #2a1c3f; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.paper .tbl-wrap { overflow-x: auto; margin: 8px 0 12px; }
.paper .tbl { display: table; font-size: 13px; }
.paper .tbl th, .paper .tbl td { white-space: normal; text-align: start; vertical-align: top; min-width: 6em; }
.paper h3 { font-size: 16px; margin-top: 18px; }
.formula { text-align: center; font-size: 18px; margin: 14px 0; overflow-x: auto; white-space: nowrap; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin-inline-start: 4px; }
.frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 6px 2px; }
.frac > span:last-child { padding: 2px 6px 0; }
.frac .rad { border-top: 1px solid currentColor; padding-top: 1px; }
.paper-lang { margin: 0 0 8px; }

/* --- ヘッダーの並び（メニューが増えても高くならないように） ---
   広い画面: 左にロゴ、右上に言語、右下にメニュー。スマホ: 1段目にロゴと言語、2段目にメニュー */
header.site {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 24px;
  grid-template-areas: "logo lang" "logo nav";
}
header.site .logo { grid-area: logo; }
header.site nav { grid-area: nav; justify-content: flex-end; }
header.site .lang-switch { grid-area: lang; justify-self: end; margin: 0; }
header.site .lang-switch select { width: auto; }
@media (max-width: 600px) {
  header.site { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "logo lang" "nav nav"; gap: 6px 8px; }
  header.site nav { justify-content: flex-start; }
  header.site .lang-switch select { width: 100px; padding: 4px 6px; }
}

/* --- ブロック帳のレア度で絞り込み --- */
.rar-btn { background: none; border: 1px solid transparent; border-radius: 999px; padding: 3px 10px 3px 4px; margin: 0 4px 6px 0; font-size: 14px; }
.rar-btn.on { border-color: var(--accent); background: #4a2550; }
