:root {
    --bg: #061017;
    --bg-soft: #0d1d27;
    --surface: #102430;
    --surface-alt: #163140;
    --ink: #e6f5ff;
    --muted: #9bb5c7;
    --primary: #2ed198;
    --primary-strong: #1cae7c;
    --accent: #5ea3ff;
    --danger-bg: #3a1822;
    --danger-ink: #ffbccb;
    --success-bg: #103329;
    --success-ink: #9ff3cc;
    --border: #204355;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(1000px 500px at 100% -5%, rgba(46, 209, 152, 0.18), transparent 55%),
        radial-gradient(900px 500px at -20% 25%, rgba(94, 163, 255, 0.18), transparent 60%),
        linear-gradient(180deg, #061017 0%, #0a151e 100%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    background: #00172c;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(94, 163, 255, 0.2);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 22px;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 34px;
    width: auto;
    max-width: min(220px, 56vw);
    object-fit: contain;
}

.topbar nav a {
    color: #b8cfe0;
    text-decoration: none;
    margin-left: 0;
    font-size: 14px;
}

.topbar nav a:hover {
    color: #e5f5ff;
}


.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 60px;
}

.container > section + section {
    margin-top: 16px;
}

.site-footer {
    margin-top: 24px;
    border-top: 1px solid rgba(94, 163, 255, 0.22);
    background: #00172c;
}

.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    color: #b8cfde;
    text-align: center;
}

.site-footer-inner strong {
    color: #e5f4ff;
}

.site-footer-inner small {
    color: #89a7bb;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(94, 163, 255, 0.25);
    border-radius: 16px;
    padding: 30px;
    background: linear-gradient(140deg, rgba(10, 32, 43, 0.95), rgba(14, 41, 53, 0.9));
    box-shadow: 0 16px 40px rgba(1, 8, 14, 0.4);
}

.hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(24px, 4vw, 38px);
}

.hero p {
    color: #b9cfdd;
    max-width: 700px;
}

.hero-home {
    min-height: 280px;
    display: flex;
    align-items: center;
    position: relative;
    isolation: isolate;
}

.hero-home.has-community-banner {
    background-image: linear-gradient(110deg, rgba(5, 22, 35, 0.92), rgba(6, 24, 37, 0.76) 55%, rgba(6, 24, 37, 0.52)), var(--home-banner-image);
    background-size: cover;
    background-position: center;
}

.hero-home.has-community-banner .hero-orb {
    opacity: 0.35;
}

.hero-home .hero-content {
    position: relative;
    z-index: 2;
}

.hero-orb {
    position: absolute;
    right: -60px;
    bottom: -40px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(46, 209, 152, 0.9), rgba(94, 163, 255, 0.45), transparent 70%);
    filter: blur(2px);
    z-index: 1;
    pointer-events: none;
}

.profile-wrap {
    display: flex;
    gap: 20px;
    align-items: center;
}

.hero.hero-dashboard {
    padding: 0;
}

.profile-account {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(280px, 360px);
    grid-template-areas:
        "avatar meta badges"
        "avatar actions badges"
        "xp xp xp";
    gap: 12px;
    align-items: start;
    padding: 14px;
}

.hero-dashboard .profile-account {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "main badges"
        "xp xp";
    gap: 8px;
    align-items: start;
}

.profile-main-inline {
    grid-area: main;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas:
        "avatar meta"
        "avatar actions";
    align-items: start;
    gap: 4px 10px;
}

.profile-editable {
    position: relative;
}

.profile-avatar-wrap {
    position: relative;
    grid-area: avatar;
    width: fit-content;
}

.profile-account .profile-avatar {
    grid-area: avatar;
}

.edit-media-btn {
    border: 1px solid #3c6680;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #d7ecfb;
    background: rgba(8, 25, 37, 0.92);
    cursor: pointer;
}

.edit-media-btn:hover {
    background: rgba(12, 35, 52, 0.96);
    border-color: #66b7e9;
}

.edit-avatar-btn {
    position: absolute;
    right: -8px;
    bottom: -8px;
    z-index: 3;
}

.edit-banner-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

.profile-account .profile-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    min-width: 0;
}

.profile-account .profile-actions {
    grid-area: actions;
    width: 100%;
}

.profile-medals-inline {
    grid-area: badges;
    border: 1px solid rgba(70, 119, 148, 0.6);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(160deg, rgba(14, 38, 52, 0.9), rgba(11, 31, 43, 0.88));
    align-self: start;
}

.profile-xp-inline {
    grid-area: xp;
    border: 1px solid rgba(70, 119, 148, 0.6);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(160deg, rgba(14, 38, 52, 0.9), rgba(11, 31, 43, 0.88));
}

.section-head.compact h3 {
    margin: 0;
    font-size: 18px;
}

.profile-meta h1 {
    margin: 0;
    line-height: 1.1;
}

.profile-meta p {
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    flex-wrap: wrap;
}

.profile-account.has-custom-banner {
    background-image: linear-gradient(140deg, rgba(8, 28, 39, 0.82), rgba(10, 33, 44, 0.84)), var(--profile-banner-image);
    background-size: cover;
    background-position: center;
}

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #02120d;
    background: linear-gradient(90deg, #4fe4ac, #79c1ff);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 0;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 700;
    color: #042113;
    background: linear-gradient(90deg, var(--primary), #61e9aa);
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.btn.secondary {
    color: #c9f4e2;
    background: linear-gradient(90deg, #1a7758, #1f8864);
}

.btn.ghost {
    color: #c5def0;
    border: 1px solid #35596e;
    background: rgba(8, 26, 39, 0.9);
}

.btn.ghost:hover {
    background: rgba(11, 33, 49, 0.95);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
}

.section-head span {
    color: var(--muted);
    font-size: 13px;
}

.section-actions {
    margin-bottom: 12px;
}

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

.ranking-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 0.6fr);
    gap: 10px;
}

.ranking-controls .search-input,
.ranking-controls .control-input {
    width: 100%;
}

.wide-grid-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 3fr 1.6fr 1.1fr 1fr;
    gap: 10px;
}

.wishlist-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 3fr 1.6fr 1fr;
    gap: 10px;
}

.search-input {
    width: min(520px, 100%);
    border: 1px solid #2f5b72;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ink);
    background: #0d2230;
}

.search-input::placeholder {
    color: #7593a8;
}

.wide-grid-controls .search-input,
.wide-grid-controls .control-input {
    width: 100%;
}

.wishlist-controls .search-input,
.wishlist-controls .control-input {
    width: 100%;
}

.control-input {
    border: 1px solid #2f5b72;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ink);
    background: #0d2230;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.metrics {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title-block {
    margin-top: 4px;
    margin-bottom: 8px;
}

.profile-media-card {
    margin-top: 10px;
}

.profile-media-form {
    display: grid;
    gap: 10px;
}

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

.profile-media-grid label {
    display: block;
    margin-bottom: 4px;
}

.profile-media-options {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: #b9d2e3;
    font-size: 13px;
}

.profile-media-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.preview-avatar-wrap .avatar.big {
    width: 72px;
    height: 72px;
}

.preview-banner-wrap {
    border: 1px solid rgba(72, 126, 158, 0.6);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(8, 25, 36, 0.9);
}

.preview-banner-wrap img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, rgba(13, 37, 52, 0.9), rgba(10, 29, 41, 0.92));
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(1, 9, 14, 0.68);
    backdrop-filter: blur(3px);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(17, 41, 54, 0.98), rgba(13, 31, 41, 0.97));
    padding: 14px;
    box-shadow: 0 18px 40px rgba(1, 8, 14, 0.55);
}

.modal-card .hero-actions .btn {
    width: 100%;
}

.modal-card .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}

.wishlist-panel {
    margin-top: 16px;
}

.profile-wishlist-panel {
    margin-top: 16px;
}

.metrics-rich {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px;
    background: linear-gradient(155deg, rgba(17, 42, 56, 0.95), rgba(12, 30, 41, 0.92));
    text-align: center;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric strong {
    font-size: 26px;
}

.metric .metric-delta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
}

.metric .metric-delta.delta-plus {
    color: #55df9f;
}

.metric .metric-delta.delta-minus {
    color: #ff7f95;
}

.metric strong.metric-delta-value {
    font-size: 32px;
    line-height: 1.1;
    font-weight: 500;
}

.metric strong.metric-delta-value.delta-plus {
    color: #55df9f;
}

.metric strong.metric-delta-value.delta-minus {
    color: #ff7f95;
}

.compare-shared {
    margin-top: 20px;
}

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

.community-section + .community-section {
    margin-top: 18px;
}

.community-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

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

.card {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(17, 41, 54, 0.96), rgba(13, 31, 41, 0.94));
    padding: 14px;
    box-shadow: 0 8px 22px rgba(2, 9, 15, 0.35);
}

.card-profile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
}

.card-profile .avatar {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
}

.card-profile-content {
    display: grid;
    gap: 8px;
    width: 100%;
}

.card-profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: #cfe3f2;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
    width: fit-content;
}

.profile-showcase-card {
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 128px auto 50px;
    height: 100%;
}

.profile-showcase-top {
    padding: 10px 14px 8px;
    background: linear-gradient(135deg, #1d6b45, #2a4f97);
    text-align: center;
    height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-showcase-top .avatar.big {
    width: 64px;
    height: 64px;
    margin: 0 auto 6px;
}

.profile-showcase-top h3 {
    margin: 0;
}

.profile-showcase-top p {
    margin: 4px 0 0;
    color: #d5e8f8;
}

.profile-showcase-mid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    background: rgba(8, 25, 35, 0.65);
    border-top: 1px solid rgba(85, 142, 181, 0.3);
    border-bottom: 1px solid rgba(85, 142, 181, 0.3);
    min-height: 42px;
    align-items: center;
}

.profile-showcase-mid span {
    text-align: center;
    color: #d5e9f8;
}

.profile-showcase-card .btn-sm {
    width: calc(100% - 24px);
    margin: 0 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    align-self: center;
    height: 34px;
}

.gamification-grid {
    margin-bottom: 10px;
}

.xp-main {
    display: grid;
    gap: 8px;
}

.xp-level {
    font-size: 30px;
    line-height: 1.1;
}

.medals-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 6px;
    align-content: start;
    min-height: 50px;
}

.medal-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #3f728d;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    background: rgba(19, 45, 59, 0.8);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medal-chip.icon-only {
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.medal-chip.icon-only.medal-more {
    font-size: 14px;
    font-weight: 700;
    color: #d3e8f8;
}

.hero-dashboard .profile-main-inline .avatar.big {
    width: 112px;
    height: 112px;
}

.mission-list {
    display: grid;
    gap: 10px;
}

.mission-item {
    border: 1px solid rgba(58, 102, 127, 0.5);
    border-radius: 10px;
    padding: 8px;
    background: rgba(12, 31, 43, 0.75);
}

.mission-item.is-done {
    border-color: rgba(84, 196, 146, 0.7);
    background: rgba(18, 55, 45, 0.62);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    align-items: stretch;
}

.chart-card {
    display: flex;
    flex-direction: column;
    min-height: 440px;
    min-width: 0;
}

.chart-wrap {
    position: relative;
    height: 250px;
}

.doughnut-wrap {
    max-width: 430px;
    margin: 0 auto;
    width: 100%;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.table-scroll-y {
    flex: 1;
    min-height: 0;
    max-height: 340px;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 2px;
}

.table-static-fill {
    flex: 1;
}

.table-scroll-y::-webkit-scrollbar {
    width: 8px;
}

.table-scroll-y::-webkit-scrollbar-track {
    background: rgba(14, 34, 46, 0.55);
    border-radius: 999px;
}

.table-scroll-y::-webkit-scrollbar-thumb {
    background: rgba(77, 161, 203, 0.55);
    border-radius: 999px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.stats-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(160deg, rgba(16, 39, 52, 0.98), rgba(13, 31, 41, 0.98));
}

.stats-table th,
.stats-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(59, 99, 123, 0.45);
    text-align: left;
    font-size: 14px;
    color: #dcefff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-table .num {
    text-align: right;
}

.stats-table-progress .num {
    text-align: right;
}

.stats-table th {
    color: #9cc4da;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stats-table tbody tr:last-child td {
    border-bottom: 0;
}

.stats-table-hours th:first-child,
.stats-table-hours td:first-child {
    width: 44px;
    text-align: center;
    color: #98bed2;
}

.stats-table-hours th:nth-child(3),
.stats-table-hours td:nth-child(3),
.stats-table-hours th:nth-child(4),
.stats-table-hours td:nth-child(4) {
    width: 120px;
}

.table-link {
    color: #dcefff;
    text-decoration: none;
}

.table-link:hover {
    color: #bfe5ff;
}

.game-card {
    overflow: hidden;
    padding: 0;
    width: 100%;
    position: relative;
}

.game-cover {
    width: 100%;
    height: 128px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border);
}

.game-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 156px;
}

.game-body h3 {
    margin: 0 0 4px;
}

.game-body p {
    margin: 0 0 6px;
}

.game-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-title a {
    color: var(--ink);
    text-decoration: none;
}

.game-title a:hover {
    color: #bde8ff;
}

.favorite-btn {
    border: 1px solid #3d6f88;
    border-radius: 9px;
    padding: 6px 10px;
    background: rgba(16, 38, 50, 0.8);
    color: #d7e9f6;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 6px;
}

.favorite-btn.active {
    border-color: #e1b544;
    color: #ffe7a6;
    background: rgba(117, 82, 23, 0.35);
}

.wish-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    border: 1px solid #3d6f88;
    border-radius: 9px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(8, 26, 39, 0.92);
    color: #cde9fb;
    font-weight: 700;
    cursor: pointer;
}

.wish-btn:hover {
    border-color: #77c4ff;
    color: #e8f7ff;
    background: rgba(11, 33, 49, 0.96);
}

.wish-btn.active {
    border-color: #82d8ff;
    color: #dbf5ff;
    background: rgba(34, 87, 112, 0.42);
}

.wish-priority {
    margin-bottom: 6px;
    width: 100%;
}

.rate-btn {
    border: 1px solid #3d6f88;
    border-radius: 9px;
    padding: 6px 10px;
    background: rgba(16, 38, 50, 0.8);
    color: #cde9fb;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 6px;
}

.rate-btn:hover {
    border-color: #77c4ff;
    color: #e8f7ff;
}

.rate-btn.rating-low {
    border-color: #d96c5f;
    background: rgba(73, 30, 24, 0.5);
    color: #ffd7cf;
}

.rate-btn.rating-mid {
    border-color: #d3b25b;
    background: rgba(73, 56, 20, 0.45);
    color: #fff0bf;
}

.rate-btn.rating-high {
    border-color: #4dcf93;
    background: rgba(19, 67, 48, 0.5);
    color: #d7ffe9;
}

.game-rating-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    color: #072217;
    background: linear-gradient(90deg, #5be7ae, #7ec6ff);
    box-shadow: 0 4px 10px rgba(1, 9, 15, 0.45);
}

.game-rating-badge.rating-low {
    color: #2d0b09;
    background: linear-gradient(90deg, #ff9a8f, #ffb29c);
}

.game-rating-badge.rating-mid {
    color: #2e2208;
    background: linear-gradient(90deg, #ffd37b, #ffe39a);
}

.game-rating-badge.rating-high {
    color: #072217;
    background: linear-gradient(90deg, #5be7ae, #7ec6ff);
}

.game-rating-badge.rating-none {
    color: #b9d1df;
    background: rgba(14, 35, 49, 0.9);
    border: 1px solid rgba(63, 104, 128, 0.7);
}

.game-rating-badge.is-hidden {
    display: none;
}

.details-cover {
    max-width: 320px;
    width: min(320px, 100%);
    height: auto !important;
    object-fit: contain;
    border-radius: 10px;
}

.game-account .profile-actions.two-up {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.game-account .profile-actions.three-up {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.game-account .profile-actions.two-up .btn {
    width: 100%;
    min-width: 0;
}

.game-account .profile-actions.three-up .btn,
.game-account .profile-actions.three-up .rate-btn {
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
}

.game-account {
    grid-template-columns: minmax(260px, 320px) 1fr;
    grid-template-areas:
        "avatar meta"
        "avatar actions";
    align-items: start;
    min-width: 0;
}

.game-account .profile-meta {
    justify-content: flex-start;
    gap: 8px;
    min-height: 0;
    min-width: 0;
}

.game-account .profile-avatar {
    width: 100%;
    max-width: 320px;
}

.progress-legend {
    margin-top: 6px;
    display: flex;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    color: #d7e9f6;
}

.progress-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.progress-legend .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.progress-legend .dot.done {
    background: #4ad596;
}

.progress-legend .dot.remain {
    background: #1e4c37;
}

.ranking-list {
    display: grid;
    gap: 10px;
}

.rank-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #274f65;
    border-radius: 10px;
    background: rgba(16, 38, 50, 0.7);
}

.rank-pos {
    min-width: 38px;
    text-align: center;
    font-weight: 700;
    color: #a8d5ee;
}

.rank-main {
    display: grid;
}

.rank-main span {
    color: var(--muted);
    font-size: 13px;
}

.rank-side {
    text-align: right;
    display: grid;
}

.rank-side small {
    color: #9bc8de;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    color: #c0d5e3;
    font-size: 13px;
    margin-bottom: 5px;
}

.progress-track {
    height: 7px;
    border-radius: 999px;
    background: #183446;
}

.progress-track div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #35d89f, #78c5ff);
}

.ach-block {
    margin-top: 8px;
}

.skeleton-grid .skeleton-card {
    pointer-events: none;
}

.skeleton-ranking .rank-item {
    pointer-events: none;
}

.skeleton-cover,
.skeleton-line,
.skeleton-track {
    background: linear-gradient(90deg, rgba(32, 63, 80, 0.6) 25%, rgba(61, 99, 121, 0.75) 50%, rgba(32, 63, 80, 0.6) 75%);
    background-size: 220% 100%;
    animation: shimmer 1.15s linear infinite;
}

.skeleton-cover {
    height: 128px;
    border-bottom: 1px solid var(--border);
}

.skeleton-line {
    border-radius: 8px;
    height: 12px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 16px;
    width: 78%;
}

.skeleton-text {
    width: 58%;
}

.skeleton-btn {
    width: 35%;
    height: 30px;
    border-radius: 9px;
}

.skeleton-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    margin-top: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.list-clean {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.list-clean li {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #244b61;
    border-radius: 10px;
    padding: 8px;
    background: rgba(16, 38, 50, 0.7);
    overflow: hidden;
}

.list-clean span {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.list-clean li > div {
    min-width: 0;
    flex: 1;
}

.list-item-link {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.list-item-link > div {
    min-width: 0;
    flex: 1;
}

.list-item-link:hover strong {
    color: #bfe5ff;
}

.recent-list strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ideas-list strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-table-compare th:nth-child(2),
.stats-table-compare td:nth-child(2),
.stats-table-compare th:nth-child(3),
.stats-table-compare td:nth-child(3),
.stats-table-compare th:nth-child(4),
.stats-table-compare td:nth-child(4) {
    width: 108px;
}

.list-cover {
    width: 92px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #2b5f7d;
}

.compare-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.compare-form input {
    min-width: 320px;
    flex: 1;
    border: 1px solid #2f5b72;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ink);
    background: #0d2230;
}

.compare-form input::placeholder {
    color: #7593a8;
}

.compare-panel {
    margin-top: 18px;
    margin-bottom: 18px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #5f88a1;
}

.avatar.big {
    width: 94px;
    height: 94px;
}

.hero-compare {
    padding: 22px;
}

.versus-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.versus-card {
    text-align: center;
}

.versus-card h2 {
    margin: 8px 0 6px;
}

.versus-card p {
    color: var(--muted);
    margin: 0;
}

.versus-middle {
    text-align: center;
    display: grid;
    gap: 6px;
    justify-items: center;
}

.versus-middle strong {
    font-size: clamp(56px, 5vw, 84px);
    font-weight: 700;
    line-height: 1;
}

.versus-middle small {
    color: var(--muted);
}

.compare-lines p {
    margin: 4px 0;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger-ink);
    border-color: #6d2d40;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-ink);
    border-color: #1f6149;
}

.muted {
    color: var(--muted);
}

@media (max-width: 900px) {
    .container {
        padding: 22px 16px 46px;
    }

    .hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: clamp(22px, 5vw, 30px);
    }

    .hero-home {
        min-height: 220px;
    }


    .medals-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }


    .hero-orb {
        width: 220px;
        height: 220px;
        right: -70px;
        bottom: -70px;
    }

    .versus-grid {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 10px;
    }

    .profile-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .avatar.big {
        width: 104px;
        height: 104px;
    }

    .game-grid,
    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .community-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-showcase-mid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .profile-showcase-top .avatar.big {
        width: 68px;
        height: 68px;
    }

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

    .chart-card {
        min-height: 0;
    }

    .table-scroll-y {
        max-height: 300px;
    }

    .chart-wrap {
        height: 220px;
    }

    .doughnut-wrap {
        max-width: 360px;
    }

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

    .profile-wrap.profile-account.game-account {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "meta"
            "actions";
        gap: 10px;
        align-items: start;
    }

    .profile-wrap.profile-account.game-account .profile-avatar.details-cover {
        width: 100%;
        max-width: none;
        max-height: 190px;
        object-fit: cover;
        display: block;
    }

    .profile-wrap.profile-account.game-account .profile-meta,
    .profile-wrap.profile-account.game-account .profile-actions {
        width: 100%;
    }

    .profile-wrap.profile-account.game-account .profile-actions.two-up {
        grid-template-columns: 1fr;
    }

    .profile-wrap.profile-account.game-account .profile-actions.two-up .btn {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .container {
        padding: 10px 14px 16px;
    }

    .topbar-inner {
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .topbar nav {
        width: auto;
        gap: 5px;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .topbar nav a {
        font-size: 13px;
        line-height: 1;
        padding: 2px 0;
        white-space: nowrap;
    }

    .site-footer-inner {
        padding: 12px 14px 16px;
        gap: 6px;
        justify-content: center;
        text-align: center;
    }

    .hero-compare {
        padding: 12px 10px;
    }

    .hero-home .btn {
        width: 100%;
    }

    .hero-home .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .hero-home p {
        max-width: 100%;
    }

    .hero-orb {
        right: -95px;
        bottom: -95px;
        width: 190px;
        height: 190px;
        opacity: 0.65;
    }

    .hero-home.has-community-banner {
        background-position: center top;
    }

    .versus-grid {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 6px;
        align-items: start;
    }

    .versus-card .avatar.big {
        width: 68px;
        height: 68px;
    }

    .versus-card h2 {
        margin: 6px 0 4px;
        font-size: 22px;
        line-height: 1.05;
    }

    .versus-card p {
        font-size: 10px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .versus-middle {
        gap: 4px;
        margin-top: 2px;
    }

    .versus-middle .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .versus-middle strong {
        font-size: 42px;
    }

    .versus-middle small {
        font-size: 11px;
        line-height: 1.1;
        text-align: center;
    }

    .compare-form input {
        min-width: 100%;
    }

    .control-input {
        width: 100%;
    }

    .section-head {
        align-items: flex-start;
    }

    .section-head span {
        width: 100%;
        text-align: left;
    }

    .wide-grid-controls,
    .wishlist-controls {
        grid-template-columns: 1fr;
    }

    .ranking-controls {
        grid-template-columns: 1fr;
    }

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

    .profile-media-options {
        flex-direction: column;
        gap: 6px;
    }

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

    .preview-banner-wrap img {
        height: 92px;
    }

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

    .charts-grid > * {
        min-width: 0;
    }

    .stats-table-hours {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .stats-table-hours th:first-child,
    .stats-table-hours td:first-child {
        width: 28px;
    }

    .stats-table-hours th:nth-child(3),
    .stats-table-hours td:nth-child(3),
    .stats-table-hours th:nth-child(4),
    .stats-table-hours td:nth-child(4) {
        width: 92px;
    }

    .stats-table-hours th:nth-child(2),
    .stats-table-hours td:nth-child(2) {
        min-width: 0;
    }

    .stats-table-hours td:nth-child(2) .table-link {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stats-table-compare th:nth-child(2),
    .stats-table-compare td:nth-child(2),
    .stats-table-compare th:nth-child(3),
    .stats-table-compare td:nth-child(3),
    .stats-table-compare th:nth-child(4),
    .stats-table-compare td:nth-child(4) {
        width: 84px;
    }

    .stats-table th,
    .stats-table td {
        padding: 8px 7px;
        font-size: 13px;
    }

    .hero {
        padding: 10px;
        border-radius: 14px;
        margin-bottom: 8px;
    }

    .profile-wrap {
        grid-template-columns: 64px 1fr;
        gap: 8px;
    }

    .profile-wrap .avatar.big {
        width: 64px;
        height: 64px;
    }

    .profile-wrap > div:last-child {
        width: 100%;
    }

    .profile-account {
        grid-template-areas:
            "avatar meta"
            "badges badges"
            "actions actions"
            "xp xp";
        align-items: start;
        grid-template-columns: 64px 1fr;
    }

    .hero-dashboard .profile-account {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "badges"
            "xp";
        gap: 8px;
    }

    .profile-account.has-custom-banner {
        background-image: none;
    }

    .hero-dashboard .profile-main-inline {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "avatar"
            "meta"
            "actions" !important;
        gap: 6px 8px !important;
        justify-items: center;
        padding: 10px;
        border: 1px solid rgba(70, 119, 148, 0.6);
        border-radius: 12px;
    }

    .profile-account.has-custom-banner .profile-main-inline {
        background-image: linear-gradient(140deg, rgba(8, 28, 39, 0.82), rgba(10, 33, 44, 0.84)), var(--profile-banner-image);
        background-size: cover;
        background-position: center;
    }

    .hero-dashboard .profile-main-inline .avatar.big {
        width: 74px;
        height: 74px;
    }

    .hero-dashboard .profile-main-inline .profile-meta {
        text-align: center;
        width: 100%;
    }

    .hero-dashboard .profile-main-inline .profile-meta h1 {
        font-size: 30px;
        line-height: 1.05;
    }

    .game-account {
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "meta"
            "actions";
    }

    .game-account .profile-avatar {
        width: 100%;
        max-width: none;
        height: auto !important;
    }

    .game-account .profile-meta {
        min-height: 0;
        gap: 6px;
        width: 100%;
    }

    .game-account .profile-actions {
        width: 100%;
    }

    .profile-account .profile-meta {
        min-height: 64px;
    }

    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .profile-medals-inline,
    .profile-xp-inline {
        width: 100%;
    }

    .card-profile .btn-sm {
        width: 100%;
    }

    .hero-actions > .btn,
    .hero-actions > button.btn,
    .hero-actions > a,
    .hero-actions > button,
    .compare-form > .btn,
    .compare-form > button,
    .compare-panel > .btn,
    .compare-panel > a,
    .pager > .btn,
    .pager > button {
        width: 100% !important;
        display: flex !important;
        justify-content: center;
    }

    .compare-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .compare-form .btn,
    .compare-panel .btn {
        width: 100%;
    }

    .metrics-rich {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric strong {
        font-size: 22px;
    }

    .metrics {
        gap: 6px;
        margin-bottom: 8px;
    }

    .metric {
        padding: 8px;
    }

    .chart-wrap {
        height: 165px;
        padding: 0 6px;
    }

    .doughnut-wrap {
        max-width: 210px;
    }

    .chart-card {
        padding: 8px 6px;
    }

    .chart-card .section-head {
        margin-bottom: 6px;
        padding: 0 4px;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .compact-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .community-profile-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .game-body {
        min-height: 132px;
        padding: 8px;
    }

    .rank-item {
        grid-template-columns: 24px 64px minmax(0, 1fr);
        grid-template-areas:
            "pos avatar main"
            "pos avatar side";
        gap: 6px;
        align-items: center;
        padding: 8px 9px;
    }

    .rank-pos {
        display: block;
        min-width: 24px;
        width: 24px;
        text-align: center;
        grid-area: pos;
        align-self: center;
    }

    .rank-item .avatar {
        grid-area: avatar;
        width: 64px;
        height: 64px;
        margin-left: 0;
    }

    .rank-main {
        grid-area: main;
        min-width: 0;
        text-align: left;
        padding-right: 8px;
    }

    .rank-side {
        grid-area: side;
        text-align: left;
        padding-right: 8px;
    }

    .rank-main strong {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .rank-side {
        margin-top: -2px;
    }

    .game-account .profile-meta h1,
    .game-account .profile-meta p {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .list-clean li {
        align-items: flex-start;
        padding: 6px;
    }

    .pager {
        justify-content: stretch;
        gap: 8px;
        margin-top: 10px;
    }

    .pager .btn {
        flex: 1;
        padding: 8px 10px;
        font-size: 14px;
    }

    .pager .muted {
        width: 100%;
        text-align: center;
    }

    .btn {
        padding: 8px 10px;
        font-size: 14px;
    }

    .progress-legend {
        gap: 10px;
        font-size: 12px;
    }

    .game-account .profile-actions.two-up {
        grid-template-columns: 1fr;
    }

    .game-account .profile-actions.two-up .btn {
        width: 100%;
        max-width: 100%;
    }

    .game-account .profile-actions.three-up {
        grid-template-columns: 1fr;
    }

    .game-account .profile-actions.three-up .btn,
    .game-account .profile-actions.three-up .rate-btn {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px 14px 22px;
    }

    .brand-logo {
        height: 24px;
        max-width: 52vw;
    }

    .topbar nav a {
        font-size: 12px;
        line-height: 1;
        padding: 1px 0;
    }

    .topbar nav {
        width: auto;
        gap: 4px;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .site-footer-inner {
        padding: 12px 14px 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .hero-home .btn {
        width: 100%;
    }

    .hero-home .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .hero-home p {
        max-width: 100%;
    }

    .hero-orb {
        right: -108px;
        bottom: -108px;
        width: 170px;
        height: 170px;
        opacity: 0.55;
    }

    .hero-home.has-community-banner {
        background-position: center top;
    }

    .avatar.big {
        width: 94px;
        height: 94px;
    }

    .profile-wrap {
        grid-template-columns: 58px 1fr;
        gap: 8px;
    }

    .profile-wrap .avatar.big {
        width: 62px;
        height: 62px;
    }

    .metrics-rich {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-account .profile-meta {
        min-height: 58px;
    }

    .profile-account {
        grid-template-areas:
            "avatar meta"
            "badges badges"
            "actions actions"
            "xp xp";
        grid-template-columns: 58px 1fr;
    }

    .hero-dashboard .profile-account {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "badges"
            "xp";
        gap: 8px;
    }

    .profile-account.has-custom-banner {
        background-image: none;
    }

    .hero-dashboard .profile-main-inline {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "avatar"
            "meta"
            "actions" !important;
        gap: 6px 8px !important;
        justify-items: center;
        padding: 10px;
        border: 1px solid rgba(70, 119, 148, 0.6);
        border-radius: 12px;
    }

    .profile-account.has-custom-banner .profile-main-inline {
        background-image: linear-gradient(140deg, rgba(8, 28, 39, 0.82), rgba(10, 33, 44, 0.84)), var(--profile-banner-image);
        background-size: cover;
        background-position: center;
    }

    .hero-dashboard .profile-main-inline .avatar.big {
        width: 70px;
        height: 70px;
    }

    .hero-dashboard .profile-main-inline .profile-meta {
        text-align: center;
        width: 100%;
    }

    .hero-dashboard .profile-main-inline .profile-meta h1 {
        font-size: 26px;
        line-height: 1.04;
    }

    .game-account .profile-meta {
        min-height: 0;
    }

    .chart-wrap {
        height: 175px;
        padding: 0 8px;
    }

    .doughnut-wrap {
        max-width: 230px;
    }

    .chart-card {
        padding: 8px 6px;
    }

    .chart-card .section-head {
        padding: 0 4px;
    }

    .section-head span {
        font-size: 12px;
        width: 100%;
        text-align: left;
    }

    .section-head {
        margin-bottom: 8px;
        gap: 4px;
        align-items: flex-start;
    }

    .section-actions {
        margin-bottom: 8px;
    }

    .controls-wrap,
    .wide-grid-controls,
    .wishlist-controls,
    .ranking-controls {
        gap: 8px;
    }

    .pager {
        gap: 6px;
    }

    .pager .btn {
        width: auto !important;
        flex: 1 1 calc(50% - 3px);
    }

    .pager .muted {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .search-input,
    .control-input {
        padding: 9px 10px;
    }

    .list-cover {
        width: 78px;
        height: 40px;
    }

    .rank-item {
        grid-template-columns: 22px 58px minmax(0, 1fr);
        gap: 6px;
        padding: 7px 8px;
    }

    .rank-pos {
        min-width: 22px;
        width: 22px;
    }

    .rank-item .avatar {
        width: 58px;
        height: 58px;
        margin-left: 0;
    }

    .game-cover {
        height: 118px;
    }

    .game-account .profile-actions.two-up {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .game-account .profile-actions.two-up .btn {
        width: 100%;
        max-width: 100%;
    }

    .game-account .profile-actions.three-up {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .game-account .profile-actions.three-up .btn,
    .game-account .profile-actions.three-up .rate-btn {
        width: 100%;
        max-width: 100%;
    }

    .progress-legend {
        justify-content: center;
        gap: 8px;
    }
}
