/* ミーム理解度選手権 ― 2000年代初頭の個人サイト風スタイル
   配色: 紺 #000080 / 銀 #c0c0c0 / 生成り #ffffee / 赤 #cc0000 / 電光 #00ff66 on 黒 */
:root {
  --navy: #000080;
  --silver: #c0c0c0;
  --paper: #ffffee;
  --red: #cc0000;
  --green: #006600;
  --gray: #555555;
  --lavender: #ccccff;
  --dot: 'DotGothic16', 'MS PGothic', 'ＭＳ Ｐゴシック', Osaka, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: #003366;
  background-image: radial-gradient(#6699cc 1px, transparent 1.5px), radial-gradient(#336699 1px, transparent 1.5px);
  background-size: 48px 48px, 48px 48px;
  background-position: 0 0, 24px 24px;
  font-family: 'MS PGothic', 'ＭＳ Ｐゴシック', Osaka, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #000000;
}
a { color: #0000ee; }
a:visited { color: #551a8b; }
a:hover { color: var(--red); }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }

.page { max-width: 800px; margin: 0 auto; padding: 16px; }
.frame { background: var(--paper); border: 4px ridge var(--silver); }

/* ---- ヘッダー ---- */
.banner { background: var(--navy); color: #ffffff; padding: 20px 16px; text-align: center; border-bottom: 2px solid #000000; }
.banner-welcome { font-size: 12px; color: #ffff66; letter-spacing: 2px; }
.banner-title { margin: 6px 0 4px; font-family: var(--dot); font-size: 40px; font-weight: 400; line-height: 1.3; letter-spacing: 2px; }
.banner-title a, .banner-title a:visited, .banner-title a:hover { color: #ffffff; text-decoration: none; }
.banner-sub { font-size: 13px; color: #c0d8ff; }
.banner.compact { padding: 8px 12px; }
.banner.compact .banner-welcome, .banner.compact .banner-sub { display: none; }
.banner.compact .banner-title { margin: 0; font-size: 22px; letter-spacing: 1px; }

.ticker { background: #000000; color: #00ff66; font-family: var(--dot); font-size: 14px; padding: 4px 0; white-space: nowrap; overflow: hidden; }
.ticker-inner { display: inline-block; padding-left: 100%; animation: ticker 28s linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes blink { 50% { visibility: hidden; } }
.blink { animation: blink 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .ticker-inner { animation: none; padding-left: 12px; }
  .blink { animation: none; }
}

.main { padding: 12px; }
.footer { border-top: 2px groove var(--silver); padding: 10px 12px; text-align: center; font-size: 12px; color: #333333; }
.notice { border: 2px dashed var(--red); background: #ffffcc; padding: 10px; }

/* ---- 共通部品 ---- */
.stack { display: flex; flex-direction: column; gap: 16px; }
h2.bar { margin: 0 0 8px; font-size: 16px; color: var(--navy); border-left: 12px solid var(--navy); border-bottom: 1px solid var(--navy); padding: 2px 8px; }
.inset { border: 2px inset var(--silver); background: #ffffff; padding: 12px 16px; }
.small { font-size: 12px; }
.muted { color: var(--gray); }
.warn { color: var(--red); }
.center { text-align: center; }
.new { color: var(--red); font-weight: bold; }

.btn {
  min-height: 44px; padding: 6px 16px; font-size: 15px; font-family: inherit; line-height: 1.3;
  background: var(--silver); color: #000000; border: 3px outset #ffffff; cursor: pointer;
}
.btn:active, .btn.on { border-style: inset; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 2px dotted var(--red); outline-offset: 2px; }
.btn[disabled] { color: #808080; cursor: not-allowed; }
.btn-big { min-width: 260px; padding: 14px 24px; font-family: var(--dot); font-size: 22px; }
.btn-red { color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---- トップ ---- */
.cols { display: flex; flex-wrap: wrap; gap: 12px; }
.side { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.body { flex: 999 1 420px; min-width: 0; }
.win { border: 2px outset #ffffff; background: var(--silver); }
.win-title { background: var(--navy); color: #ffffff; font-weight: bold; font-size: 13px; padding: 2px 8px; }
.menu { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.menu a { padding: 6px 0; }
.counter-box { padding: 8px; text-align: center; font-size: 12px; }
.counter { display: inline-block; margin: 4px 0; background: #000000; color: #00ff66; font-family: var(--dot); font-size: 22px; letter-spacing: 4px; padding: 2px 8px; border: 2px inset #808080; }
.linkfree { border: 1px solid var(--navy); background: #ffffff; color: var(--navy); font-size: 12px; text-align: center; padding: 6px; line-height: 1.4; }
.side-video { padding: 3px; }
.side-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 2px inset #808080; background: #000000; }
@media print { .side-video { display: none; } }
ol.rules { margin: 0; padding-left: 28px; }
ol.rules li { margin-bottom: 4px; }
.history { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 8px; font-size: 13px; }

/* ---- 問題 ---- */
.status { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; z-index: 2; }
.status-row { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; font-size: 13px; }
.saved { color: var(--green); }
.meter { height: 16px; border: 2px inset #808080; background: #ffffff; display: flex; }
.meter > div { background-color: var(--navy); background-image: repeating-linear-gradient(90deg, var(--navy) 0 10px, #ffffff 10px 12px); }
.meter.plain > div { background-image: none; }
.meter.ref > div { background-color: #808080; }
.q { border: 1px solid var(--navy); background: #ffffff; scroll-margin-top: 80px; }
.q-head { background: var(--lavender); border-bottom: 1px solid var(--navy); padding: 2px 8px; font-family: var(--dot); font-size: 16px; color: var(--navy); }
.q-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.q-body label { font-size: 15px; }
.q-body pre, .aa { margin: 0; padding: 8px 12px; background: #f0f0f0; border: 1px dotted #808080; font-family: 'MS Gothic', 'ＭＳ ゴシック', Osaka-mono, monospace; font-size: 16px; line-height: 1.3; overflow-x: auto; }
.q-body input[type="text"] {
  width: 100%; height: 44px; padding: 4px 8px; font-size: 16px; font-family: inherit;
  border: 2px inset #808080; background: #ffffff; color: #000000; border-radius: 0;
}
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.pager-nums { display: flex; gap: 2px; font-family: var(--dot); font-size: 15px; }
.pager-nums button { min-width: 40px; min-height: 44px; padding: 4px; font: inherit; background: none; border: 0; color: #0000ee; text-decoration: underline; cursor: pointer; }
.pager-nums button[aria-current="page"] { background: var(--navy); color: #ffffff; text-decoration: none; font-weight: bold; }
.submit-box { border: 2px dashed var(--red); background: #ffffcc; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* ---- 要確認 ---- */
.check { border: 1px solid var(--navy); background: #ffffff; }
.check.done { border-style: dotted; }
.check dl { margin: 0; padding: 10px 12px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 8px; }
.check dt { color: var(--navy); font-weight: bold; }
.check dd { margin: 0; overflow-wrap: anywhere; }
.check .btn-row { justify-content: flex-start; padding: 0 12px 12px; }

/* ---- 結果 ---- */
.hero { border: 4px double var(--navy); background: #ffffff; padding: 16px; text-align: center; }
.hero-lead { font-family: var(--dot); font-size: 18px; color: var(--navy); margin-top: 6px; }
.hero-score { display: inline-block; margin: 8px 0; background: #000000; color: #00ff66; font-family: var(--dot); font-size: 64px; line-height: 1.2; padding: 4px 20px; border: 4px inset #808080; }
.hero-score small { font-size: 32px; }
.hero-title { font-family: var(--dot); font-size: 24px; color: var(--red); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--navy); border-left: 1px solid var(--navy); background: #ffffff; }
.grid2 > div { border-right: 1px solid var(--navy); border-bottom: 1px solid var(--navy); padding: 4px 8px; }
.grid2 > div:nth-child(odd) { background: var(--lavender); }
.cat { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 96px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.cat-num { text-align: right; white-space: nowrap; }
.trend > div { margin-bottom: 10px; }
.trend > div:last-child { margin-bottom: 0; }
.trend b.good { color: var(--green); }
.trend b.bad { color: var(--red); }
.trend b.info { color: var(--navy); }
.table-wrap { overflow-x: auto; border: 1px solid var(--navy); background: #ffffff; }
table.review { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.review th { background: var(--navy); color: #ffffff; text-align: left; padding: 3px 6px; font-weight: normal; }
table.review td { padding: 4px 6px; border-bottom: 1px dotted #808080; vertical-align: top; overflow-wrap: anywhere; }
table.review th:nth-child(1), table.review th:nth-child(2) { width: 52px; }
table.review tr.incorrect td { background: #ffeeee; }
table.review tr.unanswered td, table.review tr.excluded td { background: #eeeeee; }
table.review .mark { font-weight: bold; }
table.review tr.correct .mark { color: var(--green); }
table.review tr.incorrect .mark { color: var(--red); }
table.review .qtext { color: var(--gray); font-size: 12px; }
table.review .note { color: var(--gray); font-size: 12px; display: block; }
.linkbtn { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 12px; color: #0000ee; text-decoration: underline; cursor: pointer; }

@media (max-width: 480px) {
  .page { padding: 16px 8px; }
  .banner-title { font-size: 28px; }
  .hero-score { font-size: 48px; }
  .cat { grid-template-columns: minmax(0, 1fr) 96px; }
  .cat .meter { grid-column: 1 / -1; grid-row: 2; }
  .check dl { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  body { background: #ffffff; }
  .ticker, .btn-row, .footer, .filter { display: none; }
  .page { max-width: none; padding: 0; }
  .frame { border: 0; }
  .table-wrap { overflow: visible; }
}

/* ---- ランキング・シェア ---- */
.rank-box { display: flex; flex-direction: column; gap: 6px; }
.rank-main { text-align: center; font-size: 16px; }
.rank-big { font-family: var(--dot); font-size: 40px; color: var(--red); }
.nick-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; }
.nick-row input { height: 44px; width: min(100%, 260px); padding: 4px 8px; font-size: 16px; font-family: inherit; border: 2px inset #808080; border-radius: 0; }
ul.notes { margin: 6px 0 0; padding-left: 20px; }
table.rank-cats { width: 100%; border-collapse: collapse; font-size: 13px; background: #ffffff; }
table.rank-cats th, table.rank-cats td { border: 1px solid var(--navy); padding: 3px 6px; text-align: left; }
table.rank-cats th { background: var(--lavender); }
.rank-tabs { margin: 10px 0; }
.rank-tabs .btn { min-height: 36px; padding: 4px 10px; font-size: 13px; }
table.rank-table caption { text-align: left; font-weight: bold; color: var(--navy); padding: 4px 0; }
table.rank-table tr.top1 td { background: #fff4b0; }
table.rank-table tr.top2 td { background: #eeeeee; }
table.rank-table tr.top3 td { background: #f6dfc8; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding: 8px; border: 2px inset var(--silver); background: #000000; margin-top: 10px; }
.hist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.hist-bar { width: 70%; background: #00ff66; min-height: 1px; }
.hist-n, .hist-l { font-family: var(--dot); font-size: 11px; color: #00ff66; white-space: nowrap; }
.share-box { display: flex; flex-direction: column; gap: 10px; }
.share-preview { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.share-preview img { width: 100%; max-width: 600px; height: auto; border: 2px solid var(--navy); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: #000000; }
a.btn:visited { color: #000000; }
table.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #ffffff; }
table.rank-table th { background: var(--navy); color: #ffffff; text-align: left; padding: 3px 6px; font-weight: normal; }
table.rank-table td { padding: 4px 6px; border-bottom: 1px dotted #808080; overflow-wrap: anywhere; }
table.rank-table td.mark { font-family: var(--dot); white-space: nowrap; }

.top-back { justify-content: flex-start; margin-bottom: 10px; }
@media print { .top-back { display: none; } }

.top-share .btn-row { margin-bottom: 4px; }
.top-share .small { text-align: center; min-height: 1.4em; }
