@font-face {
    font-family: "ClassicDisplayCritical";
    src: url("../fonts/brand-display-critical.woff2?v=20261108-2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "ClassicDisplay";
    src: url("../fonts/brand-display.woff2?v=20261108-2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}

:root,
[data-theme="classic"] {
    --theme-primary: #3860ff;
    --theme-primary-light: #5b7cff;
    --theme-primary-gradient: linear-gradient(135deg, #3860ff 0%, #5b7cff 100%);
    --theme-primary-hover: #2f54e0;
    --theme-primary-rgb: 56, 96, 255;
    --theme-secondary: #ffd738;
    --theme-secondary-hover: #f0c820;
    --theme-background: #f4f6fc;
    --theme-surface: #fff;
    --theme-card: #eef2ff;
    --theme-text: #1f2430;
    --theme-text-secondary: #5c6578;
    --theme-border: #efefef;
    --theme-border-strong: #dbe3ff;
    --theme-danger: #ff4d4f;
    --layout-max: 1280px;
    --layout-pad: 16px;
    --layout-shadow: 0 2px 8px rgba(31, 36, 48, 0.06);
    --font-display: "ClassicDisplayCritical", "ClassicDisplay", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.font-load-timeout,
.font-load-timeout[data-theme="classic"] {
    --font-display: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--theme-text) !important;
    background-color: var(--theme-background) !important;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(var(--theme-primary-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--theme-primary-rgb), 0.05) 1px, transparent 1px);
    background-position: top center;
    background-size: 12px 12px;
    mask-image: linear-gradient(#000, transparent 92%);
}

button,
input,
textarea,
select {
    font: inherit;
    letter-spacing: 0;
}

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

[v-cloak],
[data-page-loading] #app {
    visibility: hidden;
}

#app {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
}

.home-container,
.ranking-page-container,
.latest-page-container,
.board-page,
.classic-page {
    width: 100% !important;
    max-width: var(--layout-max) !important;
    margin: 0 auto !important;
    padding: 0 var(--layout-pad) 28px !important;
    box-sizing: border-box;
}

.classic-surface {
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface);
    box-shadow: var(--layout-shadow);
}

.classic-display,
.hero-title,
.hero-subtitle,
.hero-stat-value,
.hero-trend-title,
.section-heading,
.ranking-card-name,
.board-panel-title,
.ranking-page-title {
    font-family: var(--font-display);
    font-weight: 400;
}

/* Shared navigation */
#app > .top-nav {
    position: sticky !important;
    z-index: 1000 !important;
    top: 0;
    width: 100%;
    margin: 0 0 12px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.08) !important;
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(12px) saturate(1.35);
    box-shadow: none !important;
}

#app > .top-nav .top-nav-box {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 24px;
    width: 100%;
    max-width: var(--layout-max) !important;
    min-height: 52px;
    margin: 0 auto;
    padding: 10px var(--layout-pad) !important;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#app > .top-nav .top-nav-logo {
    display: inline-flex;
    grid-column: 1;
    justify-self: start;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #25457f;
    text-decoration: none;
}

#app > .top-nav .top-nav-logo .logo-img {
    display: block !important;
    width: auto !important;
    max-width: 200px !important;
    height: 36px !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
    flex: 0 0 auto !important;
}

#app > .top-nav .logo-text {
    display: flex;
    min-width: 0;
}

#app > .top-nav .top-nav-logo .logo-name {
    color: #25457f !important;
    font-family: "Noto Sans SC", sans-serif;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

#app > .top-nav .top-nav-menu {
    display: flex;
    grid-column: 2;
    justify-self: end;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-left: 0 !important;
}

#app > .top-nav .nav-menu-item,
#app > .top-nav .top-nav-menu > a {
    min-width: 0;
    padding: 7px 11px !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: var(--theme-text-secondary) !important;
    background: transparent !important;
    font-size: 13px !important;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

#app > .top-nav .nav-menu-item:hover,
#app > .top-nav .nav-menu-item.active,
#app > .top-nav .top-nav-menu > a:hover,
#app > .top-nav .top-nav-menu > a.active {
    color: var(--theme-primary) !important;
    background: rgba(var(--theme-primary-rgb), 0.09) !important;
}

#app > .top-nav .top-nav-actions {
    display: none !important;
}

#app > .top-nav .nav-menu-icon {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

#app > .top-nav .nav-menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--theme-text);
}

#app > .top-nav .nav-menu-mobile {
    position: relative;
}

#app > .top-nav .nav-menu-dropdown {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 10px);
    right: 0;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(31, 36, 48, 0.16);
}

#app > .top-nav .nav-drawer-item,
#app > .top-nav .nav-menu-dropdown > a {
    display: block;
    padding: 11px 13px !important;
    border-radius: 9px !important;
    color: var(--theme-text-secondary) !important;
    background: transparent !important;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

#app > .top-nav .nav-drawer-item:hover,
#app > .top-nav .nav-drawer-item.active {
    color: var(--theme-primary) !important;
    background: rgba(var(--theme-primary-rgb), 0.08) !important;
}

/* Shared footer */
.footerBox {
    width: 100% !important;
    margin-top: auto !important;
    padding: 0 !important;
    border-top: 1px solid var(--theme-border);
    background: rgba(255, 255, 255, 0.86) !important;
}

.footerBox .box {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 28px;
    width: 100% !important;
    max-width: var(--layout-max) !important;
    min-height: 0;
    margin: 0 auto !important;
    padding: 16px var(--layout-pad) !important;
    box-sizing: border-box;
    height: auto !important;
    overflow: visible !important;
    text-align: left;
}

.footer-brand-block {
    display: flex;
    flex: 1 1 20rem;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.footer-brand {
    display: flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    color: #25457f;
    text-decoration: none;
}

.footer-brand img {
    display: block;
    width: auto;
    max-width: min(200px, 100%);
    height: 36px;
    object-fit: contain;
    object-position: left center;
    flex: 0 0 auto;
}

.footer-brand strong {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.25;
    white-space: nowrap;
}

.footerBox .footer-description {
    display: -webkit-box;
    max-width: 440px;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    color: var(--theme-text-secondary) !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    opacity: 1 !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.footer-links {
    display: inline-flex;
    flex: 0 1 18rem;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    flex-wrap: wrap;
}

.footer-links a,
.footer-links button {
    padding: 0;
    border: 0;
    color: var(--theme-text-secondary);
    background: transparent;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.footer-links a:hover,
.footer-links button:hover {
    color: var(--theme-primary);
}

.footer-links .footer-link-accent {
    color: #a85a3a;
    font-weight: 600;
}

.footer-links .footer-link-accent:hover {
    color: #8a472e;
}

.footer-note {
    max-width: 360px;
    flex: 1 1 20rem;
    margin-left: auto;
    color: var(--theme-text-secondary);
    text-align: right;
}

.footerBox .footer-note p {
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

.footerBox .footer-note p + p {
    margin-top: 4px !important;
}

.float-home {
    position: fixed;
    z-index: 90;
    right: 20px;
    bottom: 20px;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    color: var(--theme-text);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(31, 36, 48, 0.12);
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.float-home:hover {
    border-color: rgba(var(--theme-primary-rgb), 0.35);
    color: var(--theme-primary);
    transform: translateY(-2px);
}

/* Common panels, filters and board pages */
.filter-section,
.ranking-content,
.latest-content,
.board-panel,
.classic-panel {
    border: 1px solid var(--theme-border) !important;
    border-radius: 14px !important;
    background: var(--theme-surface) !important;
    box-shadow: var(--layout-shadow) !important;
}

.filter-option,
.ranking-content-tab,
.game-tab {
    border-radius: 7px !important;
}

.filter-option.active,
.ranking-content-tab.active,
.game-tab.active {
    color: #fff !important;
    background: var(--theme-primary-gradient) !important;
}

.ranking-card,
.game-type-card {
    border-color: var(--theme-border) !important;
    box-shadow: none !important;
}

.ranking-card:hover,
.game-type-card:hover {
    border-color: rgba(var(--theme-primary-rgb), 0.35) !important;
    box-shadow: 0 6px 20px rgba(31, 36, 48, 0.1) !important;
}

.el-dialog {
    border: 1px solid var(--theme-border) !important;
    border-radius: 16px !important;
    background: var(--theme-surface) !important;
    box-shadow: 0 16px 48px rgba(31, 36, 48, 0.18) !important;
}

.el-overlay {
    background: rgba(31, 36, 48, 0.34) !important;
    backdrop-filter: none !important;
}

/* Footer feedback and copyright forms */
.feedback-overlay {
    position: fixed;
    z-index: 2200;
    inset: 0;
    display: grid;
    padding: 20px;
    place-items: center;
    overflow: hidden;
    background: rgba(31, 36, 48, 0.42);
    box-sizing: border-box;
    overscroll-behavior: contain;
}

.footer-feedback-dialog {
    width: min(480px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid var(--theme-border);
    border-radius: 14px !important;
    outline: none;
    background: var(--theme-surface);
    box-shadow: 0 16px 44px rgba(31, 36, 48, 0.22);
    box-sizing: border-box;
    overscroll-behavior: contain;
    will-change: transform;
}

.footer-feedback-dialog .el-dialog__header {
    display: none;
}

.footer-feedback-dialog .el-dialog__body {
    padding: 0 !important;
}

.footer-dialog-head {
    position: relative;
    display: flex;
    min-height: 56px;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px dashed var(--theme-border);
}

.footer-dialog-head h2 {
    margin: 0;
    color: var(--theme-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.footer-dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--theme-text-secondary);
    background: transparent;
    cursor: pointer;
}

.footer-dialog-close:hover {
    color: var(--theme-text);
    background: var(--theme-background);
}

.footer-dialog-form {
    display: grid;
    gap: 16px;
    max-height: calc(100vh - 98px);
    padding: 20px 24px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.footer-feedback-hint {
    padding: 11px 13px;
    border-radius: 8px;
    color: var(--theme-text-secondary);
    background: #f0f3ff;
    font-size: 12px;
    line-height: 1.7;
}

.footer-dialog-form label,
.footer-dialog-form label > span {
    display: block;
}

.footer-dialog-form label > span {
    margin-bottom: 7px;
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 600;
}

.footer-dialog-form em {
    color: #f04444;
    font-style: normal;
}

.footer-dialog-form small {
    color: var(--theme-text-secondary);
    font-size: 11px;
    font-weight: 400;
}

.footer-dialog-form input,
.footer-dialog-form textarea,
.footer-dialog-form select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #dfe3ec;
    border-radius: 8px;
    outline: 0;
    color: var(--theme-text);
    background: #fff;
    font: inherit;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.footer-dialog-form textarea {
    min-height: 124px;
    resize: vertical;
    line-height: 1.65;
}

.footer-dialog-form input:focus,
.footer-dialog-form textarea:focus,
.footer-dialog-form select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.1);
}

.footer-dialog-select {
    position: relative;
}

.footer-dialog-select select {
    padding-right: 38px;
    appearance: none;
}

.footer-dialog-select svg {
    position: absolute;
    top: 50%;
    right: 13px;
    color: var(--theme-text-secondary);
    pointer-events: none;
    transform: translateY(-50%);
}

.footer-dialog-error {
    margin: -5px 0 0;
    color: #e5484d;
    font-size: 12px;
    line-height: 1.5;
}

.footer-dialog-submit {
    width: 100%;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    color: #fff;
    background: var(--theme-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.footer-dialog-submit:hover {
    opacity: 0.9;
}

.footer-dialog-success {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 34px 24px 26px;
    text-align: center;
}

.footer-dialog-success-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #37b26c;
}

.footer-dialog-success p {
    margin: 0;
    color: var(--theme-text);
    font-size: 14px;
}

.footer-dialog-success button {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--theme-primary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.footer-dialog-form input::placeholder,
.footer-dialog-form textarea::placeholder {
    color: var(--theme-text-secondary);
    opacity: 0.65;
}

.footer-dialog-submit:disabled,
.footer-dialog-close:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.feedback-fade-enter-active,
.feedback-fade-leave-active {
    transition: opacity 0.14s ease;
}

.feedback-fade-enter-active .footer-feedback-dialog,
.feedback-fade-leave-active .footer-feedback-dialog {
    transition: transform 0.14s ease;
}

.feedback-fade-enter-from,
.feedback-fade-leave-to {
    opacity: 0;
}

.feedback-fade-enter-from .footer-feedback-dialog,
.feedback-fade-leave-to .footer-feedback-dialog {
    transform: translateY(6px);
}

@media (prefers-reduced-motion: reduce) {
    .feedback-fade-enter-active,
    .feedback-fade-leave-active,
    .feedback-fade-enter-active .footer-feedback-dialog,
    .feedback-fade-leave-active .footer-feedback-dialog {
        transition: none;
    }
}

@media (max-width: 900px) {
    .footerBox .box {
        flex-wrap: wrap;
        gap: 14px 24px;
    }

    .footer-brand-block {
        flex-basis: 55%;
    }

    .footer-links {
        flex: 0 1 auto;
        justify-content: flex-end;
    }

    .footerBox .footer-description {
        max-width: 520px;
    }

    .footer-note {
        width: 100%;
        flex-basis: 100%;
        max-width: none;
        margin-left: 0;
        text-align: left;
    }
}

@media (max-width: 760px) {
    :root {
        --layout-pad: 16px;
    }

    #app > .top-nav {
        margin-bottom: 14px !important;
        padding: 8px 0 !important;
    }

    #app > .top-nav .top-nav-menu {
        display: none !important;
    }

    #app > .top-nav .top-nav-actions,
    #app > .top-nav .nav-menu-mobile {
        display: block !important;
    }

    #app > .top-nav .top-nav-box {
        display: flex !important;
        justify-content: space-between !important;
    }

    #app > .top-nav .top-nav-actions {
        position: relative !important;
        right: auto !important;
        flex: 0 0 auto !important;
    }

    #app > .top-nav .logo-name {
        font-size: 22px;
    }

    #app > .top-nav .top-nav-logo .logo-img {
        max-width: min(200px, calc(100vw - 112px)) !important;
        height: 36px !important;
    }

    .home-container,
    .ranking-page-container,
    .latest-page-container,
    .board-page,
    .classic-page {
        padding-bottom: 20px !important;
    }

    .footerBox .box {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px var(--layout-pad) !important;
    }

    .footer-brand {
        min-height: 32px;
    }

    .footer-brand img {
        max-width: min(200px, 78vw);
        height: 36px;
    }

    .footer-brand strong {
        font-size: 21px;
    }

    .footerBox .footer-description {
        margin-top: 6px !important;
        font-size: 12px !important;
        line-height: 1.55 !important;
    }

    .footer-links {
        justify-content: flex-start;
        gap: 10px 16px;
    }

    .float-home {
        right: 12px;
        bottom: 12px;
        width: 40px;
        height: 40px;
    }

    .footer-feedback-dialog {
        width: 100% !important;
    }

    .footer-dialog-head,
    .footer-dialog-form {
        padding-right: 18px;
        padding-left: 18px;
    }

    .footer-dialog-actions {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
