@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #020b11;
    --bg-soft: #06151e;
    --surface: rgba(7, 24, 34, 0.9);
    --surface-strong: rgba(8, 29, 40, 0.97);
    --surface-hover: rgba(12, 39, 52, 0.96);
    --line: rgba(124, 218, 230, 0.16);
    --line-strong: rgba(124, 218, 230, 0.31);
    --text: #f2fcff;
    --muted: #91a9b6;
    --cyan: #25e6ee;
    --cyan-soft: #82f8ff;
    --orange: #ff8a1f;
    --green: #aef238;
    --pink: #ff4e9b;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --mono: 'DM Mono', Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--cyan) #07141c;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: 'Outfit', Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 2%, rgba(37, 230, 238, 0.14), transparent 25rem),
        radial-gradient(circle at 96% 24%, rgba(174, 242, 56, 0.07), transparent 30rem),
        radial-gradient(circle at 15% 96%, rgba(255, 138, 31, 0.12), transparent 32rem),
        linear-gradient(145deg, #02080d 0%, #04121a 45%, #020a10 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

body::before {
    opacity: 0.26;
    background-image:
        linear-gradient(rgba(37, 230, 238, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 230, 238, 0.075) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 76%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 76%);
}

body::after {
    inset: auto -6vw -16vw auto;
    width: min(68vw, 860px);
    aspect-ratio: 1;
    opacity: 0.045;
    background: url('../images/logo-neon.png') center / contain no-repeat;
    filter: saturate(1.25) drop-shadow(0 0 45px rgba(37, 230, 238, 0.35));
}

button,
input,
select {
    font: inherit;
}

a,
button,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button,
select {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--cyan-soft);
    outline-offset: 3px;
}

::selection {
    color: #001014;
    background: var(--cyan);
}

.profile-container {
    position: relative;
    width: min(1240px, calc(100% - 40px));
    margin: 34px auto 72px;
}

.profile-header,
.panel,
.stat-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(9, 29, 40, 0.95), rgba(4, 17, 25, 0.91));
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(18px);
}

/* Hero / player identity */
.profile-header {
    position: relative;
    isolation: isolate;
    min-height: 410px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(410px, 0.72fr);
    grid-template-rows: auto 1fr;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(112deg, rgba(8, 34, 46, 0.98) 0%, rgba(6, 23, 33, 0.95) 52%, rgba(5, 18, 26, 0.92) 100%);
}

.profile-header::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -115px;
    right: -65px;
    width: 510px;
    height: 510px;
    opacity: 0.11;
    background: url('../images/logo-neon.png') center / contain no-repeat;
    filter: drop-shadow(0 0 35px rgba(37, 230, 238, 0.42));
    transform: rotate(-7deg);
}

.profile-header::after {
    content: '';
    position: absolute;
    z-index: 0;
    right: 23px;
    bottom: 22px;
    width: 94px;
    height: 94px;
    border-right: 1px solid rgba(37, 230, 238, 0.36);
    border-bottom: 1px solid rgba(37, 230, 238, 0.36);
    clip-path: polygon(25% 0, 100% 0, 100% 75%, 75% 100%, 0 100%, 0 92%, 71% 92%, 92% 71%, 92% 8%, 25% 8%);
}

.header-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(8px);
}

.glow-one {
    top: -220px;
    left: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 230, 238, 0.18), transparent 68%);
}

.glow-two {
    right: 9%;
    bottom: -300px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(255, 138, 31, 0.13), transparent 66%);
}

.profile-identity,
.profile-actions,
.rank-section {
    position: relative;
    z-index: 1;
}

.profile-identity {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    padding: 52px 46px 48px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--cyan);
    font: 500 0.7rem/1.3 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 20px;
    height: 2px;
    flex: 0 0 20px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    box-shadow: 0 0 10px rgba(37, 230, 238, 0.65);
}

.profile-identity .eyebrow {
    width: fit-content;
    padding: 7px 10px;
    border: 1px solid rgba(37, 230, 238, 0.18);
    border-radius: 999px;
    background: rgba(37, 230, 238, 0.055);
}

.profile-identity .eyebrow::before {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
    border-radius: 50%;
    animation: livePulse 2.2s ease-in-out infinite;
}

.eyebrow span,
.identity-meta span {
    color: var(--orange);
}

.profile-identity h1 {
    max-width: 760px;
    margin: 18px 0 0;
    color: #fff;
    font-size: clamp(2.8rem, 6.3vw, 5.4rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.055em;
    text-wrap: balance;
    text-shadow: 0 0 32px rgba(37, 230, 238, 0.13);
}

.identity-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0;
    color: #a9c0ca;
    font-size: 0.98rem;
}

.profile-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-self: end;
    gap: 10px;
    padding: 24px 28px 0;
}

.back-btn,
.logout-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    color: var(--text);
    background: rgba(2, 12, 18, 0.48);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn {
    border-color: rgba(255, 138, 31, 0.5);
    color: #ffc282;
}

.back-btn:hover,
.logout-btn:hover {
    transform: translateY(-2px);
}

.back-btn:hover {
    border-color: var(--cyan);
    color: #021015;
    background: var(--cyan);
    box-shadow: 0 10px 25px rgba(37, 230, 238, 0.2);
}

.logout-btn:hover {
    color: #150900;
    background: var(--orange);
    box-shadow: 0 10px 25px rgba(255, 138, 31, 0.2);
}

.rank-section {
    position: relative;
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 184px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 14px 30px 34px 22px;
    border: 0;
    border-left: 1px solid rgba(37, 230, 238, 0.13);
    border-radius: 0;
    background: linear-gradient(135deg, rgba(37, 230, 238, 0.025), rgba(255, 138, 31, 0.035));
}

.rank-section::before {
    content: 'RANK SIGNAL / ACTIVE';
    position: absolute;
    top: 8px;
    right: 30px;
    color: rgba(37, 230, 238, 0.4);
    font: 0.5rem var(--mono);
    letter-spacing: 0.16em;
}

.rank-visual {
    position: relative;
    width: 184px;
    height: 184px;
    display: grid;
    place-items: center;
}

.rank-visual::before,
.rank-visual::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.rank-visual::before {
    inset: 37px;
    background: radial-gradient(circle, rgba(255, 138, 31, 0.18), transparent 68%);
    box-shadow: 0 0 55px rgba(255, 138, 31, 0.1);
}

.rank-visual::after {
    inset: 12px;
    border: 1px dashed rgba(37, 230, 238, 0.18);
    animation: orbitReverse 22s linear infinite;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(37, 230, 238, 0.3);
    border-radius: 50%;
}

.orbit::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 16%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
}

.orbit-outer {
    inset: 0;
    border-right-color: transparent;
    border-bottom-color: rgba(255, 138, 31, 0.54);
    animation: orbit 15s linear infinite;
}

.orbit-inner {
    inset: 23px;
    border-top-color: transparent;
    border-left-color: rgba(255, 138, 31, 0.57);
    animation: orbitReverse 10s linear infinite;
}

.orbit-inner::before {
    top: auto;
    right: 5%;
    bottom: 24%;
    left: auto;
    width: 5px;
    height: 5px;
    background: var(--orange);
    box-shadow: 0 0 12px var(--orange);
}

.orbit-tick {
    position: absolute;
    z-index: 3;
    width: 16px;
    height: 2px;
    background: var(--green);
    box-shadow: 0 0 8px rgba(174, 242, 56, 0.65);
}

.tick-one {
    top: 28px;
    right: 13px;
    transform: rotate(43deg);
}

.tick-two {
    bottom: 21px;
    left: 21px;
    transform: rotate(43deg);
}

.rank-badge-wrap {
    position: relative;
    z-index: 2;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 138, 31, 0.28);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(17, 44, 54, 0.97), rgba(3, 15, 23, 0.76) 70%);
    box-shadow: inset 0 0 36px rgba(37, 230, 238, 0.08), 0 0 42px rgba(37, 230, 238, 0.08);
    animation: rankFloat 4.2s ease-in-out infinite;
}

.rank-badge-wrap::before {
    content: '';
    position: absolute;
    inset: -7px;
    z-index: -1;
    border: 1px solid rgba(37, 230, 238, 0.13);
    border-radius: 50%;
    animation: badgeGlow 3.2s ease-in-out infinite;
}

.rank-badge {
    width: 94px;
    height: 94px;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 11px rgba(255, 138, 31, 0.2));
}

.rank-readout {
    min-width: 0;
    max-width: 230px;
}

.rank-label {
    margin: 0;
    color: var(--muted);
    font: 0.64rem/1.2 var(--mono);
    letter-spacing: 0.13em;
}

.rank-readout h2 {
    margin: 4px 0 2px;
    color: var(--green);
    font-size: 1.45rem;
    line-height: 1.05;
    text-shadow: 0 0 20px rgba(174, 242, 56, 0.16);
}

.mmr {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 2px 0 13px;
}

.mmr strong {
    color: #fff;
    font-size: 1.82rem;
    line-height: 1;
    letter-spacing: -0.045em;
}

.mmr span {
    color: var(--orange);
    font: 0.6rem var(--mono);
    letter-spacing: 0.12em;
}

.rank-progress {
    position: relative;
    height: 8px;
    overflow: hidden;
    border: 1px solid rgba(37, 230, 238, 0.14);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.34);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
}

.rank-progress::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: repeating-linear-gradient(90deg, transparent 0 19%, rgba(4, 16, 24, 0.78) 19% 20%);
    pointer-events: none;
}

.rank-progress > span {
    position: relative;
    display: block;
    width: var(--rank-progress);
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--orange), var(--green));
    box-shadow: 0 0 15px rgba(174, 242, 56, 0.4);
    animation: rankCharge 1.25s cubic-bezier(0.2, 0.72, 0.25, 1) both;
}

.rank-progress > span::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -55%;
    width: 42%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
    transform: skewX(-18deg);
    animation: rankScan 2.6s 1.1s ease-in-out infinite;
}

.rank-progress-meta {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    color: var(--muted);
    font: 0.55rem/1.35 var(--mono);
}

.rank-progress-meta strong {
    overflow-wrap: anywhere;
    color: var(--cyan);
    font-weight: 500;
}

/* Snapshot stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
    margin: 16px 0;
}

.stat-card {
    position: relative;
    min-width: 0;
    min-height: 152px;
    padding: 23px;
    overflow: hidden;
    border-radius: 18px;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.stat-card::before,
.stat-card::after {
    content: '';
    position: absolute;
}

.stat-card::before {
    top: 0;
    left: 0;
    width: 46%;
    height: 2px;
    background: var(--accent, var(--cyan));
    box-shadow: 0 0 16px var(--accent, var(--cyan));
}

.stat-card::after {
    right: -30px;
    bottom: -42px;
    width: 105px;
    height: 105px;
    border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 28%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 35px color-mix(in srgb, var(--accent, var(--cyan)) 10%, transparent);
}

.stat-card:hover {
    z-index: 1;
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--accent, var(--cyan)) 45%, transparent);
    background: linear-gradient(145deg, rgba(12, 38, 49, 0.98), rgba(5, 19, 27, 0.96));
}

.stat-card.orange { --accent: var(--orange); }
.stat-card.green { --accent: var(--green); }
.stat-card.cyan { --accent: var(--cyan); }
.stat-card.pink { --accent: var(--pink); }

.stat-card span,
.stat-card small {
    position: relative;
    z-index: 1;
    display: block;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card span {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.stat-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin: 13px 0 5px;
    color: var(--accent, #fff);
    font-size: clamp(2rem, 3.2vw, 2.65rem);
    line-height: 1;
    letter-spacing: -0.055em;
    text-shadow: 0 0 24px color-mix(in srgb, var(--accent, var(--cyan)) 20%, transparent);
}

.stat-card small {
    font-size: 0.72rem;
}

/* Shared content panels */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(350px, 0.94fr);
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    position: relative;
    padding: 29px;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    width: 72px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    box-shadow: 0 0 14px rgba(37, 230, 238, 0.45);
}

.panel-heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 23px;
}

.panel-heading h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.35rem, 2.6vw, 1.72rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.status-dot,
.match-count,
.form-score {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(174, 242, 56, 0.38);
    border-radius: 999px;
    color: var(--green);
    background: rgba(174, 242, 56, 0.06);
    font: 500 0.63rem var(--mono);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-dot::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.match-count {
    border-color: rgba(37, 230, 238, 0.32);
    color: var(--cyan);
    background: rgba(37, 230, 238, 0.055);
}

.form-score {
    border-color: rgba(255, 138, 31, 0.42);
    color: #ffbd7d;
    background: rgba(255, 138, 31, 0.055);
}

.profile-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    margin: 0;
}

.profile-list div {
    position: relative;
    min-width: 0;
    padding: 14px 0 14px 16px;
    border-bottom: 1px solid rgba(124, 218, 230, 0.11);
}

.profile-list div::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 7px rgba(255, 138, 31, 0.55);
}

.profile-list dt {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: #f7fdff;
    font-size: 0.93rem;
    font-weight: 600;
}

.recent-form {
    min-height: 76px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.form-pill {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 12px;
    font: 700 0.8rem var(--mono);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-pill:hover {
    transform: translateY(-3px) rotate(-2deg);
}

.form-pill.win {
    color: var(--green);
    background: rgba(174, 242, 56, 0.1);
    box-shadow: inset 0 0 15px rgba(174, 242, 56, 0.05);
}

.form-pill.loss {
    color: var(--pink);
    background: rgba(255, 78, 155, 0.1);
}

.form-pill.draw {
    color: var(--cyan);
    background: rgba(37, 230, 238, 0.1);
}

.streak-banner {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 19px;
    padding: 15px 17px;
    border: 1px solid rgba(255, 138, 31, 0.17);
    border-left: 3px solid var(--orange);
    border-radius: 0 13px 13px 0;
    background: linear-gradient(100deg, rgba(255, 138, 31, 0.12), rgba(255, 138, 31, 0.018));
}

.streak-banner > span {
    font-size: 1.55rem;
    filter: drop-shadow(0 0 8px rgba(255, 138, 31, 0.7));
}

.streak-banner strong,
.streak-banner small {
    display: block;
}

.streak-banner small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
}

.empty-state {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

/* Achievement feed */
.activity-panel,
.connections-panel {
    margin-bottom: 16px;
}

.activity-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.achievement-btn,
.view-all-btn,
.connection-search button {
    border: 1px solid rgba(37, 230, 238, 0.4);
    border-radius: 10px;
    color: var(--cyan);
    background: rgba(37, 230, 238, 0.07);
    font-weight: 700;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.achievement-btn {
    min-height: 34px;
    padding: 7px 11px;
    border-color: rgba(255, 138, 31, 0.46);
    color: #ffc183;
    background: rgba(255, 138, 31, 0.07);
    font-size: 0.68rem;
}

.achievement-btn:hover {
    border-color: var(--orange);
    color: #130800;
    background: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 9px 20px rgba(255, 138, 31, 0.17);
}

.profile-activity-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 10px;
}

.profile-activity-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(124, 218, 230, 0.12);
    border-radius: 13px;
    background: linear-gradient(130deg, rgba(37, 230, 238, 0.045), rgba(3, 14, 21, 0.26));
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.profile-activity-item:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 230, 238, 0.3);
    background: rgba(37, 230, 238, 0.06);
}

.profile-activity-icon {
    width: 41px;
    height: 41px;
    flex: 0 0 41px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(174, 242, 56, 0.3);
    border-radius: 11px;
    background: rgba(174, 242, 56, 0.07);
    font-size: 1.15rem;
}

.profile-activity-item > div {
    min-width: 0;
}

.profile-activity-item strong,
.profile-activity-item small {
    display: block;
}

.profile-activity-item strong {
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    line-height: 1.4;
}

.profile-activity-item small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
}

.activity-rank_up .profile-activity-icon {
    display: none;
}

.activity-rank-badge {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(37, 230, 238, 0.25));
}

/* Connections */
.connections-panel {
    isolation: isolate;
    background:
        radial-gradient(circle at 93% 3%, rgba(37, 230, 238, 0.1), transparent 24rem),
        radial-gradient(circle at 4% 100%, rgba(255, 138, 31, 0.075), transparent 25rem),
        linear-gradient(145deg, rgba(9, 29, 40, 0.96), rgba(4, 17, 25, 0.92));
}

.connections-heading {
    margin-bottom: 19px;
}

.section-subtitle {
    max-width: 660px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.connection-search {
    padding: 19px;
    border: 1px solid rgba(37, 230, 238, 0.17);
    border-radius: var(--radius-md);
    background: linear-gradient(115deg, rgba(37, 230, 238, 0.065), rgba(3, 15, 22, 0.4));
}

.connection-search label {
    display: block;
    margin-bottom: 9px;
    color: #e8fbff;
    font-size: 0.76rem;
    font-weight: 700;
}

.connection-search-controls {
    display: flex;
    gap: 10px;
}

.connection-search select,
.match-filters input,
.match-filters select {
    min-width: 0;
    min-height: 44px;
    border: 1px solid rgba(124, 218, 230, 0.2);
    border-radius: 10px;
    color: var(--text);
    background: #061821;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.connection-search select {
    flex: 1;
    padding: 10px 12px;
}

.connection-search select:hover,
.match-filters input:hover,
.match-filters select:hover {
    border-color: rgba(37, 230, 238, 0.42);
}

.connection-search select:focus,
.match-filters input:focus,
.match-filters select:focus {
    outline: 0;
    border-color: var(--cyan);
    background: #071d27;
    box-shadow: 0 0 0 3px rgba(37, 230, 238, 0.1);
}

.connection-search button {
    min-height: 44px;
    padding: 10px 18px;
}

.connection-search button:hover,
.view-all-btn:hover {
    color: #001115;
    background: var(--cyan);
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 230, 238, 0.16);
}

.relationship-summary {
    margin-top: 14px;
    padding: 19px;
    border: 1px solid rgba(255, 138, 31, 0.18);
    border-left: 3px solid var(--orange);
    border-radius: 0 14px 14px 0;
    background: linear-gradient(105deg, rgba(255, 138, 31, 0.085), rgba(3, 15, 22, 0.38));
}

.relationship-summary h3 {
    margin: 0 0 15px;
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.relationship-summary a,
.connection-table a {
    color: var(--cyan-soft);
    font-weight: 600;
    text-decoration: none;
}

.relationship-summary a:hover,
.connection-table a:hover {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--orange);
    text-underline-offset: 3px;
}

.relationship-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.relationship-grid > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(124, 218, 230, 0.11);
    border-radius: 11px;
    background: rgba(2, 12, 18, 0.33);
}

.relationship-grid h4 {
    margin: 0 0 8px;
    color: #fff;
}

.relationship-grid small {
    color: var(--muted);
}

.relationship-record {
    margin: 0 0 5px;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.55;
}

.connections-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    margin-top: 20px;
}

.connection-subsection {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(124, 218, 230, 0.12);
    border-radius: var(--radius-md);
    background: rgba(2, 13, 20, 0.35);
}

.connection-subsection > h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-size: 1rem;
}

.connection-subsection > h3::before {
    content: '';
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 10px rgba(255, 138, 31, 0.8);
}

.connection-subsection + .connection-subsection > h3::before {
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(37, 230, 238, 0.8);
}

.connection-table-wrap,
.table-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) rgba(37, 230, 238, 0.05);
}

.connection-table-wrap {
    border: 1px solid rgba(124, 218, 230, 0.1);
    border-radius: 11px;
    background: rgba(2, 12, 18, 0.3);
}

.connection-table {
    width: 100%;
    min-width: 510px;
    border-collapse: collapse;
}

.connection-table th,
.matches-table th {
    color: var(--muted);
    font: 500 0.61rem var(--mono);
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.connection-table th {
    padding: 11px 10px;
    background: rgba(37, 230, 238, 0.04);
}

.connection-table td {
    padding: 13px 10px;
    border-top: 1px solid rgba(124, 218, 230, 0.095);
    font-size: 0.8rem;
    white-space: nowrap;
}

.connection-table tbody tr,
.matches-table tbody tr {
    transition: background 0.18s ease;
}

.connection-table tbody tr:hover,
.matches-table .match-row:hover {
    background: rgba(37, 230, 238, 0.045);
}

.net-positive,
.net-negative,
.net-zero {
    display: inline-block;
    min-width: 30px;
    padding: 3px 6px;
    border-radius: 6px;
    font: 700 0.72rem var(--mono);
    text-align: center;
}

.net-positive {
    color: var(--green);
    background: rgba(174, 242, 56, 0.09);
}

.net-negative {
    color: #ff8abb;
    background: rgba(255, 78, 155, 0.09);
}

.net-zero {
    color: var(--cyan);
    background: rgba(37, 230, 238, 0.09);
}

.h2h-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 13px;
}

.h2h-tab {
    min-height: 35px;
    padding: 7px 10px;
    border: 1px solid rgba(124, 218, 230, 0.18);
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 0.7rem;
    font-weight: 700;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.h2h-tab:hover:not(.active) {
    border-color: rgba(37, 230, 238, 0.48);
    color: #fff;
    transform: translateY(-1px);
}

.h2h-tab.active {
    border-color: var(--cyan);
    color: #001014;
    background: var(--cyan);
    box-shadow: 0 6px 18px rgba(37, 230, 238, 0.15);
}

.h2h-panel[hidden],
.expandable-row[hidden],
.match-row[hidden],
.filter-empty[hidden] {
    display: none !important;
}

.view-all-btn {
    width: 100%;
    min-height: 39px;
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 0.75rem;
}

/* Match history */
.matches-panel {
    padding-bottom: 22px;
}

.match-filters {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -3px 0 20px;
}

.match-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.match-filters input,
.match-filters select {
    padding: 10px 12px;
    font-size: 0.82rem;
}

.match-filters input {
    flex: 1;
}

.match-filters input::placeholder {
    color: #647f8d;
}

.match-filters select {
    min-width: 150px;
}

.table-wrap {
    margin: 0 -4px -4px;
}

.matches-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
}

.matches-table th {
    padding: 0 10px 12px;
}

.matches-table td {
    padding: 16px 10px;
    border-top: 1px solid rgba(124, 218, 230, 0.1);
    font-size: 0.84rem;
    vertical-align: middle;
}

.matches-table td strong,
.matches-table td small {
    display: block;
}

.matches-table td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.match-id {
    color: var(--cyan);
    font: 600 0.72rem var(--mono);
    white-space: nowrap;
}

.score {
    color: #fff;
    font-family: var(--mono);
    white-space: nowrap;
}

.result {
    display: inline-block;
    min-width: 45px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: 500 0.58rem var(--mono);
    text-align: center;
}

.result-win {
    border-color: rgba(174, 242, 56, 0.18);
    color: var(--green);
    background: rgba(174, 242, 56, 0.1);
}

.result-loss {
    border-color: rgba(255, 78, 155, 0.18);
    color: #ff91c0;
    background: rgba(255, 78, 155, 0.1);
}

.result-draw {
    border-color: rgba(37, 230, 238, 0.18);
    color: var(--cyan);
    background: rgba(37, 230, 238, 0.1);
}

.plus,
.minus,
.zero {
    font: 600 0.76rem var(--mono);
}

.plus { color: var(--green); }
.minus { color: #ff91c0; }
.zero { color: var(--cyan); }

.empty-row {
    padding: 34px !important;
    color: var(--muted);
    text-align: center;
}

/* Dialog */
.achievement-dialog {
    width: min(730px, calc(100% - 24px));
    max-height: min(82vh, 760px);
    padding: 25px;
    overflow: auto;
    border: 1px solid rgba(37, 230, 238, 0.32);
    border-radius: 21px;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0, rgba(37, 230, 238, 0.11), transparent 20rem),
        #071a24;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), inset 0 1px rgba(255, 255, 255, 0.04);
}

.achievement-dialog::backdrop {
    background: rgba(0, 7, 11, 0.78);
    backdrop-filter: blur(6px);
}

.achievement-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(124, 218, 230, 0.13);
}

.achievement-dialog h2 {
    margin: 0;
    font-size: 1.45rem;
}

.dialog-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(124, 218, 230, 0.25);
    border-radius: 50%;
    color: #fff;
    background: rgba(3, 14, 20, 0.55);
    font-size: 1.35rem;
    line-height: 1;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dialog-close:hover {
    color: #001014;
    background: var(--cyan);
    transform: rotate(8deg);
}

.achievement-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.achievement-guide-grid article {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(124, 218, 230, 0.12);
    border-radius: 12px;
    background: rgba(37, 230, 238, 0.035);
}

.achievement-guide-grid article > span {
    font-size: 1.35rem;
}

.achievement-guide-grid strong {
    display: block;
    color: var(--green);
    font-size: 0.87rem;
}

.achievement-guide-grid p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.48;
}

.achievement-guide-grid .achievement-wide {
    grid-column: 1 / -1;
}

.back-to-top {
    position: fixed;
    right: 23px;
    bottom: 23px;
    z-index: 10;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(130, 248, 255, 0.7);
    border-radius: 14px;
    color: #001014;
    background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
    box-shadow: 0 12px 30px rgba(37, 230, 238, 0.24);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: var(--green);
    box-shadow: 0 14px 32px rgba(174, 242, 56, 0.2);
}

@keyframes livePulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 6px rgba(37, 230, 238, 0.45); }
    50% { opacity: 1; box-shadow: 0 0 14px rgba(37, 230, 238, 0.95); }
}

@keyframes badgeGlow {
    0%, 100% { opacity: 0.45; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.03); }
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

@keyframes orbitReverse {
    to { transform: rotate(-360deg); }
}

@keyframes rankFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes rankCharge {
    from { width: 0; filter: brightness(1.7); }
    to { width: var(--rank-progress); filter: brightness(1); }
}

@keyframes rankScan {
    0%, 22% { left: -55%; opacity: 0; }
    35% { opacity: 0.9; }
    68%, 100% { left: 118%; opacity: 0; }
}

@media (max-width: 1050px) {
    .profile-container {
        width: min(960px, calc(100% - 28px));
        margin-top: 20px;
    }

    .profile-header {
        grid-template-columns: minmax(0, 1fr) 370px;
    }

    .profile-identity {
        padding-right: 34px;
        padding-left: 38px;
    }

    .rank-section {
        grid-template-columns: 164px minmax(0, 1fr);
        gap: 13px;
        padding-right: 24px;
        padding-left: 16px;
    }

    .rank-visual {
        width: 164px;
        height: 164px;
    }

    .rank-badge-wrap {
        width: 104px;
        height: 104px;
    }

    .rank-badge {
        width: 88px;
        height: 88px;
    }

    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stat-card:nth-child(4),
    .stat-card:nth-child(5) {
        min-height: 132px;
    }

    .content-grid,
    .connections-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body::after {
        width: 120vw;
        right: -43vw;
        bottom: -22vw;
    }

    .profile-container {
        width: min(100% - 20px, 680px);
        margin: 10px auto 62px;
    }

    .profile-header {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0;
        padding: 0;
        border-radius: 21px;
    }

    .profile-header::before {
        top: -65px;
        right: -95px;
        width: 330px;
        height: 330px;
        opacity: 0.075;
    }

    .profile-actions {
        grid-row: 1;
        grid-column: 1;
        justify-self: stretch;
        justify-content: flex-end;
        padding: 20px 22px 0;
    }

    .profile-identity {
        grid-row: 2;
        grid-column: 1;
        padding: 25px 28px 31px;
    }

    .profile-identity h1 {
        font-size: clamp(2.65rem, 12vw, 4.4rem);
    }

    .rank-section {
        grid-row: 3;
        grid-column: 1;
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 22px;
        max-width: 100%;
        margin-top: 0;
        padding: 28px 28px 31px;
        border-top: 1px solid rgba(37, 230, 238, 0.13);
        border-left: 0;
    }

    .rank-section::before {
        top: 15px;
        right: 25px;
    }

    .rank-visual {
        width: 178px;
        height: 178px;
    }

    .rank-badge-wrap {
        width: 110px;
        height: 110px;
    }

    .rank-badge {
        width: 92px;
        height: 92px;
    }

    .rank-readout {
        max-width: none;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 10px 0;
    }

    .stat-card,
    .stat-card:nth-child(4),
    .stat-card:nth-child(5) {
        min-height: 130px;
        padding: 19px;
    }

    .stat-card:last-child {
        grid-column: 1 / -1;
    }

    .content-grid,
    .activity-panel,
    .connections-panel {
        margin-bottom: 10px;
    }

    .content-grid {
        gap: 10px;
    }

    .panel {
        padding: 22px;
        border-radius: 17px;
    }

    .panel::before {
        left: 22px;
    }

    .relationship-grid {
        grid-template-columns: 1fr;
    }

    .matches-panel .table-wrap {
        overflow: visible;
        margin: 0;
    }

    .matches-table,
    .matches-table tbody,
    .matches-table tr,
    .matches-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .matches-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .matches-table tbody {
        display: grid;
        gap: 10px;
    }

    .matches-table tr.match-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        overflow: hidden;
        border: 1px solid rgba(124, 218, 230, 0.13);
        border-radius: 13px;
        background: rgba(2, 13, 20, 0.35);
    }

    .matches-table tr.match-row:hover {
        background: rgba(37, 230, 238, 0.045);
    }

    .matches-table .match-row td {
        position: relative;
        min-width: 0;
        padding: 13px 13px 13px 106px;
        border: 0;
        border-bottom: 1px solid rgba(124, 218, 230, 0.08);
        white-space: normal;
    }

    .matches-table .match-row td:nth-child(3),
    .matches-table .match-row td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .matches-table .match-row td::before {
        position: absolute;
        top: 14px;
        left: 13px;
        color: var(--muted);
        font: 500 0.58rem var(--mono);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .matches-table .match-row td:nth-child(1)::before { content: 'Match'; }
    .matches-table .match-row td:nth-child(2)::before { content: 'Date / venue'; }
    .matches-table .match-row td:nth-child(3)::before { content: 'Team-up'; }
    .matches-table .match-row td:nth-child(4)::before { content: 'Opponents'; }
    .matches-table .match-row td:nth-child(5)::before { content: 'Score'; }
    .matches-table .match-row td:nth-child(6)::before { content: 'Result'; }
    .matches-table .match-row td:nth-child(7)::before { content: 'MMR'; }
    .matches-table .match-row td:nth-child(8)::before { content: 'Change'; }

    .matches-table .empty-row {
        display: block;
        border: 1px solid rgba(124, 218, 230, 0.13);
        border-radius: 12px;
    }
}

@media (max-width: 540px) {
    .profile-header {
        padding: 0;
    }

    .profile-actions {
        justify-content: stretch;
        padding: 15px 16px 0;
    }

    .profile-actions a {
        flex: 1;
    }

    .profile-identity .eyebrow {
        font-size: 0.61rem;
    }

    .profile-identity {
        padding: 23px 19px 25px;
    }

    .profile-identity h1 {
        margin-top: 15px;
        font-size: clamp(2.35rem, 14vw, 3.6rem);
    }

    .identity-meta {
        margin-top: 15px;
        font-size: 0.86rem;
    }

    .rank-section {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 29px 19px 24px;
    }

    .rank-section::before {
        top: 13px;
        right: 16px;
        font-size: 0.45rem;
    }

    .rank-visual {
        width: 184px;
        height: 184px;
        margin: 0 auto;
    }

    .rank-badge-wrap {
        width: 112px;
        height: 112px;
        border-radius: 50%;
    }

    .rank-badge {
        width: 94px;
        height: 94px;
        max-width: none;
        max-height: none;
    }

    .rank-readout {
        width: min(100%, 320px);
        margin: 0 auto;
        text-align: center;
    }

    .rank-readout h2 {
        font-size: 1.35rem;
    }

    .mmr {
        justify-content: center;
    }

    .mmr strong {
        font-size: 1.75rem;
    }

    .rank-progress-meta {
        justify-items: center;
    }

    .stat-card,
    .stat-card:nth-child(4),
    .stat-card:nth-child(5) {
        min-height: 120px;
        padding: 16px;
    }

    .stat-card strong {
        font-size: 2rem;
    }

    .stat-card span,
    .stat-card small {
        white-space: normal;
    }

    .panel {
        padding: 19px 15px;
    }

    .panel::before {
        left: 15px;
    }

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 19px;
    }

    .status-dot,
    .match-count,
    .form-score {
        width: fit-content;
    }

    .profile-list {
        grid-template-columns: 1fr;
    }

    .activity-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-activity-list {
        grid-template-columns: 1fr;
    }

    .connection-search,
    .relationship-summary,
    .connection-subsection {
        padding: 14px;
    }

    .connection-search-controls,
    .match-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .connection-search select,
    .connection-search button,
    .match-filters select {
        width: 100%;
        font-size: 16px;
    }

    .h2h-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .h2h-tab {
        min-height: 40px;
    }

    .connection-table {
        min-width: 470px;
    }

    .matches-table tr.match-row {
        grid-template-columns: 1fr;
    }

    .matches-table .match-row td,
    .matches-table .match-row td:nth-child(3),
    .matches-table .match-row td:nth-child(4) {
        grid-column: 1;
        padding-left: 105px;
    }

    .achievement-dialog {
        padding: 18px;
    }

    .achievement-guide-grid {
        grid-template-columns: 1fr;
    }

    .achievement-guide-grid .achievement-wide {
        grid-column: auto;
    }

    .back-to-top {
        right: 14px;
        bottom: 14px;
        width: 43px;
        height: 43px;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
