: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;
}

/* 舞い散る落ち葉の装飾レイヤー */
.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;
}

/* ================= 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-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: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-share:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.btn-create-new {
  background: linear-gradient(135deg, #d97824 0%, #a8321e 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 120, 36, 0.35);
}

.btn-create-new:hover {
  background: linear-gradient(135deg, #ea8a38 0%, #b83c26 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 120, 36, 0.5);
}

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

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

.disclaimer {
  font-size: 10px;
  opacity: 0.75;
}

/* ================= Responsive ================= */
@media (max-width: 540px) {
  .page-container {
    padding: 18px 12px 54px;
  }
  .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;
  }
}
