[data-tip] {
    position: relative;
}

[data-tip]::before {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: linear-gradient(135deg, #8100ff 0%, #1199c5 100%);
    color: #f0e6ff;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.45;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-clip: padding-box;
    white-space: normal;
    max-width: 320px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
    box-shadow:
        0 0 0 1px rgba(129,0,255,0.45),
        0 0 12px rgba(129,0,255,0.2),
        0 4px 16px rgba(0,0,0,0.5);
}

[data-tip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: rgba(129,0,255,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}

[data-tip]:hover::before,
[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tip-right]::before {
    content: attr(data-tip-right);
    bottom: auto;
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%) translateX(-4px);
}
[data-tip-right]::after {
    bottom: auto;
    top: 50%;
    left: calc(100% + 2px);
    transform: translateY(-50%) translateX(-4px);
    border-top-color: transparent;
    border-right-color: rgba(129,0,255,0.5);
}
[data-tip-right]:hover::before { transform: translateY(-50%) translateX(0); }
[data-tip-right]:hover::after  { transform: translateY(-50%) translateX(0); }

@keyframes tooltip-border-glow {
    0%   { box-shadow: 0 0 0 1px rgba(129,0,255,0.5), 0 0 12px rgba(129,0,255,0.2), 0 4px 16px rgba(0,0,0,0.5); }
    50%  { box-shadow: 0 0 0 1px rgba(0,192,255,0.5), 0 0 16px rgba(0,192,255,0.25), 0 4px 16px rgba(0,0,0,0.5); }
    100% { box-shadow: 0 0 0 1px rgba(129,0,255,0.5), 0 0 12px rgba(129,0,255,0.2), 0 4px 16px rgba(0,0,0,0.5); }
}
[data-tip]:hover::before,
[data-tip-right]:hover::before {
    animation: tooltip-border-glow 2.5s ease infinite;
}

.mini-hero {
    position: relative;
    margin-bottom: 35px;
    animation: miniHeroFadeIn 0.45s ease both;
}

@keyframes miniHeroFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.profile-mini-hero-title-bar {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    background: linear-gradient(45deg, #4d77ff, #00c8ff);
    color: white;
    margin: 0;
    position: absolute;
    top: -11px;
    left: 40px;
    transform: none;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #00c8ff;
    padding: 7px 12px 7px 12px;
    white-space: nowrap;
    cursor: default;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.profile-mini-hero-title-nick {
    font-weight: 900;
    letter-spacing: 0.02em;
    max-width: 145px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-hero-btns-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: -5px;
    margin-bottom: 16px;
}

.mini-hero-btns-row > div:only-child {
    margin-left: auto;
}

.mini-hero-body {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 15px 3px 5px 3px;
}

.mini-hero-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.mini-hero-avatar-ring {
    position: absolute;
    inset: -3px;
    border-radius: 30%;
    background: conic-gradient(#864dff, #00c8ff 35%, #7636e4 65%, #375dd9 100%);
    z-index: 0;
    opacity: 0.7;
}

.mini-hero-avatar-img {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    border-radius: 30%;
    object-fit: cover;
    display: block;
}

.mini-hero-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: center;
}

.mini-hero-nick {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    font-weight: 700;
    color: #4299e1;
}
.mini-hero-nick:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.cyber-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 8px 16px;
    min-width: 110px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    border: none;
    color: #ffffff;
}

.cyber-btn--action {
    background-color: rgb(0, 200, 255);
    color: #ffffff;
}

.cyber-btn--action:hover,
.cyber-btn--action:focus {
    animation: glitch-btn-cyan 0.22s forwards;
    background: #00c8ff;
    color: #ffffff;
    border-color: #00c8ff;
    box-shadow: 0 0 18px rgba(0,200,255,0.55), 0 0 40px rgba(0,200,255,0.2);
    transform: translateY(-3px);
    text-decoration: none;
}

.cyber-btn--action:hover svg,
.cyber-btn--action:focus svg {
    animation: blink-glitch 0.1s infinite;
}

.cyber-btn--action:hover::before {
    content: " ";
    width: 4px;
    border: 1px solid #7013ef;
    position: absolute;
    right: 6%;
    bottom: 2px;
    transform: rotate(40deg);
}

.cyber-btn--action:hover::after {
    animation: shrink-line 0.5s forwards;
    content: " ";
    width: 70%;
    border: 1px solid #7013ef;
    position: absolute;
    left: 0;
    bottom: 4px;
}

.cyber-btn--action:active {
    background: none;
    color: #00c8ff;
    box-shadow: none;
}
.cyber-btn--action:active::before,
.cyber-btn--action:active::after { display: none; }
.cyber-btn--action:active svg { animation: none; }

.cyber-btn:disabled {
    opacity: 0.70;
    cursor: not-allowed;
    pointer-events: none;
}

.cyber-btn--danger {
    background: rgba(229, 62, 62, 0.08);
    background: rgb(236 94 94 / 91%);
}

.cyber-btn--danger:hover,
.cyber-btn--danger:focus {
    animation: glitch-btn-red 0.22s forwards;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(252,129,129,0.55), 0 0 40px rgba(252,129,129,0.2);
    background: rgb(255 18 18 / 74%);
    border-color: rgb(255 35 35 / 87%);
    transform: translateY(-3px);
}

.cyber-btn--danger:hover svg,
.cyber-btn--danger:focus svg {
    animation: blink-glitch 0.1s infinite;
}

.cyber-btn--danger:hover::before {
    content: " ";
    width: 4px;
    border: 1px solid #7013ef;
    position: absolute;
    right: 6%;
    bottom: 2px;
    transform: rotate(40deg);
}

.cyber-btn--danger:hover::after {
    animation: shrink-line 0.5s forwards;
    content: " ";
    width: 70%;
    border: 1px solid #7013ef;
    position: absolute;
    left: 0;
    bottom: 4px;
}

.cyber-btn--danger:active {
    background: none;
    color: #fc8181;
    box-shadow: none;
}
.cyber-btn--danger:active::before,
.cyber-btn--danger:active::after { display: none; }
.cyber-btn--danger:active svg { animation: none; }

@keyframes glitch-btn-cyan {
    20%  { background: #ff2d78; transform: translateX(-6px); letter-spacing: 6px; border-color: #ff2d78; }
    35%  { background: #00ff88; transform: translateX(6px);  border-color: #00ff88; }
    55%  { opacity: 0.6; }
    65%  { background: #4d77ff; transform: translateX(-5px); filter: blur(3px); border-color: #4d77ff; }
    100% { background: #00c8ff; color: #464646; filter: blur(0); transform: translateY(-3px); border-color: #00c8ff;
           box-shadow: 0 0 18px rgba(0,200,255,0.55); }
}

@keyframes glitch-btn-red {
    20%  { background: #00c8ff; transform: translateX(-6px); letter-spacing: 6px; border-color: #00c8ff; }
    35%  { background: #b4ff00; transform: translateX(6px);  border-color: #b4ff00; }
    55%  { opacity: 0.6; }
    65%  { background: #8100ff; transform: translateX(-5px); filter: blur(3px); border-color: #8100ff; }
    100% { background: #fc8181; color: #464646; filter: blur(0); transform: translateY(-3px); border-color: #fc8181;
           box-shadow: 0 0 18px rgba(252,129,129,0.55); }
}

@keyframes blink-glitch {
    50% { opacity: 0; }
}

@keyframes shrink-line {
    100% { width: 8%; }
}

.mini-hero-achievements {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.55);
    border: 1.5px solid rgba(0,200,255,0.35);
    border-radius: 8px;
    flex-wrap: wrap;
    height: 36px;
}

.mini-hero-ach-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    flex-shrink: 0;
    text-align: right;
}

.mini-hero-ach-item--vets {
    flex: 1;
    min-width: 0;
}

.mini-hero-ach-sep {
    width: 1.5px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, rgba(0,200,255,0.4), transparent);
    flex-shrink: 0;
}

.mini-hero-ach-label {
    font-weight: 700;
    color: #4299e1;
    flex-shrink: 0;
    cursor: default;
    font-size: 0.78rem;
    padding: 2px;
    white-space: nowrap;
}

.mini-hero-ach-value {
    font-size: 0.78rem;
    color: #1a365d;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 2px;
}

.mini-hero-vet-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: 8px;
}

.mini-hero-vet-badge {
    position: relative;
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    filter: grayscale(1);
    transition: opacity 0.2s, filter 0.2s, transform 0.2s;
    cursor: default;
}

.mini-hero-vet-badge--unlocked {
    opacity: 1;
    filter: none;
}
.mini-hero-vet-badge:hover { transform: translateY(-2px) scale(1.1); }

.mini-hero-vet-badge-icon {
    line-height: 1;
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
}

.mini-hero-vet-check {
    position: absolute;
    bottom: -1px;
    right: -1px;
    background: #48bb78;
    color: #fff;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    font-size: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 2;
}

.mini-hero-vet-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.mini-hero-vet-ring .ring-bg   { fill: none; stroke: rgba(0,0,0,0.08); stroke-width: 3; }
.mini-hero-vet-ring .ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.4s; }

.mini-hero-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@media only screen and (orientation: portrait), (max-aspect-ratio: 4/3) {

    .mini-hero {
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 12px 5px 5px;
        border-radius: 20px;
        border-width: 4px;
    }

    .profile-mini-hero-title-bar {
        left: 50% !important;
        transform: translateX(-50%) !important;
        min-width: 80%;
        max-width: 90%;
        justify-content: center;
        font-size: 16px;
        padding: 8px 10px;
        text-wrap: auto;
    }

    .mini-hero-btns-row {
        position: relative;
        top: auto;
        right: auto;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 20px;
        margin-bottom: 15px;
        gap: 6px;
    }

    .mini-hero-btns-row > div {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
    }

    .mini-hero-btns-row > div:only-child {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    .mini-hero-btns-row > div:empty {
        display: none !important;
    }

    .cyber-btn {
        min-width: 0;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
        width: 100%;
        padding: 8px 11px;
        font-size: 0.95rem;
    }

    .mini-hero-body {
        display: grid !important;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 4px 12px;
        margin: 10px 0 0 0;
        padding: 10px 0;
    }

    .mini-hero-avatar-wrap, .mini-hero-avatar-img {
        width: 85px;
        height: 85px;
        grid-row: 1 / 3;
        grid-column: 1;
        justify-self: center;
        align-self: center;
        margin: 0;
    }

    .mini-hero-avatar-ring {
        inset: -3px;
    }

    .mini-hero-right {
        display: contents !important;
    }

    .mini-hero-top-row {
        grid-row: 1;
        grid-column: 2;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-wrap: wrap;
    }

    .mini-hero-nick {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .mini-hero-achievements {
        grid-row: 2;
        grid-column: 2;
        min-width: 0;
        max-width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 8px 10px;
        height: auto;
        border-radius: 8px;
    }

    .mini-hero-ach-sep {
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(0,200,255,0.4), transparent);
    }

    .mini-hero-ach-item {
        width: 100%;
        justify-content: space-between;
        padding: 0 !important;
        min-width: 0;
        max-width: 100%;
    }

    .mini-hero-ach-label, .mini-hero-ach-value {
        font-size: 0.9rem;
    }

    .mini-hero-ach-value {
        min-width: 0;
        text-overflow: ellipsis;
        white-space: nowrap;    
    }

    .mini-hero-vet-row {
        margin-left: 0;
        justify-content: flex-end;
    }

    .mini-hero-vet-badge {
        width: 22px;
        height: 18px;
    }

    .mini-hero-room-name {
        display: none;
    }

    .mini-hero-ach-item--vets,
    #mini-hero-flag-item,
    #mini-hero-flag-sep,
    #mini-hero-room-wrap + .mini-hero-ach-sep {
        display: none !important;
    }

    [data-tip]::before {
        max-width: 200px;
        font-size: 0.70rem;
        padding: 5px 8px;
        bottom: calc(100% + 6px);
    }
}

@media only screen and (max-width: 1024px) and (orientation: landscape) {

    .mini-hero-body {
        display: grid !important;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        column-gap: 15px;
        row-gap: 4px;
        align-items: start;
        margin: 10px 0 0 0;
    }

    .mini-hero-right {
        display: contents !important;
    }

    .mini-hero-avatar-wrap, .mini-hero-avatar-img {
        width: 85px;
        height: 85px;
        grid-row: 1 / 3;
        grid-column: 1;
        justify-self: center;
        align-self: center;
        margin: 0 !important;
    }

    .mini-hero-top-row {
        grid-row: 1;
        grid-column: 2;
        min-width: 0;
        margin: 0 15px;
    }

    .mini-hero-achievements {
        grid-row: 2;
        grid-column: 2;
        min-width: 0;
        max-width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 8px 10px;
        margin: 0px 6px;
        height: auto;
    }

    .mini-hero-ach-sep {
        width: 100%;
        height: 1px;
    }

    .mini-hero-ach-item {
        width: 100%;
        justify-content: space-between;
        padding: 0 !important;
        min-width: 0;   
        max-width: 100%;
    }

    .mini-hero-ach-value {
        min-width: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cyber-btn {
        font-size: 0.95rem;
        padding: 7px 13px;
        min-width: 0;
    }

    .mini-hero-ach-item--vets,
    #mini-hero-flag-item,
    #mini-hero-flag-sep,
    #mini-hero-room-wrap + .mini-hero-ach-sep {
        display: none !important;
    }
}