/* ぽけっと討伐隊！ 共通スタイル（フォント：M PLUS Rounded 1c） */
:root {
  --ink: #6B4A3A;
  --ink2: #8A6A55;
  --cream: #FFF4E2;
  --font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #F6E7CF; }
body { font-family: var(--font); font-weight: 700; color: var(--ink); -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font-family: inherit; font-weight: 800; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- 画面の器（スマホ＝全画面／PC＝中央にスマホ枠） ---------- */
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#app { position: relative; width: 390px; height: 844px; flex-shrink: 0; overflow: hidden; background: var(--cream); transform-origin: center center; }
body.pc { background-color: #F3DFC2; background-image: radial-gradient(#E9CFAA 2px, transparent 2px); background-size: 24px 24px; }
body.pc #app { border-radius: 40px; box-shadow: 0 0 0 10px #6B4A3A, 0 0 0 14px #FFF6E3, 0 24px 60px rgba(80, 50, 30, .35); }
body.mobile #stage { align-items: flex-start; justify-content: flex-start; }
body.mobile #app { transform-origin: top left; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* 横向き（スマホのみ） */
.rotate { display: none; position: absolute; inset: 0; z-index: 99; background: var(--cream); align-items: center; justify-content: center; font-size: 20px; font-weight: 900; }
@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) { .rotate { display: flex; } }

/* ---------- ぷっくりUI ---------- */
.pf { position: relative; border: 3px solid var(--ink); box-shadow: inset 0 3px 0 rgba(255,255,255,.75), inset 0 -5px 0 var(--dk), 0 4px 0 var(--ink), 0 9px 12px rgba(90,60,40,.18); }
.pf::after { content: ''; position: absolute; left: 14%; top: 3px; width: 28%; height: 6px; border-radius: 999px; background: rgba(255,255,255,.85); pointer-events: none; }
.flat::after { display: none; }
.c-cream { background: #FFF6E3; --dk: #EBD5B2; } .c-white { background: #FFFFFF; --dk: #EADFD2; }
.c-orange { background: #FFB65C; --dk: #E8892E; } .c-pink { background: #FFA3B8; --dk: #E8728F; }
.c-yellow { background: #FFD65E; --dk: #E9A83A; } .c-red { background: #FF7070; --dk: #D9434F; }
.c-green { background: #A6DB8C; --dk: #6FB65A; } .c-blue { background: #A3D7F7; --dk: #5AAEE0; }
.c-gray { background: #ECE4D9; --dk: #CFC3B2; }
.press { transition: transform .28s cubic-bezier(.34,1.9,.6,1), box-shadow .12s; }
.press:active { transform: translateY(4px) scale(.97); box-shadow: inset 0 3px 0 rgba(255,255,255,.75), inset 0 -3px 0 var(--dk), 0 0 0 var(--ink); }
@media (hover: hover) { .press:hover { transform: translateY(-2px); } }
.mo { font-weight: 900; }
.tw { color: var(--ink); text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 5px 0 rgba(107,74,58,.25); }
.tb { color: #fff; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 4px 0 var(--ink); }
@keyframes boing { 0%,100% { transform: scale(1,1); } 30% { transform: scale(1.12,.9); } 55% { transform: scale(.94,1.07); } 75% { transform: scale(1.03,.98); } }
.boing { animation: boing .9s ease-in-out infinite; }
.btn-lg { min-height: 52px; border-radius: 999px; font-size: 17px; font-weight: 900; padding: 0 22px 4px; width: 100%; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-height: 46px; border-radius: 999px; font-size: 14px; }
.links { gap: 4px; }
.links > * { min-height: 32px; }
.link { background: none; border: none; color: var(--ink2); text-decoration: underline; font-size: 13px; padding: 8px; }

/* ---------- タイトル ---------- */
.title-bg { position: absolute; inset: 0; background: linear-gradient(#CBE7F7 0 38%, #A9D58F 38% 46%, #F9F6EE 46%); }
.title-box { position: relative; margin: auto 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo { margin: 0 0 4px; font-size: 46px; line-height: 1.12; font-weight: 900; text-align: center; color: #fff; text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 3px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 0 8px 0 var(--ink); }
.sub { margin: 0 0 18px; font-size: 14px; }
.login-buttons { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.email-form { width: 100%; display: flex; flex-direction: column; gap: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 24px; padding: 16px; }
.email-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.email-form input { font: inherit; font-size: 16px; padding: 10px 12px; border: 3px solid #E2D3BE; border-radius: 14px; outline: none; -webkit-user-select: text; user-select: text; }
.email-form input:focus { border-color: #FFB65C; }
.msg { min-height: 1.4em; margin: 0; font-size: 13px; color: #D9434F; text-align: center; }
.ver { position: absolute; left: 14px; bottom: 10px; margin: 0; font-size: 11px; color: var(--ink2); }
.pwa-mini { position: absolute; right: 12px; bottom: 12px; border-radius: 999px; padding: 4px 12px 7px; font-size: 12px; border-width: 2px; }

/* ---------- ゲーム ---------- */
#scene { position: relative; height: 471px; flex-shrink: 0; overflow: hidden; background: #CBE7F7; }
.sheet { flex: 1; min-height: 0; margin: -20px -3px 0; z-index: 2; border-radius: 30px 30px 0 0; border-bottom: none; padding: 14px 18px 4px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.mission { align-self: center; display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 4px 16px 7px 6px; }
.mission .tag { border-radius: 999px; padding: 1px 8px 3px; font-size: 11px; color: #fff; }
.mission .mtext { display: flex; flex-direction: column; line-height: 1.25; text-align: left; font-size: 13px; }
.mission small { font-size: 10px; color: #A08770; }
.slots { display: flex; justify-content: center; gap: 10px; }
.slot { background: none; border: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.slot .face { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slot .gauge { width: 46px; height: 9px; border-radius: 999px; border-width: 2px; overflow: hidden; padding: 0; box-shadow: inset 0 2px 0 rgba(0,0,0,.08); }
.slot .gauge i { display: block; height: 100%; border-radius: 999px; box-shadow: inset 0 2px 0 rgba(255,255,255,.6); transition: width .2s linear; }
.slot.lock .face { flex-direction: column; font-size: 10px; color: #8A7A6C; gap: 1px; }
.auto { width: 50px; height: 50px; border-radius: 50%; padding: 0 0 3px; font-size: 10px; line-height: 1.1; color: #fff; text-shadow: 0 2px 0 rgba(107,74,58,.5); }
.head-row { display: flex; align-items: center; justify-content: space-between; }
.head-row .h { font-size: 16px; font-weight: 900; }
.seg { position: relative; display: flex; border-radius: 999px; padding: 3px; box-shadow: inset 0 3px 0 rgba(0,0,0,.07); }
.seg .knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 42px; border-radius: 999px; border-width: 2px; transition: left .38s cubic-bezier(.34,1.7,.6,1); }
.seg button { position: relative; z-index: 1; width: 42px; min-height: 28px; border: none; background: transparent; font-size: 12px; font-weight: 900; color: #A08770; }
.seg button[aria-pressed="true"] { color: #fff; text-shadow: 0 1px 0 #C96A1C; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.card { border-radius: 20px; padding: 8px 4px 10px; min-height: 112px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.card .ic { width: 32px; height: 32px; border-radius: 50%; border-width: 2px; display: flex; align-items: center; justify-content: center; }
.card .nm { font-size: 12px; font-weight: 900; }
.card .lv { font-size: 10px; color: #A08770; }
.card .cost { display: flex; align-items: center; justify-content: center; gap: 2px; width: 92%; border-radius: 999px; border-width: 2px; padding: 1px 2px 3px; font-size: 11px; font-weight: 900; margin-top: 3px; color: #fff; text-shadow: 0 1px 0 rgba(107,74,58,.55); }
.card.lock { color: #8A7A6C; justify-content: center; text-align: center; }
.nav { height: 76px; flex-shrink: 0; margin: 0 -3px -3px; z-index: 3; border-radius: 26px 26px 0 0; display: flex; align-items: flex-end; justify-content: space-around; padding: 0 6px 10px; }
.nav button { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink2); min-width: 54px; padding: 0; }
.nav .center { gap: 4px; color: #E8892E; font-size: 12px; }
.nav .big { width: 60px; height: 60px; margin-top: -30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ico { display: block; width: 27px; height: 27px; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; }
.nav .big .ico { width: 30px; height: 30px; }
@keyframes toastIn { 0% { transform: translate(-50%, 24px); opacity: 0; } 12%, 80% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -12px); opacity: 0; } }
.toast { position: absolute; left: 50%; top: 420px; z-index: 20; border-radius: 999px; padding: 6px 16px 9px; white-space: nowrap; font-size: 14px; animation: toastIn 1.8s cubic-bezier(.34,1.6,.6,1) both; }

/* ---------- モーダル ---------- */
.modal { position: absolute; inset: 0; z-index: 50; background: rgba(60, 40, 30, .45); display: flex; align-items: center; justify-content: center; padding: 24px; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
.modal-card { width: 100%; border-radius: 28px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px; animation: pop .35s cubic-bezier(.34,1.6,.6,1); }
.modal-card h2 { margin: 0; font-size: 20px; font-weight: 900; text-align: center; }
.modal-card .lead { margin: 0; font-size: 14px; line-height: 1.6; text-align: center; }
.steps { margin: 0; padding: 12px 14px 12px 34px; background: #FFF6E3; border-radius: 18px; font-size: 14px; line-height: 1.8; }
.steps b { color: #E8892E; }
.note { margin: 0; font-size: 11px; color: var(--ink2); text-align: center; line-height: 1.5; }

/* ---------- 読み込み中 ---------- */
.loading { position: absolute; inset: 0; z-index: 60; background: rgba(255, 244, 226, .7); display: flex; align-items: center; justify-content: center; gap: 8px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.loading .dot { width: 14px; height: 14px; border-radius: 50%; background: #FFB65C; border: 3px solid var(--ink); animation: bounce .7s ease-in-out infinite; }
.loading .dot:nth-child(2) { animation-delay: .12s; } .loading .dot:nth-child(3) { animation-delay: .24s; }

/* ---------- UIアイコン（自動生成） ---------- */
.ico-mission{background-image:url(/icons/ui/mission.svg)}
.ico-moon{background-image:url(/icons/ui/moon.svg)}
.ico-book{background-image:url(/icons/ui/book.svg)}
.ico-tent{background-image:url(/icons/ui/tent.svg)}
.ico-crown{background-image:url(/icons/ui/crown.svg)}
.ico-sword{background-image:url(/icons/ui/sword.svg)}
.ico-heart{background-image:url(/icons/ui/heart.svg)}
.ico-plus{background-image:url(/icons/ui/plus.svg)}
.ico-lock{background-image:url(/icons/ui/lock.svg)}
.ico-home{background-image:url(/icons/ui/home.svg)}
.ico-team{background-image:url(/icons/ui/team.svg)}
.ico-gacha{background-image:url(/icons/ui/gacha.svg)}
.ico-menu{background-image:url(/icons/ui/menu.svg)}
.ico-star{background-image:url(/icons/ui/star.svg)}
.ico-phone{background-image:url(/icons/ui/phone.svg)}
