/* profile-cards.css
 * --------------------------------------------------
 * Sej tier-baseret stat-card styling til /spiller.php (/@navn).
 * Hver stat-card har en .tier-{wood|stone|iron|gold|diamond|netherite|mythic}
 * klasse der trigger forskellig visuel behandling.
 *
 * v=2026.05.04
 */

/* ---------- Sektions-header som Minecraft-sign ---------- */
.page-profile .section-banner {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 2.5rem 0 1.25rem;
    padding: .75rem 1.1rem;
    background: linear-gradient(180deg, #6b3f1a 0%, #4d2d12 100%);
    border: 2px solid #000;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,.07),
        inset 0 -3px 0 rgba(0,0,0,.4),
        0 4px 0 #000,
        0 0 0 4px rgba(162,89,255,.0);
    position: relative;
    transform: rotate(-.3deg);
}
.page-profile .section-banner::before,
.page-profile .section-banner::after {
    content: "";
    position: absolute;
    top: -8px;
    width: 6px;
    height: 14px;
    background: #2a1808;
    border: 2px solid #000;
}
.page-profile .section-banner::before { left: 18px; }
.page-profile .section-banner::after  { right: 18px; }
.page-profile .section-banner-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6));
    flex: 0 0 32px;
}
.page-profile .section-banner h2 {
    margin: 0;
    font-family: 'Minecraft', sans-serif;
    font-size: 1.25rem;
    color: #ffe9b8;
    text-shadow: 2px 2px 0 #000, 0 0 12px rgba(255,233,184,.25);
    letter-spacing: .05em;
}
.page-profile .section-banner-counter {
    margin-left: auto;
    font-size: .8rem;
    color: rgba(255,233,184,.7);
    font-family: 'Minecraft', sans-serif;
    letter-spacing: .04em;
}

/* ---------- Stat-grid layout ---------- */
.page-profile .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}

/* ---------- Stat-card base (overrider den simple version i spiller.php) ---------- */
.page-profile .stat-card {
    --card-color: #a259ff;
    --card-glow:  rgba(162,89,255,.45);

    position: relative;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--card-color) 6%, rgba(20,12,32,.92)) 0%,
            rgba(14,8,24,.96) 100%);
    border: 2px solid #000;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--card-color) 40%, transparent),
        inset 0 -2px 0 rgba(0,0,0,.3),
        0 4px 0 #000,
        0 0 0 0 var(--card-glow);
    padding: 1.2rem 1.1rem 1rem;
    text-align: left;
    transition:
        transform .25s cubic-bezier(.2,.7,.2,1.2),
        box-shadow .25s ease,
        border-color .25s ease;
    overflow: hidden;
    cursor: default;
    transform-style: preserve-3d;
    will-change: transform;
}

/* indre overlay/scanline-tekstur — får kortet til at føles som Minecraft-block */
.page-profile .stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 8px,
            rgba(255,255,255,.012) 8px,
            rgba(255,255,255,.012) 16px);
    opacity: .8;
    z-index: 0;
}

.page-profile .stat-card > * {
    position: relative;
    z-index: 1;
}

.page-profile .stat-card:hover {
    box-shadow:
        inset 0 0 0 1px var(--card-color),
        inset 0 -2px 0 rgba(0,0,0,.3),
        0 8px 0 #000,
        0 0 28px var(--card-glow);
}

/* ---------- Tier-badge i hjørnet ---------- */
.page-profile .stat-tier-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .45rem .2rem .3rem;
    background: linear-gradient(180deg, rgba(0,0,0,.65), rgba(0,0,0,.85));
    border: 1px solid color-mix(in srgb, var(--card-color) 60%, #000);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-color) 30%, transparent);
    z-index: 2;
    font-family: 'Minecraft', sans-serif;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--card-color);
    text-shadow: 1px 1px 0 #000;
}
.page-profile .stat-tier-badge img {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,.6));
}

/* ---------- Rank ribbon (top-N spiller på serveren) ---------- */
.page-profile .stat-rank-ribbon {
    position: absolute;
    top: 0;
    left: -2px;
    padding: .15rem .55rem .25rem;
    background: linear-gradient(180deg, #ffd23d 0%, #b88408 100%);
    color: #2a1500;
    font-family: 'Minecraft', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(255,255,255,.3);
    border: 2px solid #000;
    border-top: none;
    border-left: none;
    box-shadow: 0 2px 0 #000;
    z-index: 3;
}
.page-profile .stat-rank-ribbon.is-top1 {
    background: linear-gradient(180deg, #ff6cb6 0%, #a82273 100%);
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    animation: pixel-pulse 1.6s ease-in-out infinite;
}

/* ---------- Stat-icon, label, value ---------- */
.page-profile .stat-icon {
    margin-bottom: .65rem;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
}
.page-profile .stat-icon img {
    width: 44px;
    height: 44px;
    image-rendering: pixelated;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6))
            drop-shadow(0 0 6px var(--card-glow));
}
.page-profile .stat-label {
    color: var(--c-text-dim, #aaa);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: .35rem;
    font-family: 'Minecraft', sans-serif;
}
.page-profile .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--card-color);
    font-family: 'Minecraft', sans-serif;
    letter-spacing: .02em;
    text-shadow: 2px 2px 0 #000;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
.page-profile .stat-sub {
    margin-top: .4rem;
    font-size: .75rem;
    color: var(--c-text-dim, #aaa);
}

/* ---------- XP-bar mod næste tier ---------- */
.page-profile .stat-progress {
    margin-top: .85rem;
    position: relative;
}
.page-profile .stat-progress-bar {
    height: 8px;
    background: rgba(0,0,0,.55);
    border: 1px solid #000;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
    overflow: hidden;
    position: relative;
}
.page-profile .stat-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg,
        var(--card-color) 0%,
        color-mix(in srgb, var(--card-color) 60%, #fff) 100%);
    box-shadow: 0 0 8px var(--card-glow);
    transition: width 1.2s cubic-bezier(.2,.7,.2,1);
}
.page-profile .stat-progress-fill.is-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,.4) 50%,
        transparent 100%);
    animation: shimmer 2.5s linear infinite;
}
.page-profile .stat-progress-text {
    margin-top: .3rem;
    font-size: .65rem;
    color: var(--c-text-mut, #777);
    letter-spacing: .05em;
    text-transform: uppercase;
    font-family: 'Minecraft', sans-serif;
    display: flex;
    justify-content: space-between;
}

/* ---------- Lore-tekst (vises på hover) ---------- */
.page-profile .stat-lore {
    margin-top: .6rem;
    font-size: .75rem;
    color: var(--c-text-mut, #888);
    line-height: 1.45;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .35s ease, opacity .25s ease, margin .25s ease;
}
.page-profile .stat-card:hover .stat-lore {
    max-height: 80px;
    opacity: 1;
}

/* ---------- Per-tier visuelle varianter ---------- */
.page-profile .stat-card.tier-wood {
    --card-color: #a47148;
    --card-glow:  rgba(164,113,72,.4);
}
.page-profile .stat-card.tier-stone {
    --card-color: #b8b8b8;
    --card-glow:  rgba(180,180,180,.4);
}
.page-profile .stat-card.tier-iron {
    --card-color: #ececec;
    --card-glow:  rgba(220,220,220,.5);
}
.page-profile .stat-card.tier-gold {
    --card-color: #ffcf3f;
    --card-glow:  rgba(255,207,63,.55);
    background:
        linear-gradient(180deg, rgba(60,40,5,.85) 0%, rgba(20,12,2,.95) 100%);
}
.page-profile .stat-card.tier-diamond {
    --card-color: #5cd1ff;
    --card-glow:  rgba(92,209,255,.55);
    background:
        linear-gradient(180deg, rgba(10,40,60,.85) 0%, rgba(5,15,30,.96) 100%);
}
.page-profile .stat-card.tier-netherite {
    --card-color: #c5a3a0;
    --card-glow:  rgba(255,80,80,.55);
    background:
        linear-gradient(180deg, rgba(40,15,15,.92) 0%, rgba(15,5,5,.98) 100%);
    border-color: #1a0808;
}
.page-profile .stat-card.tier-netherite::before {
    background:
        repeating-linear-gradient(45deg,
            transparent 0, transparent 6px,
            rgba(255,80,80,.04) 6px, rgba(255,80,80,.04) 12px);
}

/* MYTISK — animeret rainbow-border, pulserende glow, sparkle */
.page-profile .stat-card.tier-mythic {
    --card-color: #ff6cb6;
    --card-glow:  rgba(255,108,182,.65);
    background: linear-gradient(180deg, rgba(35,5,30,.92) 0%, rgba(10,2,15,.98) 100%);
    border-color: transparent;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 4px 0 #000,
        0 0 24px var(--card-glow);
}
.page-profile .stat-card.tier-mythic::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        #ff6cb6, #ffcf3f, #5cd1ff, #3ed35a, #a259ff, #ff6cb6);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: rainbow-spin 6s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.page-profile .stat-card.tier-mythic .stat-value {
    background: linear-gradient(90deg, #ff6cb6, #ffcf3f, #5cd1ff, #ff6cb6);
    background-size: 200% auto;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: rainbow-text 4s linear infinite;
}

/* "MAX TIER" indikator på mytisk */
.page-profile .stat-card.tier-mythic .stat-progress {
    display: none;
}
.page-profile .stat-card.tier-mythic .stat-max-marker {
    margin-top: .85rem;
    text-align: center;
    font-family: 'Minecraft', sans-serif;
    font-size: .72rem;
    letter-spacing: .15em;
    color: #ff6cb6;
    text-shadow: 1px 1px 0 #000, 0 0 10px rgba(255,108,182,.5);
    animation: pixel-pulse 2s ease-in-out infinite;
}

/* ---------- Animationer ---------- */
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes rainbow-spin {
    to { transform: rotate(360deg); }
}
@keyframes rainbow-text {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
@keyframes pixel-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(1.05); opacity: .85; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .page-profile .stat-card,
    .page-profile .stat-progress-fill,
    .page-profile .stat-card.tier-mythic::after,
    .page-profile .stat-card.tier-mythic .stat-value,
    .page-profile .stat-rank-ribbon.is-top1,
    .page-profile .stat-card.tier-mythic .stat-max-marker,
    .page-profile .stat-progress-fill.is-shimmer::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Player level badge i header ---------- */
.page-profile .profile-level-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: .8rem 0 .4rem;
    flex-wrap: wrap;
}
.page-profile .profile-level-badge {
    --lvl-color: #a259ff;
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    grid-template-rows: 1fr auto;
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--lvl-color) 30%, transparent), transparent 65%),
        linear-gradient(180deg, #18102a, #0c0617);
    border: 3px solid #000;
    box-shadow:
        inset 0 0 0 2px var(--lvl-color),
        0 4px 0 #000,
        0 0 18px color-mix(in srgb, var(--lvl-color) 50%, transparent);
    text-align: center;
    line-height: 1;
}
.page-profile .profile-level-num {
    font-family: 'Minecraft', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--lvl-color);
    text-shadow: 2px 2px 0 #000;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.page-profile .profile-level-word {
    font-family: 'Minecraft', sans-serif;
    font-size: .55rem;
    letter-spacing: .15em;
    color: var(--lvl-color);
    opacity: .85;
    margin-bottom: 4px;
}
.page-profile .profile-level-meta {
    flex: 1 1 200px;
    min-width: 200px;
}
.page-profile .profile-level-title {
    font-family: 'Minecraft', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: .35rem;
    letter-spacing: .03em;
}
.page-profile .profile-level-bar {
    height: 10px;
    background: rgba(0,0,0,.55);
    border: 1px solid #000;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
    overflow: hidden;
    margin-bottom: .25rem;
}
.page-profile .profile-level-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg,
        var(--lvl-color, #a259ff) 0%,
        color-mix(in srgb, var(--lvl-color, #a259ff) 60%, #fff) 100%);
    box-shadow: 0 0 8px color-mix(in srgb, var(--lvl-color, #a259ff) 60%, transparent);
    transition: width 1.4s cubic-bezier(.2,.7,.2,1);
}
.page-profile .profile-level-xp {
    font-size: .7rem;
    color: var(--c-text-mut, #888);
    letter-spacing: .04em;
    font-family: 'Minecraft', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ---------- Fun-facts card ---------- */
.page-profile .fun-facts-card {
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.25rem 1rem;
}
.page-profile .fun-facts-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .65rem;
    flex-wrap: wrap;
}
.page-profile .fun-facts-header h3 {
    margin: 0;
    font-family: 'Minecraft', sans-serif;
    font-size: 1.05rem;
    color: var(--profile-accent, #a259ff);
    text-shadow: 1px 1px 0 #000;
    letter-spacing: .04em;
}
.page-profile .fun-facts-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.page-profile .fun-facts-list li {
    padding: .45rem 0 .45rem 1.6rem;
    font-size: .92rem;
    color: var(--c-text-dim, #ccc);
    line-height: 1.5;
    border-bottom: 1px dashed rgba(255,255,255,.06);
    position: relative;
}
.page-profile .fun-facts-list li:last-child { border-bottom: none; }
.page-profile .fun-facts-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    top: .45rem;
    color: var(--profile-accent, #a259ff);
    font-weight: 700;
}

.page-profile .fun-share-btn {
    font-family: 'Minecraft', sans-serif;
    font-size: .8rem;
    padding: .4rem .75rem;
    cursor: pointer;
}
.page-profile .fun-share-btn.is-copied {
    background: var(--profile-accent, #a259ff) !important;
    color: #000;
}
