/* retro.css — 「なつかしゲーム」共通（mn.css の後に読み込む） */
.rt-screen { position: relative; margin: 0 auto; width: 100%; max-width: 480px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rt-inner { position: relative; margin: 0 auto; background: #000; overflow: hidden; border-radius: 6px; }
.rt-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: crosshair; }
.rt-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 12px; color: #fff; font-weight: 700; text-shadow: 0 2px 0 #000, 0 0 6px #000; line-height: 1.5; }
.rt-overlay.on { display: flex; flex-direction: column; gap: 6px; }
.rt-overlay .rt-big { font-size: clamp(22px, 7vw, 34px); letter-spacing: .04em; }
.rt-overlay .rt-blink { animation: rt-blink 1s steps(2) infinite; }
@keyframes rt-blink { 50% { opacity: 0; } }
.rt-crt .rt-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); mix-blend-mode: multiply; }
.rt-crt .rt-inner { border-radius: 14px / 18px; box-shadow: inset 0 0 30px rgba(0,0,0,.6); }
.rt-flash { animation: rt-flash .18s; }
@keyframes rt-flash { 0% { filter: brightness(2.2); } 100% { filter: none; } }

/* 筐体の枠 */
.rt-frame-table { padding: 14px; border-radius: 18px; background: linear-gradient(160deg, #3b2a1e, #1c130c); box-shadow: inset 0 0 0 3px #5a4231, 0 8px 22px rgba(0,0,0,.35); }
.rt-frame-table::after { content: "TABLE GAME  100YEN"; display: block; text-align: center; color: #c9a77c; font: 700 11px/1 monospace; letter-spacing: .3em; margin-top: 10px; opacity: .8; }
.rt-frame-lcd { padding: 18px 18px 14px; border-radius: 14px 14px 38px 14px; background: linear-gradient(170deg, #d9d4c7, #b9b2a2); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 8px 22px rgba(0,0,0,.3); }
.rt-frame-lcd .rt-inner { border-radius: 4px; box-shadow: inset 2px 2px 6px rgba(0,0,0,.35); background: #b7c4a0; }
.rt-frame-phone { padding: 22px 20px 18px; border-radius: 30px 30px 40px 40px; background: linear-gradient(170deg, #4a5160, #262a33); box-shadow: inset 0 0 0 2px #6b7385, 0 8px 22px rgba(0,0,0,.35); }
.rt-frame-phone::before { content: ""; display: block; width: 44px; height: 6px; border-radius: 3px; background: #15181e; margin: -8px auto 12px; }
.rt-frame-phone .rt-inner { border-radius: 4px; background: #9bbc0f; }
.rt-frame-arcade { padding: 10px; border-radius: 12px; background: linear-gradient(180deg, #1a1d2b, #0b0c14); box-shadow: 0 0 0 2px #2b3150, 0 0 24px rgba(80,120,255,.25); }
.rt-frame-neon { padding: 4px; border-radius: 16px; background: linear-gradient(135deg, #ff3cac, #784ba0 50%, #2b86c5); box-shadow: 0 10px 30px rgba(120,75,160,.35); }
.rt-frame-neon .rt-inner { border-radius: 12px; }

/* 仮想パッド */
.rt-pad { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px auto 0; max-width: 480px; touch-action: none; user-select: none; -webkit-user-select: none; }
.rt-pad-l, .rt-pad-r { display: flex; gap: 10px; }
.rt-pbtn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: #2a2d3a; color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 #11131a; touch-action: none; -webkit-tap-highlight-color: transparent; }
.rt-pbtn.on { transform: translateY(3px); box-shadow: 0 1px 0 #11131a; }
.rt-pbtn-a { background: #d83a4a; box-shadow: 0 4px 0 #7e1c27; width: 72px; height: 72px; }
.rt-pbtn-a.on { box-shadow: 0 1px 0 #7e1c27; }
.rt-pbtn-b { background: #c99a1e; box-shadow: 0 4px 0 #7a5c0f; }
.rt-dpad { display: grid; grid-template-columns: 52px 52px 52px; grid-template-rows: 52px 52px 52px; gap: 0; }
.rt-dpad .rt-pbtn { width: 52px; height: 52px; border-radius: 10px; font-size: 18px; }
.rt-dpad .u { grid-column: 2; grid-row: 1; } .rt-dpad .l { grid-column: 1; grid-row: 2; } .rt-dpad .r { grid-column: 3; grid-row: 2; } .rt-dpad .d { grid-column: 2; grid-row: 3; }

/* HUD（キャンバス外の日本語表示） */
.rt-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 480px; margin: 0 auto 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rt-hud b { font-size: 1.15em; }
.rt-hud .rt-hud-c { text-align: center; flex: 1; }

/* 名前入れ・ハイスコア表 */
.rt-name { text-align: center; padding: 14px; border-radius: var(--radius, 16px); background: #0b0c14; color: #fff; }
.rt-name-h { font: 800 14px/1.4 monospace; letter-spacing: .2em; color: #ffd23f; margin: 0 0 8px; }
.rt-name-h small { font: 400 11px/1 var(--font, sans-serif); letter-spacing: 0; color: #aab; }
.rt-name-row { display: flex; justify-content: center; gap: 14px; margin-bottom: 10px; }
.rt-name-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rt-name-cell button { width: 48px; height: 36px; border: 0; border-radius: 8px; background: #2a2d3a; color: #fff; }
.rt-name-cell b { font: 800 34px/1.2 monospace; width: 48px; border-bottom: 3px solid #ffd23f; }
.rt-name.done { opacity: .75; }
.rt-hs { list-style: none; padding: 12px 16px; margin: 0; border-radius: var(--radius, 16px); background: #0b0c14; color: #e8e8f0; font: 700 15px/1.9 ui-monospace, Menlo, Consolas, monospace; }
.rt-hs li { display: grid; grid-template-columns: 3.4em 1fr 3em; gap: 8px; white-space: pre; }
.rt-hs li b { text-align: right; color: #fff; }
.rt-hs li i { font-style: normal; color: #ffd23f; text-align: right; }
.rt-hs li.me { color: #3ee08f; animation: rt-blink 1s steps(2) 4; }

/* 懐かし／新世代のペア案内 */
.rt-pair { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm, 10px); border: 1px dashed var(--line); text-decoration: none; color: var(--text); }
.rt-pair b { display: block; }
.rt-pair small { color: var(--text-sub); }
.rt-pair .rt-pair-tag { flex: none; font: 800 11px/1 monospace; padding: 6px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.rt-era { font: 800 12px/1 ui-monospace, monospace; letter-spacing: .25em; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .rt-overlay .rt-blink, .rt-hs li.me { animation: none; }
  .rt-flash { animation: none; }
}
.rt-hero { display: flex; justify-content: center; }
.rt-hero canvas, .rt-hero svg { max-width: 100%; height: auto; display: block; }
.rt-unit { font-size: .4em; margin-left: .15em; }
.rt-title-name { font-weight: 800; color: var(--accent); font-size: 1.1em; margin: 0; }
.rt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rt-hist { display: flex; align-items: flex-end; gap: 4px; height: 84px; margin: 8px 0 4px; }
.rt-hb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; min-width: 0; }
.rt-hb i { display: block; width: 100%; background: var(--line); border-radius: 3px 3px 0 0; }
.rt-hb.me i { background: var(--accent); }
.rt-hb span { font-size: 10px; color: var(--text-sub); white-space: nowrap; }
.rt-play { max-width: 520px; margin: 0 auto; }
.rt-canvas.rt-smooth { image-rendering: auto; }
.rt-start .mn-daily-num { white-space: nowrap; }
