/* ============================================
   BitCraft Market Search - style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --bg: #070d17;
  --bg2: #0d1827;
  --bg3: #111f30;
  --border: #1e3a55;
  --border2: #2a4f72;
  --accent: #00c896;
  --accent2: #00a37a;
  --accent-sell: #00c896;
  --accent-buy: #5b9cf6;
  --accent-gold: #f0a500;
  --text: #c8dff0;
  --text2: #7a9ab8;
  --text3: #4a6a88;
  --danger: #ff4d6d;
  --pos: #00c896;
  --neg: #ff4d6d;
  --card-bg: rgba(13, 24, 39, 0.9);
  --glow: 0 0 20px rgba(0,200,150,0.15);
  --radius: 8px;
  --radius-lg: 14px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- 背景エフェクト ---- */
.bg-grid {
  display: none;
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(0,200,150,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- ヘッダー ---- */
header {
  position: relative; z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(7,13,23,0.95);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px var(--accent));
}
.logo h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1;
}
.logo h1 .accent { color: var(--accent); }
.logo .tagline {
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ---- メイン ---- */
main {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ---- 検索 ---- */
.search-section {
  margin-bottom: 40px;
}
.search-box {
  position: relative;
  margin-bottom: 16px;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px 16px;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  min-height: 44px;
}
.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.12);
}
.search-icon { font-size: 1.1rem; color: var(--text3); }
#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1rem;
  padding: 10px 0;
}
#searchInput::placeholder { color: var(--text3); }
#searchBtn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-lg);
  padding: 10px 24px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}
#searchBtn:hover { background: #00e6ad; }
#searchBtn:active { transform: scale(0.97); }

/* サジェスト */
.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(0,200,150,0.08); }
.s-name { font-weight: 500; }
.s-ja { color: var(--text2); font-size: 0.85rem; }
.s-tier {
  margin-left: auto;
  font-size: 0.75rem;
  background: rgba(0,200,150,0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}

/* フィルター */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group label {
  font-size: 0.8rem;
  color: var(--text2);
  white-space: nowrap;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.filter-group select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.filter-group select:focus { border-color: var(--accent); }

/* ---- セクションタイトル ---- */
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- アイテムヘッダー ---- */
.item-header {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
}
.item-title h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.item-ja { color: var(--text2); font-size: 1.3rem; }
.item-badges { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.item-ja-name { margin: 0; font-size: 1.8rem; white-space: nowrap; }
.item-en-name { color: var(--text2); font-size: 1.3rem; white-space: nowrap; }

.item-name-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: baseline;
  white-space: nowrap;
}
.badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.badge.tier {
  background: rgba(240,165,0,0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(240,165,0,0.3);
}
.badge.cat {
  background: rgba(91,156,246,0.15);
  color: var(--accent-buy);
  border: 1px solid rgba(91,156,246,0.3);
}

/* ---- 価格カード ---- */
.price-summary {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.price-cards {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.price-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}
.price-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.price-card.sell { border-left: 3px solid var(--accent-sell); }
.price-card.buy { border-left: 3px solid var(--accent-buy); }
.price-card.avg, .price-card.avg7 { border-left: 3px solid var(--accent-gold); }
.price-card.vol { border-left: 3px solid var(--text3); }
.price-card.avg-sell { border-left: 3px solid var(--accent-sell); }
.price-card.avg-buy { border-left: 3px solid var(--accent-buy); }
.pc-label {
  font-size: 0.72rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  margin-bottom: 6px;
}
.pc-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.pc-sub {
  font-size: 0.7rem;
  color: var(--text3);
}
.coin { font-size: 0.9em; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ---- 需要と供給 ---- */
.supply-demand-section {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.sd-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}
.sd-info { display: flex; flex-direction: column; gap: 8px; }
.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--bg2);
  border: 1px solid var(--border);
}
.sd-label { font-size: 0.85rem; min-width: 110px; }
.sd-count {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.sd-qty {
  font-size: 0.8rem;
  color: var(--text2);
  margin-left: auto;
}
.sd-bar-wrap { min-width: 0; }
.sd-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.sd-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  transition: width 0.6s ease;
}
.sell-fill { background: rgba(0,200,150,0.35); color: var(--accent); }
.buy-fill { background: rgba(91,156,246,0.35); color: var(--accent-buy); }
.sd-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text2);
  font-family: 'Rajdhani', sans-serif;
}

/* ---- 注文＋マップレイアウト ---- */
.orders-map-layout {
  display: grid;
  grid-template-columns: 1fr 580px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .orders-map-layout { grid-template-columns: 1fr; }
  .sd-wrap { grid-template-columns: 1fr; }
}

/* ---- 注文一覧 ---- */
.orders-list {
  display: flex;
  flex-direction: column;
}

.orders-table-wrap {
  overflow-y: auto;
  max-height: 500px;
}

.orders-table-wrap::-webkit-scrollbar {
  display: none;
}

.orders-list::-webkit-scrollbar {
  display: none;
}

.order-count {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 400;
}
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.orders-table thead tr {
  border-bottom: 1px solid var(--border2);
}
.orders-table th {
  padding: 8px 12px;
  text-align: left;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}
.order-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}
.order-row:hover { background: rgba(0,200,150,0.05); }
.order-row td { padding: 10px 12px; vertical-align: middle; }
.order-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.order-badge.sell {
  background: rgba(0,200,150,0.15);
  color: var(--accent-sell);
  border: 1px solid rgba(0,200,150,0.3);
}
.order-badge.buy {
  background: rgba(91,156,246,0.15);
  color: var(--accent-buy);
  border: 1px solid rgba(91,156,246,0.3);
}
.price-cell {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}
.claim-name { color: var(--text); font-weight: 500; }
.coords { font-family: 'Rajdhani', sans-serif; font-size: 0.8rem; color: var(--text2); }
.no-orders { color: var(--text2); text-align: center; padding: 24px; }

/* ---- マップ ---- */
.map-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.map-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.map-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
  font-size: 0.9rem;
}
.map-inner { position: relative; }
.claims-svg {
  width: 100%;
  height: auto;
  display: block;
}
.map-marker { transition: opacity 0.2s; }
.map-marker:hover { opacity: 0.8; }
.pulse-ring {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { r: 12; opacity: 0.4; }
  50% { r: 18; opacity: 0.1; }
  100% { r: 12; opacity: 0.4; }
}
.map-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.map-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  color: var(--accent);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.map-link-btn:hover { background: rgba(0,200,150,0.2); }
.map-hint { font-size: 0.75rem; color: var(--text3); }

/* マーカー情報ポップアップ */
.marker-info {
  position: absolute;
  bottom: 12px; right: 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 10;
}
.mi-header { margin-bottom: 6px; }
.mi-header strong { display: block; font-size: 0.95rem; color: #fff; }
.mi-region { font-size: 0.75rem; color: var(--text2); }
.mi-coords { font-size: 0.78rem; color: var(--text2); margin-bottom: 8px; font-family: 'Rajdhani', sans-serif; }
.mi-orders { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.mi-order {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 4px 8px;
  background: var(--bg2);
  border-radius: 4px;
}
.mi-maplink {
  display: block;
  text-align: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}
.mi-close {
  position: absolute;
  top: 8px; right: 8px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
}
.mi-close:hover { color: var(--text); }

/* 凡例 */
.map-legend { margin-top: 12px; }
.legend-items { display: flex; gap: 16px; flex-wrap: wrap; }
.leg {
  font-size: 0.78rem;
  color: var(--text2);
  font-family: 'Rajdhani', sans-serif;
}
.leg.sell { color: var(--accent-sell); }
.leg.buy { color: var(--accent-buy); }
.leg.both { color: var(--accent-gold); }

/* ---- 空状態 ---- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-sub { font-size: 0.85rem; color: var(--text3); margin-top: 6px; }

/* ---- ローディング ---- */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- エラー ---- */
.error-msg {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 0.9rem;
}

/* ---- フッター ---- */
footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #666;
  font-size: 13px;
  margin-top: 40px;
}
footer a { color: var(--text2); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ---- ユーティリティ ---- */
.hidden { display: none !important; }

.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.order-badge.sell {
  background: rgba(0, 200, 150, 0.2);
  color: #00c896;
  border: 1px solid #00c896;
}

.order-badge.buy {
  background: rgba(91, 156, 246, 0.2);
  color: #5b9cf6;
  border: 1px solid #5b9cf6;
}

.suggestion-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.suggestion-item:hover {
  background: rgba(255,255,255,0.05);
}

.s-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.s-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.s-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.s-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
}

.s-sub {
  font-size: 11px;
  color: #888;
}

.s-tags {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 100%;
}

.s-tier {
  font-size: 11px;
  color: #f0a500;
  font-weight: 600;
}

.s-rarity {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.rarity-common { color: #aaa; }
.rarity-uncommon { color: #00c896; }
.rarity-rare { color: #5b9cf6; }
.rarity-epic { color: #c673e0; }
.rarity-legendary { color: #f0a500; }
.rarity-mythic { color: #ff4d6d; }
.search-results {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.result-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.result-card:hover {
  background: rgba(255,255,255,0.05);
}

.result-card .s-top {
  flex: 1;
  align-items: center;
  gap: 10px;
}

.result-card .s-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-card .s-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
}

.result-card .s-sub {
  font-size: 11px;
  color: #888;
}

.result-card .s-tags {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rc-top {
  display: contents; /* PC 版では rc-top を無視して子要素を直接並べる */
}

.rc-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.rc-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: flex-start;
  white-space: nowrap;
}

.rc-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.rc-sub {
  font-size: 12px;
  color: #888;
}

.rc-badges {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rc-badges .badge,
.rc-badges .s-rarity,
.rc-badges .s-parent-category,
.rc-badges .s-tag {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(0,200,150,0.3);
}

.rc-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.rc-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.rc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.rc-sub {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.rc-badges {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: #00c896;
  color: #00c896;
}

.map-btn {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(0,200,150,0.15);
  border: 1px solid rgba(0,200,150,0.4);
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.map-btn:hover {
  background: rgba(0,200,150,0.3);
}

.item-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.item-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.item-title-text {
  flex: 1;
  min-width: 0;
}
.item-title-text h2 {
  margin: 0 0 8px 0;
  font-size: 1.6rem;
}

.price-chart-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.region-stats-section {
  margin-bottom: 16px;
}

.region-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.region-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px;
}

.region-card.sell { border-left: 3px solid #00c896; }
.region-card.sell-high { border-left: 3px solid #f0a500; }
.region-card.buy { border-left: 3px solid #5b9cf6; }
.region-card.count { border-left: 3px solid #c673e0; }

.rc-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.rc-val {
  font-size: 16px;
  font-weight: 700;
  color: #e0e0e0;
}

.rc-claim {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-label {
  font-size: 13px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 10px;
}

.region-chart-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.period-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.period-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 4px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.period-btn:hover {
  border-color: #00c896;
  color: #00c896;
}

.period-btn.active {
  background: rgba(0,200,150,0.15);
  border-color: #00c896;
  color: #00c896;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
}

.page-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: #00c896;
  color: #00c896;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  color: #aaa;
  font-size: 14px;
}

.order-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.tab-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: #00c896;
  color: #00c896;
}

.tab-btn.active {
  background: rgba(0,200,150,0.15);
  border-color: #00c896;
  color: #00c896;
}

.sort-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  margin-left: 4px;
}

.sort-btn.active {
  border-color: #00c896;
  color: #00c896;
}

.sort-btn:hover {
  border-color: #00c896;
  color: #00c896;
}

.chart-orders-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.price-chart-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
}

.orders-list {
  overflow-y: auto;
  max-height: 800px;
}
.region-order-filter {
  background: #1a2535;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}

.region-order-filter option {
  background: #1a2535;
  color: #e0e0e0;
}

@media (max-width: 768px) {
  .chart-orders-layout {
    grid-template-columns: 1fr;
  }

  .order-type-tabs {
    flex-wrap: wrap;
  }

  .region-order-filter {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }

  .price-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    flex-wrap: wrap;
  }

  .filter-group {
    flex: 1 1 45%;
  }

  .orders-table {
    font-size: 12px;
  }

  .orders-table th,
  .orders-table td {
    padding: 6px 4px;
  }

  main {
    margin: 0;
    padding: 16px;
    text-align: left;
  }
  .search-results {
    max-width: 100%;
    padding: 0;
    margin: 0;
    text-align: left;
  }
  .result-grid {
    margin-top: 0;
  }

  .result-card {
    flex-direction: column;
    padding: 10px 12px;
    gap: 6px;
    text-align: left;
     margin-right: 20px;
     margin-left: 20px;
  }

  .result-card .s-top {
    width: 100%;
    gap: 8px;
  }

  .result-card .s-icon {
    width: 24px;
    height: 24px;
  }

  .result-card .s-name {
    font-size: 13px;
  }

  .result-card .s-sub {
    font-size: 11px;
  }

  .result-card .s-tags {
    width: 100%;
    margin-left: 0;
    gap: 4px;
  }

  .rc-info {
    white-space: normal;
    gap: 2px;
    flex-direction: column;
    text-align: left;
    min-width: 0;
     overflow: hidden;
text-overflow: ellipsis;
  }

  .rc-name {
    font-size: 12px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rc-sub {
    font-size: 10px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rc-badges {
    margin-left: 32px;
    gap: 4px;
    text-align: left;
  }
  .result-card {
    justify-content: flex-start;
  }

  .rc-badges {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    margin-top: 0;
    gap: 4px;
    flex-wrap: wrap;
  }
  .rc-badges .badge,
  .rc-badges .s-rarity,
  .rc-badges .s-parent-category,
  .rc-badges .s-tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .suggestion-item {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .s-top {
    width: 100%;
    flex: 1;
  }

  .s-tags {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding-left: 0;
    justify-content: flex-start;
  }

  .s-tier,
  .s-rarity,
  .s-parent-category,
  .s-tag {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .s-text {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .s-name {
    flex-shrink: 1;
    min-width: 0;
  }

  .s-sub {
    margin-left: 8px;
    flex-shrink: 1;
    min-width: 0;
  }

  /* アイテム詳細のタイトル名：スマホでは日本語と英語を縦並び */
  .item-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: normal;
  }

  .item-ja-name {
    font-size: 1.3rem;
    white-space: normal;
    word-break: break-word;
  }

  .item-en-name {
    font-size: 1rem;
    white-space: normal;
    word-break: break-word;
  }
}



.orders-list {
  position: relative;
}

.orders-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0d1520;
}

.trade-log-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.log-filter {
  margin-bottom: 12px;
}

.log-filter select {
  background: #1a2535;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.log-filter select option {
  background: #1a2535;
}

.log-table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.log-table th {
  text-align: left;
  padding: 8px 12px;
  color: #888;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  background: #0d1520;
}

.log-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #e0e0e0;
}

.log-table tr:hover {
  background: rgba(255,255,255,0.03);
}



.claim-search {
  background: #1a2535;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  width: 120px;
  outline: none;
  flex-shrink: 0;
}

.claim-search::placeholder {
  color: #666;
}

.orders-search-bar {
  padding: 8px 0;
}

.orders-table-body::-webkit-scrollbar {
  display: none;
}

.orders-table-header table,
.orders-table-body table {
  table-layout: fixed;
  width: 100%;
}

.orders-table-header th:nth-child(1),
.orders-table-body td:nth-child(1) { width: 60px; }

.orders-table-header th:nth-child(2),
.orders-table-body td:nth-child(2) { width: 100px; }

.orders-table-header th:nth-child(3),
.orders-table-body td:nth-child(3) { width: 60px; }

.orders-table-header th:nth-child(4),
.orders-table-body td:nth-child(4) { width: 150px; }

.orders-table-header th:nth-child(5),
.orders-table-body td:nth-child(5) { width: 120px; }

.orders-table-header th:nth-child(6),
.orders-table-body td:nth-child(6) { width: 120px; }

.orders-table-wrap::-webkit-scrollbar {
  width: 6px;
}

.orders-table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
}

.orders-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

.refresh-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 16px;
  margin-left: 8px;
  transition: all 0.2s;
}

.refresh-btn:hover {
  border-color: #00c896;
  color: #00c896;
}

.sd-region-filter {
  margin-bottom: 12px;
}

.sd-region-filter select {
  background: #1a2535;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.sd-region-filter select option {
  background: #1a2535;
}

.price-region-filter {
  margin-bottom: 12px;
}

.price-region-filter select {
  background: #1a2535;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.price-region-filter select option {
  background: #1a2535;
}

.multi-select-wrap {
  position: relative;
}

.multi-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s;
}

.multi-select-btn:hover {
  border-color: var(--accent);
}

.ms-arrow {
  font-size: 10px;
  color: #fff;
}

.multi-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  z-index: 200;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
  color: #fff;
}

.ms-item:hover {
  background: rgba(255,255,255,0.1);
}

.ms-item input[type=checkbox] {
  accent-color: var(--accent);
  cursor: pointer;
}

.ms-all {
  border-bottom: 1px solid var(--border);
  color: var(--danger);
  font-weight: 600;
}

.ms-group {
  font-weight: 600;
  color: var(--accent);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.ms-child {
  padding-left: 24px;
  color: var(--text2);
}

.clear-filter-btn {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--danger);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.clear-filter-btn:hover {
  background: rgba(255,77,109,0.2);
}

.s-tag {
  font-size: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--text2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.s-parent-category {
  font-size: 9px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 20px;
  background: rgba(91,156,246,0.15);
  color: var(--accent-buy);
  border: 1px solid rgba(91,156,246,0.3);
  white-space: nowrap;
  margin-right: 4px;
}


.ms-parent {
  padding: 6px 12px;
  font-size: 11px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.ms-parent:hover { background: var(--bg2); color: var(--text2); }
.ms-parent-arrow { font-size: 10px; transition: transform 0.2s; }
.ms-parent.open .ms-parent-arrow { transform: rotate(90deg); }
.ms-section { }
.ms-section-body { display: none; }
.ms-section-body.open { display: block; }

.s-category {
  font-size: 9px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 20px;
  background: rgba(91,156,246,0.15);
  color: var(--accent-buy);
  border: 1px solid rgba(91,156,246,0.3);
  white-space: nowrap;
  margin-right: 4px;
}

/* ティアタブ */
.item-title {
  justify-content: space-between;
}

@media (max-width: 768px) {
  .item-title-text h2 {
    font-size: 1.2rem;
  }
}

.tier-select-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

.tier-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 120px;
}

.tier-select:hover {
  border-color: #00c896;
  color: #00c896;
}

.tier-select:focus {
  border-color: #00c896;
  color: #00c896;
  outline: none;
}

.calc-list-btn {
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  color: var(--accent);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.calc-list-btn:hover {
  background: rgba(0,200,150,0.2);
}

#calcListModal input[type=number]::-webkit-inner-spin-button,
#calcListModal input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#calcListModal input[type=number] {
  -moz-appearance: textfield;
}
