:root {
  /* POP BASE のブランドカラー（ロゴのカラーパレット：#DCCEF5 / #F7C9D8 / #FFF4F1 と濃色） */
  --brand-lavender: #dccef5;
  --brand-pink: #f7c9d8;
  --brand-cream: #fff4f1;
  --brand-ink: #2e2729;
  --brand-grad: linear-gradient(135deg, #dccef5 0%, #efcbe6 45%, #f7c9d8 75%, #fff4f1 100%);
  --bg: #fffaf8;
  --surface: #ffffff;
  --surface-2: #f8f2fb;
  --ink: #2e2729;
  --ink-soft: #75696e;
  --line: #efe4ea;
  --primary: #2e2729;
  --primary-ink: #ffffff;
  --accent: #9b80e0;
  --pink: #d9729a;
  --sky-top: #dccef5;
  --sky-bottom: #fff4f1;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(120, 90, 140, .08);
  --font-latin: 'Poppins', 'Zen Kaku Gothic New', sans-serif;
  --font: 'Zen Kaku Gothic New', system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c181b;
    --surface: #272226;
    --surface-2: #2f2830;
    --ink: #f6eef2;
    --ink-soft: #b9adb3;
    --line: #3b3238;
    --primary: #f7c9d8;
    --primary-ink: #2e2729;
    --accent: #c9b5f5;
    --pink: #f5a9c4;
    --sky-top: #3a3150;
    --sky-bottom: #4a3440;
    --shadow: 0 6px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* hidden 属性は display の指定より優先する（入口のキャラクター・お知らせの表示切り替えなど） */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--shop-font, var(--font)); /* 店内管理画面で選んだフォント */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }

/* ---------- ボタン ---------- */
.btn {
  border: 0;
  border-radius: 999px;
  padding: .8em 1.8em;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 22px rgba(150, 110, 190, .28); letter-spacing: .04em; }
.btn-lg { font-size: 1.15rem; padding: .9em 2.6em; }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-grid; place-items: center;
  font-size: 1.1rem; line-height: 1;
}
.icon-btn:disabled { opacity: .35; }
.link-btn {
  display: block; margin: .4rem auto 0;
  background: none; border: 0; color: var(--ink-soft);
  font-size: .8rem; text-decoration: underline;
}

/* ---------- 入口 ---------- */
.entrance {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  /* テーマの2色のグラデーション＋（POP BASE テーマでは）ロゴのようなピンクのにじみ */
  background:
    radial-gradient(60% 50% at 85% 15%, var(--theme-glow, transparent), transparent 70%),
    radial-gradient(55% 45% at 10% 90%, var(--theme-glow, transparent), transparent 70%),
    linear-gradient(160deg, var(--theme-top, var(--sky-top)), var(--theme-bottom, var(--sky-bottom)));
  overflow: hidden;
  text-align: center;
  padding: 24px 16px;
}
.entrance { color: var(--ent-ink, var(--theme-ink, var(--ink))); }
/* 入口のボタンは内装のテーマの色 */
.entrance .btn-primary { background: var(--theme-btn, var(--primary)); color: var(--theme-btn-ink, var(--primary-ink));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--theme-btn, #6b5a8e) 28%, transparent); }
.entrance-bg { position: absolute; inset: 0; z-index: 0; background: center / cover no-repeat; }
.entrance-inner { position: relative; z-index: 2; transition: opacity .5s, transform .6s; }
/* 設定を読み込むまで中身を出さない（初期値が一瞬見えるのを防ぐ） */
.entrance:not(.is-ready) .entrance-inner { opacity: 0; }
.entrance-kicker { letter-spacing: .3em; font-weight: 700; color: var(--ent-ink, var(--theme-ink, var(--ink-soft))); margin: 0; font-size: .85rem; }
/* 入口の上：お店のロゴ（POP BASE のマーク＋文字）。管理画面で文字を設定したときは文字だけ */
.entrance-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 .6rem; }
.entrance-brand img { width: clamp(52px, 9vw, 72px); height: auto; filter: drop-shadow(0 8px 18px rgba(170, 130, 210, .3)); }
.entrance-brand .entrance-kicker { font-family: var(--font-latin); font-weight: 600; letter-spacing: .12em; font-size: clamp(.95rem, 2.4vw, 1.15rem); color: var(--ent-ink, var(--theme-ink, var(--brand-ink))); }
.entrance-brand.is-text img { display: none; }
.entrance-brand.is-text .entrance-kicker { font-family: inherit; font-weight: 700; letter-spacing: .3em; font-size: .85rem; color: var(--ent-ink, var(--theme-ink, var(--ink-soft))); }
.logo-big { font-family: var(--font-latin); font-size: clamp(1.7rem, 6.2vw, 3.3rem); font-weight: 600; letter-spacing: .04em; line-height: 1.15; margin: .1em 0 .2em; color: var(--ent-heading, var(--theme-heading, var(--brand-ink))); text-shadow: 0 2px 24px rgba(255, 255, 255, .7); }
.entrance-logo { display: block; max-width: min(80vw, 560px); max-height: 32vh; margin: 0 auto .4rem; object-fit: contain; }
.entrance-notice {
  display: inline-block; max-width: min(36em, 100%); margin: -.4rem 0 1.4rem;
  padding: .45em 1.2em; border-radius: 999px;
  background: rgba(255, 255, 255, .8); color: #3a3346; font-weight: 700; font-size: .9rem;
  white-space: pre-line;
}
.entrance-notice + .btn { display: table; margin: 0 auto; }
.entrance-theme { font-weight: 700; font-size: clamp(1.15rem, 3.6vw, 1.45rem); margin: .2rem 0 1rem; }
.entrance-cast { display: flex; justify-content: center; gap: clamp(4px, 2vw, 18px); margin: 0 auto 1rem; }
.entrance-cast svg, .entrance-cast .char-img { width: clamp(60px, 16vw, 110px); height: auto; }
.entrance-period { font-weight: 700; margin: 0 0 1.4rem; white-space: pre-line; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 3;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, .25) 46px 48px),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-top, #dccef5) 65%, #fff), color-mix(in srgb, var(--theme-bottom, #fff4f1) 65%, #fff));
  transform: translateX(0);
  transition: transform 1.1s cubic-bezier(.7, 0, .3, 1);
  pointer-events: none;
}
.door-left { left: 0; transform: translateX(-100%); }
.door-right { right: 0; transform: translateX(100%); }
.entrance.open .door-left { animation: doorLeft 1.3s forwards; }
.entrance.open .door-right { animation: doorRight 1.3s forwards; }
.entrance.open { animation: fadeOut .5s 1s forwards; }
.entrance.open .entrance-inner { opacity: 0; transform: scale(1.05); }
@keyframes doorLeft { 0% { transform: translateX(-100%); } 35% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes doorRight { 0% { transform: translateX(100%); } 35% { transform: translateX(0); } 100% { transform: translateX(100%); } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-latin); font-weight: 600; font-size: 1.1rem; letter-spacing: .04em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo-mark { width: 30px; height: auto; }
/* ロゴの横の「オンラインポップアップショップ」（お店の名前の説明。イベントのブランド名は出さない） */
.logo small { display: inline-block; margin-left: .3em; padding-left: .8em; border-left: 1px solid var(--line); font-family: var(--font); font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 400px) {
  /* 狭い画面：説明はお店の名前の下に小さく（カートのボタンが下の行に落ちないように） */
  .logo { display: inline-grid; grid-template-columns: auto auto; column-gap: 8px; row-gap: 0; }
  .logo .logo-mark { grid-row: span 2; }
  .logo span { line-height: 1.1; align-self: end; }
  .logo small { margin: 0; padding: 0; border: 0; font-size: .6rem; letter-spacing: .02em; line-height: 1.3; align-self: start; }
}
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: .9rem;
  padding: .4em .9em; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.cart-btn {
  position: relative; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center;
}
.cart-btn svg { width: 24px; height: 24px; transform: translate(-1px, 1px); } /* 真ん中から少しだけ左下へ（見た目の釣り合い） */
.cart-btn.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.18); } }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--pink); color: #fff;
  font-size: .72rem; font-weight: 800; line-height: 20px;
}
.cart-count[hidden] { display: none; }
.fly-dot {
  position: fixed; z-index: 200; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pink); pointer-events: none;
}

/* ---------- セクション ---------- */
.section { padding: clamp(48px, 8vw, 88px) clamp(16px, 4vw, 40px); max-width: 1180px; margin: 0 auto; }
.section-alt { max-width: none; background: linear-gradient(160deg, color-mix(in srgb, var(--brand-lavender) 35%, var(--bg)), color-mix(in srgb, var(--brand-pink) 25%, var(--bg)) 60%, var(--bg)); }
.section-head { margin-bottom: 28px; }
.section-head .eyebrow + h2 { margin-top: 4px; }
.eyebrow { margin: 0; font-family: var(--font-latin); font-size: .78rem; font-weight: 600; letter-spacing: .25em; color: var(--accent); }
.section h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); font-weight: 700; }
.lead { color: var(--ink-soft); margin: .4rem 0 0; }

/* ---------- バッジ ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: .66rem; font-weight: 800; padding: .15em .7em; border-radius: 999px; letter-spacing: .04em; }
.badge-limited { background: var(--pink); color: #fff; }
.badge-new { background: #ffd76a; color: #5a4300; }
.badge-few { background: #fff; color: #c0392b; border: 1px solid #f0c0b8; }
.badge-soldout { background: #555; color: #fff; }

/* ---------- ご案内 ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.info-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 1rem; color: var(--ink); margin-bottom: 6px; }
.info-card h3::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--brand-grad); vertical-align: 1px; }
.info-card p { margin: 0; font-size: .92rem; }
.cast { margin-top: 48px; }
.cast > h3 { font-size: 1.2rem; margin-bottom: 16px; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.cast-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--card-bg, color-mix(in srgb, var(--c) 22%, var(--surface))); }
.cast-card svg, .cast-card .char-img { width: 76px; flex: none; }
.cast-card h4 small { margin-left: .5em; font-size: .7rem; letter-spacing: .15em; color: var(--ink-soft); }
.cast-card p { margin: 2px 0 0; font-size: .86rem; white-space: pre-line; }

.site-footer { text-align: center; padding: 32px 16px 48px; color: var(--ink-soft); font-size: .85rem; border-top: 1px solid var(--line); }
.site-footer p { margin: 4px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0 auto 14px; max-width: 760px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: .8rem; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.demo-note { font-size: .78rem; color: var(--ink-soft); }

/* ---------- モーダル・ドロワー ---------- */
.modal, .drawer { position: fixed; inset: 0; z-index: 50; }
.modal[hidden], .drawer[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 26, 45, .45); opacity: 0; transition: opacity .25s; }
.is-open .modal-backdrop { opacity: 1; }
.modal { display: grid; place-items: center; padding: 16px; }
.modal-card {
  position: relative; width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border-radius: 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  transform: translateY(20px) scale(.97); opacity: 0; transition: transform .25s, opacity .25s;
}
.is-open .modal-card { transform: none; opacity: 1; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
/* 規約・ポリシー */
.policy-card { width: min(720px, 100%); padding: 28px clamp(20px, 4vw, 40px) 36px; }
.policy-card h3 { font-size: 1.2rem; padding-right: 40px; margin-bottom: 16px; }
.policy-body { font-size: .9rem; line-height: 1.9; color: var(--ink); overflow-wrap: anywhere; }
.policy-body h1, .policy-body h2, .policy-body h3, .policy-body h4 { font-size: 1rem; margin: 1.4em 0 .4em; }
.policy-body p { margin: 0 0 .9em; }
.policy-body table { border-collapse: collapse; width: 100%; margin: .6em 0 1em; }
.policy-body th, .policy-body td { border: 1px solid var(--line); padding: .5em .7em; text-align: left; vertical-align: top; }
.policy-body a { color: var(--accent); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 680px) { .product-detail { grid-template-columns: 1fr; } }
.pd-image { background: color-mix(in srgb, var(--c) 30%, var(--surface)); aspect-ratio: 1; }
.pd-image svg { width: 100%; height: 100%; }
/* 商品写真（Shopify）は棚用に余白を少なくしているので、詳細画面では周りに余白をとって小さめに見せる */
.pd-image img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 14%; box-sizing: border-box; }
.pd-body { padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.pd-body h3 { font-size: 1.25rem; padding-right: 32px; }
.pd-body p { margin: 0; }
.pd-body #pmDesc { white-space: pre-line; } /* Shopify の商品説明の改行をそのまま表示 */
.pd-body .pd-desc { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.pd-body .pd-desc:empty { display: none; }
/* スマホ：写真を少し低くして、金額とカートに入れるボタンが最初の画面に入るようにする */
@media (max-width: 680px) {
  .pd-image { aspect-ratio: auto; height: min(40vh, 92vw); }
  .pd-body { padding: 20px 22px 26px; }
}
.pd-price { font-size: 1.5rem; font-weight: 800; }
.pd-price small { font-size: .7rem; margin-left: 4px; color: var(--ink-soft); font-weight: 500; }
.pd-spec, .pd-stock { font-size: .85rem; color: var(--ink-soft); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.pd-actions .btn { flex: 1; min-width: 160px; }
/* 「カートに入れる」は目立つように、テーマのアクセントの色（白い文字が読めるよう少しだけ濃く） */
#pmAdd { --add: color-mix(in srgb, var(--theme-accent, #9b80e0) 88%, #000);
  background: var(--add); color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--add) 40%, transparent); }
#pmAdd:hover:not(:disabled) { background: color-mix(in srgb, var(--add) 90%, #000); }
.pd-note { font-size: .82rem; color: var(--pink); font-weight: 700; min-height: 1.4em; }
.qty { display: inline-flex; align-items: center; gap: 10px; }
.qty output { min-width: 1.6em; text-align: center; font-weight: 800; }
.qty-sm .icon-btn { width: 28px; height: 28px; font-size: .9rem; }

.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--surface); display: flex; flex-direction: column; gap: 14px;
  padding: 20px; transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.novelty { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; font-size: .85rem; }
.novelty p { margin: 0 0 8px; }
.novelty strong { color: var(--pink); }
.meter { height: 10px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #c3b2f2, #f59ab7); border-radius: inherit; transition: width .4s; }
.cart-items { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; display: grid; align-content: start; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: start; }
.ci-image { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.ci-image svg { width: 100%; height: 100%; }
.ci-image img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 10%; box-sizing: border-box; }
.ci-body p { margin: 0; }
.ci-name { font-size: .86rem; font-weight: 700; line-height: 1.4; }
.ci-price { font-size: .85rem; color: var(--ink-soft); margin-bottom: 4px !important; }
.ci-remove { background: none; border: 0; color: var(--ink-soft); font-size: .78rem; text-decoration: underline; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }
.empty-char { width: 100px; margin: 0 auto 8px; opacity: .8; }
.cart-summary dl { margin: 0; display: grid; gap: 4px; }
.cart-summary dl div { display: flex; justify-content: space-between; font-size: .92rem; }
.cart-summary dd { margin: 0; font-weight: 700; }
.cart-summary .discount { color: var(--pink); }
.cart-summary .total { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; font-size: 1.1rem; font-weight: 800; }
.hint { margin: 6px 0 0; font-size: .78rem; color: var(--ink-soft); }

.done-card { width: min(440px, 100%); text-align: center; padding: 32px 24px; }
.done-cast { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; }
.done-cast svg, .done-cast .char-img { width: 64px; }
.done-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.done-card .btn { margin-top: 16px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: .7em 1.4em; border-radius: 999px; font-size: .88rem; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center;
  transition: transform .3s, opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 640px) {
  /* スマホ：1行目はロゴ、2行目に「店内・ご案内」とカート（カートは店内・ご案内と同じ高さの右端） */
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 8px; padding-top: 30px; padding-bottom: 5px; } /* 上の端からロゴまで 30px */
  .logo { grid-column: 1 / -1; justify-self: start; }
  .nav { grid-column: 1; grid-row: 2; margin: 0 0 0 -4px; }
  .nav a { font-size: .85rem; padding: .3em .9em; }
  .cart-btn { grid-column: 2; grid-row: 2; margin: 0; width: 38px; height: 38px; top: -4px; }
  .cart-btn svg { width: 22px; height: 22px; }
  html { scroll-padding-top: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* 下書きプレビューの帯（/?preview=draft） */
.preview-banner {
  position: fixed; left: 50%; top: 10px; z-index: 400; transform: translateX(-50%);
  padding: .4em 1.2em; border-radius: 999px; background: #c98a12; color: #fff;
  font-size: .82rem; font-weight: 800; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); pointer-events: none;
  max-width: calc(100% - 24px); text-align: center;
}

/* 画像に差し替えたキャラクター */
.char-img { display: block; aspect-ratio: 1; object-fit: contain; }

/* ---------- 入場制限：待機・終了・残り時間 ---------- */
.entrance.is-hidden { display: none; }
.entrance-wait, .entrance-ended {
  margin: 0 auto; max-width: 420px; padding: 18px 22px; border-radius: 22px;
  background: rgba(255, 255, 255, .88); color: #2e2729; box-shadow: 0 10px 30px rgba(120, 90, 140, .14);
}
.entrance-wait p, .entrance-ended p { margin: 0; }
.ew-title, .ee-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px !important; }
.ew-pos { font-weight: 700; }
.ew-pos b { font-size: 2.4rem; color: var(--theme-accent, #9b80e0); margin: 0 .1em; }
.ew-est { font-weight: 700; color: #6f6880; min-height: 1.5em; }
.ew-note { font-size: .85rem; margin-top: 8px !important; }
.ew-small { font-size: .74rem; color: #6f6880; margin-top: 6px !important; }
.entrance-ended { margin-bottom: 18px; }
.entrance.is-waiting #enterBtn, .entrance.is-waiting #entNotice { display: none; }
#enterBtn:disabled { opacity: .7; }

.visit-timer {
  position: fixed; left: 50%; top: 12px; z-index: 60; transform: translateX(-50%);
  padding: .4em 1.2em; border-radius: 999px;
  background: #fff; color: #2e2729; font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); border: 2px solid #dccef5;
}
.visit-timer b { font-variant-numeric: tabular-nums; font-size: 1.15em; margin-left: .2em; }
.visit-timer.is-urgent { background: #c0392b; color: #fff; border-color: #c0392b; animation: timerPulse 1s infinite; }
@keyframes timerPulse { 50% { transform: translateX(-50%) scale(1.06); } }

/* ---------- 入店するときのアバター選び ---------- */
.entrance.is-picking { overflow-y: auto; align-items: start; }
.entrance.is-picking .entrance-inner { padding: 16px 0 32px; }
.entrance.is-picking #enterBtn, .entrance.is-picking #entranceCast,
.entrance.is-picking #entNotice, .entrance.is-picking #entEnded { display: none; }
.entrance-pick {
  margin: 0 auto; max-width: 560px; padding: 18px 18px 14px; border-radius: 24px;
  background: rgba(255, 255, 255, .9); color: #2e2729; box-shadow: 0 10px 30px rgba(120, 90, 140, .14);
}
.ep-title { margin: 0 0 12px; font-weight: 800; font-size: 1.05rem; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ep-grid .pick-char {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px;
  border-radius: 16px; border: 2px solid transparent;
  background: var(--card-bg, color-mix(in srgb, var(--c) 22%, #fff)); font-weight: 700; font-size: .85rem; color: #3a3346;
}
.ep-grid .pick-char svg, .ep-grid .pick-char .char-img { width: 100%; max-width: 72px; height: auto; aspect-ratio: 1; }
.ep-grid .pick-char[aria-checked="true"] { border-color: var(--theme-accent, #9b80e0); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #9b80e0) 35%, transparent); }
.ep-note { margin: 0 0 12px; font-size: .78rem; color: #6f6880; }
.entrance-pick .link-btn { margin-top: 8px; }

/* ---------- 退店の確認 ---------- */
.exit-card { width: min(420px, 100%); padding: 28px 24px 22px; text-align: center; }
.exit-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.exit-card p { margin: 0 0 18px; font-size: .92rem; }
.exit-card strong { color: var(--pink); }
.exit-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-danger { background: #c0392b; color: #fff; }

/* ---------- 営業時間外の入口 ---------- */
.entrance-status {
  margin: 0 auto 8px; max-width: 420px; padding: 16px 22px; border-radius: 22px;
  background: rgba(255, 255, 255, .88); color: #2e2729; box-shadow: 0 10px 30px rgba(120, 90, 140, .14);
}
.entrance-status p { margin: 0; }
.es-title { font-weight: 800; font-size: 1.1rem; }
.es-text { margin-top: 4px !important; font-weight: 700; color: var(--theme-accent, #8a6bd6); }
.entrance.is-closed #enterBtn, .entrance.is-closed #entPick { display: none; }
/* オープンまでのカウントダウン */
.es-count { display: flex; justify-content: center; gap: clamp(8px, 3vw, 18px); margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.es-count span { display: grid; justify-items: center; min-width: 3.2em; }
.es-count b { font-family: var(--font-latin); font-weight: 600; font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1.1; color: var(--theme-accent, #8a6bd6); }
.es-count small { font-size: .72rem; font-weight: 700; color: #7a7075; }

/* イベントが何も予定されていないとき：POP BASE だけの画面（イベントのテーマ・ブランド・キャラクターは出さない） */
.entrance.is-idle {
  background:
    radial-gradient(55% 45% at 82% 18%, rgba(247, 201, 216, .75), transparent 70%),
    radial-gradient(55% 45% at 12% 85%, rgba(220, 206, 245, .85), transparent 70%),
    linear-gradient(160deg, #fff4f1, #f6f0fb);
  color: var(--brand-ink, #2e2729);
}
.entrance.is-idle .entrance-inner > :not(.entrance-idle) { display: none !important; }
.entrance.is-idle .entrance-bg { display: none; }
.entrance-idle img { width: clamp(76px, 14vw, 104px); height: auto; filter: drop-shadow(0 12px 26px rgba(170, 130, 210, .35)); animation: idle-float 4s ease-in-out infinite; }
.ei-name { margin: .7rem 0 0; font-family: var(--font-latin); font-weight: 600; letter-spacing: .14em; font-size: clamp(1.6rem, 6vw, 2.4rem); color: #2e2729; }
.ei-tag { margin: .2rem 0 0; font-weight: 700; letter-spacing: .12em; font-size: .82rem; color: #7a7075; }
.ei-text { margin: 2rem auto 0; max-width: 26em; line-height: 1.9; font-weight: 500; color: #4a4245; }
@keyframes idle-float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .entrance-idle img { animation: none; } }
/* イベントがないときは、入口の下のページ（店内・ご案内）も出さない */
body.shop-idle main { display: none; }

/* キャラクターに話しかけたときの紹介文（背景色はテーマ・管理画面で指定） */
.toast.toast-note { font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); width: min(520px, calc(100% - 32px)); max-width: none; line-height: 1.6; border-radius: 18px;
  padding: .85em 1.3em .95em; text-align: left; font-size: .9rem; }
.toast-note .toast-title { display: block; font-weight: 800; font-size: 1.1em; padding-right: 2.2em; min-height: 30px; line-height: 30px; margin-top: -4px; }
.toast-note .toast-text { display: block; white-space: pre-line; }
.toast-note .toast-text:first-child { padding-right: 2.2em; }
.toast-note .toast-title + .toast-text { margin-top: .2em; }
.toast.toast-note.show { pointer-events: auto; }
.toast-close {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: color-mix(in srgb, currentColor 14%, transparent); color: inherit;
  font-size: 1.1rem; line-height: 30px; font-weight: 700; cursor: pointer;
}
.toast-close:hover { background: color-mix(in srgb, currentColor 24%, transparent); }

/* スマホ・タブレット：紹介文は中央に、右下の移動スティックより上に出す（左のスタンプには重なってよい） */
@media (pointer: coarse) {
  .toast.toast-note { bottom: calc(152px + env(safe-area-inset-bottom)); }
}
.pre-line { white-space: pre-line; }
