/* ========= Profile Page ========= */

.profile-page{
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 12px 24px;
    min-height: calc(100vh - 140px);
}

/* header */
.profile-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin: 4px 0 10px;
}
.profile-head-left{
  flex:1 1 420px;
  min-width:0;
}
.profile-title{
  margin: 2px 0 4px;
  display:flex;
  align-items:center;
  gap:10px;
}
.profile-desc{
  margin:0;
  color: var(--muted, #6b7280);
  font-size: 13px;
}
.tag-pill{
  display:inline-flex;
  align-items:center;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  color: var(--text, #0f172a);
  background: transparent;
}
.breadcrumbs{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 2px;
}
.breadcrumbs a{ color: inherit; text-decoration:none; }
.breadcrumbs a:hover{ text-decoration: underline; }
.breadcrumbs .sep{ opacity:.6; }

/* === player page tabs === */
.player-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 10px 0 14px;
}

.player-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
}

.player-tab.is-active{
  background: var(--text-main);
  color:#fff;
  border-color: var(--text-main);
}

@media (max-width: 640px){
  /* 2列にして縦伸びしにくくする */
  .player-tab{ flex: 1 1 calc(50% - 8px); }
}


/* actions */
.profile-head-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex:0 1 640px;
  min-width:0;
  flex-wrap:wrap;
}

.profile-head-actions > .btn,
.profile-head-actions > .auto-track-btn{
  flex:0 0 auto;
  width:auto;
  max-width:100%;
  min-height:34px !important;
  height:auto !important;
  padding:0 12px !important;
  border-radius:999px !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:normal !important;
  word-break:keep-all !important;
  line-height:1.15 !important;
  box-sizing:border-box;
  text-align:center;
}

    /* 自動追跡ボタン */
    .auto-track-btn {
    font-size: 11px;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    cursor: pointer;
    color: var(--text-main);
    white-space: normal;
    line-height: 1.15;
    word-break: keep-all;
    overflow-wrap: anywhere;
    }

    .auto-track-btn[data-enabled="1"] {
    border-color: #22c55e;
    background: #ecfdf3;
    }

    .auto-track-btn:disabled {
    opacity: .6;
    cursor: default;
    }

/* cards spacing */
.profile-page .card + .card{
  margin-top: 14px;
}

.profile-refresh-limit{
  flex:0 0 100%;
  width:100%;
  min-width:0;
  min-height:16px;
  color:#64748b;
  font-size:11px;
  font-weight:750;
  line-height:1.45;
  text-align:right;
}

.profile-refresh-limit a{
  color:#2563eb;
  font-weight:900;
  text-decoration:none;
}

.profile-refresh-limit a:hover{
  text-decoration:underline;
}
.profile-page > .card{
  border-radius: 9px;
}
.profile-page > .card:not(.profile-hero){
  content-visibility: auto;
  contain-intrinsic-size: 520px;
}

/* card head */
.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding: 0 0 10px;
}
.card-sub{
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
}
.card-head--split{
  align-items:center;
}
.card-head-left{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.card-head-right{
  display:flex;
  align-items:center;
  gap:10px;
}
.ui-input--sm{
  padding: 8px 12px;
  font-size: 14px;
  width: auto;
  min-width: 220px;
}

/* data history */
.profile-history-card{
  padding: 14px;
}

.profile-history-summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  list-style:none;
  cursor:pointer;
  margin:0;
}

.profile-history-summary::-webkit-details-marker{
  display:none;
}

.profile-history-summary-arrow{
  flex:0 0 auto;
  font-size:22px;
  transition:transform .18s ease;
}

.profile-history-card[open] .profile-history-summary-arrow{
  transform:rotate(180deg);
}

.profile-history-content{
  padding-top:10px;
}

.profile-history-filters{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-bottom:10px;
}

.profile-history-filter{
  appearance:none;
  border:1px solid var(--border-soft);
  border-radius:999px;
  background:#fff;
  color:var(--text-main);
  padding:7px 11px;
  font:inherit;
  font-size:12px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
}

.profile-history-filter.is-active{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1d4ed8;
}

.profile-history-graph[hidden],
.profile-history-list[hidden]{
  display:none !important;
}

.profile-history-graph{
  margin-bottom:10px;
}

.profile-history-graph-canvas{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.profile-history-graph-card{
  position:relative;
  min-width:0;
  overflow:visible;
  border:1px solid #dbe3ed;
  border-radius:9px;
  background:#fbfdff;
}

.profile-history-graph-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  min-width:0;
  padding:8px 10px 1px;
}

.profile-history-graph-card-title{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}

.profile-history-graph-card-title img{
  display:block;
  width:18px;
  height:18px;
  object-fit:contain;
  flex:0 0 auto;
}

.profile-history-graph-card-title strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  color:#1f2937;
}

.profile-history-graph-card svg{
  display:block;
  width:100%;
  height:auto;
}

.profile-history-graph-grid{
  stroke:#e7edf4;
  stroke-width:1;
  vector-effect:non-scaling-stroke;
}

.profile-history-graph-axis-label{
  fill:#64748b;
  font-family:inherit;
  font-size:10px;
  font-weight:700;
}

.profile-history-graph-value-label{
  fill:#64748b;
  font-family:inherit;
  font-size:8px;
  font-weight:800;
}

.profile-history-graph-area{
  fill:rgba(51,65,85,.07);
}

.profile-history-graph-line{
  fill:none;
  stroke:#334155;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}

.profile-history-graph-point{
  fill:#fff;
  stroke:#334155;
  stroke-width:2;
  vector-effect:non-scaling-stroke;
}

.profile-history-graph-point:focus{
  outline:none;
  stroke:#0f172a;
  stroke-width:4;
}

.profile-history-graph-tooltip{
  position:absolute;
  z-index:3;
  max-width:calc(100% - 16px);
  transform:translate(-50%, calc(-100% - 7px));
  border-radius:6px;
  background:#111827;
  color:#fff;
  padding:4px 7px;
  font-size:9px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  pointer-events:none;
}

.profile-history-graph-tooltip[hidden]{
  display:none;
}

.profile-history-list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.profile-history-events{
  min-width:0;
  padding:9px;
  border:1px solid var(--border-soft);
  border-radius:12px;
  background:#fff;
}

.profile-history-events > h3{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 7px;
  color:var(--text-main);
  font-size:13px;
}

.profile-history-events > h3 i{
  color:#475569;
  font-size:16px;
}

.profile-history-event-list{
  display:grid;
  gap:6px;
}

.profile-history-item{
  display:grid;
  grid-template-columns:38px minmax(0, 1fr);
  gap:10px;
  align-items:center;
  min-width:0;
  padding:10px;
  border:1px solid var(--border-soft);
  border-radius:12px;
  background:#fff;
}

.profile-history-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:9px;
  background:#f1f5f9;
  color:#334155;
  font-size:18px;
}

.profile-history-icon img{
  display:block;
  width:30px;
  height:30px;
  object-fit:contain;
}

.profile-history-body{
  min-width:0;
}

.profile-history-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}

.profile-history-top > strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}

.profile-history-top time{
  flex:0 0 auto;
  color:var(--muted, #6b7280);
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}

.profile-history-change{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  margin-top:4px;
  min-width:0;
  color:var(--muted, #475569);
  font-size:12px;
  font-weight:700;
}

.profile-history-change > span,
.profile-history-change > strong{
  max-width:100%;
  overflow-wrap:anywhere;
}

.profile-history-change > strong{
  color:var(--text-main);
}

.profile-history-arrow{
  opacity:.55;
}

.profile-history-initial{
  font-size:10px;
}

.profile-history-delta{
  margin-left:auto;
  font-size:11px;
  font-style:normal;
  font-weight:900;
}

.profile-history-delta.is-up{
  color:#16a34a;
}

.profile-history-delta.is-down{
  color:#dc2626;
}

.profile-history-error{
  color:#dc2626;
}

/* hero */
.profile-hero{
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items:start;
  padding: 12px;
  --profile-tile-w: 148px;
}
.profile-summary-card,
.profile-metrics-card,
.profile-details-card{
  min-width:0;
  border-radius: 7px;
  background: transparent;
}
.profile-summary-card{
  grid-column: span 4;
  padding: 12px 14px;
  border: 0;
  background: transparent;
}
.profile-hero-left{
  display:flex;
  align-items:flex-start;
  gap:13px;
  min-width: 0;
}
.profile-avatar-stack{
  display:flex;
  flex:0 0 auto;
  flex-direction:column;
  align-items:center;
  gap:7px;
  width:68px;
  min-width:68px;
}
.profile-avatar{
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 0;
  border: 0;
  background: transparent;
}
.profile-hero-text{
  min-width:0;
}
.player-name{
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}
.player-name-stack{
  display:grid;
  gap:3px;
  min-width:0;
}
.player-original-name{
  color:var(--text-sub);
  font-size:11px;
  font-weight:600;
  line-height:1.2;
  opacity:.78;
}
.player-name-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.player-info-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.player-tag{
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  width:100%;
  max-width:68px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #475569);
  overflow:hidden;
  text-align:center;
  white-space:nowrap;
}
.player-club{
  margin-top: 8px;
  display:inline-flex;
  align-items:center;
  max-width:100%;
  gap:7px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 800;
  min-height: 0;
}
.player-club-text{
  display:flex;
  min-width:0;
  flex-direction:row;
  align-items:center;
  gap:6px;
  line-height:1.15;
}
.player-club-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color: var(--text, #0f172a);
}
.player-club-tag{
  font-size: 11px;
  color: var(--muted, #6b7280);
}
.player-club a{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-width:0;
  max-width:100%;
  color: inherit;
  text-decoration:none;
}
.player-club a:hover{ text-decoration: underline; }
.club-badge{
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}
.player-meta{
  /* 更新表示はJS側で入れない（空でもレイアウト崩れないように） */
  min-height: 0;
  margin-top: 6px;
  color: var(--muted, #6b7280);
  font-size: 12px;
}

/* KPI grid */
.hero-kpi-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--profile-tile-w), 1fr));
  gap:7px;
  min-width: 0;
  justify-items: stretch;
}
.hero-kpi{
  display:grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap:8px;
  align-items:center;
  border-radius: 6px;
  border: 0;
  background: rgba(248,250,252,.86);
  padding: 7px 9px;
  min-height: 48px;
}
.hero-kpi > div{
  min-width:0;
}
.hero-kpi-ico{
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.hero-kpi-label{
  font-size: clamp(9.5px, .78vw, 10.5px);
  color: var(--muted, #6b7280);
  font-weight: 800;
  line-height: 1.1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hero-kpi-val{
  font-size: clamp(12.5px, .98vw, 14px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text, #0f172a);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* profile data notices and compact panels */
.profile-notice{
  grid-column: 1 / -1;
  border: 1px solid #fde68a;
  border-radius: 14px;
  background: #fffbeb;
  color: #92400e;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}
.profile-notice[hidden]{
  display:none;
}
.profile-notice-item + .profile-notice-item{
  margin-top: 4px;
}
.profile-metrics-card{
  grid-column: span 8;
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:0;
  border:0;
  background:transparent;
  min-height:0;
}
.profile-details-card{
  grid-column: 1 / -1;
  padding: 10px 11px;
  min-height:0;
}
.profile-details-card .card-head{
  padding-bottom: 8px;
}
.profile-play-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:44px;
  margin-bottom:8px;
  padding:8px 10px;
  border:1px solid var(--border-soft, #e2e8f0);
  border-radius:7px;
  background:rgba(248,250,252,.86);
}
.profile-play-status-label{
  color:var(--muted, #6b7280);
  font-size:11px;
  font-weight:800;
}
.profile-play-status-value{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:7px;
  min-width:0;
  color:var(--text, #0f172a);
  font-size:13px;
}
.profile-play-status-value strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.profile-play-status-value img{
  width:28px;
  height:28px;
  object-fit:contain;
  flex:0 0 auto;
}
.profile-play-status-value img[hidden],
.profile-online-mode[hidden],
.profile-online-map[hidden],
.profile-play-status.is-offline .profile-play-status-value img,
.profile-play-status.is-unavailable .profile-play-status-value img{
  display:none !important;
}
.profile-online-mode,
.profile-online-map{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-width:0;
}
.profile-online-mode::before,
.profile-online-map::before{
  content:"-";
  color:var(--muted, #64748b);
  font-size:12px;
  font-weight:900;
}
.profile-online-mode img{
  width:24px;
  height:24px;
  object-fit:contain;
}
.profile-online-mode small,
.profile-online-map small{
  max-width:220px;
  overflow:hidden;
  color:var(--muted, #475569);
  font-size:11px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.profile-online-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#94a3b8;
  flex:0 0 auto;
}
.profile-online-dot.is-online{
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.14);
}
.profile-play-status.is-unavailable{
  opacity:.72;
}
.profile-details-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:7px;
  align-items:start;
}
.profile-extra-stats{
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap:7px;
  align-items: stretch;
  min-height:0;
}
.profile-extra-stats > .stat{
  min-width:0;
}
.profile-subhead{
  margin: 10px 0 6px;
  padding: 0 2px;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 950;
}
.profile-mini-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:7px;
  overflow:visible;
  border:0;
  border-radius: 0;
  background: transparent;
}
.profile-details-grid > .profile-mini-grid{
  display:contents;
}
.profile-mini-tile{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  border:0;
  border-radius: 6px;
  background: rgba(248,250,252,.86);
  padding:7px 9px;
  min-height: 48px;
}
.profile-mini-icon{
  width:22px;
  height:22px;
  object-fit:contain;
  flex:0 0 auto;
}
.profile-mini-copy{
  min-width:0;
  max-width:100%;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
}
.profile-mini-label{
  color: var(--muted, #6b7280);
  font-size: clamp(10px, .78vw, 12px);
  font-weight: 900;
  line-height:1.1;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.profile-mini-value{
  color: var(--text, #0f172a);
  font-size: clamp(11.5px, .88vw, 13px);
  font-weight: 950;
  line-height:1.2;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
}
.profile-mini-sub{
  color: var(--muted, #6b7280);
  font-size: clamp(9.5px, .72vw, 11px);
  font-weight: 800;
  line-height:1.2;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
}

/* stats */
.stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap:7px;
}
.profile-metrics-card > .stats{
  grid-template-columns: repeat(auto-fit, minmax(var(--profile-tile-w), 1fr));
}
.stat{
  display:grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    ". sub";
  align-items:center;
  column-gap:8px;
  row-gap:1px;
  border-radius: 6px;
  border: 0;
  background: rgba(248,250,252,.86);
  padding: 7px 9px;
  min-height: 48px;
}
.stat-top{
  grid-area: label;
  min-width:0;
  margin:0;
}
.stat-ico{
  grid-area: icon;
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.stat-label{
  color: var(--muted, #6b7280);
  font-size: clamp(9.5px, .72vw, 11px);
  font-weight: 900;
  line-height: 1.1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.stat-val{
  display:contents;
  font-size: clamp(12px, .94vw, 15px);
  font-weight: 950;
  letter-spacing: .2px;
}
.stat-val span{
  grid-area: value;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.stat-sub{
  grid-area: sub;
  min-width:0;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted, #6b7280);
  font-weight: 800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* brawlers */
.brawlers{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  align-items:start;
  align-content:start;
  min-height:0;
}
.brawler-card{
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(255,255,255,.06);
  padding: 10px 12px;
  align-self:start;
}
.brawler-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 8px;
}
.brawler-ico{
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brawler-name{
  font-weight: 950;
  font-size: 14px;
  line-height: 1.1;
}
.brawler-meta{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  font-weight: 800;
}
.brawler-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top: 6px;
}
.brawler-pill{
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(255,255,255,.07);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}
.brawler-pill img{
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* recent */
.recent{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.profile-recent-all{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#2563eb;
  font-size:12px;
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;
}
.profile-recent-all span{
  font-size:18px;
  line-height:1;
}
.profile-match-card{
  min-width:0;
  overflow:hidden;
  color:var(--text-main, #111827);
  text-decoration:none;
  border:2px solid #dbe2ea;
  border-radius:14px;
  background:var(--bg-card, #fff);
  padding:10px 11px 8px;
  display:flex;
  flex-direction:column;
  gap:8px;
  transition:border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.profile-match-card:hover{
  transform:translateY(-1px);
  box-shadow:0 7px 18px rgba(15,23,42,.08);
}
.profile-match-card.is-victory{ border-color:#86efac; }
.profile-match-card.is-defeat{ border-color:#fecaca; }
.profile-match-card.is-draw,
.profile-match-card.is-placement{ border-color:#fed7aa; }
.profile-match-head,
.profile-match-body{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.profile-match-mode{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.profile-match-icons{
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex:0 0 auto;
  color:#94a3b8;
  font-size:11px;
}
.profile-match-icons img{
  width:24px;
  height:24px;
  object-fit:contain;
  display:block;
}
.profile-match-mode-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.profile-match-mode-copy strong,
.profile-match-mode-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.profile-match-mode-copy strong{
  font-size:13px;
  line-height:1.25;
}
.profile-match-mode-copy small{
  color:var(--muted, #64748b);
  font-size:10px;
  font-weight:700;
}
.profile-match-result{
  flex:0 0 auto;
  font-size:16px;
  letter-spacing:.08em;
}
.profile-match-card.is-victory .profile-match-result{ color:#16a34a; }
.profile-match-card.is-defeat .profile-match-result{ color:#ef4444; }
.profile-match-card.is-draw .profile-match-result,
.profile-match-card.is-placement .profile-match-result{ color:#d97706; }
.profile-match-body{
  min-height:38px;
  padding:5px 7px;
  border-radius:9px;
  background:#f8fafc;
}
.profile-match-brawler{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}
.profile-match-brawler > img{
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 auto;
}
.profile-match-brawler > span{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.profile-match-brawler strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
}
.profile-match-progress{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:1px;
}
.profile-match-progress-values{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#334155;
  font-size:12px;
  white-space:nowrap;
}
.profile-match-progress-values img{
  width:18px;
  height:18px;
  object-fit:contain;
}
.profile-match-progress-values strong{
  font-size:12px;
}
.profile-match-progress > small{
  font-size:9px;
  font-weight:900;
}
.profile-match-progress > small.is-positive{ color:#16a34a; }
.profile-match-progress > small.is-negative{ color:#ef4444; }
@media (max-width: 980px){
  .profile-head{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .profile-head-actions{
    flex:0 0 100%;
    width:100%;
    justify-content:flex-start;
  }
  .profile-refresh-limit{
    text-align:left;
  }
  .profile-hero{
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .profile-summary-card,
  .profile-metrics-card,
  .profile-details-card,
  .hero-kpi-grid,
  .profile-notice{
    grid-column: 1 / -1;
  }
  .hero-kpi-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }
  .stats{
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .profile-metrics-card > .stats{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-extra-stats{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-details-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .brawlers{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ui-input--sm{
    min-width: 200px;
  }
}

@media (max-width: 640px){
  .profile-hero{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-head{
    flex-direction:column;
    align-items:flex-start;
  }
  .profile-head-left{
    flex:0 1 auto;
    width:100%;
  }
  .profile-head-actions{
    flex:0 0 auto;
    width: 100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
  .hero-kpi-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-refresh-limit{
    text-align:left;
  }
  .profile-details-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-metrics-card > .stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-extra-stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-mini-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brawlers{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-head--split{
    flex-direction:column;
    align-items:flex-start;
  }
  .profile-history-card{
    padding:11px;
  }
  .profile-history-summary.card-head--split{
    flex-direction:row;
    align-items:center;
  }
  .profile-history-graph-canvas{
    grid-template-columns:1fr;
    gap:6px;
  }
  .profile-history-list{
    grid-template-columns:1fr;
  }
  .profile-history-graph-card-head{
    padding:6px 6px 1px;
  }
  .profile-history-graph-card-title img{
    width:16px;
    height:16px;
  }
  .profile-history-graph-card-title strong{
    font-size:10px;
  }
  .profile-history-graph-card-head > b{
    font-size:10px;
  }
  .profile-history-item{
    grid-template-columns:32px minmax(0, 1fr);
    gap:8px;
    padding:8px;
  }
  .profile-history-icon{
    width:30px;
    height:30px;
  }
  .profile-history-icon img{
    width:26px;
    height:26px;
  }
  .ui-input--sm{
    width: 100%;
    min-width: 0;
  }
}

/* ===== Stats: subがある時の間隔を少し整える ===== */
.stat-val{
  flex-wrap: wrap;           /* 値が長い時に崩れない */
  row-gap: 4px;
}
.stat-sub{
  opacity: .95;
}

/* ===== Brawlers: 카드見やすく + スマホで詰まらない ===== */
.brawler-card{
  box-shadow: 0 10px 26px rgba(2,6,23,.08);
}
.brawler-row{
  flex-wrap: wrap;
}
.brawler-pill{
  flex: 1 1 calc(50% - 10px); /* 2列で折り返し */
}
@media (max-width: 420px){
  .brawlers{ grid-template-columns: 1fr; } /* 1列 */
  .brawler-pill{ flex: 1 1 100%; }         /* ピルも1列 */
}

.profile-hero-left{ min-width:0; }
.hero-kpi-grid{ width:100%; }

/* brawler cards: 余白と視認性を上げる */
.brawlers-grid{ gap:12px; }

.brawler-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:8px;
  padding:12px;
  background:#fff;
}

.brawler-top{ gap:10px; }
.brawler-ico{ width:46px; height:46px; }

.brawler-name{ font-size:14px; font-weight:800; line-height:1.15; }
.brawler-meta{ font-size:12px; opacity:.75; margin-top:2px; }

.brawler-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.brawler-pill{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:#f6f7fb;
  font-size:12px;
}

.brawler-pill img{ width:16px; height:16px; }

@media (max-width: 640px){
  .brawlers{ grid-template-columns: 1fr; }
  .brawler-row{ flex-wrap: wrap; }
  .brawler-pill{ flex: 1 1 calc(50% - 10px); justify-content: flex-start; }
  .brawler-top{ gap: 10px; }
  .brawler-name{ font-size: 14px; }
}

/* 認証バッジまわり */
.player-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  vertical-align: middle;
}

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.player-badge i {
  font-size: 14px;
  line-height: 1;
}

/* ---- action buttons (refresh / generate) ---- */
#refreshBtn, #generateProfileBtn, #profileImagePageBtn{
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    cursor: pointer;
    color: var(--text-main);
}

#refreshBtn:hover, #generateProfileBtn:hover, #profileImagePageBtn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.16);
}

#refreshBtn:disabled, #generateProfileBtn:disabled{
    opacity: .6;
    cursor: default;
}

.profile-render-quick-result{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  align-items:center;
  gap:10px;
  margin:0 0 10px;
  padding:10px 12px;
  border:1px solid #bfdbfe;
  border-radius:10px;
  background:#eff6ff;
}

.profile-render-quick-result[hidden]{
  display:none !important;
}

.profile-render-quick-result > img{
  display:block;
  width:72px;
  height:48px;
  border-radius:6px;
  object-fit:cover;
  object-position:top center;
  background:#fff;
}

.profile-render-quick-copy{
  min-width:0;
  display:grid;
  gap:5px;
  font-size:12px;
}

.profile-render-quick-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.profile-render-quick-actions[hidden]{
  display:none !important;
}

.profile-render-quick-actions a{
  color:#1d4ed8;
  font-weight:850;
  text-decoration:none;
}

.profile-render-quick-actions a:hover{
  text-decoration:underline;
}

#profileRenderQuickClose{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  padding:0;
  border:0;
  background:transparent;
  color:#475569;
  font-size:19px;
  cursor:pointer;
}

.brawler-meta{
  display:flex;
  align-items:center;
  gap:6px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  font-weight: 800;
  margin-top: 2px;
  opacity:.75;
}

.mini-ico{
  width: 14px;
  height: 14px;
  display:inline-block;
}

.brawler-buffies{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:8px;
}

.brawler-buffie{
  width:18px;
  height:18px;
  object-fit:contain;
}

/* Wide brawler ownership cards */
.brawlers{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: start;
  align-content: start;
}

.brawlers .profile-empty{
  grid-column: 1 / -1;
}

.brawler-card-v2{
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 96px;
  align-items: center;
  align-self: start;
  gap: 9px;
  min-height: 98px;
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
  contain: layout paint style;
}

.brawler-card-v2:hover{
  border-color: rgba(37, 99, 235, .34);
  background: #fbfdff;
}

.brawler-card-v2:active{
  transform: translateY(1px);
}

.brawler-card-v2:focus-visible{
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
}

.brawler-card-v2 .brawler-portrait{
  width: 66px;
  height: 66px;
  overflow: hidden;
  background: #f3f4f6;
}

.brawler-card-v2 .brawler-ico{
  width: 66px;
  height: 66px;
  display: block;
  object-fit: cover;
}

.brawler-card-v2 .brawler-main{
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  transform: translateY(4px);
}

.brawler-headline{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.brawler-card-v2 .brawler-name{
  min-width: 0;
  font-size: clamp(14px, .92vw, 17px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.05em;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brawler-side{
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  align-self: stretch;
}

.brawler-trophy-stack{
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: end;
  gap: 3px 7px;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  color: #20242c;
  text-align: right;
  width: 100%;
}

.brawler-trophy-stack span{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.brawler-trophy-stack img{
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.brawler-loadout{
  display: grid;
  grid-template-rows: repeat(2, 26px);
  row-gap: 0;
  min-width: 0;
  width: min(176px, 100%);
}

.brawler-power-icon,
.brawler-loadout-icon{
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.brawler-power-icon{
  width: 22px;
  height: 22px;
}

.brawler-loadout-row{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 24px;
  align-items: center;
  column-gap: 4px;
  width: max-content;
}

.brawler-loadout-row-top{
  margin-left: 12px;
}

.brawler-loadout-row-bottom{
  margin-left: 0;
}

.brawler-loadout-icon.is-missing{
  filter: grayscale(1) saturate(.2) opacity(.58);
}

.brawler-loadout-empty{
  color: var(--muted, #6b7280);
  font-weight: 900;
}

.brawler-footline{
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #111827;
  font-size: 11px;
  font-weight: 900;
}

.brawler-footline small{
  color: var(--muted, #6b7280);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.brawler-prestige{
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(15,23,42,.22));
  flex: 0 0 auto;
}

@media (max-width: 1020px){
  .brawlers{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px){
  .recent{
    grid-template-columns:1fr;
    gap:8px;
  }

  .profile-match-card{
    padding:9px 10px 7px;
    border-radius:12px;
  }

  .profile-match-icons img{
    width:22px;
    height:22px;
  }

  .profile-match-result{
    font-size:15px;
  }

  .profile-match-body{
    min-height:34px;
    padding:4px 6px;
  }

  .profile-match-brawler > img{
    width:30px;
    height:30px;
  }

  .brawlers{
    grid-template-columns: 1fr;
  }

  .brawler-card-v2{
    grid-template-columns: 54px minmax(0, 1fr) 82px;
    gap: 7px;
    min-height: 82px;
    padding: 6px;
  }

  .brawler-card-v2 .brawler-portrait,
  .brawler-card-v2 .brawler-ico{
    width: 54px;
    height: 54px;
  }

  .brawler-card-v2 .brawler-name{
    font-size: clamp(13px, 3.9vw, 16px);
    letter-spacing: -.04em;
  }

  .brawler-trophy-stack{
    font-size: 11px;
    gap: 3px 5px;
  }

  .brawler-trophy-stack img{
    width: 15px;
    height: 15px;
  }

  .brawler-loadout{
    grid-template-rows: repeat(2, 22px);
    row-gap: 0;
    width: min(150px, 100%);
  }

  .brawler-power-icon{
    width: 20px;
    height: 20px;
  }

  .brawler-loadout-icon{
    width: 18px;
    height: 18px;
  }

  .brawler-loadout-row{
    grid-auto-columns: 21px;
    column-gap: 3px;
  }

  .brawler-loadout-row-top{
    margin-left: 9px;
  }

  .brawler-prestige{
    width: 34px;
    height: 34px;
  }
}

.profile-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line, #d7dce5);
  border-radius: 999px;
  color: inherit;
  background: var(--panel, #fff);
  font-size: 17px;
  text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}

.profile-social-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 18px;
}

.profile-social-link:hover {
  transform: translateY(-1px);
  opacity: .88;
}

.profile-social-link--x {
  color: #111;
}

.profile-social-link--youtube {
  color: #fff;
  border-color: #ff0033;
  background: #ff0033;
}
