/* ============================================================================
 * PharmaQuest 特典＆コラム 専用スタイル (assets/lounge.css)
 * ========================================================================== */

.lounge-body {
  background-color: #f2f4f8;
  background-image: none;
  color: #1b254b;
  padding-top: 0; /* style.css の body は演習ホーム用の固定ヘッダー分(68px)の上余白を持つため打ち消す */
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

/* ==================== 1. ダークネイビー＆ホログラム ヒーローヘッダー ==================== */
.lounge-hero {
  position: relative;
  background: linear-gradient(180deg, #061029 0%, #102152 55%, #2b1a66 100%);
  color: #ffffff;
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0;
  overflow: hidden;
  border-bottom: 3px solid #1b254b;
}

.hero-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star-sparkle {
  position: absolute;
  color: #e2e8f0;
  opacity: 0.75;
  animation: twinkleStar 3.2s ease-in-out infinite;
}

.star-sparkle.s1 { width: 18px; height: 18px; top: 24%; left: 14%; animation-delay: 0s; }
.star-sparkle.s2 { width: 12px; height: 12px; top: 62%; left: 22%; color: #94a3b8; animation-delay: 0.8s; }
.star-sparkle.s3 { width: 16px; height: 16px; top: 42%; right: 16%; animation-delay: 1.4s; }
.star-sparkle.s4 { width: 11px; height: 11px; top: 22%; right: 26%; color: #67e8f9; animation-delay: 2.1s; }
.star-sparkle.s5 { width: 14px; height: 14px; top: 68%; right: 12%; color: #f472b6; animation-delay: 0.4s; }

@keyframes twinkleStar {
  0%, 100% { transform: scale(0.75) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 0.95; }
}

.lounge-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

/* 1段目：ナビゲーション＆ウォレット行 */
.lounge-nav-row {
  display: flex;
  flex-wrap: wrap; /* 極端に狭い画面ではウォレットを2行目に回し、はみ出さない */
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.back-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  padding: 0.36rem 0.78rem;
  border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: background 0.18s, transform 0.15s;
}

.back-home-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

.lounge-wallet-cluster {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

/* ログイン状態ピル */
.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(248, 113, 113, 0.6);
  color: #fecaca;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.auth-status-pill .auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
}

.auth-status-pill.logged-in {
  border-color: rgba(52, 211, 153, 0.65);
  color: #d1fae5;
}

.auth-status-pill.logged-in .auth-dot {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.wallet-pill {
  background: rgba(15, 23, 42, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.48rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.wallet-pill.gem-wallet {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

.wallet-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.wallet-text-col {
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
  line-height: 1;
}

.wallet-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.wallet-val {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
}

/* 2段目：タイトルブロック */
.lounge-title-showcase {
  text-align: center;
  margin: 0.2rem auto 1.05rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
}

.lounge-page-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: clamp(1.65rem, 5.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: linear-gradient(90deg, #ffffff 0%, #e0f2fe 50%, #f5d0fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 18px rgba(56, 189, 248, 0.25);
}

.lounge-page-subtitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: clamp(0.8rem, 3.2vw, 0.95rem);
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.24rem 0.95rem;
  border-radius: 999px;
}

.subtitle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #ec4899);
  display: inline-block;
  flex-shrink: 0;
}

/* 3段目：中央のホログラム発光マスコットステージ */
.holo-mascot-pedestal {
  position: relative;
  width: 144px;
  height: 148px;
  margin: 0 auto -6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.holo-aura-glow {
  position: absolute;
  width: 210px;
  height: 210px;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(192, 38, 211, 0.55) 0%, rgba(56, 189, 248, 0.35) 45%, rgba(0, 0, 0, 0) 72%);
  filter: blur(12px);
  animation: auraPulse 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes auraPulse {
  0%, 100% { transform: translateX(-50%) scale(0.95); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.12); opacity: 1; }
}

.holo-card-frame {
  position: relative;
  width: 130px;
  height: 142px;
  background: #ffffff;
  border-radius: 34px 34px 0 0;
  padding: 10px 10px 0;
  box-shadow: 0 -6px 28px rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.holo-gradient-mesh {
  width: 100%;
  height: 98px;
  border-radius: 24px;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 35%, #8b5cf6 68%, #ec4899 100%);
  background-size: 220% 220%;
  animation: holoShift 5s ease infinite;
  position: relative;
}

@keyframes holoShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.holo-owl-img {
  position: absolute;
  top: 12px;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(27, 37, 75, 0.35)) saturate(1.3);
  animation: holoFloat 2.8s ease-in-out infinite;
}

@keyframes holoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

.holo-drop {
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(180deg, #a855f7, #ec4899);
  animation: dropRise 2.6s ease-in-out infinite;
}

.holo-drop.d1 { width: 10px; height: 18px; bottom: 8px; left: 42px; animation-delay: 0s; }
.holo-drop.d2 { width: 12px; height: 22px; bottom: 20px; right: 26px; animation-delay: 0.9s; }
.holo-drop.d3 { width: 8px; height: 14px; bottom: 26px; left: 24px; background: #38bdf8; animation-delay: 1.6s; }

@keyframes dropRise {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-7px); opacity: 0.55; }
}

/* ==================== 2. メインコンテナ＆セグメントタブ ==================== */
.lounge-main-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.lounge-control-bar {
  margin-bottom: 1.35rem;
}

.lounge-segmented-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  background: #e2e8f0;
  padding: 0.3rem;
  border-radius: 16px;
  border: 2px solid #1b254b;
}

.seg-tab-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.52rem 0.25rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.seg-tab-btn.active {
  background: #ffffff;
  color: #1b254b;
  box-shadow: 0 3px 0 rgba(27, 37, 75, 0.16);
  transform: translateY(-1px);
}

.lounge-section {
  margin-bottom: 2.2rem;
}

.lounge-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.lounge-sec-eyebrow {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #7c3aed;
}

.lounge-sec-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #1b254b;
}

.lounge-sec-note {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
}

.column-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.col-tag-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.col-tag-btn.active {
  background: #1b254b;
  color: #ffffff;
  border-color: #1b254b;
}

/* ==================== 3. プラン比較型カード ==================== */
.plan-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.plan-style-card {
  background: #ffffff;
  border-radius: 22px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.2s;
  animation: cardSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.plan-style-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 14px 32px rgba(27, 37, 75, 0.11);
}

@keyframes cardSlideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.plan-card-ribbon {
  padding: 0.42rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.03em;
  background-size: 200% 200%;
  animation: ribbonFlow 4s ease infinite;
}

.plan-card-ribbon.rainbow {
  background-image: linear-gradient(90deg, #d946ef 0%, #6366f1 48%, #10b981 100%);
}

.plan-card-ribbon.blue {
  background-image: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
}

.plan-card-ribbon.gold {
  background-image: linear-gradient(90deg, #f59e0b 0%, #ec4899 100%);
}

@keyframes ribbonFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.plan-card-inner {
  padding: 1.35rem 1.35rem 1.4rem;
}

.plan-card-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.plan-meta-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.plan-badge-pill {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  white-space: nowrap;
}

.plan-badge-pill.gem-tag {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.plan-badge-pill.reward-tag {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.plan-badge-pill.applied-tag {
  background: #f3e8ff;
  color: #6d28d9;
  border-color: #c4b5fd;
}

.plan-badge-pill.member-lock-tag {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.plan-badge-pill.member-ok-tag {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}

.plan-card-title {
  font-size: 1.24rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.32;
  margin-bottom: 0.22rem;
}

.plan-card-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.85rem;
}

.plan-check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

.plan-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #334155;
  line-height: 1.4;
}

.check-svg-icon {
  width: 18px;
  height: 18px;
  color: #4f46e5;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 右側の浮遊イラスト＆キラキラ演出 */
.plan-illust-stage {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.plan-illust-bg {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(16, 185, 129, 0.2));
  transform: rotate(-10deg);
  transition: transform 0.3s ease;
}

.plan-style-card:hover .plan-illust-bg {
  transform: rotate(8deg) scale(1.08);
}

.plan-illust-img {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.18));
  animation: illustBob 3s ease-in-out infinite;
}

@keyframes illustBob {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1); }
  50% { transform: translateY(-7px) rotate(4deg) scale(1.05); }
}

/* カード下部の立体ボタン */
.plan-cta-btn {
  width: 100%;
  min-height: 52px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 0 #cbd5e1;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s;
}

.plan-cta-btn .btn-gradient-text {
  background: linear-gradient(90deg, #1d4ed8 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.plan-cta-btn.login-required-btn {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 4px 0 #fcd34d;
}

.plan-cta-btn:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #f8fafc;
}

.plan-cta-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #cbd5e1;
}

.plan-cta-btn.primary-gradient {
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  color: #ffffff;
  border-color: #1b254b;
  box-shadow: 0 4px 0 #1b254b;
}

.plan-cta-btn.completed-btn {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

/* ==================== 4. 下部アイコンドック ==================== */
.lounge-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 2px solid #e2e8f0;
  padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 100%;
}

.dock-item {
  border: none;
  background: transparent;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
  cursor: pointer;
  color: #64748b;
  padding: 0.15rem 0.4rem;
}

.dock-icon-box {
  width: 48px;
  height: 44px;
  border-radius: 14px;
  border: 2.5px solid transparent;
  display: grid;
  place-items: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item.active .dock-icon-box {
  background: #eff6ff;
  border-color: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.18);
}

.dock-item.active .dock-label {
  color: #1d4ed8;
  font-weight: 900;
}

.dock-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.dock-label {
  font-size: 0.65rem;
  font-weight: 800;
}

/* ==================== 5. 応募モーダル＆記事リーダーモーダル ==================== */
.lounge-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(5px);
  z-index: 3500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lounge-modal-backdrop.open {
  display: flex;
}

.lounge-modal-card {
  background: #ffffff;
  border-radius: 24px;
  border: 3px solid #1b254b;
  max-width: 480px;
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: modalZoomIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lounge-modal-card.reader-modal-card {
  max-width: 680px;
}

@keyframes modalZoomIn {
  0% { opacity: 0; transform: scale(0.9) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.lounge-modal-ribbon {
  background: linear-gradient(90deg, #d946ef 0%, #6366f1 50%, #10b981 100%);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 0.55rem 1.25rem;
  text-align: center;
}

.lounge-modal-body {
  padding: 1.35rem;
}

.apply-modal-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.apply-modal-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.apply-modal-illust {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.one-time-limit-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #f59e0b;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.22rem;
}

.apply-modal-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #1b254b;
  line-height: 1.3;
}

.apply-modal-sub {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 0.15rem;
}

.gem-calculation-box {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gem-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 800;
  color: #334155;
}

.gem-calc-row.cost {
  color: #dc2626;
}

.gem-calc-row.after {
  padding-top: 0.45rem;
  border-top: 1.5px dashed #cbd5e1;
  font-size: 0.92rem;
  color: #1b254b;
}

.apply-form-group {
  margin-bottom: 0.85rem;
}

.apply-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  color: #334155;
  margin-bottom: 0.3rem;
}

.apply-form-input {
  width: 100%;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1b254b;
}

.apply-form-input:focus {
  outline: none;
  border-color: #4f46e5;
}

.apply-error-msg {
  background: #fee2e2;
  border: 1.5px solid #ef4444;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.85rem;
}

.lounge-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.modal-cancel-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem;
  cursor: pointer;
}

/* ==================== 6. コラムリーダー＆記事テンプレート用装飾スタイル ==================== */
.reader-sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-cat-badge {
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid #1b254b;
}

.reader-top-actions {
  display: flex;
  gap: 0.45rem;
}

.reader-tool-btn {
  background: #ffffff;
  border: 2px solid #1b254b;
  border-radius: 10px;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  color: #1b254b;
}

.reader-tool-btn.red-on {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

.reader-article-body {
  padding: 1.35rem;
}

.reader-meta-row {
  font-size: 0.76rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.reader-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #1b254b;
  line-height: 1.35;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px dashed #e2e8f0;
}

.reader-content {
  font-size: 0.94rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.8;
}

.reader-content .article-lead {
  background: #f8fafc;
  border-left: 4px solid #38bdf8;
  padding: 0.75rem 0.95rem;
  border-radius: 0 12px 12px 0;
  color: #334155;
  margin-bottom: 1.1rem;
}

.reader-content h3 {
  font-size: 1.06rem;
  font-weight: 900;
  color: #1b254b;
  margin: 1.35rem 0 0.55rem;
  padding: 0.35rem 0.7rem;
  background: #f1f5f9;
  border-left: 5px solid #6366f1;
  border-radius: 0 10px 10px 0;
}

.reader-content p {
  margin-bottom: 0.85rem;
}

/* 記事テンプレートパーツ①：ゴロ合わせBOX */
.article-goro-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}

.goro-badge {
  display: inline-block;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.goro-phrase {
  font-size: 1.08rem;
  font-weight: 900;
  color: #92400e;
  margin-bottom: 0.35rem !important;
}

.goro-desc {
  font-size: 0.84rem;
  color: #78350f;
  margin-bottom: 0 !important;
}

/* 記事テンプレートパーツ②：比較テーブル */
.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.95rem 0 1.2rem;
  font-size: 0.84rem;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #cbd5e1;
}

.article-table th {
  background: #1b254b;
  color: #ffffff;
  font-weight: 900;
  text-align: left;
  padding: 0.55rem 0.75rem;
}

.article-table td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  vertical-align: top;
}

.text-danger {
  color: #dc2626;
  font-weight: 900;
}

/* 記事テンプレートパーツ③：重要ポイントBOX */
.article-point-box {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  margin: 1rem 0;
}

.point-box-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: #1e40af;
  margin-bottom: 0.45rem;
}

.article-point-box ul {
  padding-left: 1.2rem;
  margin: 0;
}

.article-point-box li {
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
}

/* 記事テンプレートパーツ④：理解度チェックミニ問題BOX */
.article-quiz-box {
  background: #f5f3ff;
  border: 2px solid #c4b5fd;
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  margin: 1.1rem 0;
}

.quiz-box-header {
  display: inline-block;
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.14rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}

.quiz-question {
  font-size: 0.88rem;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 0.45rem !important;
}

.quiz-answer {
  font-size: 0.85rem;
  color: #4c1d95;
  margin-bottom: 0 !important;
}

/* ==================== 7. 未ログイン時の記事途中ロック（ペイウォール） ==================== */
.reader-paywall-wrapper {
  position: relative;
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.reader-blurred-teaser {
  filter: blur(6px);
  opacity: 0.42;
  user-select: none;
  pointer-events: none;
  max-height: 150px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.reader-login-gate-card {
  position: relative;
  z-index: 3;
  margin-top: -55px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #f8fafc 100%);
  border: 2.5px solid #1b254b;
  border-radius: 22px;
  padding: 1.4rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(27, 37, 75, 0.14);
}

.gate-badge {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #f59e0b;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}

.gate-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1b254b;
  margin-bottom: 0.45rem;
}

.gate-desc {
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1.1rem !important;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.gate-sub-link {
  font-size: 0.78rem;
  font-weight: 800;
  color: #4f46e5;
  text-decoration: underline;
}

/* ログイン案内モーダル専用 */
.login-modal-body {
  text-align: center;
}

.login-modal-icon-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.85rem;
  border-radius: 22px;
  background: #f5f3ff;
  border: 2px solid #c4b5fd;
  display: grid;
  place-items: center;
}

.login-modal-emoji {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.login-modal-title {
  font-size: 1.18rem;
  font-weight: 900;
  color: #1b254b;
  margin-bottom: 0.45rem;
}

.login-modal-desc {
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 0.95rem;
}

.login-benefit-list {
  list-style: none;
  text-align: left;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1.15rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.reader-reward-box {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 2px solid #1b254b;
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.reader-reward-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reader-gem-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.reader-reward-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #1b254b;
}

.reader-reward-sub {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
}

/* 応募履歴カード */
.history-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-item-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: #1b254b;
}

.history-item-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 0.15rem;
}

.history-gem-badge {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #1d4ed8;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

#lounge-toast-container {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4500;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

@media (max-width: 640px) {
  .lounge-segmented-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-card-top-grid {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
  .plan-illust-stage {
    width: 82px;
    height: 82px;
  }
  .plan-illust-img {
    width: 60px;
    height: 60px;
  }
  .back-home-pill span {
    font-size: 0.7rem;
  }
}

/* スマホ幅：ヘッダー1段目（戻る＋ログイン＋ジェム＋XP）が1行に収まるよう圧縮 */
@media (max-width: 480px) {
  .lounge-nav-row { gap: 0.4rem; }
  .back-home-pill { padding: 0.36rem 0.62rem; }
  .lounge-wallet-cluster { gap: 0.28rem; }
  .auth-status-pill { padding: 0.3rem 0.5rem; gap: 0.26rem; font-size: 0.66rem; }
  .auth-status-pill #lounge-auth-label {
    max-width: 5.2em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wallet-pill { padding: 0.26rem 0.55rem 0.26rem 0.4rem; gap: 0.3rem; }
  .wallet-icon-img { width: 18px; height: 18px; }
  .wallet-text-col { gap: 0.22rem; }
  .wallet-val { font-size: 0.9rem; }
  .lbl-long { display: none; }
}

