/* ページの外側はほかのゲームと同じノート。ゲームの中は昔の 3D ゲームの窓 */
:root {
  --paper: #fbfaf4; --rule: #bcd3ea; --margin: #f0a5a5;
  --pencil: #3b3b3f; --faint: #7a7a80;
  --win-top: #2a3f9e; --win-bot: #0d1650; --win-line: #e8ecff; --yellow: #ffe35a; --dim: #aab4e0;
  --pixel: "DotGothic16", "MS Gothic", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; color: var(--pencil); background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 46px, var(--margin) 46px, var(--margin) 47.5px, transparent 47.5px),
    repeating-linear-gradient(var(--paper) 0 31px, var(--rule) 31px 32px);
  font-family: "Klee One", "Hiragino Maru Gothic ProN", "Yu Gothic", serif;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 600px) {
  body { background-image:
    linear-gradient(90deg, transparent 14px, var(--margin) 14px, var(--margin) 15.5px, transparent 15.5px),
    repeating-linear-gradient(var(--paper) 0 31px, var(--rule) 31px 32px); }
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
header { max-width: 980px; margin: 0 auto; padding: 18px 16px 6px 64px; }
@media (max-width: 600px) { header { padding-left: 26px; } }
h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: .04em; line-height: 1.3; }
header svg { display: block; margin: -2px 0 2px -4px; }
header p { margin: 0; font-size: 15px; color: var(--faint); }
.wrap { max-width: 980px; margin: 0 auto; padding: 14px 16px 48px 64px;
  display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 600px) { .wrap { padding: 8px 12px 40px 26px; } }
aside h2 { font-size: 22px; font-weight: 600; margin: 0 0 4px; display: inline-block;
  background: linear-gradient(transparent 62%, rgba(242, 194, 48, .55) 62%, rgba(242, 194, 48, .55) 92%, transparent 92%); }
aside ol, aside ul { margin: 0 0 24px; padding-left: 1.6em; font-size: 16px; line-height: 32px; }
aside li::marker { color: var(--faint); }

/* ---------- ゲームの画面 ---------- */
.stage { position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 4.2; max-height: calc(100vh - 24px);
  margin: 0 auto; border: 3px solid #1b1b22; border-radius: 4px; background: #000;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  font-family: var(--pixel); color: #fff; }
.stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#cv3 { image-rendering: pixelated; image-rendering: crisp-edges; }
.sound { position: absolute; right: 6px; top: 6px; z-index: 5; font-size: 12px; padding: 2px 6px;
  background: rgba(13, 22, 80, .8); border: 1px solid var(--win-line); color: #fff; }

.win-wrap { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
.win-wrap[hidden] { display: none; }
.win-wrap.scroll { justify-content: flex-start; overflow-y: auto; touch-action: pan-y; background: rgba(0, 0, 0, .35); padding-top: 34px; }
.win { position: relative; padding: 10px 12px; font-size: 14px; line-height: 1.7;
  background: linear-gradient(var(--win-top), var(--win-bot)); border: 2px solid var(--win-line); border-radius: 5px;
  box-shadow: 0 0 0 2px #0a0f33, 3px 3px 0 2px rgba(0, 0, 0, .45); }
.win p { margin: 0; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.yellow { color: var(--yellow); }
.title-win .logo { font-size: 30px; letter-spacing: .12em; color: var(--yellow); text-shadow: 2px 2px 0 #7a3b00; margin-bottom: 4px; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.pick { text-align: left; padding: 3px 4px 3px 22px; position: relative; font-size: 16px; }
.pick:hover, .pick:focus-visible { color: var(--yellow); outline: none; }
.pick:hover::before, .pick:focus-visible::before { content: "▶"; position: absolute; left: 4px; font-size: 12px; top: 6px; }
.result { font-size: 30px; line-height: 1.2; color: var(--yellow); font-variant-numeric: tabular-nums; }
.result small { font-size: 16px; margin-left: 2px; }
.verdict { font-size: 14px; }
.stats { width: 100%; border-collapse: collapse; margin: 6px 0 2px; font-size: 13px; }
.stats th { text-align: left; font-weight: 400; color: var(--dim); padding: 1px 0; width: 7.5em; }
.stats td { padding: 1px 0; }
.stats tr + tr { border-top: 1px dotted #4a5aa8; }
.hint { margin-top: 4px !important; color: var(--yellow); font-size: 13px; }
.nameline { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.nameline input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: #fff; background: #050a30; border: 1px solid var(--win-line); padding: 3px 6px; border-radius: 0; outline: none; }
.nameline input::placeholder { color: #6a74a8; }
.nameline button { flex: none; padding: 3px 12px; border: 1px solid var(--yellow); color: var(--yellow); }
.nameline button:disabled { opacity: .5; }
.regmsg { color: #ff9a9a; font-size: 12px; min-height: 1em; }
#regDone[hidden], #nameFold[hidden] { display: none; }
.share-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.share-row a, .share-row button { flex: 1 1 auto; text-align: center; color: #fff; text-decoration: none; font-size: 13px; padding: 3px 8px; border: 1px solid var(--win-line); white-space: nowrap; }
ol.board { list-style: none; margin: 6px 0 0; padding: 0; min-height: 48px; font-size: 14px; }
ol.board li { display: flex; gap: 10px; line-height: 1.8; }
ol.board li + li { border-top: 1px dotted #4a5aa8; }
ol.board .n { width: 2em; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
ol.board li:nth-child(-n+3) .n { color: var(--yellow); }
ol.board .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.board .d { font-variant-numeric: tabular-nums; }
ol.board li.me { color: var(--yellow); }
ol.board li.me .who::after { content: " ← あなた"; font-size: 12px; }
ol.board li.msg { color: var(--dim); justify-content: center; }
