/* list.css — 試合一覧画面スタイル（最新：コンパクトチャンピオン版） */

:root {
  --item-size: 28px;
  --item-gap: 4px;
  --card-gap: 8px;
  --stat-width: 11ch;
}

body {
  background: #1e1e2e;
  color: #e0e0e0;
  font-family: sans-serif;
  margin: 0;
  padding: 2em;
}

.container {
  max-width: 780px;
  margin: auto;
  position: relative; /* コンテナを相対位置に設定 - 子要素の絶対位置の基準点 */
}

h1 {
  text-align: center;
  margin-bottom: 2em;
  font-size: 2rem;
}

.error {
  color: #f88;
  text-align: center;
  margin-bottom: 2em;
}

/* フォーム */
form {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-bottom: 2em;
  flex-wrap: wrap;
}
form input {
  padding: 1em;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #2e2e3e;
  color: #e0e0e0;
  width: 220px;
}
form button {
  padding: 1em 2em;
  font-size: 1.1rem;
  border: none;
  border-radius: 6px;
  background: linear-gradient(45deg, #5e9cff, #e6a3a8);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: opacity .2s;
}
form button:hover {
  opacity: .85;
}

@media (max-width: 600px) {
  form input,
  form button {
    width: 100%;
    max-width: 300px;
  }
}

/* マッチカードリスト */
.match-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.match-card {
  margin-bottom: var(--card-gap);
  display: grid;
  grid-template-columns: 4px 1fr;
  background: #2a2a3a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s;
}
.match-card.win {
  border-left: 4px solid #28a745;
}
.match-card.loss {
  border-left: 4px solid #dc3545;
}
.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.6);
}

.content {
  padding: 1em;
  min-height: 120px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

/* row1：デフォルト gap 1em */
.row1 {
  display: grid;
  grid-template-columns: auto 56px auto auto auto auto 1fr auto;  /* 最後にautoを追加 */
  align-items: center;
  gap: 1em;
  align-content: center;
}

/* ◯日前と画像の間を狭く */
.elapsed {
  font-weight: bold;
  white-space: nowrap;
  min-width: 60px;
  font-size: 0.9rem; /* フォントサイズを小さく */
}
.time-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.mode-label {
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 0.2em;
}

/* メインチャンプ */
.main-champ {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: -0.5em;
}

/* スペル＋ルーン */
.spells-runes {
  display: flex;
  align-items: flex-start;
  gap: 0.1em;
}
.spells {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}
.spell-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.rune-container {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}
.rune-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

/* KDA */
.kda-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kda {
  font-size: 1rem;
  font-weight: 600;
  width: 6ch;
  text-align: center;
}
.kda-ratio {
  font-size: 0.75rem;
  color: #ccc;
  margin-top: 0.2em;
}

/* スタッツ */
.stats-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  font-size: 0.75rem;
  color: #ccc;
  white-space: nowrap;
}
.stats-block .stat {
  display: inline-block;
  width: var(--stat-width);
  text-align: left;
}

/* アイテム */
.items {
  display: grid;
  grid-template-columns: repeat(4, var(--item-size));
  grid-template-rows: repeat(2, var(--item-size));
  gap: 8px 4px;  /* 行間隔8px 列間隔4px */
  width: calc(var(--item-size) * 4 + var(--item-gap) * 3);
  align-content: start;
  height: calc(var(--item-size) * 2 + 8px);  /* 高さも調整 */
}

/* アイテムアイコンのサイズを指定 */
.item-icon {
  width: var(--item-size);
  height: var(--item-size);
  object-fit: cover;
  border-radius: 4px;
}

/* アイテムプレースホルダー */
.item-placeholder {
  width: var(--item-size);
  height: var(--item-size);
  background: #3c3c4c;
  border-radius: 4px;
}

/* チャンプ一覧 */
.teams-champs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-content: center;
}
.ally-champs,
.enemy-champs {
  display: flex;
  gap: 4px;
}
.enemy-champs {
  opacity: 0.7;
}
.mini-champ {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
  transition: transform .2s;
}
.mini-champ:hover {
  transform: scale(1.1);
}

/* フィードバックボタン */
.feedback-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(45deg, #3a5c9c, #8b5c6d);
  color: #fff;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity .2s, transform .1s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback-btn:hover {
  opacity: .85;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.6);
}

/* neomorphic dark feedback button */
.feedback-btn.neu {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2a2a3a;
  box-shadow:
    /* 外側の暗い影 */
    -4px -4px 8px rgba(255,255,255,0.05),
     4px  4px 8px rgba(0,0,0,0.7),
    /* 内側のハイライト */
    inset 2px 2px 4px rgba(255,255,255,0.1),
    inset -2px -2px 4px rgba(0,0,0,0.6);
  color: #e0e0e0;
  font-size: 24px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition:
    box-shadow .2s,
    transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback-btn.neu:hover {
  transform: translateY(-2px);
  box-shadow:
    -4px -4px 12px rgba(255,255,255,0.1),
     4px  4px 12px rgba(0,0,0,0.8),
    inset 2px 2px 6px rgba(255,255,255,0.15),
    inset -2px -2px 6px rgba(0,0,0,0.7);
}

/* ハンバーガーメニュー */
.menu-toggle {
  position: absolute;
  top: 1.5em;
  right: 1.5em;
  width: 36px;
  height: 36px;
  background: #2a2a3a;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1000;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: #3a3a4a;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #e0e0e0;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.dropdown-menu {
  position: absolute;
  top: 4.5em;
  right: 1.5em;
  background: #2a2a3a;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  z-index: 900;
  max-width: 250px;
  width: calc(100% - 3em);
}

.dropdown-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-items li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.menu-items li:last-child {
  border-bottom: none;
}

.menu-items a {
  display: block;
  padding: 0.9em 1.2em;
  color: #e0e0e0;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.menu-items a:hover {
  background: rgba(255,255,255,0.05);
}

.menu-items a.active {
  background: linear-gradient(45deg, #5e9cff, #e6a3a8);
  color: #fff;
}

.badge {
  display: inline-block;
  font-size: 0.7em;
  background: #ff6b6b;
  color: #fff;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  margin-left: 0.5em;
  vertical-align: middle;
}

.menu-icon {
  margin-right: 0.8em;
  font-size: 1.1em;
  vertical-align: middle;
}

/* サモナーカードのスタイル（コンパクトチャンピオン版） */
.summoner-card-container {
  margin: 1.5em auto;
  width: 100%;
  max-width: 1200px;
}

.summoner-card-compact {
  background: linear-gradient(135deg, #2a2a3a 0%, #1e1e2e 100%);
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5em;
  display: flex;
  align-items: flex-start;
  gap: 1.5em;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.4s ease-out;
}

.summoner-main-info {
  display: flex;
  align-items: flex-start;
  gap: 1em;
  flex: 0 0 400px;  /* PCでは400px固定 */
  max-width: 400px;
}

.profile-icon {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid #5e9cff;
  object-fit: cover;
  flex-shrink: 0;
}

.summoner-details {
  flex: 1;
}

.summoner-name-line {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.summoner-name {
  font-size: 1.3em;
  font-weight: bold;
  color: #e0e0e0;
}

.summoner-tag {
  color: #888;
  font-size: 1em;
}

.hot-streak {
  color: #ff6b00;
  font-size: 1.2em;
  text-shadow: 0 0 5px rgba(255, 107, 0, 0.5);
}

.veteran {
  color: #ffd700;
  font-size: 1em;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.summoner-rank-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
  margin-bottom: 0.8em;
}

.rank-icon {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.rank-text {
  font-weight: bold;
  color: #fff;
  font-size: 1em;
}

.rank-stats {
  color: #888;
  font-size: 0.95em;
}

.ladder-rank {
  color: #ff6b6b;
  font-size: 0.9em;
  font-weight: 500;
}

.performance-line {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  color: #ccc;
  font-size: 0.9em;
}

.recent-winrate {
  font-weight: 600;
}

.streak {
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.85em;
}

.win-streak {
  background: rgba(50, 199, 120, 0.2);
  color: #32c778;
  border: 1px solid rgba(50, 199, 120, 0.3);
}

.loss-streak {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.recent-kda {
  font-family: monospace;
}

.favorite-roles {
  color: #5e9cff;
}

.champion-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-left: auto;
  align-self: flex-start;
  min-width: 280px;
}

.champion-detail {
  display: flex;
  align-items: center;
  gap: 0.7em;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4em 0.6em;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.champion-detail:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.champ-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #444;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.champion-detail:hover .champ-icon {
  transform: scale(1.05);
}

.champion-stats-text {
  font-size: 0.85em;
  text-align: left;
  line-height: 1.3;
}

.champion-name-record {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-bottom: 0.1em;
}

.champion-name {
  font-weight: bold;
  color: #e0e0e0;
  font-size: 0.95em;
}

.champion-record {
  color: #888;
  font-size: 0.85em;
}

.champion-kda {
  color: #aaa;
  font-size: 0.8em;
  font-family: monospace;
}

/* エラー表示 */
.summoner-card.error {
  background: #4a1f1f;
  color: #ff6b6b;
  text-align: center;
  padding: 1em;
  border-radius: 8px;
  margin-bottom: 1.5em;
}

/* ツールチップスタイル */
.champion-quick [title] {
  position: relative;
}

.champion-quick img[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5em;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: nowrap;
  z-index: 100;
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .summoner-card-compact {
    flex-direction: column;
    gap: 1em;
    padding: 1em;
  }
  
  .summoner-main-info {
    width: 100%;
    flex: none;
    max-width: none;
  }
  
  .champion-summary {
    width: 100%;
    margin-left: 0;
  }
  
  .ladder-rank {
    width: 100%;
    text-align: left;
    margin-top: 0.3em;
  }
  
  .performance-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1em;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 1em;
  }
  
  .content {
    padding: 0.8em;
    min-height: 100px;
  }
  
  /* row1 の gap を半分に */
  .row1 {
    gap: 0.5em;
    grid-template-columns: auto 40px auto auto 1fr auto;  /* stats-block用のカラムを削除 */
  }
  
  /* 経過時間のフォントサイズをさらに小さく */
  .elapsed {
    font-size: 0.8rem;
  }
  
  /* KDAとキーストーンの間隔を調整 */
  .spells-runes {
    gap: 0.1em;
  }
  
  .main-champ {
    width: 40px;
    height: 40px;
    margin-left: -0.3em;
  }
  
  .spell-icon,
  .rune-icon,
  .item-icon,
  .mini-champ {
    width: 28px;
    height: 28px;
  }
  
  /* フィードバックボタン */
  .feedback-btn,
  .feedback-btn.neu {
    width: 60px;
    height: 60px;
    font-size: 30px;
    margin-left: 10px;
  }

  /* PWAインストールボタン */
.install-btn {
  display: none; /* 初期状態は非表示 */
  padding: 0.9em 1.2em;
  background: linear-gradient(135deg, #5e9cff 0%, #e6a3a8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 1em auto;
  text-align: center;
  max-width: 280px;
  width: 100%;
}

.install-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

  /* メニュー調整 */
  .menu-toggle {
    top: 1em;
    right: 1em;
  }
  
  .dropdown-menu {
    top: 4em;
    right: 1em;
  }
  
  /* モバイルで非表示にする要素 */
  .stats-block,
  .items,
  .teams-champs {
    display: none;
  }
}



@media (max-width: 480px) {
  .summoner-card-compact {
    padding: 0.8em;
  }
  
  .profile-icon {
    width: 60px;
    height: 60px;
  }
  
  .summoner-name {
    font-size: 1.1em;
  }
  
  .summoner-rank-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3em;
  }
  
  .champion-detail {
    padding: 0.3em 0.5em;
    gap: 0.6em;
  }
  
  .champ-icon {
    width: 36px;
    height: 36px;
  }
  
  .champion-stats-text {
    font-size: 0.8em;
  }
  
  .champion-name {
    font-size: 0.9em;
  }
  
  .champion-record {
    font-size: 0.8em;
  }
  
  .champion-kda {
    font-size: 0.75em;
  }
  
  .performance-line {
    gap: 0.3em;
    font-size: 0.85em;
  }
}