:root {
  /* 秋のカラーパレット（深い紅葉・バーントオレンジ・琥珀・ダークウッド） */
  --autumn-dark-bg: #27130e;
  --autumn-deep-red: #8f2415;
  --autumn-vermilion: #b83a1b;
  --autumn-orange: #d9631e;
  --autumn-amber: #e68328;
  --autumn-gold: #f2ad38;
  --autumn-card-bg: rgba(43, 20, 14, 0.72);
  --autumn-card-border: rgba(217, 99, 30, 0.35);
  
  --text-main: #fcf4eb;
  --text-sub: #dfcebf;
  --text-muted: #a38d7e;
  
  /* セール・割引バッジ */
  --sale-green: #689f1d;
  --sale-green-glow: rgba(104, 159, 29, 0.35);
  
  --font-sans: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-round: 'M PLUS Rounded 1c', sans-serif;
  --font-en: 'Outfit', sans-serif;

  --shadow-warm: 0 8px 30px rgba(18, 7, 5, 0.45);
  --shadow-card: 0 12px 32px rgba(15, 6, 4, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  /* 深い秋のグラデーション背景（紅葉の森、夕暮れの茜色、焼き栗のブラウン） */
  background: 
    radial-gradient(ellipse at 80% 10%, rgba(217, 99, 30, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(143, 36, 21, 0.35) 0%, transparent 60%),
    linear-gradient(170deg, #381810 0%, #29120c 40%, #1a0b08 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* アプリ内ブラウザ（LINE等）向け外部ブラウザ起動バナー */
.iab-banner {
  background: linear-gradient(135deg, #d9631e, #8f2415);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 100000;
}
.iab-banner-btn {
  background: #ffffff;
  color: #8f2415;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.iab-banner-btn:hover {
  transform: scale(1.04);
}

/* 舞い散る落ち葉の装飾レイヤー */
.leaf-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-leaf {
  position: absolute;
  font-size: 26px;
  opacity: 0.16;
  filter: blur(0.5px);
  animation: floatDown 24s linear infinite;
}

.l1 { top: -40px; left: 8%; animation-duration: 22s; animation-delay: 0s; font-size: 32px; }
.l2 { top: -40px; left: 28%; animation-duration: 28s; animation-delay: 6s; font-size: 24px; opacity: 0.12; }
.l3 { top: -40px; left: 65%; animation-duration: 25s; animation-delay: 3s; font-size: 30px; }
.l4 { top: -40px; left: 88%; animation-duration: 32s; animation-delay: 11s; font-size: 22px; opacity: 0.14; }
.l5 { top: -40px; left: 45%; animation-duration: 26s; animation-delay: 15s; font-size: 28px; }

@keyframes floatDown {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
  }
  50% {
    transform: translateY(50vh) rotate(180deg) translateX(25px);
  }
  100% {
    transform: translateY(105vh) rotate(360deg) translateX(-20px);
  }
}

.page-container {
  max-width: 660px;
  margin: 0 auto;
  padding: 28px 18px 72px;
  position: relative;
  z-index: 1;
}

/* ================= Header ================= */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(217, 99, 30, 0.25);
  margin-bottom: 26px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaf-icon {
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(217, 99, 30, 0.4));
}

.logo-texts {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-round);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.logo-sub {
  font-family: var(--font-en);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--autumn-amber);
}

.header-count {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 800;
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(217, 99, 30, 0.35);
  color: var(--text-sub);
  border-radius: 20px;
  transition: all 0.25s ease;
}

.header-count.done {
  background: var(--autumn-orange);
  color: #fff;
  border-color: var(--autumn-gold);
  box-shadow: 0 4px 16px rgba(217, 99, 30, 0.4);
}

/* ================= Lead ================= */
.lead-section {
  text-align: center;
  margin-bottom: 26px;
}

.lead-title {
  font-family: var(--font-round);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.highlight-nine {
  display: inline-block;
  background: linear-gradient(135deg, var(--autumn-amber) 0%, var(--autumn-vermilion) 100%);
  color: #fff;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 50%;
  text-align: center;
  font-family: var(--font-en);
  font-size: 21px;
  font-weight: 900;
  margin: 0 4px;
  box-shadow: 0 4px 12px rgba(217, 99, 30, 0.45);
}

.lead-desc {
  font-size: 13.5px;
  color: var(--text-sub);
}

/* ================= Search ================= */
.search-section {
  position: relative;
  margin-bottom: 28px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 54px;
  padding: 0 44px 0 46px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  background: rgba(33, 14, 10, 0.85);
  backdrop-filter: blur(8px);
  border: 2px solid var(--autumn-card-border);
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--autumn-amber);
  background: rgba(43, 18, 13, 0.95);
  box-shadow: 0 0 0 4px rgba(230, 131, 40, 0.25);
}

.clear-btn {
  position: absolute;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-sub);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  background: #2a130d;
  border: 2px solid var(--autumn-orange);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(217, 99, 30, 0.18);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: rgba(217, 99, 30, 0.15);
}

.search-item-img {
  width: 64px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background-color: #111;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  margin-top: 2px;
}

.price-initial {
  text-decoration: line-through;
  color: var(--text-muted);
}

.price-final {
  font-weight: 800;
  color: #ffde99;
}

.badge-discount {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  background-color: var(--sale-green);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
}

.search-item-add {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--autumn-amber), var(--autumn-vermilion));
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(184, 58, 27, 0.4);
}

.search-item-add.added {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  box-shadow: none;
  cursor: default;
}

.search-state-msg {
  padding: 24px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

/* ================= 9 Slots Shelf ================= */
.shelf-section {
  margin-bottom: 30px;
}

.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.shelf-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(217, 99, 30, 0.3);
  color: var(--text-sub);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.reset-btn:hover {
  background: rgba(217, 99, 30, 0.2);
  color: #fff;
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.shelf-slot {
  position: relative;
  aspect-ratio: 2 / 3;
  background: rgba(28, 12, 8, 0.65);
  border: 2px dashed rgba(217, 99, 30, 0.35);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.shelf-slot.empty {
  cursor: pointer;
}

.shelf-slot.empty:hover {
  border-color: var(--autumn-amber);
  background: rgba(45, 20, 14, 0.85);
  transform: translateY(-2px);
}

.shelf-slot.empty .slot-number {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 800;
  color: rgba(217, 99, 30, 0.35);
}

.shelf-slot.empty:hover .slot-number {
  color: var(--autumn-amber);
}

.shelf-slot.filled {
  border: 1px solid rgba(217, 99, 30, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  background-color: #120806;
}

/* ドラッグ＆ドロップスタイル (作成画面用) */
.shelf-slot.draggable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.shelf-slot.draggable:active {
  cursor: grabbing;
}

.shelf-slot.dragging {
  opacity: 0.35;
  transform: scale(0.94);
  border: 2px dashed var(--autumn-amber) !important;
  box-shadow: 0 0 20px rgba(230, 131, 40, 0.6);
}

.shelf-slot.drag-over {
  border: 2px solid var(--autumn-gold) !important;
  box-shadow: 0 0 22px rgba(242, 173, 56, 0.7) !important;
  transform: scale(1.04);
  background: rgba(65, 30, 16, 0.9) !important;
  z-index: 10;
}

/* 個別表示画面用のリンクスロット */
.shelf-slot.viewer-link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.shelf-slot.viewer-link:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--autumn-amber);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
}

/* ================= 5番枠: 私の一番お気に入りの一作 (特別デザイン) ================= */
.shelf-slot.center-favorite {
  position: relative;
}

/* 空の5番枠 */
.shelf-slot.center-favorite.empty {
  border: 2px dashed rgba(242, 173, 56, 0.7);
  background: radial-gradient(circle at center, rgba(65, 30, 16, 0.9) 0%, rgba(35, 15, 10, 0.8) 100%);
  box-shadow: 0 0 16px rgba(242, 173, 56, 0.25), inset 0 0 12px rgba(242, 173, 56, 0.15);
}

.shelf-slot.center-favorite.empty:hover {
  border-color: #ffc83b;
  box-shadow: 0 0 24px rgba(242, 173, 56, 0.45), inset 0 0 16px rgba(242, 173, 56, 0.25);
  transform: translateY(-2px) scale(1.02);
}

.center-fav-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
}

.center-fav-crown {
  font-size: 26px;
  filter: drop-shadow(0 2px 6px rgba(242, 173, 56, 0.6));
  animation: pulseCrown 3s ease-in-out infinite;
}

.center-fav-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffde7a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.center-fav-sub {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 800;
  color: rgba(255, 222, 122, 0.65);
  letter-spacing: 0.1em;
}

@keyframes pulseCrown {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 6px rgba(242, 173, 56, 0.6)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 4px 12px rgba(242, 173, 56, 0.9)); }
}

/* ゲームが入った5番枠 */
.shelf-slot.center-favorite.filled {
  border: 2px solid #f2ad38;
  box-shadow: 0 0 22px rgba(242, 173, 56, 0.5), 0 8px 24px rgba(0, 0, 0, 0.7);
  transform: scale(1.02);
  z-index: 2;
}

/* 王冠リボンバッジ */
.center-fav-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f2ad38 0%, #d9631e 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 10px 4px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  letter-spacing: -0.02em;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-top: none;
}

/* 他の枠に入っているゲームを「★一番のお気に入り」に昇格させるボタン */
.slot-star-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #ffde7a;
  border: 1px solid rgba(242, 173, 56, 0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 4;
}

.slot-star-btn:hover {
  transform: scale(1.15);
  background: #f2ad38;
  color: #120806;
}

.shelf-slot.filled:hover .slot-star-btn {
  opacity: 1;
}

.slot-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-discount-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  font-family: var(--font-en);
  font-size: 11.5px;
  font-weight: 900;
  background-color: var(--sale-green);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.slot-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.shelf-slot.filled:hover .slot-remove-btn {
  opacity: 1;
}

.slot-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 70%, transparent 100%);
  padding: 20px 8px 8px;
  color: #fff;
}

.slot-title {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.slot-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 10.5px;
  margin-top: 1px;
}

.slot-price-final {
  font-weight: 800;
  color: #ffde7a;
}

.slot-price-initial {
  text-decoration: line-through;
  opacity: 0.65;
  font-size: 9.5px;
}

/* ================= Meter Section ================= */
.meter-section {
  margin-bottom: 28px;
}

.meter-card {
  background: rgba(35, 15, 10, 0.85);
  backdrop-filter: blur(10px);
  border: 2px solid var(--autumn-card-border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(217, 99, 30, 0.2);
}

.meter-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meter-icon {
  font-size: 18px;
}

.meter-badge {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--autumn-gold);
  letter-spacing: 0.04em;
}

.meter-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

/* 3カラムの指標グリッド */
.meter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 12px;
}

.meter-box {
  background: rgba(20, 8, 5, 0.55);
  border: 1px solid rgba(217, 99, 30, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.box-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.box-value {
  font-family: var(--font-en);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

/* 通常価格（打ち消し線） */
.price-strikethrough {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* セール価格（オレンジ） */
.val-accent {
  color: var(--autumn-amber);
}

/* 割安になった金額（おトク額ボックス） */
.box-savings {
  background: rgba(104, 159, 29, 0.12);
  border-color: rgba(104, 159, 29, 0.4);
}

.box-savings .box-label {
  color: #a4d868;
}

.savings-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.val-savings {
  color: #7bd322;
  font-size: 20px;
}

.savings-discount-rate {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  color: #a4d868;
}

/* ================= Actions ================= */
.action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 44px;
}

.btn-action {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.btn-see-result {
  background: linear-gradient(135deg, #f2ad38 0%, #e05e1b 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 22px rgba(224, 94, 27, 0.45);
  animation: glowSeeResult 2s ease-in-out infinite alternate;
}

.btn-see-result:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbb847 0%, #eb6926 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(224, 94, 27, 0.65);
}

.btn-see-result:disabled {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
  box-shadow: none;
  animation: none;
  cursor: not-allowed;
  opacity: 0.6;
}

@keyframes glowSeeResult {
  from {
    box-shadow: 0 4px 16px rgba(224, 94, 27, 0.4);
  }
  to {
    box-shadow: 0 6px 24px rgba(242, 173, 56, 0.7);
  }
}

.btn-image {
  background: linear-gradient(135deg, var(--autumn-vermilion) 0%, var(--autumn-orange) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(184, 58, 27, 0.45);
}

.btn-image:hover:not(:disabled) {
  background: linear-gradient(135deg, #a33215 0%, #c45517 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(184, 58, 27, 0.6);
}

.btn-share {
  background: #0f1419;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-share:hover:not(:disabled) {
  background: #1d242c;
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
}

.btn-create-new {
  background: linear-gradient(135deg, #f2ad38 0%, #d9631e 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(217, 99, 30, 0.45);
}

.btn-create-new:hover {
  background: linear-gradient(135deg, #fbb847 0%, #e06e28 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(217, 99, 30, 0.65);
}

.btn-icon {
  font-size: 18px;
}

/* ================= Footer ================= */
.app-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 2;
  border-top: 1px solid rgba(217, 99, 30, 0.2);
  padding: 24px 16px 36px;
}

/* Ko-fi 応援ボタン */
.footer-kofi-container {
  margin-bottom: 14px;
}
.footer-kofi-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: rgba(217, 99, 30, 0.12);
  border: 1px solid rgba(217, 99, 30, 0.35);
  color: #f1cfaf;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}
.footer-kofi-btn:hover {
  background: rgba(217, 99, 30, 0.24);
  border-color: rgba(217, 99, 30, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217, 99, 30, 0.2);
}
.kofi-icon {
  flex-shrink: 0;
  width: 20px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.footer-kofi-btn:hover .kofi-icon {
  transform: scale(1.08);
}

/* フッターの免責リンクボタン */
.footer-legal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.footer-legal-btn:hover { opacity: 1; }

/* ================= 免責事項モーダル ================= */
.legal-modal {
  background: #1c1612;
  color: #d4c4a8;
  border: 1px solid rgba(217, 99, 30, 0.35);
  border-radius: 14px;
  padding: 0;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.legal-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.legal-modal-inner {
  padding: 28px 28px 32px;
  overflow-y: auto;
  max-height: 85dvh;
  position: relative;
}
.legal-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.legal-modal-close:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.legal-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #e8d5b0;
  margin: 0 0 20px;
  padding-right: 32px;
  border-bottom: 1px solid rgba(217, 99, 30, 0.2);
  padding-bottom: 14px;
}
.legal-section {
  margin-bottom: 18px;
}
.legal-section h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: #c8a87a;
  margin: 0 0 6px;
  letter-spacing: 0.03em;
}
.legal-section p {
  font-size: 12px;
  line-height: 1.75;
  color: #a89880;
  margin: 0;
}
.legal-section a {
  color: #c8a87a;
  text-underline-offset: 3px;
}
.legal-section a:hover { color: #e8c890; }

/* ================= 画像保存モーダル（スマホ・LINE用 堅牢オーバーレイ） ================= */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.image-modal-card {
  background: #181411;
  color: #f1cfaf;
  border: 1px solid rgba(217, 99, 30, 0.45);
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  text-align: center;
  padding: 24px 20px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
}
.image-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.image-modal-close:hover { opacity: 1; }
.image-modal-header {
  margin-bottom: 14px;
  padding-right: 28px;
}
.image-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}
.image-modal-hint {
  font-size: 12px;
  color: #c4a888;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(217, 99, 30, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 14px 0 16px;
  line-height: 1.6;
}
.image-modal-hint strong {
  color: #ffaa66;
}
.image-modal-footer {
  margin-top: 10px;
}
.btn-close-modal {
  padding: 8px 28px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d4c4a8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}


/* ================= App Navigation ================= */
.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 8, 5, 0.6);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(217, 99, 30, 0.25);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--autumn-orange), var(--autumn-vermilion));
  color: #fff;
  box-shadow: 0 2px 10px rgba(184, 58, 27, 0.45);
}

.nav-icon {
  font-size: 14px;
}

/* ================= Viewer Banner (/list/:id 着地時) ================= */
.viewer-banner {
  background: radial-gradient(circle at 10% 20%, rgba(217, 99, 30, 0.25) 0%, rgba(35, 15, 10, 0.9) 100%);
  border: 2px solid var(--autumn-gold);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 0 24px rgba(242, 173, 56, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.viewer-banner-text {
  flex: 1;
  min-width: 240px;
}

.viewer-banner-tag {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--autumn-gold);
  background: rgba(242, 173, 56, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}

.viewer-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}

.viewer-banner-desc {
  font-size: 12.5px;
  color: var(--text-sub);
}

.btn-primary-glow {
  background: linear-gradient(135deg, #f2ad38 0%, #d9631e 100%);
  color: #1a0b08;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(242, 173, 56, 0.45);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(242, 173, 56, 0.7);
  color: #000;
}

.btn-copy-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(217, 99, 30, 0.4);
  color: var(--text-main);
}

.btn-copy-link:hover {
  background: rgba(217, 99, 30, 0.25);
  color: #fff;
}

/* ================= Explore View (/explore) ================= */
.explore-hero {
  text-align: center;
  margin-bottom: 28px;
}

.explore-badge {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--autumn-amber);
  margin-bottom: 6px;
}

.explore-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.explore-desc {
  font-size: 13.5px;
  color: var(--text-sub);
}

.explore-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.explore-card {
  background: rgba(35, 15, 10, 0.85);
  border: 1.5px solid var(--autumn-card-border);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.explore-card:hover {
  transform: translateY(-3px);
  border-color: var(--autumn-amber);
  box-shadow: 0 8px 26px rgba(217, 99, 30, 0.35);
}

.explore-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(217, 99, 30, 0.2);
  padding-bottom: 10px;
}

.explore-card-date {
  font-size: 11.5px;
  color: var(--text-muted);
}

.explore-card-center-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--autumn-gold);
  background: rgba(242, 173, 56, 0.12);
  border: 1px solid rgba(242, 173, 56, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ミニ 3x3 サムネイルプレビュー */
.explore-card-thumbs {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}

.explore-thumb-box {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #110705;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.explore-thumb-box.is-center {
  border: 2px solid var(--autumn-gold);
  box-shadow: 0 0 8px rgba(242, 173, 56, 0.4);
}

.explore-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.explore-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding-top: 4px;
}

.explore-card-count {
  color: var(--text-sub);
  font-weight: 700;
}

.explore-card-action {
  color: var(--autumn-amber);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.explore-empty {
  text-align: center;
  padding: 48px 20px;
  background: rgba(35, 15, 10, 0.5);
  border: 2px dashed rgba(217, 99, 30, 0.3);
  border-radius: 16px;
}

.explore-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.explore-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.explore-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.explore-loading {
  text-align: center;
  padding: 36px;
  color: var(--text-sub);
  font-size: 14px;
}

/* ================= Responsive ================= */
@media (max-width: 540px) {
  .page-container {
    padding: 18px 12px 54px;
  }
  .app-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .app-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .lead-title {
    font-size: 19px;
  }
  .shelf-grid {
    gap: 8px;
  }
  .meter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .box-value {
    font-size: 17px;
  }
  .val-savings {
    font-size: 18px;
  }
  .viewer-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-primary-glow {
    width: 100%;
    justify-content: center;
  }
}
