﻿:root {
    --bg: #e9f1ec;
    --bg-soft: #f5faf7;
    --card: #ffffff;
    --line: #d8e6dd;
    --line-strong: #bfd4c8;
    --text: #10231d;
    --text-2: #25483d;
    --muted: #62756c;
    --muted-2: #9aa9a1;
    --brand: #007a53;
    --brand-dark: #005c46;
    --brand-soft: #e1f5ec;
    --brand-soft-2: #bdeed9;
    --cup-navy: #10213f;
    --cup-blue: #2251ff;
    --cup-red: #d91f2a;
    --cup-gold: #dca944;
    --up: #2251ff;
    --draw: #dca944;
    --down: #d91f2a;
    --shadow-sm: 0 2px 8px rgba(16, 35, 29, .06);
    --shadow-md: 0 10px 28px rgba(16, 35, 29, .10);
    --radius: 4px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background: #e9f1ec;
    background-image: linear-gradient(180deg, rgba(16, 33, 63, .07) 0, rgba(16, 33, 63, 0) 230px), repeating-linear-gradient(90deg, rgba(0, 122, 83, .035) 0 72px, rgba(255, 255, 255, .34) 72px 144px);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-top: 62px;
    padding-bottom: env(safe-area-inset-bottom);
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.site-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    width: 100%;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(216, 230, 221, .92);
    box-shadow: 0 8px 24px rgba(16, 35, 29, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-app-header-inner {
    max-width: 730px;
    min-height: 62px;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-app-logo {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.site-app-logo-box {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(16, 33, 63, .12);
    background: linear-gradient(135deg, var(--brand), var(--cup-navy));
    box-shadow: 0 0 0 2px rgba(0, 122, 83, .10);
}

.site-app-logo-box img {
    width: 100%;
    height: 100%;
    display: block;
}

.site-app-logo-text {
    min-width: 0;
    display: block;
}

.site-app-logo-text strong,
.site-app-logo-text small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-app-logo-text strong {
    color: var(--cup-navy);
    font-size: 16px;
    line-height: 1.1;
    font-weight: 800;
}

.site-app-logo-text small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.site-app-action-link {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid #bdeed9;
    background: linear-gradient(180deg, #f2fff8 0%, #e1f5ec 100%);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.site-app-action-link:hover {
    background: #d8f6e9;
}

.app-shell {
    min-height: 100vh;
}

.wrap {
    max-width: 730px;
    margin: 0 auto;
    padding: 12px 12px 18px;
}

.hero {
    background: linear-gradient(135deg, #08382e 0%, #0f7b54 54%, var(--cup-navy) 100%);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 38px, rgba(255,255,255,.105) 38px 76px), linear-gradient(135deg, rgba(217,31,42,.22) 0 20%, transparent 20% 70%, rgba(34,81,255,.18) 70% 100%);
    pointer-events: none;
}

.hero::after {
    content: "WORLD CUP 2026 · ELO MATCH TOOL";
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 1;
    max-width: calc(100% - 28px);
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .30);
    background: rgba(16, 33, 63, .28);
    color: rgba(255, 255, 255, .94);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: .08em;
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding: 44px 16px 16px;
}

.topline {
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.brand-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.brand {
    min-width: 0;
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
}

.brand p {
    margin: 8px 0 0;
    color: rgba(255,255,255,.92);
    font-size: 13px;
    line-height: 1.55;
    max-width: 760px;
}

.jump-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.32);
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .18s ease, transform .18s ease;
}

.jump-btn:hover {
    background: rgba(255,255,255,.24);
    transform: translateY(-1px);
}

.jump-btn-secondary {
    background: rgba(255,255,255,.16);
}

.filter-row {
    margin-top: 0;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
}

.mini-meta {
    height: 44px;
    padding: 0 12px;
    border-radius: 4px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
}

.mini-k {
    font-size: 12px;
    font-weight: 600;
    opacity: .92;
}

.mini-v {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.hero-tip {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.26);
    color: rgba(255,255,255,.94);
    font-size: 12.5px;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

.panel {
    margin-top: 12px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 8px 20px rgba(16, 35, 29, .07);
    overflow: hidden;
}

.panel-head {
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #fff 0, #f0faf4 100%);
    border-bottom: 1px solid var(--line);
}

.panel-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--cup-navy);
}

.panel-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
}

.panel-body {
    padding: 14px;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 12px;
    color: var(--muted);
}

.select-input,
.analyze-btn {
    min-height: 42px;
    border-radius: 4px;
    font-size: 13px;
}

.select-input {
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.select-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,122,83,.13);
}

.field-switch,
.field-action {
    justify-content: flex-end;
}

.switch-row {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text-2);
}

.switch-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.analyze-btn {
    width: 100%;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: .2px;
    background: linear-gradient(135deg, var(--brand), var(--cup-navy));
    box-shadow: 0 10px 24px rgba(0,122,83,.22);
}

.analysis-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12.5px;
}

.analysis-result.is-empty .result-cards {
    display: none;
}

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

.result-card {
    min-height: 112px;
    padding: 14px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0, #f7fbf8 100%);
    box-shadow: 0 4px 14px rgba(16, 35, 29, .04);
}

.result-card.wide {
    grid-column: span 3;
    min-height: auto;
}

.result-k {
    font-size: 12px;
    color: var(--muted);
}

.result-v {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--cup-navy);
}

.result-desc {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.6;
}

.prob-home .result-v {
    color: var(--up);
}

.prob-draw .result-v {
    color: var(--draw);
}

.prob-away .result-v {
    color: var(--down);
}

.page-loading {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 241, 236, .78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.loading-card {
    min-width: 180px;
    padding: 18px 20px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 3px solid rgba(0,122,83,.16);
    border-top-color: var(--brand);
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 12.5px;
    color: var(--text-2);
}

body.loading-active {
    overflow: hidden;
}

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

.site-footer {
    margin-top: 22px;
    padding: 18px 12px calc(22px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.8;
}

.footer-links a {
    color: var(--text-2);
    text-decoration: none;
    padding: 2px 4px;
}

.footer-links a:hover {
    color: var(--brand-dark);
}

.footer-links .sep {
    opacity: .35;
}

.footer-meta {
    margin-top: 10px;
    line-height: 1.6;
}

.footer-meta .slogan {
    margin-top: 4px;
    font-size: 11px;
    opacity: .8;
}

#backToTop {
    position: fixed;
    right: 16px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    line-height: 46px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, var(--brand), var(--cup-navy));
    border: none;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0,122,83,.26);
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .2s ease;
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:hover {
    background: var(--brand-dark);
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }

    .site-app-header-inner {
        min-height: 56px;
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
        gap: 10px;
    }

    .site-app-logo-box {
        width: 34px;
        height: 34px;
    }

    .site-app-logo-text strong {
        font-size: 15px;
    }

    .site-app-logo-text small {
        max-width: 190px;
    }

    .site-app-action-link {
        min-height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }

    .wrap {
        padding: 10px 10px 16px;
    }

    .hero-inner {
        padding: 42px 14px 14px;
    }

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

    .brand h1 {
        font-size: 20px;
    }

    .brand p {
        font-size: 12.5px;
    }

    .jump-btn {
        align-self: flex-start;
    }

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

    .mini-meta,
    .hero-tip {
        min-height: 42px;
        height: auto;
    }

    .panel-head,
    .panel-body {
        padding: 12px;
    }

    .analysis-grid,
    .result-cards {
        grid-template-columns: 1fr;
    }

    .result-card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 560px) {
    .panel-sub {
        display: block;
    }
}

/* footer compact mobile override */
@media (max-width: 640px) {
    .site-footer {
        padding: 12px 8px calc(14px + env(safe-area-inset-bottom));
    }

    .law-note {
        margin-bottom: 6px !important;
        font-size: 11px;
        line-height: 1.25;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .footer-inner {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .footer-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        line-height: 1.4;
        padding-bottom: 1px;
    }

    .footer-links a,
    .footer-links .sep {
        flex: 0 0 auto;
    }

    .footer-links a {
        padding: 1px 2px;
        font-size: 11px;
    }

    .footer-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        width: 100%;
        margin-top: 0;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        line-height: 1.3;
        font-size: 11px;
    }

    .footer-meta > div {
        flex: 0 0 auto;
    }

    .footer-meta .slogan {
        margin-top: 0;
        font-size: 10px;
    }

    .law-note::-webkit-scrollbar,
    .footer-links::-webkit-scrollbar,
    .footer-meta::-webkit-scrollbar {
        display: none;
    }

    .login-footer {
        padding: 0 8px calc(env(safe-area-inset-bottom) + 14px);
    }

    .login-footer .footer-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        font-size: 11px;
        line-height: 1.4;
    }

    .login-footer .footer-links a,
    .login-footer .sep {
        flex: 0 0 auto;
    }

    .login-footer .footer-note {
        margin-top: 6px;
        font-size: 11px;
        line-height: 1.25;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .login-footer .footer-links::-webkit-scrollbar,
    .login-footer .footer-note::-webkit-scrollbar {
        display: none;
    }
}

/* background repeat guard */
body {
    background-repeat: no-repeat;
}


