/* Perfil: tarjeta del jugador, resumen y juegos (como profile.css de WhatPiece). */
.db-profile-page { padding-top: 23px; }
.db-profile-title { text-align: center; color: #f4ecd9; margin-bottom: 24px; }
.db-profile-title h1 { font-size: clamp(2.1rem, 4vw, 3rem); color: #ffce70; text-shadow: 2px 3px 0 #743818, 0 4px 16px #112c37; margin: 0 0 8px; line-height: 1.15; }
.db-profile-title > p { color: #d6e0d4; font-size: 12px; margin: 0 auto; max-width: 520px; }

/* Tarjeta del jugador */
.db-profile-hero { max-width: 560px; margin: 0 auto 22px; padding: 26px 24px 20px; text-align: center; border: 2px solid #233f4b; border-top: 4px solid var(--db-orange); border-radius: var(--db-radius); background: radial-gradient(ellipse at 50% 0%, #fffcf0, transparent 70%), var(--db-surface); box-shadow: var(--db-shadow); }
.db-profile-avatar { --ring: #d37b21; position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto 14px; padding: 0; border: 4px solid var(--ring); border-radius: 50%; background: radial-gradient(circle at 30% 24%, #fff1b5, #ffc04f 44%, #f3901f 74%, #d36713); box-shadow: inset -5px -6px 8px #bd4c1250, 0 6px 0 #142d3640, 0 0 0 6px #fff5df; transition: transform .18s; }
.db-profile-avatar:hover { transform: translateY(-2px) rotate(-3deg); }
.db-profile-avatar-face { display: grid; place-items: center; width: 100%; height: 100%; font-size: 54px; line-height: 1; overflow: hidden; border-radius: 50%; }
.db-profile-avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.db-profile-avatar-edit { position: absolute; right: -2px; bottom: 2px; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--db-surface); border-radius: 50%; background: var(--db-bg-2); color: var(--db-gold); font-size: 13px; }

.db-nickname { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.db-nickname[hidden] { display: none; }
.db-nickname-text { font-family: 'Bangers', Impact, sans-serif; font-size: 32px; letter-spacing: .03em; line-height: 1.1; color: var(--db-text); overflow-wrap: anywhere; }
.db-verified { color: var(--db-blue); font-size: 20px; }
.db-verified[hidden] { display: none; }
.db-nickname-btn { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; padding: 0; border: 1px solid #c5b797; border-radius: 50%; background: #efe3c6; color: var(--db-orange-dark); font-size: 14px; transition: background .15s, color .15s; }
.db-nickname-btn:hover { background: var(--db-orange); border-color: var(--db-orange-dark); color: #fff; }
.db-nickname-btn--ok { background: var(--db-correct); border-color: #2a5a3c; color: #fff; }
.db-nickname-input { width: min(260px, 100%); min-height: 42px; padding: 6px 14px; border: 2px solid var(--db-orange); border-radius: 8px; background: #fffdf5; color: var(--db-text); font-weight: 800; font-size: 16px; text-align: center; }
.db-nickname-input:focus { outline: 3px solid #f5832740; outline-offset: 1px; }
.db-profile-role { margin: 6px 0 0; color: var(--db-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.db-ban-alert { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 9px 14px; border: 1px solid #c27b6c; border-radius: 8px; background: #f8ddd2; color: #8a2f1f; font-size: 12px; }
.db-ban-alert[hidden] { display: none; }

/* Resumen */
.db-profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 820px; margin: 0 auto 32px; }
.db-profile-stat { --tone: var(--db-orange); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px 14px; text-align: center; border: 2px solid #233f4b; border-bottom: 4px solid var(--tone); border-radius: var(--db-radius); background: var(--db-surface); box-shadow: 0 4px 0 #142d36; }
.db-profile-stat > i { font-size: 22px; color: var(--tone); }
.db-profile-stat--star { --tone: #d9a225; }
.db-profile-stat--shield { --tone: var(--db-blue); }
.db-profile-stat--plays { --tone: var(--db-correct); }
.db-profile-stat-val { font-family: 'Bangers', Impact, sans-serif; font-size: 34px; line-height: 1.05; color: var(--db-text); font-variant-numeric: tabular-nums; }
.db-profile-stat-lbl { font-size: 11px; font-weight: 800; color: var(--db-muted); line-height: 1.3; }

/* Juegos */
.db-profile-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 25px; color: #f8ebcd; }
.db-profile-section-title i { color: var(--db-gold); font-size: 22px; }
.db-profile-games-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.db-game-card { --card-accent: #ad5319; position: relative; display: flex; flex-direction: column; padding: 14px 16px 12px; border: 2px solid #243f49; border-top: 4px solid var(--card-accent); border-radius: var(--db-radius); background: var(--db-surface); box-shadow: var(--db-shadow); color: var(--db-text); text-decoration: none; transition: transform .18s; }
a.db-game-card:hover { color: var(--db-text); transform: translateY(-3px); }
.db-game-card-head { display: flex; align-items: center; gap: 10px; }
/* Emblema del juego (el de su tarjeta en la portada), proporción 160×132. */
.db-game-card-logo { display: block; flex-shrink: 0; width: 64px; aspect-ratio: 160 / 132; }
.db-game-card-logo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.db-game-card-name { font-family: 'Bangers', Impact, sans-serif; font-size: 22px; letter-spacing: .025em; line-height: 1.1; }
.db-game-card-body { display: flex; flex-direction: column; align-items: center; padding: 12px 0 10px; }
.db-game-card-val { font-family: 'Bangers', Impact, sans-serif; font-size: 46px; line-height: 1; color: var(--db-orange-dark); font-variant-numeric: tabular-nums; }
.db-game-card-lbl { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--db-muted); }
.db-game-card-lbl i { color: var(--db-orange); }
.db-game-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 9px; border-top: 1px dashed #c9b58e; font-size: 11px; color: var(--db-muted); }
.db-game-card-foot i { color: #d9a225; margin-right: 4px; }
.db-game-card-foot strong { color: var(--db-text); }
.db-game-card-status { padding: 2px 9px; border-radius: 20px; background: #f5832722; color: var(--db-orange-dark); font-weight: 900; white-space: nowrap; }
.db-game-card-status:empty { display: none; }
.db-game-card-status.is-played { background: #38744e22; color: var(--db-correct); }
.db-game-card--soon { --card-accent: #7c8a8f; background: #efe4cb; border-style: dashed; border-top-style: solid; box-shadow: 0 5px 0 #142d3680; }
.db-game-card--soon .db-game-card-head, .db-game-card--soon .db-game-card-body { opacity: .5; filter: grayscale(.85); }

/* Selector de avatar */
.db-avatar-modal { max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; padding: 26px 22px 22px; }
.db-avatar-modal h2 { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 30px; margin: 0 0 16px; }
.db-avatar-modal h2 i { color: var(--db-orange-dark); font-size: 24px; }
.db-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; overflow-y: auto; padding: 4px; }
.db-avatar-loading { grid-column: 1 / -1; margin: 20px 0; }
.db-avatar-card { --ring: #c5b797; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border: 2px solid var(--ring); border-radius: 12px; background: #fffaf0; color: var(--db-text); font: inherit; text-align: center; box-shadow: 0 3px 0 #b98b5a40; transition: transform .15s, border-color .15s; }
button.db-avatar-card:hover { transform: translateY(-2px); border-color: var(--db-orange); }
.db-avatar-card.is-active { border-color: var(--db-orange); background: #fff1d6; box-shadow: 0 0 0 3px #f5832740, 0 3px 0 #b98b5a40; }
.db-avatar-face { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #f3e4c0; font-size: 34px; line-height: 1; }
.db-avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.db-avatar-name { font-weight: 900; font-size: 12px; line-height: 1.2; }
.db-avatar-badge { padding: 1px 8px; border-radius: 20px; background: var(--db-orange); color: #fff; font-size: 10px; font-weight: 900; }
.db-avatar-card.is-locked { background: #ece2cc; cursor: default; }
.db-avatar-card.is-locked .db-avatar-face { filter: grayscale(1) brightness(.75); opacity: .6; }
.db-avatar-lock { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--db-bg-2); color: var(--db-gold); font-size: 12px; }
.db-avatar-hint { font-size: 10px; color: var(--db-muted); line-height: 1.3; }
.db-avatar-progress { width: 100%; height: 6px; margin-top: auto; border-radius: 6px; background: #d8c5a1; overflow: hidden; }
.db-avatar-progress > span { display: block; height: 100%; background: var(--db-orange); }
.db-avatar-progress-lbl { font-size: 10px; font-weight: 800; color: var(--db-muted); font-variant-numeric: tabular-nums; }

/* Rareza: aro de color en el avatar */
.db-rarity-rare { --ring: #3c7fc0; }
.db-rarity-epic { --ring: #8a4fc4; }
.db-rarity-legendary { --ring: #e2a21c; }
.db-rarity-ultralegendary { --ring: #d6432c; }
.db-profile-avatar.db-rarity-legendary, .db-profile-avatar.db-rarity-ultralegendary { box-shadow: inset -5px -6px 8px #bd4c1250, 0 6px 0 #142d3640, 0 0 0 6px #fff5df, 0 0 22px 8px #ffc04f80; }

@media (max-width: 760px) {
    .db-profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .db-profile-games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
    .db-profile-page { padding-top: 18px; }
    .db-profile-hero { padding: 22px 16px 18px; }
    .db-profile-avatar { width: 96px; height: 96px; }
    .db-profile-avatar-face { font-size: 46px; }
    .db-nickname-text { font-size: 27px; }
    .db-profile-stat-val { font-size: 30px; }
    .db-profile-games-grid { grid-template-columns: 1fr; }
    .db-avatar-modal { padding: 22px 14px 16px; }
    .db-avatar-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
    .db-avatar-face { width: 54px; height: 54px; font-size: 28px; }
    .db-avatar-lock { top: 40px; }
}
