/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #ffd700;
  --gold-dark: #c8a800;
  --celeb-bg: #0a0a3e;
  --poor-bg: #1a1008;
  --rich-glow: #ffd70033;
  --text-light: #f0e8cc;
  --font-main: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: #0a0a1a;
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0a0a2e, #1a1050);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 12px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--gold), #fff8cc, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.lang-toggle {
  display: flex;
  gap: 6px;
}
.lang-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.2s;
}
.lang-btn.active, .lang-btn:hover {
  background: var(--gold);
  color: #1a1010;
}

/* ===== LIST PAGE ===== */
.list-page-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}

.search-bar {
  flex: 1;
  min-width: 160px;
  padding: 8px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--gold);
  background: rgba(255,215,0,0.07);
  color: var(--text-light);
  font-size: 0.95rem;
  outline: none;
}
.search-bar::placeholder { color: rgba(240,232,200,0.5); }
.search-bar:focus { border-color: #fff8cc; box-shadow: 0 0 0 3px rgba(255,215,0,0.15); }

.sort-btns, .period-btns, .region-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.sort-btn, .period-btn, .region-btn {
  padding: 5px 13px;
  border-radius: 18px;
  border: 1.5px solid rgba(255,215,0,0.4);
  background: transparent;
  color: rgba(240,232,200,0.8);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.sort-btn.active, .period-btn.active, .region-btn.active,
.sort-btn:hover, .period-btn:hover, .region-btn:hover {
  background: rgba(255,215,0,0.2);
  border-color: var(--gold);
  color: var(--gold);
}

.celeb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.celeb-card {
  background: linear-gradient(135deg, rgba(255,215,0,0.07), rgba(255,255,255,0.03));
  border: 1.5px solid rgba(255,215,0,0.25);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.celeb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,215,0,0.04));
  opacity: 0;
  transition: opacity 0.2s;
}
.celeb-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255,215,0,0.2);
}
.celeb-card:hover::before { opacity: 1; }

.celeb-card-rank {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: bold;
  opacity: 0.7;
}

.celeb-card-icon-wrap { flex-shrink: 0; }
.celeb-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.celeb-cat-ja    { background: radial-gradient(circle, #3a1a50, #1a0a2a); border: 2px solid #aa44ff; }
.celeb-cat-us    { background: radial-gradient(circle, #1a3a50, #0a1a3a); border: 2px solid #4488ff; }
.celeb-cat-zh    { background: radial-gradient(circle, #501a1a, #2a0a0a); border: 2px solid #ff4444; }
.celeb-cat-other { background: radial-gradient(circle, #1a4a2a, #0a2a1a); border: 2px solid #44cc88; }
.card-emoji { font-size: 1.6rem; }

.celeb-card-info { flex: 1; min-width: 0; }
.celeb-card-name { font-size: 0.95rem; font-weight: 700; color: #fff8cc; margin-bottom: 2px; }
.celeb-card-desc { font-size: 0.75rem; color: rgba(240,232,200,0.6); margin-bottom: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.celeb-name-desc-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  text-align: center;
  padding: 6px 12px 6px;
  background: rgba(255,255,255,0.85);
  min-height: 56px;
}
.celeb-page-name {
  font-size: 1rem;
  font-weight: 800;
  color: #3a2800;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.celeb-description {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.celeb-card-earnings { font-size: 0.9rem; font-weight: bold; color: var(--gold); }
.per-sec { font-size: 0.7rem; color: rgba(255,215,0,0.7); margin-left: 2px; }

.celeb-card-views { text-align: right; flex-shrink: 0; }
.views-icon { font-size: 0.9rem; }
.views-count { display: block; font-size: 1rem; font-weight: bold; color: #aaddff; }
.views-label { font-size: 0.7rem; color: rgba(240,232,200,0.5); }

.no-results { text-align: center; padding: 40px; color: rgba(240,232,200,0.5); font-size: 1.1rem; grid-column: 1/-1; }

/* ===== CELEB PAGE (light theme) ===== */
.celeb-page-body {
  overflow: hidden;
  background: #ede8da;
  color: #333;
}

.celeb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(237,232,218,0.85);
  backdrop-filter: blur(6px);
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  gap: 10px;
  height: 52px;
}

.back-to-list-btn {
  padding: 5px 16px;
  border: 1.5px solid #999;
  border-radius: 20px;
  background: rgba(255,255,255,0.8);
  color: #333;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.back-to-list-btn:hover { background: #fff; border-color: #555; }

.celeb-page-body .lang-btn {
  border-color: #bbb;
  color: #444;
  background: rgba(255,255,255,0.8);
}
.celeb-page-body .lang-btn.active,
.celeb-page-body .lang-btn:hover {
  background: #444;
  color: #fff;
  border-color: #444;
}

/* ===== SPLIT LAYOUT ===== */
.celeb-split {
  display: flex;
  /* iOS Safari: 100vh はブラウザUIを含む全高。--app-height をJSで設定しフォールバック */
  height: calc(var(--app-height, 100vh) - 52px - 48px);
  /* svh対応ブラウザ(iOS15.4+/Chrome108+)はこちらが優先 */
  height: calc(100svh - 52px - 48px);
  margin-top: 52px;
  background: #fff;
  gap: 0;
}

/* ===== CELEB AREA (50%) ===== */
.celeb-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Hide stars */
.celeb-area::before { display: none; }

/* Counter display - below celeb-name-desc-wrap (min-height: 56px) */
.earnings-counter-wrap {
  position: absolute;
  top: 60px;
  left: 6%;
  z-index: 20;
  text-align: left;
  width: 88%;
}
.earnings-header {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 4px;
}
.earnings-amount-display {
  font-size: 2.2rem;
  font-weight: 900;
  color: #3a2800;
  line-height: 1.15;
  -webkit-text-fill-color: #3a2800;
  animation: none;
}
.earnings-body-text {
  font-size: 0.9rem;
  color: #555;
  margin-top: 4px;
}
.celeb-name-em { font-weight: bold; color: #7a5800; }
.amount-em { font-weight: bold; color: #3a2800; }
.elapsed-time { font-size: 0.75rem; color: #999; margin-top: 2px; }

/* Celeb icon - centered in lower half of celeb area */
.celeb-icon-wrap {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 67px;
}
.celeb-icon-wrap svg { width: 100%; height: auto; }

/* Floor color (no grid lines) */
.celeb-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(180,145,90,0.18) 60%, rgba(160,125,75,0.28));
}

/* Money rain layer */
.money-rain-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

/* Floor bills layer */
.floor-bills-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  z-index: 8;
  pointer-events: none;
}

/* Mascot wrap */
.mascot-wrap {
  position: absolute;
  bottom: 5%;
  z-index: 12;
  width: 47px;
  height: 47px;
  transition: transform 0.1s;
}
.mascot-wrap svg { width: 100%; height: auto; }

/* ===== POOR AREA (50%) ===== */
.poor-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Kanrinin icon - slightly lower than celeb icon (celeb: bottom 22%) */
/* width = celeb icon (67px) × 85% ≈ 57px */
.poor-person-wrap {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  width: 57px;
  z-index: 5;
}
.poor-person-wrap img { width: 100%; height: auto; display: block; }
.poor-person-wrap svg { width: 100%; height: auto; }

/* User income diagnosis block */
.user-income-block {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  z-index: 20;
}
.user-income-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 6px;
}
.user-income-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.user-income-input {
  width: 130px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: bold;
  border: 2px solid #ccc;
  border-radius: 6px;
  text-align: right;
  outline: none;
  transition: border-color 0.2s;
}
.user-income-input:focus { border-color: #f0c020; }
.user-income-select {
  padding: 6px 4px;
  font-size: 0.85rem;
  font-weight: bold;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.user-income-select:focus { border-color: #f0c020; }
.user-income-unit {
  font-size: 0.82rem;
  color: #555;
  white-space: nowrap;
}
.user-income-btn {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: bold;
  background: #f0c020;
  color: #333;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.user-income-btn:hover { opacity: 0.85; }
.user-income-result {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #cc3300;
  line-height: 1.5;
  min-height: 1.2em;
}

/* Admin info block - just below poor-person-wrap */
.admin-info-block {
  position: absolute;
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-size: 0.78rem;
  color: #555;
  line-height: 1.6;
  z-index: 6;
}
.admin-info-block #admin-income-label { display: none; }
.admin-info-block #admin-comparison {
  font-size: 1.05rem;
  font-weight: 800;
  color: #cc3300;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(255,100,0,0.15);
}

/* Poor area buttons - above admin info block */
.poor-area-buttons {
  position: absolute;
  bottom: calc(1% + 52px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 88%;
  z-index: 6;
}
.poor-area-btn {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: opacity 0.2s;
  text-align: center;
}
.poor-area-btn:hover { opacity: 0.85; }
.poor-area-btn-gray { background: #ccc8c0; color: #333; }
.poor-area-btn-gold { background: #f0c020; color: #333; }

/* Manager wrap */
.manager-wrap {
  display: inline-block;
  width: 80px;
}
.manager-wrap svg { width: 100%; height: auto; }

/* ===== FALLING BILLS ===== */
.falling-bill {
  position: absolute;
  top: -10%;
  border-radius: 4px;
  animation: fall-bill var(--fall-dur, 3s) ease-in forwards;
  transform-origin: center center;
  pointer-events: none;
}

/* Luxury item pop-in */
@keyframes luxuryAppear {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  70%  { transform: scale(1.2) rotate(5deg);  opacity: 1; }
  100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}
.luxury-label {
  font-size: 0.55rem;
  font-weight: bold;
  color: #7a5800;
  margin-top: 2px;
  white-space: nowrap;
}

@keyframes flutter {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  20%  { transform: translateX(var(--sway1, -60px)) translateY(calc(var(--fallDistance) * 0.2)) rotate(20deg); }
  40%  { transform: translateX(var(--sway2, 50px)) translateY(calc(var(--fallDistance) * 0.4)) rotate(-18deg); }
  60%  { transform: translateX(var(--sway3, -35px)) translateY(calc(var(--fallDistance) * 0.6)) rotate(13deg); }
  80%  { transform: translateX(var(--sway4, 20px)) translateY(calc(var(--fallDistance) * 0.8)) rotate(-8deg); }
  100% { transform: translateX(0px) translateY(var(--fallDistance)) rotate(0deg); opacity: 1; }
}
@keyframes fall-bill {
  0%   { top: -8%; transform: rotate(var(--rotation, 0deg)) translateX(0px); opacity: 0.9; }
  12%  { transform: rotate(calc(var(--rotation, 0deg) * -1.2)) translateX(var(--fx, 60px)); opacity: 1; }
  25%  { transform: rotate(calc(var(--rotation, 0deg) * 1.0)) translateX(calc(var(--fx, 60px) * -1)); }
  37%  { transform: rotate(calc(var(--rotation, 0deg) * -0.9)) translateX(calc(var(--fx, 60px) * 0.9)); }
  50%  { transform: rotate(calc(var(--rotation, 0deg) * 0.7)) translateX(calc(var(--fx, 60px) * -0.75)); }
  62%  { transform: rotate(calc(var(--rotation, 0deg) * -0.5)) translateX(calc(var(--fx, 60px) * 0.6)); }
  75%  { transform: rotate(calc(var(--rotation, 0deg) * 0.3)) translateX(calc(var(--fx, 60px) * -0.4)); }
  87%  { transform: rotate(calc(var(--rotation, 0deg) * -0.15)) translateX(calc(var(--fx, 60px) * 0.2)); }
  100% { top: var(--land-y, 70%); transform: rotate(calc(var(--rotation, 0deg) * 0.1)) translateX(0px); opacity: 0.85; }
}
.bill-face {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: serif;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  overflow: hidden;
}
.bill-jpy { background: linear-gradient(135deg, #c8a870, #d8bc8a, #c8a870); color: #4a2e08; }
.bill-usd { background: linear-gradient(135deg, #7aab70, #90c080, #7aab70); color: #1a3a10; }
.bill-cny { background: linear-gradient(135deg, #cc7070, #d88080, #cc7070); color: #4a1010; }
.bill-amount { font-size: 1.1em; font-weight: 900; }
.bill-label { font-size: 0.55em; opacity: 0.7; letter-spacing: 1px; }

.floor-bill { position: absolute; border-radius: 2px; }
.floor-bundle { position: absolute; border-radius: 4px; }

/* ===== SHARE MODAL ===== */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.share-modal.show { opacity: 1; }
.share-modal-box {
  background: linear-gradient(135deg, #0a0a30, #1a1060);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 24px;
  max-width: 480px;
  width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.share-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.share-modal-title { color: var(--gold); font-size: 1.2rem; font-weight: bold; margin-bottom: 14px; text-align: center; }
.share-preview { width: 100%; border-radius: 10px; margin-bottom: 14px; border: 1px solid rgba(255,215,0,0.3); }
.share-text-preview { font-size: 0.85rem; color: rgba(240,232,200,0.8); margin-bottom: 16px; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 8px; }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-btn-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}
.share-btn-item:hover { opacity: 0.85; }
.share-btn-item.twitter   { background: #1a1a2a; border: 1px solid #aaa; color: white; }
.share-btn-item.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: white; }
.share-btn-item.line      { background: #06c755; color: white; }
.share-btn-item.whatsapp  { background: #25d366; color: white; }
.share-btn-item.facebook  { background: #1877f2; color: white; }
.share-btn-item.tiktok    { background: #010101; color: white; border: 1px solid #333; }
.share-btn-item.download  { background: #555; color: white; grid-column: 1 / -1; }
.share-modal-close-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,215,0,0.4);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.9rem;
}
.share-img-hint {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #aaa;
  text-align: center;
}

/* ===== INCOME DIAGNOSIS TOAST ===== */
.income-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1a0a00, #3a2000);
  border: 2px solid #f0c020;
  border-radius: 14px;
  padding: 16px 24px;
  max-width: 90vw;
  width: 360px;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff8cc;
  z-index: 8600;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.income-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== DONATION MESSAGE ===== */
.donation-msg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donation-msg-box {
  background: linear-gradient(135deg, #1a0a00, #3a2000);
  border: 2px solid #e08020;
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 420px;
  width: 90vw;
  text-align: center;
  position: relative;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.donation-msg-icon { font-size: 3rem; margin-bottom: 12px; }
.donation-msg-text { font-size: 1rem; line-height: 1.6; color: #fff8cc; }
.donation-msg-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #e08020;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ===== AFFILIATE POPUP (fullscreen interstitial) ===== */
.affiliate-popup {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.affiliate-popup.affiliate-show { opacity: 1; pointer-events: all; }
.affiliate-popup.affiliate-exit { opacity: 0; pointer-events: none; }
.affiliate-inner {
  background: #1a1a2e;
  border: 2px solid #ffd700;
  border-radius: 18px;
  padding: 36px 20px 20px;
  position: relative;
  overflow: hidden;
  width: min(360px, 92vw);
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}
.affiliate-ad-frame {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.affiliate-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(0,0,0,0.4);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  transition: opacity 0.3s;
}
.affiliate-close:disabled { opacity: 0.2; cursor: not-allowed; }
.affiliate-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; }
.affiliate-body { font-size: 0.95rem; color: rgba(255,255,255,0.85); margin-bottom: 18px; }
.affiliate-cta {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  color: #111;
  margin-bottom: 14px;
}
.affiliate-skip-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
}
.affiliate-timer-bar {
  height: 3px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  width: 100%;
  margin-top: 10px;
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .earnings-counter-wrap { width: 70%; }
  .earnings-amount-display { font-size: 1.5rem; }
  .site-title { font-size: 1.1rem; }
  .celeb-list { grid-template-columns: 1fr; }
  .bottom-btn { padding: 12px 14px; font-size: 0.82rem; }
}

/* ===== PORTRAIT (縦長) ===== */
@media (orientation: portrait) {
  .celeb-split {
    flex-direction: column;
  }
  .celeb-area {
    flex: none;
    height: 50%;
    border: none;
  }
  .poor-area {
    flex: none;
    height: 50%;
    border: none;
    width: 100%;
  }
  .poor-person-wrap {
    width: 57px;
    bottom: 46%;
  }
  .earnings-counter-wrap { width: 88%; }
  .earnings-amount-display { font-size: 1.6rem; }
}

/* ===== SMARTPHONE PORTRAIT OPTIMISATION (max-width:640px + portrait) ===== */
/* PCレイアウトには一切影響しない。スマホ縦持ち専用。 */
@media (max-width: 640px) and (orientation: portrait) {

  /* ─── 1. テキスト・ボタンを読める範囲で小さく ─── */
  .celeb-name-desc-wrap    { padding: 4px 8px; min-height: 44px; z-index: 26; }
  .celeb-page-name         { font-size: 0.85rem; }
  .celeb-description       { font-size: 0.68rem; }

  .earnings-counter-wrap   { top: 50px; width: 86%; z-index: 26; }
  .earnings-header         { font-size: 0.74rem; margin-bottom: 2px; }
  .earnings-amount-display { font-size: 1.2rem; }
  .earnings-body-text      { font-size: 0.7rem; margin-top: 2px; }
  .elapsed-time            { font-size: 0.62rem; }

  .user-income-title       { font-size: 0.7rem; margin-bottom: 3px; }
  .user-income-input       { width: 90px; padding: 4px 6px; font-size: 0.74rem; }
  .user-income-select      { padding: 4px 2px; font-size: 0.7rem; }
  .user-income-unit        { font-size: 0.68rem; }
  .user-income-btn         { padding: 4px 7px; font-size: 0.64rem; }
  .user-income-result      { font-size: 0.7rem; margin-top: 3px; }

  .poor-area-btn           { padding: 6px 10px; font-size: 0.7rem; }
  /* ボタン群はadmin-info(~35px高)の真上に置く: bottom: 38px */
  .poor-area-buttons       { gap: 4px; bottom: 38px; }

  .admin-info-block                   { font-size: 0.65rem; }
  .admin-info-block #admin-comparison { font-size: 0.84rem; }

  /* ─── 2. Z-index：テキスト・UIをセレブ画像より必ず前面に ─── */
  .celeb-icon-wrap { z-index: 20; }

  /* ─── 3. 床：スマホで視認できるよう少し濃く・高く ─── */
  .celeb-floor {
    height: 44%;
    background: linear-gradient(to bottom,
      transparent,
      rgba(180,145,90,0.30) 50%,
      rgba(155,120,65,0.55));
  }

  /* ─── 4. セレブ画像：床底部に足が接するよう配置（浮き解消） ─── */
  /* 画像比率1.5 × 幅75px = 高さ112px。bottom:4% で足元が床の最下部に着地 */
  .celeb-icon-wrap  { bottom: 4%; width: 75px; }

  /* ─── 5. 管理人画像：ボタン群と重ならない高さへ ─── */
  /* celeb 75px × 85% = 64px。bottom:40% でボタン上端(≈88px)より常に上 */
  /* portrait既存ルール bottom:46% を上書き */
  .poor-person-wrap { bottom: 40%; width: 64px; }
}

/* ===== TABLET LANDSCAPE (横向きタブレット) ===== */
/* 管理人画像がシェアボタンと重ならないよう上に移動 */
@media (orientation: landscape) and (max-height: 900px) and (min-width: 641px) {
  .poor-person-wrap {
    bottom: 28%;
  }
}

/* ===== TABLET PORTRAIT: フッターまでスクロール可能にする ===== */
/* スマホ縦(~640px)は overflow:hidden を維持。タブレット縦(641px~)のみスクロール許可 */
@media (orientation: portrait) and (min-width: 641px) {
  .celeb-page-body {
    overflow-y: auto;
  }
}

/* ===== CELEB PAGE FOOTER (fixed) ===== */
.celeb-page-body footer {
  /* iOS ホームインジケーター/ツールバーの下に隠れないよう安全領域を確保 */
  padding-bottom: max(5px, env(safe-area-inset-bottom));
}

/* ===== UTILITIES ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,215,0,0.3);
}
