* { box-sizing: border-box; }
html { color-scheme: light; background: #170c11; }
body { margin: 0; min-width: 280px; color: #2c1719; background: radial-gradient(circle at 50% 0, #6c2230 0, #271116 46rem, #12090c 100%); font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif; }
button { font: inherit; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #ffd967; outline-offset: 3px; }
.is-embed .site-hero, .is-embed .site-about { display: none; }

.site-hero { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 24px 4px 14px; color: #fff8e9; }
.site-hero h1 { margin: 3px 0 5px; font-family: serif; font-size: clamp(1.55rem, 4vw, 2.45rem); letter-spacing: .04em; }
.site-hero p { margin: 0; }
.site-kicker { color: #f3c85a; font: 800 .72rem/1.2 system-ui, sans-serif; letter-spacing: .18em; }

#rrApp { --rr-red: #a51f36; --rr-dark: #46101c; --rr-ink: #2c1719; --rr-paper: #fff8e9; --rr-gold: #e9b93e; position: relative; container: rrapp / inline-size; width: min(1120px, calc(100% - 24px)); margin: 0 auto; overflow: hidden; border: 2px solid rgba(255,232,169,.75); border-radius: 18px; background: linear-gradient(145deg, rgba(255,252,239,.98), rgba(241,220,186,.97)); box-shadow: 0 28px 80px rgba(0,0,0,.48), inset 0 0 0 5px rgba(132,29,43,.12); isolation: isolate; }
#rrApp p, #rrApp dl, #rrApp dd, #rrApp dt { margin: 0; padding: 0; }
#rrApp button { border: 0; cursor: pointer; }
#rrApp [hidden] { display: none !important; }

#rrApp .rr-topbar { min-height: 66px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; color: #fff8e9; background: linear-gradient(105deg, #651222, #a6223b 55%, #681526); border-bottom: 3px solid #d3a636; }
#rrApp .rr-stage-mark { display: grid; grid-template-columns: auto auto; align-items: end; min-width: 52px; padding: 3px 9px; border: 1px solid rgba(255,238,190,.55); border-radius: 9px; background: rgba(34,4,10,.32); }
#rrApp .rr-stage-mark span { font: 900 1.65rem/1 serif; }
#rrApp .rr-stage-mark small { padding-bottom: 2px; font-weight: 800; }
#rrApp .rr-title-block { min-width: 0; }
#rrApp .rr-stage-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 clamp(1rem, 2vw, 1.25rem)/1.25 serif; letter-spacing: .05em; }
#rrApp .rr-stage-hint { margin-top: 2px; color: #f9e7b7; font-size: .78rem; line-height: 1.3; }
#rrApp .rr-top-actions { display: flex; gap: 6px; }
#rrApp .rr-icon-button { min-width: 44px; min-height: 44px; padding: 6px 10px; color: #fff8e9; border: 1px solid rgba(255,255,255,.44); border-radius: 8px; background: rgba(43,5,13,.34); font-weight: 800; font-size: .76rem; }
#rrApp .rr-icon-button:hover { background: rgba(255,255,255,.17); }
#rrApp .rr-full-button { font-size: 1.15rem; line-height: 1; }
#rrApp .rr-full-button[aria-pressed="true"] { background: rgba(255,236,178,.28); }

#rrApp .rr-play-grid { display: grid; grid-template-columns: minmax(125px, 174px) minmax(360px, 1fr) minmax(175px, 220px); min-height: 0; }
#rrApp .rr-character { position: relative; min-width: 0; overflow: hidden; background: linear-gradient(#f2dfbc, #e7c891); border-right: 1px solid #b98f52; }
#rrApp .rr-character::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(45deg, transparent 46%, #a32a3c 47% 53%, transparent 54%); background-size: 34px 34px; }
#rrApp .rr-nameplate { position: relative; z-index: 2; margin: 12px 9px 0; padding: 8px; text-align: center; border-top: 2px solid #8f2637; border-bottom: 2px solid #8f2637; background: rgba(255,248,232,.8); }
#rrApp .rr-nameplate small { display: block; color: #765056; font-size: .68rem; }
#rrApp .rr-nameplate strong { display: block; margin-top: 2px; font-family: serif; font-size: 1.02rem; }
#rrApp .rr-character img { position: absolute; z-index: 1; left: 50%; bottom: 7px; width: min(150%, 238px); height: calc(100% - 74px); transform: translateX(-50%); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 9px 6px rgba(67,17,24,.28)); }
#rrApp .rr-speech { position: absolute; z-index: 3; left: 8px; right: 8px; bottom: 9px; padding: 7px 8px; border: 1px solid rgba(102,27,38,.45); border-radius: 10px; color: #4b1620; background: rgba(255,252,242,.92); font-size: .72rem; font-weight: 800; line-height: 1.45; box-shadow: 0 3px 12px rgba(49,13,19,.16); }

#rrApp .rr-board-wrap { position: relative; min-width: 0; aspect-ratio: 4 / 5; overflow: hidden; background: #3d2830; touch-action: none; }
#rrApp #gameCanvas { display: block; width: 100%; height: 100%; background: #3d2830; cursor: crosshair; touch-action: none; }
#rrApp .rr-aim-callout { position: absolute; left: 50%; bottom: 3.8%; transform: translateX(-50%); width: max-content; max-width: 82%; padding: 7px 13px; border: 1px solid rgba(255,245,207,.76); border-radius: 999px; color: #fffbed; background: rgba(54,10,19,.82); font-size: clamp(.72rem, 2.2cqw, .9rem); font-weight: 900; letter-spacing: .04em; pointer-events: none; transition: opacity .18s; }
#rrApp .rr-aim-callout.is-hidden { opacity: 0; }
#rrApp .rr-combo { position: absolute; top: 14%; left: 50%; transform: translateX(-50%) scale(.8); color: #fff2a1; font: 1000 clamp(1rem, 6cqw, 2rem)/1 system-ui, sans-serif; text-shadow: 0 2px 0 #8b142a, 0 0 14px #ffca43; opacity: 0; pointer-events: none; }
#rrApp .rr-combo.is-pop { animation: rrCombo .45s ease-out; }
@keyframes rrCombo { 0% { opacity: 0; transform: translateX(-50%) scale(.55); } 35% { opacity: 1; transform: translateX(-50%) scale(1.1); } 100% { opacity: 0; transform: translateX(-50%) scale(1); } }
#rrApp .rr-stage-banner { position: absolute; top: 10%; left: 7%; right: 7%; z-index: 4; padding: 14px 18px; color: #fff9e8; text-align: center; background: linear-gradient(100deg, rgba(58,8,17,.05), rgba(87,12,25,.94) 18% 82%, rgba(58,8,17,.05)); pointer-events: none; animation: rrBanner 1.8s both; }
#rrApp .rr-stage-banner small, #rrApp .rr-stage-banner span { display: block; }
#rrApp .rr-stage-banner small { color: #f4cb62; font-weight: 900; letter-spacing: .16em; }
#rrApp .rr-stage-banner strong { display: block; margin: 4px 0; font: 900 clamp(1.4rem, 5cqw, 2.1rem)/1.2 serif; }
#rrApp .rr-stage-banner span { font-size: .78rem; }
@keyframes rrBanner { 0% { opacity: 0; transform: translateY(-10px); } 16%,72% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#rrApp .rr-hud { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 12px; background: linear-gradient(180deg, #fff9ec, #ead0a1); border-left: 1px solid #b98f52; }
#rrApp .rr-hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-bottom: 1px dashed #bd8f56; font-size: .78rem; }
#rrApp .rr-hud-row strong { color: #6b1524; font-size: 1.05rem; }
#rrApp .rr-barrier-row { display: block; text-align: center; }
#rrApp .rr-barrier-row span { display: block; margin-bottom: 3px; font-weight: 800; }
#rrApp .rr-barrier-row strong { color: #bb213d; letter-spacing: .12em; }
#rrApp .rr-power-card { padding: 9px; border: 1px solid #bf9554; border-radius: 10px; background: rgba(255,252,239,.72); }
#rrApp .rr-power-card > p { margin-bottom: 7px; color: #74182a; font: 900 .82rem/1.2 serif; }
#rrApp .rr-power-card dl div { display: flex; justify-content: space-between; gap: 5px; padding: 4px 0; font-size: .74rem; }
#rrApp .rr-power-card dd { color: #791728; font-weight: 900; }
#rrApp .rr-charge { margin-top: auto; }
#rrApp .rr-charge > div:first-child { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: .75rem; font-weight: 900; }
#rrApp .rr-charge-track { height: 10px; overflow: hidden; border: 1px solid #71334a; border-radius: 99px; background: #2d1721; }
#rrApp .rr-charge-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #df304f, #ffd85c, #fff6c0); box-shadow: 0 0 12px #ffdf65; transition: width .18s; }
#rrApp .rr-spell-button { min-height: 50px; padding: 7px; color: #fff9ea; border-radius: 10px; background: linear-gradient(#bd263f, #701326); box-shadow: 0 4px 0 #450916; font-weight: 900; }
#rrApp .rr-spell-button small { display: block; margin-top: 2px; font-size: .62rem; font-weight: 600; opacity: .82; }
#rrApp .rr-spell-button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .55; box-shadow: none; }
#rrApp .rr-spell-button:not(:disabled) { animation: rrSpellPulse 1s infinite alternate; }
@keyframes rrSpellPulse { to { box-shadow: 0 4px 0 #450916, 0 0 17px #e9b93e; } }
#rrApp .rr-control-note { color: #6b4e47; font-size: .66rem; line-height: 1.5; }
#rrApp .rr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#rrApp .rr-overlay { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 18px; color: #2c1719; background: rgba(23,5,10,.88); touch-action: pan-y; }
#rrApp .rr-panel { width: min(680px, 100%); margin: auto; padding: clamp(18px, 4vw, 34px); border: 2px solid #e5bd59; border-radius: 16px; background: linear-gradient(145deg, #fffcef, #efd9ad); box-shadow: 0 24px 80px rgba(0,0,0,.52); }
#rrApp .rr-panel-kicker { color: #a42138; font-weight: 1000; font-size: .73rem; letter-spacing: .18em; }
#rrApp .rr-panel-title { margin-top: 5px; font: 900 clamp(1.5rem, 5vw, 2.1rem)/1.2 serif; }
#rrApp .rr-panel-copy { margin-top: 8px; line-height: 1.7; }
#rrApp .rr-main-button { min-height: 46px; padding: 10px 22px; color: #fff9ea; border-radius: 10px; background: linear-gradient(#b7243d, #751326); box-shadow: 0 4px 0 #4e0a18; font-weight: 900; }
#rrApp .rr-main-button:hover { filter: brightness(1.12); }
#rrApp .rr-text-button { min-height: 44px; padding: 8px 12px; color: #711526; background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
#rrApp .rr-overlay-actions { display: flex; align-items: center; gap: 9px; margin-top: 18px; }

/* ---- 導入動画 ---- */
#rrApp .rr-intro-overlay { padding: 0; background: #0b0407; touch-action: manipulation; }
#rrApp .rr-intro-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: 100%; padding: 0 0 16px; }
/* 高さの上限は「字幕のぶんを残す」ため。64px が字幕1行ぶん。
   ★単体ページのときだけ 62vh も足す。単体ページは #rrApp が画面より高いので、
   これが無いと字幕が折り返しの下へ落ちる。埋め込みのときは vh＝わくの高さなので、
   足すと逆に動画が小さくなりすぎる（1366×768 で 384px まで縮んだ）。 */
#rrApp .rr-intro-video { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100% - 64px); aspect-ratio: 16 / 9; object-fit: contain; background: #0b0407; }
html:not(.is-embed):not(.is-fullscreen) #rrApp .rr-intro-video { max-height: min(calc(100% - 64px), 62vh); }
#rrApp .rr-intro-caption { flex: 0 0 auto; width: max-content; max-width: min(92%, 40em); padding: 10px 18px; border: 1px solid rgba(255,236,178,.42); border-radius: 12px; color: #fff8e9; background: rgba(14,3,7,.86); font-size: clamp(.85rem, 3cqw, 1.15rem); font-weight: 800; line-height: 1.55; text-align: center; text-wrap: balance; pointer-events: none; opacity: 0; transition: opacity .28s; }
#rrApp .rr-intro-caption.is-on { opacity: 1; }
#rrApp .rr-intro-buttons { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 8px; }
#rrApp .rr-intro-skip { position: relative; z-index: 3; min-width: 74px; min-height: 44px; padding: 8px 14px; color: #fff8e9; border: 1px solid rgba(255,238,190,.6); border-radius: 10px; background: #7c1425; font-weight: 900; font-size: .82rem; }
#rrApp .rr-intro-skip:hover { filter: brightness(1.18); }

#rrApp .rr-story-overlay { padding: 0; background: #331019 url("img/bg_shrine_sakura.jpg") center/cover no-repeat; }
#rrApp .rr-story-overlay::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(38,5,11,.2), rgba(38,5,11,.72)); }
#rrApp .rr-story-scene { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(180px, .85fr) minmax(300px, 1.15fr); align-items: end; width: min(900px, 94%); height: min(650px, 92%); margin: auto; }
#rrApp .rr-story-scene > img { width: 100%; height: 96%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 16px 9px rgba(0,0,0,.38)); }
#rrApp .rr-story-card { align-self: center; padding: clamp(18px, 4vw, 34px); border: 2px solid #e6bd59; border-radius: 14px; background: rgba(255,250,232,.96); box-shadow: 0 18px 50px rgba(0,0,0,.38); }
#rrApp .rr-story-kicker { color: #9a1c32; font-weight: 1000; letter-spacing: .18em; font-size: .72rem; }
#rrApp .rr-story-title { margin-top: 7px; font: 900 clamp(1.35rem, 4vw, 2.15rem)/1.28 serif; }
#rrApp .rr-story-text { margin-top: 13px; line-height: 1.85; }
#rrApp .rr-story-dots { margin-top: 16px; color: #a01c33; letter-spacing: .22em; }

#rrApp .rr-upgrade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 18px; }
#rrApp .rr-upgrade-card { min-height: 160px; padding: 14px 10px; border: 1px solid #c2944e; border-radius: 12px; color: #3e1820; background: linear-gradient(#fffdf4, #efd8aa); box-shadow: 0 5px 0 #b48647; text-align: center; }
#rrApp .rr-upgrade-card:hover { transform: translateY(-2px); filter: brightness(1.04); }
#rrApp .rr-upgrade-card img { display: block; width: 62px; height: 62px; margin: 0 auto 7px; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(70,18,27,.25)); }
#rrApp .rr-upgrade-card strong { display: block; color: #85182d; font: 900 1rem/1.25 serif; }
#rrApp .rr-upgrade-card span { display: block; margin-top: 7px; font-size: .72rem; line-height: 1.5; }

#rrApp .rr-result-panel { display: grid; grid-template-columns: minmax(120px, 210px) 1fr; align-items: center; gap: 22px; }
#rrApp .rr-result-panel > img { width: 100%; max-height: 330px; object-fit: contain; object-position: bottom; }
#rrApp .rr-final-score { margin: 16px 0 !important; padding: 10px 13px !important; border-top: 1px solid #bd9252; border-bottom: 1px solid #bd9252; }
#rrApp .rr-final-score strong { color: #a11e35; font-size: 1.45rem; }
#rrApp .rr-help-panel { max-width: 590px; }
#rrApp .rr-help-panel ol { margin: 16px 0; padding-left: 1.4rem; line-height: 1.75; }
#rrApp .rr-help-panel > p:not(.rr-panel-kicker):not(.rr-panel-title) { line-height: 1.75; }
#rrApp .rr-help-panel .rr-main-button { margin-top: 18px; }

.site-about { width: min(820px, calc(100% - 32px)); margin: 24px auto 64px; padding: 22px 24px; color: #fff5e6; border: 1px solid rgba(245,206,111,.3); border-radius: 14px; background: rgba(36,12,18,.72); line-height: 1.85; }
.site-about h2 { margin: 1.1em 0 .3em; color: #f4ce6f; font-size: 1.25rem; }
.site-about h2:first-child { margin-top: 0; }
.site-about p { margin: 0 0 .8em; }
.site-rights { color: #d9c8bd; font-size: .84rem; }

@container rrapp (max-width: 760px) {
  #rrApp .rr-topbar { min-height: 58px; gap: 7px; padding: 6px 8px; }
  #rrApp .rr-stage-mark { min-width: 43px; padding: 3px 6px; }
  #rrApp .rr-stage-mark span { font-size: 1.35rem; }
  #rrApp .rr-stage-hint { display: none; }
  #rrApp .rr-icon-button { min-width: 44px; min-height: 44px; padding: 4px 7px; font-size: .68rem; }
  #rrApp .rr-play-grid { grid-template-columns: 1fr; }
  /* ★立ち絵は「下ぞろえで縦に長い絵」を置くと頭が切れる（実機で20px切れていた）。
     上ぞろえで切り取って、顔が必ず出るようにする。帯も低くして盤へ高さを回す。 */
  #rrApp .rr-character { height: 68px; border-right: 0; border-bottom: 1px solid #b98f52; }
  #rrApp .rr-character img { left: 10px; bottom: 0; width: 58px; height: 100%; transform: none;
    object-fit: cover; object-position: center top; filter: drop-shadow(0 3px 4px rgba(67,17,24,.24)); }
  #rrApp .rr-nameplate { position: absolute; top: 6px; left: 76px; margin: 0; padding: 2px 8px; text-align: left; }
  #rrApp .rr-nameplate strong { font-size: .92rem; }
  #rrApp .rr-nameplate small { display: none; }
  #rrApp .rr-speech { left: 76px; right: 7px; bottom: 5px; padding: 4px 7px; font-size: .68rem; line-height: 1.3; }
  #rrApp .rr-board-wrap { aspect-ratio: 4 / 5; }
  /* ★HUDが縦に233pxもあって、盤に高さが残らなかった（実機で盤242px）。
     結界・一射・得点を1段にまとめ、今の力／霊力／夢想封印を右へ寄せて2段に詰める。 */
  #rrApp .rr-hud { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: auto auto auto;
    gap: 5px; padding: 6px 8px; border-left: 0; border-top: 1px solid #b98f52; }
  #rrApp .rr-hud-row { padding: 3px 4px; text-align: center; border-bottom: 0; }
  #rrApp .rr-hud-row span { display: block; font-size: .66rem; }
  #rrApp .rr-hud-row strong { display: block; font-size: 1rem; line-height: 1.15; }
  #rrApp .rr-barrier-row { grid-column: 1; grid-row: 1; }
  #rrApp .rr-barrier-row span { margin-bottom: 1px; }
  #rrApp .rr-barrier-row strong { letter-spacing: .06em; }
  #rrApp .rr-power-card { grid-column: 1 / 3; grid-row: 2 / 4; padding: 5px 7px; }
  #rrApp .rr-power-card > p { margin-bottom: 3px; font-size: .74rem; }
  #rrApp .rr-power-card dl { display: grid; grid-template-columns: repeat(3, 1fr); }
  #rrApp .rr-power-card dl div { display: block; padding: 2px 0; text-align: center; font-size: .68rem; }
  #rrApp .rr-charge { grid-column: 3; grid-row: 2; align-self: center; margin: 0; }
  #rrApp .rr-charge > div:first-child { margin-bottom: 2px; font-size: .68rem; }
  #rrApp .rr-charge-track { height: 8px; }
  #rrApp .rr-spell-button { grid-column: 3; grid-row: 3; min-height: 46px; padding: 4px; font-size: .86rem; }
  #rrApp .rr-spell-button small { margin-top: 0; font-size: .56rem; }
  #rrApp .rr-control-note { display: none; }
  #rrApp .rr-intro-caption { padding: 8px 13px; }
  #rrApp .rr-intro-buttons { top: 9px; right: 9px; gap: 6px; }
  #rrApp .rr-intro-skip { min-width: 62px; padding: 7px 10px; font-size: .76rem; }
  #rrApp .rr-story-scene { grid-template-columns: 34% 66%; height: min(620px, 96%); }
  #rrApp .rr-story-card { padding: 16px; }
}

@container rrapp (max-width: 480px) {
  #rrApp .rr-stage-title { font-size: .94rem; }
  #rrApp .rr-top-actions { gap: 3px; }
  #rrApp .rr-character { height: 60px; }
  #rrApp .rr-character img { width: 50px; }
  #rrApp .rr-nameplate, #rrApp .rr-speech { left: 66px; }
  #rrApp .rr-nameplate strong { font-size: .84rem; }
  #rrApp .rr-speech { font-size: .64rem; }
  #rrApp .rr-upgrade-grid { grid-template-columns: 1fr; }
  #rrApp .rr-upgrade-card { display: grid; grid-template-columns: 58px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 84px; text-align: left; }
  #rrApp .rr-upgrade-card img { grid-row: 1 / 3; width: 50px; height: 50px; margin: 0; }
  #rrApp .rr-upgrade-card span { margin-top: 3px; }
  #rrApp .rr-story-scene { display: block; width: 94%; height: auto; }
  #rrApp .rr-story-scene > img { position: absolute; left: -10px; bottom: 100%; width: 130px; height: 190px; }
  #rrApp .rr-story-card { position: relative; }
  #rrApp .rr-story-title { font-size: 1.25rem; }
  #rrApp .rr-result-panel { grid-template-columns: 90px 1fr; gap: 12px; }
}

@media (max-height: 500px) and (min-width: 650px) {
  .site-hero { display: none; }
  #rrApp { width: min(920px, calc(100% - 10px)); border-radius: 10px; }
  #rrApp .rr-topbar { min-height: 48px; padding: 4px 9px; }
  #rrApp .rr-stage-mark { padding-block: 1px; }
  #rrApp .rr-play-grid { grid-template-columns: 128px minmax(300px, 1fr) 180px; height: calc(100dvh - 58px); min-height: 300px; max-height: 438px; }
  #rrApp .rr-board-wrap { height: 100%; aspect-ratio: 4 / 5; justify-self: center; }
  #rrApp .rr-character img { height: calc(100% - 60px); }
  #rrApp .rr-nameplate { margin-top: 6px; padding: 4px; }
  #rrApp .rr-speech { font-size: .63rem; }
  #rrApp .rr-hud { gap: 4px; padding: 6px; }
  #rrApp .rr-hud-row { padding: 3px; }
  #rrApp .rr-control-note { display: none; }
  #rrApp .rr-intro-stage { gap: 8px; padding-bottom: 10px; }
  #rrApp .rr-intro-video { max-height: calc(100% - 56px); }
  html:not(.is-embed):not(.is-fullscreen) #rrApp .rr-intro-video { max-height: min(calc(100% - 56px), 66vh); }
  #rrApp .rr-intro-caption { padding: 6px 12px; font-size: .82rem; line-height: 1.4; }
  #rrApp .rr-story-scene { height: 94%; }
  #rrApp .rr-story-card { padding: 14px 18px; }
  #rrApp .rr-story-text { margin-top: 6px; line-height: 1.45; }
  #rrApp .rr-story-dots { margin-top: 7px; }
  #rrApp .rr-overlay-actions { margin-top: 7px; }
  .site-about { display: none; }
}

/* ---- WordPressの中（?embed=1）ではわくの高さに収める ---- */
/* ★中で縦スクロールが出ると、盤の下のボタンが隠れて押せなくなる。
   高さは vh ではなく親の 100% を使う（iframeの高さは決まっているので、これで足りる）。 */
.is-embed, .is-embed body,
.is-fullscreen, .is-fullscreen body { height: 100%; }
/* 全画面のときは、単体ページでも見出しと解説を隠してゲームだけにする。 */
.is-fullscreen .site-hero, .is-fullscreen .site-about { display: none; }
.is-fullscreen body { background: #0b0407; }
.is-embed #rrApp,
.is-fullscreen #rrApp {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.is-embed #rrApp .rr-topbar,
.is-fullscreen #rrApp .rr-topbar { flex: 0 0 auto; }
/* 埋め込みではわくが画面に収まっているので、導入は中央ぞろえのほうが収まりがよい。
   単体ページは #rrApp が画面より高いことがあるので、上ぞろえのまま。 */
.is-embed #rrApp .rr-intro-stage,
.is-fullscreen #rrApp .rr-intro-stage { justify-content: center; padding-bottom: 0; }
.is-embed #rrApp .rr-play-grid,
.is-fullscreen #rrApp .rr-play-grid { flex: 1 1 auto; min-height: 0; }
/* 横に広い画面で全画面にすると、盤の左右に空きができすぎる（2880px幅で実測）。
   盤は高さから幅が決まるので、並び全体の幅も高さから決めて中央へ寄せる。 */
/* 盤の幅＝(画面の高さ − 上の帯66px) × 0.8。左右の列は最大174pxと220px。
   その合計に少し余裕(24px)を足したところで止めると、比率を保ったまま中央に詰まる。
   ★ここを「高さ×決め打ちの倍率」にすると、画面の縦横比によって盤がつぶれる。 */
.is-fullscreen #rrApp .rr-play-grid { width: min(100%, calc(418px + (100vh - 66px) * 0.8)); margin-inline: auto; }
/* 高さが決まったので、盤は高さから幅を出して真ん中に置く（横向きのときと同じやり方）。 */
.is-embed #rrApp .rr-board-wrap,
.is-fullscreen #rrApp .rr-board-wrap { height: 100%; max-width: 100%; aspect-ratio: 4 / 5; justify-self: center; }

@container rrapp (max-width: 760px) {
  .is-embed #rrApp .rr-play-grid,
  .is-fullscreen #rrApp .rr-play-grid { grid-template-rows: auto minmax(0, 1fr) auto; }
}

/* ---- わくが低いとき（スマホに大きな広告が出ている日）---- */
/* ★2026-08-31にスマホの本番で、上に411pxの固定広告が出て、使える帯が319pxしか残らなかった。
   そのままだと盤が51pxになる。飾りの帯を隠し、HUDも1段に詰めて、残りを全部盤へ回す。
   それでも狭いので、この状態では ⛶ の全画面がいちばん快適になる。 */
@media (max-height: 520px) and (max-width: 649px) {
  #rrApp .rr-character { display: none; }
  #rrApp .rr-hud { grid-template-rows: auto auto; gap: 4px; padding: 5px 7px; }
  #rrApp .rr-hud-row { padding: 2px; }
  #rrApp .rr-hud-row span { font-size: .6rem; }
  #rrApp .rr-hud-row strong { font-size: .88rem; }
  #rrApp .rr-power-card { grid-column: 1 / 3; grid-row: 2; padding: 3px 6px; }
  #rrApp .rr-power-card > p { display: none; }
  #rrApp .rr-power-card dl div { padding: 0; font-size: .62rem; }
  #rrApp .rr-charge { grid-column: 3; grid-row: 1; }
  #rrApp .rr-charge > div:first-child { font-size: .6rem; }
  #rrApp .rr-spell-button { grid-column: 3; grid-row: 2; min-height: 40px; font-size: .78rem; }
  #rrApp .rr-spell-button small { display: none; }
  #rrApp .rr-topbar { min-height: 48px; padding: 4px 7px; }
  #rrApp .rr-stage-title { font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  #rrApp *, #rrApp *::before, #rrApp *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

html > ins.adsbygoogle:not([data-ad-status="filled"]) { pointer-events: none !important; }
