.index-cross-table {
  overflow-x: auto;
  max-width: 100%;
}

.index-cross-table__table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-base);
  width: max-content;
}

.index-cross-table__table th,
.index-cross-table__table td {
  padding: 4px 6px;
  text-align: center;
  border: 1px solid #555;
  min-width: 36px;
  white-space: nowrap;
}

.index-cross-table__table thead th {
  position: sticky;
  top: 0;
  background: #222;
  z-index: 2;
  font-weight: bold;
}

.index-cross-table__table tbody th {
  position: sticky;
  left: 0;
  background: #222;
  z-index: 1;
  font-weight: bold;
  text-align: right;
}

.index-cross-table__table thead th:first-child {
  z-index: 3;
  left: 0;
}

.index-cross-table__table td {
  font-size: var(--fs-xl);
}

.index-cross-table__table td:hover {
  outline: 2px solid #fff;
}

.index-reaction-summary__table {
  border-collapse: collapse;
  font-size: var(--fs-base);
  width: 100%;
}

.index-reaction-summary__table th,
.index-reaction-summary__table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #444;
}

.index-reaction-summary__table th {
  background: #222;
  position: sticky;
  top: 0;
  z-index: 1;
}

.index-reaction-summary__table th:first-child,
.index-reaction-summary__table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #222;
  z-index: 2;
}

.index-reaction-summary__table thead th:first-child {
  z-index: 3;
}

.index-reaction-summary__table tbody tr:hover {
  background: #333;
}

.index-reaction-summary__row--collapsed {
  display: none;
}

.index-reaction-summary__toggle {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  font-size: var(--fs-base);
}

.index-reaction-summary__toggle:hover {
  background: #333;
}

/* === Profile Cards === */

.profile-card {
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

/* Hero header */
.profile-hero-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}
.profile-hero-inner .stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: relative;
    margin-top: 0.4rem;
    align-items: center;
}

/* Status strip */
.profile-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #444;
    background: #333;
}

/* Status detail (tappable <details>) */
.status-detail {
    flex: 1;
    min-width: 140px;
}
.status-detail summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}
.status-detail summary::-webkit-details-marker { display: none; }
.status-detail[open] .status-breakdown {
    padding: 0.5rem 0.8rem;
    font-size: var(--fs-sm);
}
.status-breakdown .sb-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.15rem 0;
    border-bottom: 1px solid #333;
}
.status-breakdown .sb-row:last-child { border-bottom: none; }
.status-breakdown .sb-muted { color: #999; font-size: var(--fs-xs); margin-top: 0.3rem; }

/* Reactions grid */
.profile-reactions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #444;
    background: #333;
}
.rxn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #2f2f2f;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: var(--fs-md);
    color: #ddd;
}

.rxn-detail summary::-webkit-details-marker { display: none; }
.stat-row details { position: relative; display: inline; margin: 0; padding: 0; }
.stat-row details > summary.rxn-chip {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0.5rem;
    font-size: var(--fs-md);
    line-height: 1.4;
}
.stat-row details > summary.rxn-chip::-webkit-details-marker { display: none; }
.stat-row details > summary.rxn-chip::marker { display: none; content: ""; }
.stat-row .rxn-chip { line-height: 1.4; font-size: var(--fs-md); }
.rxn-detail[open] summary .rxn-hint { display: none; }

/* Relations grid */
.profile-relations {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #444;
}
.relation-section {
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    border-radius: 6px;
}
.relation-section:last-child { margin-bottom: 0; }
.relation-label {
    font-weight: 700;
    font-size: var(--fs-md);
    margin-bottom: 0.35rem;
}
.avatar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

/* Game dynamics (collapsible) */
.game-dynamics-detail summary {
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    font-size: var(--fs-base);
    padding: 0.6rem 0;
    list-style: none;
}
.game-dynamics-detail summary::-webkit-details-marker { display: none; }
.game-dynamics-detail summary::before {
    content: '\25B6  ';
    font-size: var(--fs-xs);
    color: #888;
}
.game-dynamics-detail[open] summary::before {
    content: '\25BC  ';
}

/* Curiosities */
.curiosity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: var(--fs-base);
    color: #ccc;
}
.curiosity-icon { font-size: var(--fs-lg); flex-shrink: 0; }

/* Mobile responsive */
@media (max-width: 600px) {
    .profile-hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .profile-hero-inner .stat-row {
        justify-content: center;
    }
    .profile-status-strip {
        flex-direction: column;
    }
    .profile-status-strip .status-detail {
        min-width: 100%;
    }
    .profile-reactions-grid {
        grid-template-columns: 1fr !important;
    }
}
