/* Memora Q 社会：プレミアムの画面（87回目④B 横に丸い記号）と、買ったすぐあとのカード（92回目②A 真ん中のカード）。js/mq_prem.js。2026-11-22。
   手本＝世界史_一問一答/案/op82q の i87q_4.js（v4b）・i92b_1.js（y2a）の色と字の大きさ。
   入れ物は app.js のシート（#sheet）。中身が .mqp なら全画面、.mqc なら真ん中のカード（:has で切りかえる。中身が消えると、ふつうのシートにもどる）。 */
.mqp, .mqc { --mqp-g: #FFD46A; --mqp-g2: #E3B35C; --mqp-ink: #1A1406; --mqp-w: #F2F3F5; --mqp-sub: rgba(255,255,255,.6); --mqp-ln: rgba(255,255,255,.14);
  color: var(--mqp-w); color-scheme: dark; }
.sheet:has(> .mqp) > .grip, .sheet:has(> .mqp) > .sh-x, .sheet:has(> .mqc) > .grip, .sheet:has(> .mqc) > .sh-x { display: none; }

/* ---------- プレミアムの画面：シートを全画面に（下からすべって入る） ---------- */
.sheet:has(> .mqp) { left: 0; right: 0; top: 0; bottom: 0; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0;
  background: #0A0B0E; box-shadow: none; overflow: hidden; }
.sheet-bg:has(~ .sheet > .mqp) { background: rgba(0,0,0,.6); }
/* 見出しの位置：852 の高さで上から 290（手本）。低い画面は上へ、高い画面は絵を大きく */
.mqp { --mqp-top: max(calc(var(--sat) + 52px), calc(100vh - 640px)); position: absolute; inset: 0; background: #0A0B0E; }
@supports (height: 100dvh) { .mqp { --mqp-top: max(calc(var(--sat) + 52px), calc(100dvh - 640px)); } }
.mqp-sc { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.mqp-hero { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--mqp-top) + 180px); overflow: hidden; background: #0A0B0E; pointer-events: none; }
.mqp-hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: brightness(.72) saturate(.92); -webkit-user-select: none; user-select: none; }
.mqp-hero::after { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: -1px;
  background: linear-gradient(180deg, rgba(10,11,14,.55) 0, rgba(10,11,14,0) 22%, rgba(10,11,14,0) 42%, rgba(10,11,14,.82) 80%, #0A0B0E 100%); }
.mqp-in { position: relative; z-index: 1; flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; max-width: 480px; margin: 0 auto;
  padding: var(--mqp-top) 24px max(16px, calc(var(--sab) - 4px)); }
.mqp-k { font-size: 13px; line-height: 1; font-weight: 800; letter-spacing: .06em; color: var(--mqp-g); }
.mqp-h { margin: 8px 0 0; font-size: 30px; line-height: 1.2; font-weight: 900; letter-spacing: -.01em; color: #fff; white-space: nowrap; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
/* 丸い記号・名前・ひとこと（手本は3つ → 4つ。列は左右 8px まで広げる） */
.mqp-cols { margin: 34px -16px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.mqp-c { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.mqp-o { flex: none; width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--mqp-g);
  background: radial-gradient(circle at 50% 32%, rgba(255,212,106,.24), rgba(230,195,92,.07) 72%);
  box-shadow: inset 0 0 0 1px rgba(255,212,106,.5), 0 12px 28px -14px rgba(230,195,92,.7); }
.mqp-o svg { display: block; }
.mqp-c b { margin-top: 13px; font-size: 15px; line-height: 1.3; font-weight: 800; color: #fff; white-space: nowrap; }
.mqp-c small { margin-top: 5px; font-size: 11.5px; line-height: 1.5; font-weight: 600; color: rgba(255,255,255,.55); word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
/* 96回目①A：「AI に聞く」を上の広いカード＋下に4つを2×2 */
.mqp-ai { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,212,106,.2), rgba(227,179,92,.06));
  box-shadow: inset 0 0 0 1px rgba(255,212,106,.55), 0 12px 26px -14px rgba(230,195,92,.55); }
.mqp-ai > div { flex: 1; min-width: 0; }
.mqp-ai b { display: block; font-size: 15px; font-weight: 800; color: var(--mqp-g); line-height: 1.3; }
.mqp-ai small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; font-weight: 600; color: rgba(255,255,255,.84); }
.mqp-cols2 { margin-top: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mqp-c2 { min-width: 0; padding: 11px 12px; border-radius: 16px; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  background: rgba(22,24,30,.76); box-shadow: inset 0 0 0 .7px rgba(255,255,255,.14); }
.mqp-c2 b { margin-top: 7px; font-size: 13.5px; line-height: 1.3; font-weight: 800; color: #fff; }
.mqp-c2 small { margin-top: 2px; font-size: 11px; line-height: 1.4; font-weight: 600; color: rgba(255,255,255,.6); word-break: keep-all; overflow-wrap: anywhere; }
.mqp-o.sm { width: 34px; height: 34px; color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 .7px rgba(255,255,255,.22); }
.mqp-o.gold { width: 38px; height: 38px; color: var(--mqp-g); background: rgba(255,212,106,.18); box-shadow: inset 0 0 0 .9px rgba(255,212,106,.62); }
/* 下：値段・金のボタン・購入を復元 */
.mqp-sp { flex: 1 1 12px; min-height: 12px; }
.mqp-dock { text-align: center; }
.mqp-pr { display: flex; align-items: baseline; justify-content: center; gap: 6px; color: #fff; }
.mqp-pr span { font-size: 16px; line-height: 1; font-weight: 700; }
.mqp-pr b { font-family: var(--num); font-size: 21px; line-height: 1; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.mqp-pn { margin-top: 9px; font-size: 12.5px; line-height: 1; font-weight: 600; color: rgba(255,255,255,.5); }
.mqp-buy { display: flex; align-items: center; justify-content: center; width: 100%; height: 54px; margin-top: 14px; border-radius: 27px;
  font-size: 16px; font-weight: 800; letter-spacing: .02em; color: var(--mqp-ink); background: linear-gradient(180deg, var(--mqp-g), var(--mqp-g2));
  box-shadow: 0 10px 26px -12px rgba(230,195,92,.75); }
.mqp-sub { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin-top: 4px; font-size: 15px; font-weight: 700; color: rgba(255,255,255,.78); }
.mqp-buy:active:not(:disabled), .mqp-sub:active:not(:disabled) { transform: scale(.98); }
.mqp-buy:disabled, .mqp-sub:disabled { opacity: .55; cursor: default; }
/* すでに買った人：押せない金のふちの札 */
.mqp-own { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 27px; font-size: 16px; font-weight: 800; letter-spacing: .02em;
  color: var(--mqp-g); background: rgba(255,212,106,.1); box-shadow: inset 0 0 0 1px rgba(255,212,106,.45); }
.mqp-own span { display: flex; }
.mqp.is-pro .mqp-pn { margin-top: 12px; }
.mqp-x { position: absolute; left: 16px; top: calc(var(--sat) + 8px); z-index: 3; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(18,20,25,.58); -webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.14); }
.mqp-x svg { display: block; }
.mqp-x:active { transform: scale(.94); }

/* ---------- 買ったすぐあと：真ん中のカード（後ろの画面はぼかして暗く） ---------- */
.sheet:has(> .mqc) { left: 22px; right: 22px; top: 50%; bottom: auto; max-width: 400px; max-height: calc(100vh - var(--sat) - var(--sab) - 24px);
  padding: 30px 22px 22px; border-radius: 30px; background: linear-gradient(180deg, rgba(46,40,26,.97), rgba(22,21,18,.97));
  box-shadow: inset 0 0 0 1px rgba(255,212,106,.32), 0 30px 60px -20px rgba(0,0,0,.8);
  transform: translateY(-50%) scale(.92); opacity: 0; transition: transform .32s cubic-bezier(.2,.9,.3,1.12), opacity .2s ease; }
.sheet.on:has(> .mqc) { transform: translateY(-50%); opacity: 1; }
.sheet-bg:has(~ .sheet > .mqc) { background: rgba(5,6,8,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mqc-seal { width: 66px; height: 66px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--mqp-ink);
  background: linear-gradient(180deg, var(--mqp-g), var(--mqp-g2)); box-shadow: 0 0 0 6px rgba(255,212,106,.14), 0 0 34px rgba(255,212,106,.5); }
.mqc-seal svg { display: block; }
.mqc-t { margin-top: 18px; text-align: center; font-size: 23px; line-height: 1.3; font-weight: 900; letter-spacing: .02em; color: #fff; }
.mqc-s { margin-top: 7px; text-align: center; font-size: 13.5px; line-height: 1.4; font-weight: 600; color: var(--mqp-sub); }
.mqc-list { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--mqp-ln); }
.mqc-r { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.mqc-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--mqp-g);
  background: rgba(255,212,106,.08); box-shadow: inset 0 0 0 .5px rgba(255,212,106,.42); }
.mqc-ic svg { display: block; }
.mqc-r > div { flex: 1; min-width: 0; line-height: 1.25; }
.mqc-r b { display: block; font-size: 15px; font-weight: 800; color: #fff; }
.mqc-r small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; font-weight: 500; color: var(--mqp-sub); word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
.mqc-go { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; margin-top: 16px; border-radius: 26px;
  font-size: 17px; font-weight: 800; letter-spacing: .02em; color: var(--mqp-ink); background: linear-gradient(180deg, var(--mqp-g), var(--mqp-g2)); }
.mqc-go:active { transform: scale(.98); }
