.brawler-portrait,
.profile-pic,
.brawler-tier,
.brawler-gears img,
.stat-icon img,
.mode-icon,
.map-image,
.battle-log-trophy-icon {
  aspect-ratio: auto; 
  display: block;
  background-color: rgba(255, 255, 255, 0); 
}

/* GENERAL */

.stats-card{
  background-color: var(--color-surface-mid);
  border: 2px solid rgba(75, 70, 1, 0.452);
  border-radius: 10px;
  padding: 20px;   
  margin: 10px 0;
  max-width: 700px;
}

.left-right-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    align-items: stretch; 
}

.left-right-grid > div { 
    display: flex; 
    flex-direction: column; 
}

.left-right-grid > div:nth-child(2) .card {
    flex: 1 1 0;        
    display: flex;
    flex-direction: column;
}

.left-right-grid > div:nth-child(2) .scrollable {
    flex: 1 1 auto;     
    overflow: auto;
}

/* PROFILE CARD */
.profile-card{
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;               
}

.profile-info {
    display: flex;             
    align-items: center;       
}

.name-card{
    margin-left: 20px;
}

.profile-pic{
    width: 60px;
    border: 2px solid white;
}

.player-tag{
    color: var(--color-text-faint);
}

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s, filter 0.3s;
}

.share-btn:hover img {
    transform: scale(1.1);
    filter: brightness(1.2);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.share-btn.spin img {
    animation: spin 0.3s ease;
}

/* socials */

.socials{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.social-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-item img{
    height: 40px;
    width: auto;
    margin-bottom: 2px;
}

.social-item:hover{
    transform: scale(1.05);
}

/* Skill Score */

.skill-box{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* STAT BOX */

.stats-card-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 12px;
}

.stat-box{
    margin: 6px 0;
    display: flex;
    align-items: flex-start; 
    gap: 10px; 
}

.stat-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: translateY(-4px);
}

.stat-icon img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}


.stat{
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;        
    color: var(--color-yellow);
    font-weight: 600;
    margin-left: 0;      
}

/* Progression Bar */
.progress-container {
  --value: 65; 
  --progress: calc(var(--value) / 100);
  --hue: calc(var(--progress) * 120); 

  width: 100%;
  margin: 0 auto;
  margin-top: 10px;
  text-align: center;
  font-family: system-ui, sans-serif;
}

.progress-value {
  margin-bottom: 2px;
  font-weight: 700;
  font-size: 16px;
  color: hsl(var(--hue), 80%, 35%);
}

progress {
  width: 100%;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--color-text-faint);
}

progress::-webkit-progress-bar {
  background-color: var(--color-text-faint);
  border-radius: 10px;
}

progress::-webkit-progress-value {
  background-color: hsl(var(--hue), 80%, 45%);
  border-radius: 10px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

progress::-moz-progress-bar {
  background-color: hsl(var(--hue), 80%, 45%);
  border-radius: 10px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Brawler List */

.brawlers-sort-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;       
}

.sort-dropdown{
    background-color: #000;
    color: var(--color-text-muted);
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
    border: 2px solid var(--color-border);
}

.brawler-grid{
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    gap: 14px;
    padding: 10px;
}

.brawler-icon {
    position: relative;
    width: 100%;
    height: 110px;
    background-color: var(--color-bg);
    border-radius: 8px;
}

.portrait-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.brawler-portrait {
    will-change: transform;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.brawler-power {
    position: absolute;
    top: 60px;
    left: 4px;
    background: var(--color-yellow);
    color: #000;
    border: 1px solid black;
    font-weight: 800;
    font-size: 14px;
    border-radius: 6px;
    padding: 2px 5px;
}

.brawler-gears {
    position: absolute;
    top: 5px;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brawler-gears img {
    width: 17px;
    height: 17px;
}

.brawler-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 19px;
    background: var(--color-surface-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 2px;
}

.brawler-tier {
    position: absolute;
    top: -4px;
    left: -8px;
    height: 30px;
}

.brawler-trophies {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--color-yellow);
    font-weight: bold;
    font-size: 14px;
}

.brawler-trophies img {
    height: auto;
    width: 20px;
    transform: translateY(1px);
}
/* Battle Log */

.battle-log-box {
    border: 1px solid rgba(255, 255, 255, 0.116);
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.battle-log-header {
    background-color: black;
    border-radius: inherit;
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 10px;
    row-gap: 0;
    column-gap: 10px;
}

.battle-log-header-left,
.battle-log-header-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.battle-log-main {
    display: grid;
    grid-template-columns: calc(35% - 3.33px) calc(30% - 3.33px) calc(35% - 3.33px);
    gap: 5px;
    padding: 10px;
}

.battle-log-main-left,
.battle-log-main-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.battle-log-main-mid {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.map-image {
    width: 100%;
    margin: 10px 0;
}

.mode-icon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    z-index: 2;
}

.battle-log-player-friendly,
.battle-log-player-enemy {
    width: 100%;
    padding: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
    text-wrap: nowrap;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.battle-log-player-friendly:hover,
.battle-log-player-enemy:hover {
    transform: scale(1.05);
}

.battle-log-player-friendly a,
.battle-log-player-enemy a {
    color: var(--color-text);
}

.battle-log-player-friendly {
    background-color: rgba(0, 255, 0, 0.1);
    flex-direction: row;
}

.battle-log-player-enemy {
    background-color: rgba(255, 0, 0, 0.1);
    flex-direction: row-reverse;
    text-align: right;
}

.battle-log-player-friendly img,
.battle-log-player-enemy img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.battle-log-friendly-info,
.battle-log-enemy-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.battle-log-friendly-info {
    text-align: left;
}

.battle-log-enemy-info {
    text-align: right;
}

.battle-log-enemy-info .player-trophies-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: right;
    gap: 5px;
}

.battle-log-friendly-info .player-trophies-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: left;
    gap: 5px;
}

.battle-log-trophy-icon {
    width: 16px !important;
    height: auto !important;
    flex-shrink: 0;
    transform: translateX(3px);
}

.truncate {
  display: flex-end;     
  max-width: 110px;          
  white-space: nowrap;     
  overflow: hidden;          
  text-overflow: ellipsis;     
  vertical-align: bottom;   
}

/* SCROLL GRID MECH — Optimized for touch devices */

.card {
  position: relative;
  background-color: var(--color-surface-mid);
  border: 2px solid rgba(75, 70, 1, 0.452);
  border-radius: 10px;
  padding: 20px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  transition: height 0.25s ease;
  overflow: hidden;
  max-width: 700px;
}

.scrollable {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
  outline: none;
  border: none;

  /* --- Touch optimization --- */
  -webkit-overflow-scrolling: touch; /* Enables momentum scrolling on iOS */
  touch-action: pan-y;               /* Prevents accidental zoom/pan conflicts */
  overscroll-behavior: contain;      /* Prevents parent scroll chaining */
}

/* Optional: Make it feel "snappy" on touch scroll lists */
@media (hover: none) and (pointer: coarse) {
  .scrollable {
    scroll-behavior: auto; /* Avoids laggy feel on touch scroll */
  }
}

.battlelog-list {
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
  padding-bottom: 8px;
}

.battlelog-list .battle-entry {
  padding: 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
}

.scrollable:focus {
  outline: none;
  box-shadow: none;
}

/* --- Custom Scrollbars (Desktop only) --- */
.scrollable::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.scrollable::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: rgba(75, 70, 1, 0.5);
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.05);
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background-color: rgba(75, 70, 1, 0.7);
}

/* Hide scrollbars completely on mobile for cleaner look */
@media (hover: none) and (pointer: coarse) {
  .scrollable::-webkit-scrollbar {
    display: none;
  }
  .scrollable {
    scrollbar-width: none;
  }
}

.gem{
    width: 20px;
    height: 20px;
    margin-right: 2px;
    transform: translateY(1px);
}

.scrollable {
    will-change: transform;
    backface-visibility: hidden; /* Helps with 3D acceleration */
}