/* Avelia2 layout-only pass.
   No fonts, images, animations, copy or feature styling are replaced here. */

html,
body {
    width: 100%;
    max-width: none;
    overflow-x: clip;
}

body {
    min-width: 320px;
}

img,
video,
canvas {
    max-width: 100%;
}

.container {
    width: min(100% - 32px, 1320px);
}

/* Keep the original navigation, but make every state fit cleanly. */
#navbar .container {
    gap: 12px;
}

#navbar .navbar-collapse {
    min-width: 0;
}

#navbar .navbar-nav {
    align-items: center;
    min-width: 0;
}

#navbar .navbar-nav .nav-link {
    white-space: nowrap;
}

/* Preserve the original hero artwork and content while keeping it in view. */
.header {
    width: 100%;
    min-height: 650px;
    height: min(793px, calc(100dvh - 108px));
    background-size: cover;
}

.header .row {
    margin-inline: 0;
}

.header .col-md-6 {
    width: min(100%, 590px);
}

/* Server statistics retain their artwork and counters. */
.section-stats .row {
    align-items: stretch;
}

.section-stats .row > div {
    display: flex;
    min-height: 124px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Existing live windows and feature windows share a stable layout. */
.avelia-live,
.avelia-features-grid {
    align-items: stretch;
}

.avelia-live-box,
.avelia-feature {
    height: 100%;
}

/* Existing news cards remain scrollable without widening the page. */
.news-slider {
    min-width: 0;
}

.news-slider-container {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
}

.news-slider-panel {
    scroll-snap-align: start;
}

/* Preserve the original ranking artwork and animation. */
.section-ranking .tab-content,
.section-ranking .tab-pane,
.section-ranking .row,
.section-ranking [class*="col-"] {
    min-width: 0;
}

.section-ranking-character {
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
}

.section-ranking-panel {
    width: 100%;
    overflow: hidden;
}

.section-ranking-panel-table {
    width: 100%;
}

/* Keep the invitation window visible and scale it instead of removing it. */
@media screen and (max-width: 1750px) and (min-width: 992px) {
    #invite-panel {
        display: block;
        left: auto;
        right: 12px;
        top: auto;
        bottom: 16px;
        width: 250px;
        height: 338px;
        padding: 188px 14px 12px;
        background-size: 250px 338px;
        font-size: 13px;
        transform: none;
    }

    #invite-panel h4 {
        font-size: 18px;
    }

    #invite-panel-button {
        width: calc(100% - 16px);
        height: 76px;
        bottom: 8px;
        padding: 44px 12px 0;
        background-size: cover;
        font-size: 13px;
    }
}

@media screen and (min-width: 992px) and (max-width: 1320px) {
    #navbar {
        font-size: 13px;
    }

    #navbar .navbar-nav .nav-link {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    .nav-link-button {
        margin-left: 8px;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

@media screen and (min-width: 992px) and (max-width: 1199px) {
    #invite-panel {
        width: 200px;
        height: 270px;
        padding: 145px 10px 8px;
        background-size: 200px 270px;
        font-size: 11px;
    }

    #invite-panel h4 {
        font-size: 15px;
    }

    #invite-panel-button {
        width: calc(100% - 12px);
        height: 54px;
        bottom: 6px;
        padding: 30px 8px 0;
        font-size: 11px;
    }
}

@media screen and (max-width: 991px) {
    .container {
        width: min(100% - 28px, 720px);
    }

    #navbar .navbar-nav {
        align-items: stretch;
        padding: 12px 0 8px;
    }

    #navbar .navbar-nav .nav-link {
        padding: 10px 14px !important;
    }

    .nav-link-button {
        margin: 8px 14px 12px !important;
    }

    .header {
        height: min(760px, calc(100dvh - 100px));
        min-height: 660px;
        padding-top: clamp(260px, 42vh, 340px);
    }

    .header .col-md-6 {
        width: min(100%, 620px);
        margin-inline: auto;
    }

    .avelia-live {
        grid-template-columns: 1fr;
    }

    .avelia-live-box {
        min-height: 168px;
    }

    .section-register .row,
    .section-community .row {
        align-items: center;
    }

    .section-ranking {
        padding-bottom: 60px;
    }

    .section-ranking .tab-pane .col-md-8.d-md-block.d-none {
        display: block !important;
    }

    .section-ranking-character {
        height: 390px;
        margin-top: -40px;
    }

    #invite-panel {
        display: block;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 12px;
        width: auto;
        height: 142px;
        padding: 16px 16px 14px 126px;
        border-radius: 14px;
        background-size: cover;
        background-position: center 28%;
        font-size: 13px;
        text-align: left;
    }

    #invite-panel h4 {
        display: block;
        font-size: 18px;
    }

    #invite-panel-button {
        left: 126px;
        right: 16px;
        bottom: 10px;
        width: auto;
        height: 42px;
        padding: 11px 14px;
        background: #fff;
        border-radius: 10px;
        line-height: 20px;
        text-align: center;
    }
}

@media screen and (max-width: 767px) {
    .topbar {
        padding: 10px 0;
        text-align: center;
    }

    .topbar .row {
        row-gap: 4px;
    }

    .topbar .text-end {
        text-align: center !important;
    }

    .avelia-ticker-track {
        min-width: 0;
    }

    .header {
        background-position: center top;
    }

    .section-stats {
        padding: 8px 0 18px;
    }

    .section-stats .row > div {
        min-height: 136px;
    }

    .avelia-features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .news-slider-container {
        margin: -34px 0 0;
        padding: 0 14px 10px;
        scroll-padding-inline: 14px;
    }

    .news-slider-panel,
    .news-slider-panel:last-child {
        width: calc(100vw - 44px);
        min-width: calc(100vw - 44px);
        max-width: 420px;
        margin-left: 0;
        margin-right: 14px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .news-slider-panel:last-child {
        margin-right: 0;
    }

    .section-presentation h2,
    .section-register h2,
    .section-community h2 {
        white-space: normal;
    }

    .section-presentation-button,
    .section-register-button {
        width: min(100%, 300px);
        margin-inline: auto;
    }

    .section-ranking-character {
        height: 330px;
        margin-top: -20px;
    }

    .section-ranking-panel {
        margin-top: 22px;
    }

    .section-community .text-end {
        text-align: center !important;
    }

    .section-community-button {
        width: min(100%, 300px);
        margin-inline: auto !important;
    }

    .footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 22px;
        padding-inline: 18px;
    }
}

@media screen and (max-width: 575px) {
    .container {
        width: min(100% - 24px, 540px);
    }

    .header {
        height: 700px;
        min-height: 700px;
        padding-top: 280px;
    }

    .header h2 {
        font-size: 38px;
        line-height: 1.08;
    }

    .header p {
        font-size: 15px;
    }

    .header-button-download {
        max-width: calc(100vw - 40px);
        background-size: contain;
    }

    .avelia-features-grid {
        grid-template-columns: 1fr;
    }

    .avelia-feature {
        min-height: 178px;
    }

    .section-ranking-nav {
        justify-content: center;
    }

    .section-ranking-nav .nav-item {
        width: 50%;
        max-width: 150px;
    }

    .section-ranking-character-info {
        text-align: center;
    }

    .section-ranking-flag {
        float: none;
        display: inline-block;
        margin: 0 8px -7px 0;
    }

    .footer-logo {
        height: 130px;
        background-size: contain;
    }
}

@media screen and (max-width: 420px) {
    #invite-panel {
        height: 132px;
        padding: 14px 12px 12px 104px;
    }

    #invite-panel h4 {
        font-size: 16px;
    }

    #invite-panel-button {
        left: 104px;
        right: 12px;
        bottom: 8px;
    }
}

/* Account area: preserve the existing content and brand, improve structure and responsiveness. */
.account-page {
    padding-top: 64px;
}

.account-page .container {
    max-width: 1120px;
}

.account-page .page-subtitle {
    margin-bottom: 44px;
}

.account-page .panel {
    overflow: hidden;
    padding: 0 0 42px;
    border: 1px solid rgba(188, 73, 60, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(49, 31, 27, 0.18);
}

.account-page .panel > .text-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 24px 30px 18px;
    border-bottom: 1px solid rgba(188, 73, 60, 0.1);
}

.account-page .panel > .text-center .panel-button {
    width: auto;
    min-width: 150px;
    margin: 0;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #656361;
    box-shadow: 0 6px 16px rgba(32, 29, 27, 0.12);
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.account-page .panel > .text-center .panel-button:hover {
    transform: translateY(-2px);
    background: #514f4d;
    box-shadow: 0 9px 20px rgba(32, 29, 27, 0.18);
}

.account-page .panel > .text-center .panel-button:active {
    transform: translateY(0);
}

.account-page .panel > .text-center .panel-button-active,
.account-page .panel > .text-center .panel-button-active:hover {
    background: #bc493c;
    box-shadow: 0 8px 22px rgba(188, 73, 60, 0.24);
}

.account-page .panel-bar {
    margin: 0;
    padding: 18px 34px;
    border: 0;
    background: #2a2725 !important;
    color: #f4eee8 !important;
}

.account-page .panel-bar > .row > div,
.account-page .panel > .row > div {
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
}

.account-page .panel-bar .row {
    align-items: center;
}

.account-page .panel-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid rgba(243, 194, 127, 0.34);
    border-radius: 10px;
    background: rgba(224, 164, 92, 0.1);
    color: #f3c27f;
    line-height: 1;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.account-page .panel-bar a:hover {
    transform: translateY(-1px);
    border-color: rgba(243, 194, 127, 0.7);
    background: rgba(224, 164, 92, 0.18);
    color: #ffe0aa;
}

.account-page .panel > .row {
    margin: 0;
    padding: 34px 34px 0;
}

.account-page .panel-box {
    overflow: hidden;
    margin-bottom: 34px;
    padding: 10px 22px;
    border: 1px solid rgba(224, 164, 92, 0.2);
    border-radius: 14px;
    background: #2a2725 !important;
    box-shadow: 0 14px 34px rgba(28, 22, 19, 0.16);
}

.account-page .panel-settings-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
}

.account-page .panel-settings-table tr:not(:last-child) {
    border-bottom: 1px solid rgba(224, 164, 92, 0.12);
}

.account-page .panel-settings-table td {
    padding: 15px 10px;
    color: #d65a4c;
    vertical-align: middle;
}

.account-page .panel-settings-table td:first-child {
    width: 54%;
    color: #d7cec3;
}

.account-page .panel-settings-table td:nth-child(2) {
    overflow-wrap: anywhere;
    font-weight: 600;
}

.account-page .panel-settings-table td:last-child {
    width: 44px;
    padding: 7px 4px 7px 0;
}

.account-page .panel-settings-table td:last-child a,
.account-page .panel-settings-table td:last-child button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(214, 90, 76, 0.32) !important;
    border-radius: 9px !important;
    background: rgba(188, 73, 60, 0.1) !important;
    color: #d65a4c !important;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.account-page .panel-settings-table td:last-child a:hover,
.account-page .panel-settings-table td:last-child button:hover {
    transform: translateY(-1px);
    border-color: rgba(214, 90, 76, 0.72) !important;
    background: rgba(188, 73, 60, 0.2) !important;
}

.account-page .panel-box-title {
    margin: 6px 0 16px;
    color: #bc493c;
    font-size: 15px;
    letter-spacing: 0.035em;
}

.account-page .panel-box .row.text-center > div[style] {
    width: 100%;
    overflow-x: auto;
    background: transparent !important;
    scrollbar-color: #bc493c rgba(255, 255, 255, 0.08);
}

.account-page .panel-box .table {
    min-width: 650px;
    margin-bottom: 0;
    color: #ddd5c8;
    vertical-align: middle;
}

.account-page .panel-box .table thead th {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(224, 164, 92, 0.24);
    color: #f1e3c2;
    font-size: 13px;
    font-weight: 700;
}

.account-page .panel-box .table tbody th,
.account-page .panel-box .table tbody td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(224, 164, 92, 0.1);
    color: #ddd5c8;
}

.account-page .panel-box .table tbody tr:last-child th,
.account-page .panel-box .table tbody tr:last-child td {
    border-bottom: 0;
}

.account-page .panel-box .table tbody tr:hover > * {
    background: rgba(224, 164, 92, 0.07);
    color: #fff4e5;
}

.account-page .panel-box .table img {
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.account-page .panel-box .table .panel-button {
    margin: 0;
    border-radius: 9px;
    background: #656361;
    transition: transform 180ms ease, background-color 180ms ease;
}

.account-page .panel-box .table .panel-button:hover {
    transform: translateY(-1px);
    background: #bc493c;
}

@media screen and (max-width: 767px) {
    .account-page {
        padding-top: 46px;
        padding-bottom: 82px;
    }

    .account-page .page-title {
        font-size: clamp(30px, 9vw, 40px);
    }

    .account-page .page-subtitle {
        margin-bottom: 30px;
    }

    .account-page .panel {
        padding-bottom: 28px;
        border-radius: 15px;
    }

    .account-page .panel > .text-center {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 18px 16px;
    }

    .account-page .panel > .text-center .panel-button {
        min-width: 0;
        width: 100%;
        padding-inline: 10px;
        white-space: nowrap;
    }

    .account-page .panel-bar {
        padding: 16px 20px;
    }

    .account-page .panel > .row {
        padding: 24px 16px 0;
    }

    .account-page .panel-box {
        margin-bottom: 26px;
        padding: 8px 14px;
    }
}

@media screen and (max-width: 575px) {
    .account-page .panel-bar .col-5,
    .account-page .panel-bar .col-7 {
        width: 100%;
        text-align: center !important;
    }

    .account-page .panel-bar .col-7 {
        margin-top: 12px;
    }

    .account-page .panel-settings-table,
    .account-page .panel-settings-table tbody,
    .account-page .panel-settings-table tr,
    .account-page .panel-settings-table td {
        display: block;
        width: 100%;
    }

    .account-page .panel-settings-table tr {
        position: relative;
        padding: 13px 48px 13px 4px;
    }

    .account-page .panel-settings-table td,
    .account-page .panel-settings-table td:first-child,
    .account-page .panel-settings-table td:nth-child(2) {
        width: 100%;
        padding: 2px 0;
        text-align: left;
    }

    .account-page .panel-settings-table td:first-child {
        margin-bottom: 5px;
        font-size: 12px;
    }

    .account-page .panel-settings-table td:last-child {
        position: absolute;
        top: 50%;
        right: 2px;
        width: 38px;
        padding: 0;
        transform: translateY(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .account-page .panel-button,
    .account-page .panel-bar a,
    .account-page .panel-settings-table a,
    .account-page .panel-settings-table button {
        transition: none !important;
    }
}
