/* ============================================================
   共通の 見た目（ゲームごとの 色は theme.css の --変数で 変える）
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--bg2); color: var(--ink); overscroll-behavior: none; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; user-select: text; -webkit-user-select: text; }
#app {
  position: relative; max-width: 520px; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden; box-shadow: 0 0 40px rgba(0,0,0,.25);
}
.dim { color: var(--dim); font-size: .85em; }
.center { text-align: center; }
.big { font-size: 1.15em; font-weight: 700; }
.err { color: #e0334a; min-height: 1.2em; font-size: .9em; margin: 4px 0; }
.ico { font-style: normal; display: inline-block; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 6px; font-size: .85em; }

/* ---- ボタン ---- */
.btn {
  border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; background: var(--btn); color: var(--ink);
  box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .06s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn.pri { background: linear-gradient(180deg, var(--pri1), var(--pri2)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.big { font-size: 1.25em; padding: 14px 40px; border-radius: 16px; }
.btn.small { padding: 6px 10px; font-size: .85em; border-radius: 9px; }
.btn.wide { display: block; width: 100%; margin: 6px 0; }
.btn.danger { background: #e0334a; color: #fff; }
.btn:disabled { opacity: .45; filter: grayscale(.6); }
.btn.glow { animation: glow 1.6s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 18px var(--pri1), 0 3px 0 rgba(0,0,0,.2); } }

/* ---- タイトル ---- */
#title { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 20px 16px 18px; overflow: hidden; background: var(--title-bg); }
.tart { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.tart { overflow: hidden; }
.tart img { height: 58%; margin: 0 -34%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); animation: bob 3s ease-in-out infinite; }
.tart img:nth-child(2) { height: 70%; z-index: 2; animation-delay: -.8s; }
.tart img:nth-child(3) { animation-delay: -1.6s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.tlogo { position: absolute; top: 8%; left: 0; right: 0; text-align: center; z-index: 3; }
.tlogo small { display: inline-block; background: var(--pri2); color: #fff; padding: 3px 12px; border-radius: 99px; font-weight: 700; letter-spacing: .1em; }
.tlogo h1 { margin: 8px 0 0; font-size: clamp(44px, 14vw, 70px); line-height: 1; color: #fff; letter-spacing: .04em; -webkit-text-stroke: 2px var(--logo-stroke); text-shadow: 0 5px 0 var(--logo-stroke), 0 10px 20px rgba(0,0,0,.35); transform: rotate(-3deg); }
.tsub { margin-top: 12px; color: #fff; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.tbtns { position: relative; z-index: 4; display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.tbtns .btn:not(.big) { background: rgba(255,255,255,.9); }
.tstatus { position: relative; z-index: 4; margin-top: 10px; font-size: .78em; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.tfoot { position: relative; z-index: 4; margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: .72em; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.testmark { background: #ffe14d; color: #5a4300; padding: 2px 8px; border-radius: 6px; text-shadow: none; font-weight: 700; }

/* ---- 上の帯 ---- */
#top { position: relative; z-index: 5; display: flex; gap: 6px; align-items: center; padding: max(6px, env(safe-area-inset-top)) 8px 15px; background: var(--bar); color: #fff; font-size: 13px; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; cursor: pointer; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { opacity: .75; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res { position: relative; display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.3); border-radius: 99px; padding: 3px 9px 3px 4px; white-space: nowrap; }
.res .ico { width: 20px; height: 20px; display: grid; place-items: center; }
.res .ico svg, .ico svg { width: 100%; height: 100%; }
.res em.plus { font-style: normal; background: var(--pri1); width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 12px; margin-left: 2px; }
.res.stam span { font-size: 12px; }
.res .timer { position: absolute; top: 100%; left: 0; right: 0; margin-top: 1px; text-align: center; font-size: 9px; line-height: 11px; opacity: .9; white-space: nowrap; }
.res.gem, .res.stam { cursor: pointer; }

/* ---- 下のタブ ---- */
#view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
#nav { display: flex; background: var(--bar); padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; flex: 1; background: none; border: 0; color: rgba(255,255,255,.7); padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 700; }
.tab i { font-style: normal; font-size: 20px; filter: grayscale(.4); }
.tab.on { color: #fff; background: rgba(255,255,255,.12); }
.tab.on i { filter: none; transform: scale(1.12); }
.dot { position: absolute; top: 2px; right: 16%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #ff3550; color: #fff; font-size: 10px; font-style: normal; display: none; place-items: center; font-weight: 900; }
.dot.on { display: grid; animation: pop 1.2s infinite; }
@keyframes pop { 50% { transform: scale(1.18); } }

/* ---- カード ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; padding: 6px; }
.card {
  position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: linear-gradient(160deg, #e9eef6, #b9c4d4); border: 3px solid #8b97aa; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.card .cimg { position: absolute; inset: -3% -62% -78%; background-size: cover; background-position: 50% 8%; }
.card .crar { position: absolute; top: 2px; left: 3px; font-weight: 900; font-size: 12px; color: #fff; -webkit-text-stroke: .5px rgba(0,0,0,.6); text-shadow: 0 1px 2px rgba(0,0,0,.6); font-style: italic; }
.card .ctype { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 900; border: 1.5px solid #fff; }
.card .cname { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 3px 2px; font-size: 11px; font-weight: 800; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cstar { position: absolute; bottom: 17px; left: 0; right: 0; text-align: center; color: #ffd84a; font-size: 9px; letter-spacing: -1px; text-shadow: 0 0 2px #000; }
.card .clv { position: absolute; top: 20px; left: 3px; font-size: 9px; background: rgba(0,0,0,.55); color: #fff; padding: 0 4px; border-radius: 4px; }
.card .ctag { position: absolute; top: 40%; left: -2px; right: -2px; text-align: center; background: #ff3550; color: #fff; font-weight: 900; font-size: 12px; transform: rotate(-12deg); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.card.none { filter: grayscale(1) brightness(.6); }
.card.small { border-width: 2px; }
.r-SR.card { background: linear-gradient(160deg, #f3e6ff, #b18be0); border-color: #9a64d8; }
.r-SSR.card { background: linear-gradient(160deg, #fff6d2, #f2b632); border-color: #e3a51c; box-shadow: 0 0 8px rgba(255,190,40,.7); }
.r-UR.card { background: linear-gradient(160deg, #ffd6f2, #c7e9ff, #fff6b8, #d8ffd6); border-color: transparent; border-image: linear-gradient(135deg, #ff5f8f, #ffd23f, #4be38a, #4ab2ff, #b46bff) 1; box-shadow: 0 0 10px rgba(200,120,255,.8); }
.r-UR.card::after, .r-SSR.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); background-size: 250% 100%; animation: shine 2.6s infinite; pointer-events: none; }
@keyframes shine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
.rt { display: inline-block; padding: 1px 6px; border-radius: 6px; margin: 2px; font-size: 11px; font-weight: 800; color: #fff; background: #8b97aa; }
.rt.r-SR { background: #9a64d8; } .rt.r-SSR { background: #e3a51c; } .rt.r-UR { background: linear-gradient(90deg, #ff5f8f, #ffb03f, #4ab2ff, #b46bff); }

.cdetail { display: flex; gap: 12px; }
.cbig { position: relative; flex: 0 0 44%; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, #e9eef6, #b9c4d4); border: 3px solid #8b97aa; }
.cbig img { display: block; width: 100%; }
.cbig.r-SR { background: linear-gradient(160deg, #f3e6ff, #b18be0); border-color: #9a64d8; }
.cbig.r-SSR { background: linear-gradient(160deg, #fff6d2, #f2b632); border-color: #e3a51c; }
.cbig.r-UR { background: linear-gradient(160deg, #ffd6f2, #c7e9ff, #fff6b8); border-color: #c77dff; }
.cbig .crar { position: absolute; top: 4px; left: 6px; font-weight: 900; font-size: 20px; color: #fff; font-style: italic; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.cinfo { flex: 1; min-width: 0; font-size: .92em; }
.cinfo p { margin: 4px 0 8px; }
.quote { font-weight: 700; color: var(--accent); }
.stat { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: .9em; }
.stat b { color: var(--accent); }

/* ---- ダイアログ・トースト ---- */
.mwrap { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,25,.55); display: flex; align-items: center; justify-content: center; padding: 14px; animation: fade .15s; }
.mwrap.out { opacity: 0; transition: opacity .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; max-height: 88dvh; display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.4); animation: zoom .2s; }
.modal.wide { max-width: 490px; }
@keyframes zoom { from { transform: scale(.85); opacity: 0; } }
.mhead { display: flex; align-items: center; padding: 11px 14px; background: linear-gradient(180deg, var(--pri1), var(--pri2)); color: #fff; }
.mhead b { flex: 1; font-size: 1.05em; }
.mhead .x { background: rgba(255,255,255,.25); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; }
.mbody { padding: 12px 14px; overflow-y: auto; }
.mfoot { display: flex; gap: 8px; padding: 10px 14px 14px; justify-content: center; flex-wrap: wrap; }
.mfoot .btn { flex: 1; min-width: 100px; }
.modal.pitch .mhead { background: linear-gradient(90deg, #ff3f6c, #ff9a2e); }
.modal.pitch .buy { animation: glow 1.4s infinite; }
#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(20,20,40,.88); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: .9em; font-weight: 700; animation: fade .2s; max-width: 90vw; text-align: center; }
.toast.gold { background: linear-gradient(90deg, #e3a51c, #ff8a2e); }
.toast.bad { background: #e0334a; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .4s; }
.busy { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; font-weight: 700; }
.note { background: #fff6d8; border: 1px solid #f0d27a; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: .88em; display: flex; gap: 8px; align-items: center; justify-content: space-between; }

/* ---- ガチャ画面 ---- */
.btabs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.btab { position: relative; flex: 0 0 auto; border: 0; border-radius: 10px; padding: 8px 12px; background: var(--btn); font-weight: 700; font-size: .85em; }
.btab.on { background: var(--pri2); color: #fff; }
.btab em { font-style: normal; background: #ff3550; color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 4px; margin-right: 4px; }
.banner { position: relative; margin: 0 8px; border-radius: 16px; overflow: hidden; min-height: 250px; background: var(--banner-bg); color: #fff; }
.banner.bg-limited { background: radial-gradient(circle at 70% 40%, #ffe27a, #ff6b3d 45%, #7a1b5a); }
.banner.bg-paid { background: radial-gradient(circle at 70% 40%, #fff, #c7a6ff 40%, #3a1a7a); }
.bpick { position: absolute; right: -6%; bottom: 0; top: 0; width: 70%; }
.bpick img { position: absolute; bottom: -2%; height: 108%; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.bpick .bp0 { right: 10%; z-index: 3; } .bpick .bp1 { right: 42%; height: 88%; z-index: 2; } .bpick .bp2 { right: -14%; height: 84%; z-index: 1; }
.btext { position: relative; z-index: 5; width: 58%; padding: 14px; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.btext h2 { margin: 4px 0; font-size: 1.35em; line-height: 1.15; }
.btext p { margin: 4px 0; font-size: .82em; }
.limtag { background: #ff3550; padding: 2px 8px; border-radius: 6px; font-weight: 900; font-size: .8em; text-shadow: none; }
.until { color: #fff36b; font-weight: 800; font-size: .85em; }
.gbtns { display: flex; gap: 8px; padding: 10px 8px 4px; flex-wrap: wrap; }
.gbtn { flex: 1; min-width: 120px; border: 0; border-radius: 14px; padding: 10px 6px; background: linear-gradient(180deg, #5b9dff, #2a5fd6); color: #fff; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 0 #1b3f94; position: relative; }
.gbtn b { font-size: 1.2em; } .gbtn small { font-size: .85em; display: flex; gap: 3px; align-items: center; }
.gbtn small .ico { width: 16px; height: 16px; }
.gbtn em { font-style: normal; font-size: 10px; background: #ffd23f; color: #6a4500; border-radius: 6px; padding: 0 5px; margin-top: 2px; font-weight: 800; }
.gbtn.ten { background: linear-gradient(180deg, #ff8a3d, #e5452a); box-shadow: 0 4px 0 #9c2a16; }
.gbtn.free { background: linear-gradient(180deg, #4be38a, #17a85a); box-shadow: 0 4px 0 #0f6e3b; animation: pop 1.2s infinite; }
.gbtn.ticket { background: linear-gradient(180deg, #ffd23f, #e3a51c); color: #5a3a00; box-shadow: 0 4px 0 #9c6e0a; }
.gbtn:disabled { opacity: .5; }
.pity { margin: 6px 10px; font-size: .78em; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pbar, .mbar { flex: 1 1 100%; height: 8px; background: rgba(0,0,0,.12); border-radius: 99px; overflow: hidden; }
.pbar i, .mbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff7a2e); }
.glinks { display: flex; justify-content: center; gap: 16px; }
.pickrow h3 { margin: 6px 10px 0; font-size: .95em; }

/* ---- ガチャ演出（入れもの） ---- */
#gacha { position: fixed; inset: 0; z-index: 70; background: radial-gradient(circle at 50% 45%, #2a2a5a, #07071a 70%); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; }
#gacha.out { opacity: 0; transition: opacity .2s; }
#gacha.flash::before { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .5s forwards; z-index: 5; pointer-events: none; }
#gacha.gold { background: radial-gradient(circle at 50% 45%, #7a5a10, #1a1000 70%); }
#gacha.rain { background: radial-gradient(circle at 50% 45%, #6a2a8a, #0a0a2a 70%); }
@keyframes flash { to { opacity: 0; } }
.gstage { position: relative; width: 100%; max-width: 520px; height: 100%; display: flex; align-items: center; justify-content: center; }
.gskip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 9; background: rgba(255,255,255,.18); border: 0; color: #fff; padding: 8px 14px; border-radius: 99px; font-weight: 700; }
.ghint { position: absolute; bottom: 18%; font-size: .9em; opacity: .7; animation: pop 1.2s infinite; }
.gobj { position: relative; width: 190px; height: 140px; animation: drop .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes drop { from { transform: translateY(-120vh) rotate(-20deg); } }
.gobj .body { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; font-size: 30px; font-weight: 900; letter-spacing: .3em; color: rgba(0,0,0,.55); animation: shake .9s infinite; z-index: 2; }
@keyframes shake { 10%, 30% { transform: rotate(-4deg); } 20%, 40% { transform: rotate(4deg); } 50% { transform: none; } }
.gobj .glow { position: absolute; inset: -60px; border-radius: 50%; filter: blur(22px); opacity: .9; z-index: 1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .6; } }
.gobj .rays { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px; background: repeating-conic-gradient(rgba(255,255,255,.18) 0 8deg, transparent 8deg 22deg); animation: spin 8s linear infinite; z-index: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.c-silver .body { background: linear-gradient(135deg, #f2f4f8, #aab4c4); } .c-silver .glow { background: #9fc3ff; }
.c-gold .body { background: linear-gradient(135deg, #fff3b0, #f2b632 55%, #c8860a); } .c-gold .glow { background: #ffcc33; }
.c-rainbow .body { background: linear-gradient(135deg, #ff7ab0, #ffd23f, #4be38a, #4ab2ff, #b46bff); background-size: 300% 300%; animation: shake .9s infinite, hue 1.5s linear infinite; }
.c-rainbow .glow { background: conic-gradient(#ff5f8f, #ffd23f, #4be38a, #4ab2ff, #b46bff, #ff5f8f); }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.gobj.up { animation: upg .6s; } @keyframes upg { 40% { transform: scale(1.35); } }
.gobj.open .body { transform: scale(1.6); opacity: 0; transition: .45s; }
.gstage > .card.flip { width: 46%; max-width: 220px; animation: flip .45s; }
@keyframes flip { from { transform: rotateY(90deg) scale(.7); } }
.gshow { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gshow .rays { position: absolute; left: 50%; top: 45%; width: 1200px; height: 1200px; margin: -600px; background: repeating-conic-gradient(rgba(255,220,120,.25) 0 6deg, transparent 6deg 18deg); animation: spin 10s linear infinite; }
.gshow.r-UR .rays { background: repeating-conic-gradient(rgba(255,120,200,.3) 0 6deg, rgba(120,200,255,.25) 6deg 12deg, transparent 12deg 18deg); }
.gshow img { position: relative; height: 62%; filter: drop-shadow(0 0 24px rgba(255,220,120,.9)); animation: come .7s cubic-bezier(.2,1.4,.4,1); }
.gshow.r-UR img { filter: drop-shadow(0 0 26px rgba(255,140,255,.95)); }
@keyframes come { from { transform: scale(.2) translateY(40%); opacity: 0; } }
.gname { position: relative; text-align: center; animation: fade .6s .3s both; }
.gname em { display: block; font-size: 42px; font-weight: 900; font-style: italic; color: #ffd23f; text-shadow: 0 0 12px #ff8a00; }
.gshow.r-UR .gname em { background: linear-gradient(90deg, #ff5f8f, #ffd23f, #4be38a, #4ab2ff, #b46bff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.gname small { display: block; opacity: .85; } .gname b { font-size: 28px; }
.gquote { position: relative; margin-top: 8px; padding: 6px 14px; background: rgba(0,0,0,.45); border-radius: 12px; font-weight: 700; animation: fade .6s .6s both; }
.gnew { position: relative; color: #ff5f8f; font-weight: 900; font-size: 22px; margin-top: 6px; }
.gsum { width: 100%; padding: 16px; text-align: center; animation: fade .3s; max-height: 100%; overflow-y: auto; }
.gsum h2 { margin: 4px 0 10px; }
.gresult { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gresult.one { grid-template-columns: 1fr; width: 50%; margin: 0 auto; }
.gresult .card { animation: flip .35s both; }
.gbtns2 { display: flex; gap: 10px; margin-top: 14px; }
.gbtns2 .btn { flex: 1; }

/* ---- ショップ ---- */
.testbar { background: #ffe14d; color: #5a4300; font-weight: 700; font-size: .82em; text-align: center; padding: 6px; border-radius: 8px; margin: 8px; }
.shead { margin: 14px 10px 6px; font-size: 1em; display: flex; align-items: center; gap: 6px; }
.shead::before { content: ""; width: 5px; height: 18px; border-radius: 3px; background: var(--pri1); }
.plist { display: grid; gap: 8px; padding: 0 8px; }
.plist.gems { grid-template-columns: repeat(3, 1fr); }
.prod { position: relative; background: var(--panel); border-radius: 14px; padding: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12); cursor: pointer; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.prod.sold { opacity: .55; cursor: default; }
.prod.k-pack, .prod.k-sub, .prod.k-pass { background: linear-gradient(135deg, #fff, #fff4dc); border: 2px solid #ffc94a; }
.prod.k-sub { background: linear-gradient(135deg, #fff, #e3f6ff); border-color: #5ab8ff; }
.prod.k-pass { background: linear-gradient(135deg, #fff, #f3e6ff); border-color: #b47cff; }
.ribbon { position: absolute; top: 8px; right: -30px; transform: rotate(35deg); background: #ff3550; color: #fff; font-style: normal; font-weight: 900; font-size: 10px; padding: 2px 32px; z-index: 2; }
.gemstack { display: flex; flex-direction: column; align-items: center; padding: 4px 0; }
.ico.big { width: 40px; height: 40px; }
.gemstack b { font-size: 1.2em; }
.pname { font-weight: 800; font-size: .95em; }
.pdesc { font-size: .78em; color: var(--dim); }
.prod .btn.price { margin-top: auto; width: 100%; padding: 8px; }
.prod.k-gems { align-items: center; text-align: center; }
.packart { display: flex; justify-content: center; height: 110px; overflow: hidden; }
.packart img { height: 190%; margin: 0 -34px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.contents { margin: 4px 0; padding-left: 18px; font-size: .88em; }
.contents.small { font-size: .78em; }
.contents li::marker { color: var(--pri1); }
.value { color: #e0334a; font-weight: 900; font-size: .9em; }
.prod .until { color: #e0334a; }
.owned { color: #17a85a; font-weight: 800; font-size: .85em; }
.prod.trade { flex-direction: row; align-items: center; gap: 8px; }
.prod.trade .pname { flex: 1; } .prod.trade .pdesc { flex: 2; }
.shopfoot { display: flex; flex-direction: column; align-items: center; padding: 14px; }

/* ---- メニュー・ミッション・ログボ・パス ---- */
.menu { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.mrow { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: var(--panel); border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.mrow i { font-style: normal; font-size: 22px; }
.mrow span { display: flex; flex-direction: column; } .mrow small { color: var(--dim); font-size: .78em; }
.mrow .dot { position: static; margin-left: auto; }
.mis { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.mis .mtext { grid-column: 1 / 2; display: flex; flex-direction: column; } .mis .mtext small { color: var(--dim); font-size: .75em; }
.mis .mbar { grid-column: 1 / 2; } .mis .mnum { font-size: .8em; }
.mis .btn { grid-row: 1 / 3; grid-column: 3; }
.mis.got { opacity: .5; }
.lbgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.lb { background: var(--btn); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: .72em; display: flex; flex-direction: column; gap: 2px; }
.lb.got { opacity: .45; } .lb.today { background: linear-gradient(180deg, #ffd23f, #ff8a2e); color: #fff; animation: pop 1s infinite; opacity: 1; }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.phead div { display: flex; flex-direction: column; } .phead small { color: var(--dim); font-size: .78em; }
.pcols, .prow { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 6px; align-items: stretch; }
.pcols { text-align: center; font-size: .85em; margin-top: 8px; } .pcols .gold { color: #b47cff; }
.prows { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; max-height: 48dvh; overflow-y: auto; }
.plv { display: grid; place-items: center; font-weight: 900; font-size: .8em; background: var(--btn); border-radius: 8px; }
.prow.on .plv { background: var(--pri1); color: #fff; }
.pcell { border: 0; border-radius: 8px; background: var(--btn); font-size: .72em; padding: 6px 4px; display: flex; align-items: center; gap: 4px; justify-content: center; min-height: 40px; }
.pcell img { height: 34px; }
.pcell.ready { background: linear-gradient(180deg, #ffd23f, #ff8a2e); color: #fff; font-weight: 800; animation: pop 1.2s infinite; }
.pcell.got { opacity: .4; } .pcell.lock { filter: grayscale(.4); opacity: .75; }
.pcell.lock::after { content: "🔒"; }

/* ---- ランキング・アカウント・ホームの横ボタン ---- */
table.rank, table.rates, table.hist { width: 100%; border-collapse: collapse; font-size: .88em; }
table.rank td, table.rates td, table.hist td, table.rates th { padding: 5px 6px; border-bottom: 1px solid rgba(0,0,0,.07); }
table.rates .hd th { text-align: left; background: var(--btn); }
.rank .rk { width: 40px; text-align: center; font-weight: 900; } .rank .sc { text-align: right; font-weight: 800; }
.rank tr.me { background: #fff3c4; }
.rtiers { margin-top: 10px; font-size: .8em; background: var(--btn); border-radius: 10px; padding: 8px; }
.rtiers div { display: flex; justify-content: space-between; padding: 2px 0; }
.atabs { display: flex; gap: 6px; margin-bottom: 10px; }
.atab { flex: 1; border: 0; padding: 9px; border-radius: 10px; background: var(--btn); font-weight: 700; }
.atab.on { background: var(--pri2); color: #fff; }
.auth label, .form label { display: flex; flex-direction: column; gap: 3px; font-size: .85em; font-weight: 700; margin-bottom: 8px; }
.auth input, .form input { padding: 10px; border-radius: 10px; border: 2px solid #d6dbe6; font-size: 16px; }
.auth small { font-weight: 400; color: var(--dim); }
details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.form .btn { margin: 2px 4px 10px 0; }
.savecmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.savecmp > div { background: var(--btn); border-radius: 10px; padding: 8px; font-size: .85em; }
.side { position: absolute; right: 6px; top: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.sidebtn { position: relative; width: 54px; border: 0; border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: 0 2px 5px rgba(0,0,0,.25); padding: 5px 0 3px; display: flex; flex-direction: column; align-items: center; font-size: 9px; font-weight: 800; }
.sidebtn i { font-style: normal; font-size: 20px; }
.sidebtn .dot { top: -4px; right: -4px; }
.sidebtn[data-k=sale] { background: linear-gradient(180deg, #ff6b8a, #ff3550); color: #fff; animation: pop 1.6s infinite; }
.card.food .cimg { inset: -6% -24% -6%; background-size: cover; background-position: 50% 52%; }

/* ============================================================
   デザインの 決まり（2026-10-19 見直し）
   ・フォントは 丸ゴシック 1種類（Zen Maru Gothic）
   ・文字の 大きさは 5段階だけ：xs 11 / s 12.5 / m 14 / l 17 / xl 22（px）
   ・太さは 500（ふつう）/ 700（強調）/ 800（見出し・数字）
   ・色は 本文 --ink・補足 --dim・強調 --accent・注意 --warn・お得 --deal の 5つ
   ここより 上の 古い 指定は ここで 上書きする
   ============================================================ */
:root {
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --fs-xs: 11px; --fs-s: 12.5px; --fs-m: 14px; --fs-l: 17px; --fs-xl: 22px;
  --lh: 1.5;
  --warn: #d6334a; --deal: #e0602a;
  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --line: rgba(0,0,0,.08);
}
body, button, input { font-family: var(--font); }
body { font-size: var(--fs-m); line-height: var(--lh); font-weight: 500; letter-spacing: .02em; }
b, strong, h1, h2, h3 { font-weight: 700; }
h2 { font-size: var(--fs-l); line-height: 1.35; }
h3 { font-size: var(--fs-m); }
p { margin: 6px 0; }
.dim { font-size: var(--fs-s); color: var(--dim); }
.big { font-size: var(--fs-l); font-weight: 700; line-height: 1.4; }
.err { font-size: var(--fs-s); color: var(--warn); }
.link { font-size: var(--fs-s); }
.btn { font-weight: 700; font-size: var(--fs-m); line-height: 1.3; }
.btn.small { font-size: var(--fs-s); }
.btn.big { font-size: var(--fs-l); }

/* ---- 上の帯（2段） ---- */
#top { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: max(6px, env(safe-area-inset-top)) 10px 8px; font-size: var(--fs-s); }
.toprow { display: flex; align-items: center; gap: 8px; min-height: 26px; }
#top .who { flex: 1; min-width: 0; display: block; font-size: var(--fs-m); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
#top .login { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); color: #fff; border-radius: 99px; padding: 2px 12px; font-size: var(--fs-s); font-weight: 700; line-height: 1.6; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top .login.on { border-color: transparent; background: rgba(0,0,0,.25); }
.resrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#top .res { position: static; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 5px; border-radius: var(--r-m); background: rgba(0,0,0,.28); min-width: 0; white-space: normal; }
#top .res .ico { width: 22px; height: 22px; flex: 0 0 auto; }
#top .res .rv { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
#top .res .rv b { font-size: var(--fs-m); font-weight: 800; white-space: nowrap; }
#top .res .rv small { position: static; font-size: var(--fs-xs); opacity: .8; white-space: nowrap; margin: 0; text-align: left; line-height: 1.3; }
#top .res em.plus { width: 18px; height: 18px; flex: 0 0 auto; font-size: var(--fs-s); font-weight: 800; margin: 0; }

/* ---- 下のタブ ---- */
.tab { font-size: var(--fs-xs); font-weight: 700; gap: 2px; }
.dot { font-size: var(--fs-xs); font-weight: 700; min-width: 17px; height: 17px; }

/* ---- カード ---- */
.card .crar { font-size: var(--fs-s); font-weight: 800; }
.card .cname { font-size: var(--fs-xs); font-weight: 700; padding-top: 12px; }
.card .cstar { font-size: 10px; letter-spacing: 0; }
.card .clv, .card .ctype { font-size: 10px; font-weight: 700; }
.card .ctag { font-size: var(--fs-xs); font-weight: 800; }

/* ---- ダイアログ ---- */
.mhead b { font-size: var(--fs-l); font-weight: 800; line-height: 1.35; }
.mbody { font-size: var(--fs-m); line-height: var(--lh); padding: 14px 16px; }
.mfoot { gap: 10px; padding: 4px 16px 16px; }
.toast { font-size: var(--fs-s); font-weight: 700; }

/* ---- 中身の 一覧（品名 … 数） ---- */
ul.contents { list-style: none; margin: 8px 0; padding: 0; border-radius: var(--r-m); background: rgba(0,0,0,.035); overflow: hidden; font-size: var(--fs-m); }
ul.contents li { margin: 0; }
ul.contents li.crow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line); line-height: 1.4; }
ul.contents li.crow:first-child { border-top: 0; }
ul.contents li.crow span { color: var(--ink); min-width: 0; }
ul.contents li.crow b { color: var(--accent); font-weight: 800; white-space: nowrap; }
ul.contents li.crow.perk span::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 6px; }
ul.contents li::marker { content: none; }
ul.contents.small { font-size: var(--fs-s); }
ul.contents.small li.crow { padding: 5px 10px; }

/* ---- おすすめパック（ポップアップ） ---- */
.modal.pitch .mbody { text-align: center; }
.modal.pitch .mbody > p.center.big { margin: 10px 0 4px; font-size: var(--fs-l); }
.modal.pitch ul.contents { text-align: left; }
.modal.pitch .until, .prod .until { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: rgba(214,51,74,.1); color: var(--warn); font-size: var(--fs-s); font-weight: 700; }
.modal.pitch .value, .prod .value { color: var(--deal); font-size: var(--fs-m); font-weight: 800; }

/* ---- ショップ ---- */
.shead { font-size: var(--fs-m); font-weight: 800; margin: 18px 12px 8px; }
.plist { gap: 10px; padding: 0 10px; }
.prod { padding: 12px; gap: 6px; border-radius: var(--r-l); }
.prod .pname { font-size: var(--fs-m); font-weight: 800; line-height: 1.35; }
.prod .pdesc { font-size: var(--fs-s); line-height: 1.45; }
.prod .owned { font-size: var(--fs-s); }
.prod.k-gems .pname { font-size: var(--fs-s); }
.gemstack b { font-size: var(--fs-l); font-weight: 800; }
.ribbon { font-size: 10px; font-weight: 800; }
.testbar { font-size: var(--fs-s); }

/* ---- メニュー・ミッション・パス・ランキング ---- */
.mrow b { font-size: var(--fs-m); } .mrow small { font-size: var(--fs-s); line-height: 1.35; }
.mis .mtext b { font-size: var(--fs-m); line-height: 1.35; } .mis .mtext small { font-size: var(--fs-xs); }
.mis .mnum { font-size: var(--fs-xs); }
.lb { font-size: var(--fs-xs); line-height: 1.35; padding: 7px 4px; }
.pcell { font-size: var(--fs-xs); line-height: 1.3; }
.plv { font-size: var(--fs-xs); }
.rtiers { font-size: var(--fs-s); }
table.rank, table.rates, table.hist { font-size: var(--fs-s); }
.sidebtn { font-size: 10px; font-weight: 700; width: 56px; }
.btab { font-size: var(--fs-s); }
.btext h2 { font-size: var(--fs-l); }
.btext p { font-size: var(--fs-s); line-height: 1.45; }
.gbtn b { font-size: var(--fs-l); font-weight: 800; }
.gbtn small { font-size: var(--fs-s); }
.gbtn em { font-size: var(--fs-xs); font-weight: 700; }
.pity { font-size: var(--fs-s); }

/* ---- ホームの 横の ボタン（せまい 画面でも 入るように） ---- */
.side { gap: 5px; top: 6px; right: 6px; }
.sidebtn { width: 50px; padding: 4px 0 3px; border-radius: 11px; line-height: 1.25; }
.sidebtn i { font-size: 18px; }
@media (max-width: 400px) { .sidebtn span { font-size: 9.5px; letter-spacing: 0; } .sidebtn { width: 46px; } .sidebtn i { font-size: 16px; } }

/* ---- キャラの くわしい 画面（せまい 画面では 上下に） ---- */
.cdetail { gap: 14px; }
.cinfo { font-size: var(--fs-m); line-height: var(--lh); }
.cinfo .quote { font-size: var(--fs-m); line-height: 1.55; }
.stat { gap: 4px 12px; font-size: var(--fs-s); align-items: baseline; }
.stat span { color: var(--dim); white-space: nowrap; }
@media (max-width: 460px) {
  .cdetail { flex-direction: column; align-items: center; }
  .cbig { flex: none; width: 58%; max-width: 230px; }
  .cinfo { width: 100%; }
}

/* ---- ガチャの 看板：文字の うしろを すこし 暗く ---- */
.btext { background: linear-gradient(90deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,.25) 70%, transparent 100%); border-radius: var(--r-l) 0 0 var(--r-l); min-height: 100%; }
.btext p { text-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* ---- タイトルの ロゴ：ことばごとに 行を わけ、長い 名前は 小さく ---- */
.tlogo h1 span { display: block; }
.tlogo h1 span + span { margin-top: 4px; font-size: .78em; }
.tlogo h1.long { font-size: clamp(36px, 11.5vw, 58px); }
.tlogo h1 { padding: 0 12px; }
.tsub { font-size: var(--fs-s); padding: 0 16px; }

/* ---- キャラの くわしい 画面は いつも 上下に ---- */
.cdetail { flex-direction: column; align-items: center; }
.cbig { flex: none; width: 52%; max-width: 220px; }
.cinfo { width: 100%; }
.tlogo h1 span { white-space: nowrap; }
.tlogo h1.long { font-size: clamp(32px, 10vw, 54px); }

/* ---- 改行は ことばの 区切り（空白・読点）だけで。ことばの 途中では 切らない ---- */
body { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
p, li, small, .pdesc, .sctext, .ptbubble span, .bubble, .saybox, .quote, .mtext, .btext p { text-wrap: pretty; }
h1, h2, h3, .mhead b, .pname, .shead, .big, .gname b { text-wrap: balance; }

/* 2026-10-19: full-height anime artwork, shared across all three games */
.card:not(.food) .cimg { inset: 0; background-size: 150% auto; background-position: 50% 0; background-repeat: no-repeat; }
.cbig img { object-fit: contain; }

/* 2026-10-19: ensemble title key visual */
#title .tart { pointer-events: none; }
#title .tart .title-keyvisual { position: absolute; top: 0; left: 0; width: 100%; height: auto; min-height: 70%; margin: 0; object-fit: cover; object-position: center top; filter: none; animation: none; }
#title .tart::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(8,14,30,.08) 43%, rgba(8,14,30,.65) 72%, rgba(8,14,30,.96) 100%); }
#title .tlogo { top: 46%; transform: translateY(-50%); }
#title .tlogo h1 { line-height: 1.05; text-shadow: 0 3px 0 var(--logo-stroke), 0 7px 18px rgba(0,0,0,.65); }
#title .tlogo small { box-shadow: 0 2px 12px rgba(0,0,0,.25); }
#title .tsub { text-shadow: 0 2px 5px #081020; }
#title .tbtns { max-width: 360px; }
#title .tbtns .btn { width: 100%; }
@media (max-height: 650px) { #title .tlogo { top: 33%; } #title .tlogo h1 { font-size: clamp(32px, 10vw, 44px); } #title .tsub { margin-top: 6px; } }

/* family title logo placement */
body[data-game="kazoku-gacha"] #title .tlogo { top: calc(min(100vw, 520px) * .60); }
@media (max-height: 650px) { body[data-game="kazoku-gacha"] #title .tlogo { top: 31%; } }
