/* =====================================================================
   HLV Bóng Đá — mùa 4: giao diện "Đêm cúp" (owner, 2026-11-20)
   Loaded after app.css. Two parts:
     1. the season's look: midnight navy, emerald, gold — colours and surfaces only
     2. phones: every page shorter and lighter (one-line tab strip, compact row cards,
        folded long lists, no costly effects)
   Removing this file gives the previous green theme back.
   ===================================================================== */

/* ------------------------------------------------------------------ 1. the look */

:root {
    --bg: #070c1b;
    --panel: #0f1730;
    --panel-2: #162042;
    --panel-3: #1f2c58;
    --line: rgba(150, 172, 255, .13);
    --line-2: rgba(150, 172, 255, .24);
    --text: #eef2ff;
    --muted: #97a3cc;
    --accent: #34e3a1;
    --accent-2: #12b981;
    --accent-ink: #03241a;
    --gold: #ffcf5a;
    --gem: #8fe3ff;
    --warn: #f6b84a;
    --danger: #f2616c;
    --info: #5cc8ff;
    /* the season's second colour: glows and gradients */
    --brand: #5b7cff;
    --brand-2: #8f6bff;

    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 12px 34px rgba(2, 6, 23, .45);
}

body {
    background:
        radial-gradient(1100px 620px at 100% -10%, rgba(91, 124, 255, .22), transparent 60%),
        radial-gradient(900px 520px at -10% 110%, rgba(52, 227, 161, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

h1 { letter-spacing: -.015em; }
h2 { letter-spacing: .005em; }
a { color: #7fd8ff; }
.pos-text { color: var(--accent); }
::selection { background: color-mix(in srgb, var(--brand) 55%, transparent); color: #fff; }

/* shell */
.sidebar {
    background: linear-gradient(180deg, #121b40 0%, #0b1129 55%, #080d1f 100%);
    border-right-color: var(--line);
    scrollbar-color: var(--panel-3) transparent;
}
.brand-name { background: linear-gradient(90deg, #ffffff, #ffe9ad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { background: linear-gradient(135deg, var(--brand), var(--accent-2)); box-shadow: 0 4px 14px rgba(91, 124, 255, .4); }
.icon-btn { background: linear-gradient(180deg, rgba(150, 172, 255, .12), rgba(150, 172, 255, .04)), var(--panel-2); border-color: var(--line-2); }
.club-card { border-color: var(--line-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.chip, .coin { background: rgba(8, 13, 31, .55); border-color: var(--line-2); }
.nav a { border-radius: 12px; }
.nav a:hover { background: rgba(150, 172, 255, .09); }
.nav a.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 34%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
    color: #fff;
}
.nav a.active::before { background: linear-gradient(180deg, var(--accent), var(--brand)); width: 4px; }
.nav-section { color: #7f8cb8; letter-spacing: .1em; }
.user-box { border-top-color: var(--line); }

/* surfaces */
.card {
    background:
        linear-gradient(90deg, transparent, rgba(150, 172, 255, .42), transparent) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(140, 165, 255, .075), rgba(140, 165, 255, .015) 46%),
        var(--panel);
    border-color: var(--line);
}
.scoreboard { background: radial-gradient(600px 220px at 50% 0, rgba(91, 124, 255, .22), transparent 70%), var(--panel); }
/* a card's title carries the season's colours */
.card > h2:first-child, .card > .section-head:first-child h2 {
    padding-left: .6rem; border-left: 3px solid var(--accent); border-image: linear-gradient(180deg, var(--accent), var(--brand)) 1;
}
.alert { border-radius: 14px; border-left-width: 3px; }
.modal { border-color: var(--line-2); }
code { background: rgba(150, 172, 255, .14); }
.quick-help { border-color: var(--line-2); border-radius: 12px; }

/* controls */
.btn {
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(150, 172, 255, .13), rgba(150, 172, 255, .04)), var(--panel-2);
    border-color: var(--line-2);
}
.btn.primary {
    background: linear-gradient(135deg, #46f0b2, #12b981 55%, #0ea5a0);
    color: var(--accent-ink); border-color: transparent;
    box-shadow: 0 6px 18px rgba(18, 185, 129, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.danger { background: linear-gradient(180deg, #f87580, #e04a57); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { border-radius: 10px; }
.btn.lg { border-radius: 15px; }
select, input:not([type]), input[type=text], input[type=number], input[type=email], input[type=password], input[type=datetime-local], input[type=date], input[type=tel], textarea {
    background: #0b1230; border-color: var(--line-2); color: var(--text);
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52, 227, 161, .18); }
.pill { background: var(--panel-2); border-color: var(--line-2); }
.pill.active { background: linear-gradient(135deg, #46f0b2, #12b981); color: var(--accent-ink); border-color: transparent; }
.tab.active { color: #fff; }
.tag { border-radius: 7px; }

/* tables */
.table th { color: #8794c2; }
.table tbody tr:nth-child(even) { background: rgba(150, 172, 255, .035); }
.table tr.me { background: color-mix(in srgb, var(--accent) 13%, transparent); }
@media (hover: hover) { .table tbody tr:hover { background: rgba(150, 172, 255, .08); } }
.bar { background: rgba(150, 172, 255, .16); }

/* page tabs */
.hub-tabs { border-bottom-color: var(--line); }
.hub-tabs a { background: rgba(150, 172, 255, .08); color: var(--muted); border: 1px solid transparent; }
.hub-tabs a.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 42%, transparent), color-mix(in srgb, var(--accent) 22%, transparent));
    color: #fff; border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* announcements */
.ticker { border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 20%, var(--panel)), var(--panel) 70%); }

/* accounts and the landing page */
.auth-shell { background: radial-gradient(circle at 30% 15%, #24348f, var(--bg) 62%); }
.auth-card { border-color: var(--line-2); }
.landing { background: radial-gradient(ellipse at 70% 0%, #2b3aa6 0%, #0e1644 46%, #070c1b 100%); }
.landing-kicker { background: var(--accent); color: var(--accent-ink); }
/* (the gold call to action stays gold: it is the one thing a visitor must see) */
.landing .landing-cta { background: linear-gradient(180deg, #ffe680, #ffc928); color: #241a02; border-color: transparent; box-shadow: 0 10px 30px rgba(255, 201, 40, .35); }
.landing-sub { color: #dbe3ff; }
.landing-free { color: #e9eeff; }
.landing-proof { color: #cbd5fb; }
.reason { background: rgba(150, 172, 255, .08); border-color: rgba(150, 172, 255, .2); }
.reason p { color: #cbd5fb; }
.landing-news { background: rgba(8, 13, 31, .5); }
.landing-news-item { color: #e9eeff; }
.landing-pitch .goal-flash rect { fill: rgba(7, 12, 27, .88); }
.dot-live { background: var(--accent); }
.dot-live::after { background: rgba(52, 227, 161, .7); }
.lead-story { background: linear-gradient(135deg, rgba(255, 207, 90, .13), rgba(91, 124, 255, .09)); border-color: rgba(255, 207, 90, .35); }
.post.mine { border-color: rgba(52, 227, 161, .4); }

/* tablet rail and the phone bars keep to the new colours */
.topbar { background: rgba(10, 17, 48, .9); border-bottom-color: var(--line); }
.bottom-nav { background: rgba(10, 17, 48, .94); border-top-color: var(--line); }
.bottom-nav .active { color: var(--accent); }

/* ------------------------------------------------------------------ 2. phones: shorter, lighter pages */

@media (max-width: 767px) {
    :root { --topbar: 52px; --bottombar: 58px; --radius: 14px; }

    /* No fixed background, no blur behind the bars: both repaint on every scrolled frame on a phone. */
    body { background: linear-gradient(180deg, #0d1640, var(--bg) 360px) var(--bg); background-attachment: scroll; }
    .topbar { background: #0a1130; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .bottom-nav { background: #0a1130; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .backdrop, .modal-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }

    .content { padding: .7rem .7rem calc(var(--bottombar) + var(--safe-b) + 1.1rem); }
    h1 { font-size: 1.22rem; margin-bottom: .55rem; }
    h2 { font-size: 1rem; margin-bottom: .5rem; }
    h3 { font-size: .98rem; }
    .page-head { margin-bottom: .55rem; gap: .45rem; }
    .card { padding: .78rem .82rem; margin-bottom: .65rem; border-radius: 14px; box-shadow: none; }
    .grid-2 { gap: .65rem; }
    .grid-2 + .card, .grid-2 + .grid-2 { margin-top: .65rem; }
    .alert { padding: .5rem .7rem; margin: .5rem 0; font-size: .9rem; }
    .pills { margin-bottom: .6rem; }
    .section-head { margin-bottom: .45rem; }

    /* The top of every page: the content starts within the first screen. */
    .ticker { margin: 0 0 .55rem; padding: .28rem .7rem; font-size: .84rem; border-radius: 11px; }
    .quick-help { margin: 0 0 .5rem; padding: .2rem .65rem; font-size: .84rem; border-style: solid; border-color: var(--line); }
    .quick-help summary { font-weight: 600; opacity: .75; }
    /* A page's introduction: two lines, a tap shows the rest. */
    main.content > p.muted, main.content > p.small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin: 0 0 .55rem; font-size: .84rem; cursor: pointer; }
    main.content > p.muted[data-open], main.content > p.small[data-open] { display: block; -webkit-line-clamp: unset; line-clamp: unset; }

    /* The bottom bar: lower, with a marker on the open section. */
    .bottom-nav a, .bottom-nav button { position: relative; font-size: .66rem; }
    .bottom-nav .ico { font-size: 1.22rem; }
    .bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--accent), var(--brand)); }
    .bottom-nav .active .ico { transform: translateY(-1px) scale(1.06); }
}

@media (max-width: 699px) {
    /* Page tabs: one line that scrolls sideways instead of a grid of big buttons (which took up to half a screen). */
    .hub-tabs {
        display: flex; grid-template-columns: none; gap: .35rem; overflow-x: auto; overflow-y: hidden;
        margin: 0 -.7rem .55rem; padding: 0 .7rem .4rem; border-bottom: 1px solid var(--line);
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .hub-tabs::-webkit-scrollbar { display: none; }
    .hub-tabs a {
        flex: none; flex-direction: row; justify-content: center; gap: .3rem; min-height: 36px; padding: .32rem .72rem;
        border-radius: 999px; font-size: .84rem; white-space: nowrap; text-align: left; line-height: 1.2;
    }
    .hub-tabs a > span:first-child { font-size: 1rem; }
    .hub-tabs .nav-badge { position: static; transform: none; margin: 0 0 0 .2rem; }

    /* Wide tables as row cards: the row's name on top, the other cells in two columns. */
    table.table.stacked tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .9rem;
        margin: 0 0 .45rem; padding: .42rem .65rem; border-radius: 12px; border-color: var(--line);
        background: rgba(150, 172, 255, .06);
    }
    table.table.stacked tbody tr:nth-child(even) { background: rgba(150, 172, 255, .06); }
    table.table.stacked td {
        display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .1rem .5rem;
        padding: .15rem 0; text-align: right; font-size: .84rem; min-width: 0; white-space: normal;
    }
    table.table.stacked td + td { border-top: 0; }
    table.table.stacked td::after { content: none; }
    table.table.stacked td::before { float: none; flex: none; max-width: 60%; margin: 0; padding: 0; font-size: .7rem; letter-spacing: .01em; }
    table.table.stacked td:first-child { font-weight: inherit; }
    table.table.stacked td[data-cell="title"] {
        grid-column: 1 / -1; order: -1; justify-content: flex-start; text-align: left;
        font-weight: 700; font-size: .93rem; padding: .05rem 0 .2rem;
    }
    table.table.stacked td[data-cell="title"]::before { content: none; }
    table.table.stacked td[data-cell="wide"] { grid-column: 1 / -1; }
    table.table.stacked td[data-cell="wide"][data-label=""] { justify-content: flex-end; }
    table.table.stacked td[data-cell="empty"] { display: none; }
    table.table.stacked td .btn { margin: .1rem 0 .1rem .3rem; min-height: 34px; }
    table.table.stacked tr.me { border-color: var(--accent); }
    /* A long list shows its first ten rows; the bar under them opens the rest. */
    table.table.stacked[data-fold] tbody tr:nth-child(n+11) { display: none; }
    table.table.stacked[data-fold]::after {
        content: attr(data-fold); display: block; margin: .1rem 0 .3rem; padding: .62rem; text-align: center;
        border: 1px dashed var(--line-2); border-radius: 12px; color: var(--accent); font-weight: 700; font-size: .9rem; cursor: pointer;
    }

    /* Lists of matches and of news keep to one compact line each. */
    .fixtures li { padding: .42rem .15rem; }
    .news li { padding: .5rem 0; }
}

/* "show more" under a long list (the server sends a page of rows at a time) */
.more-rows { width: 100%; margin: .4rem 0 .7rem; color: var(--accent); border-style: dashed; }

@media (max-width: 767px) {
    /* A card taller than a screen shows its top; the bar at its foot opens the rest (see ui.js). */
    section.card[data-fold], .stories[data-fold], .social-feed[data-fold] { max-height: 440px; overflow: hidden; position: relative; }
    .stories[data-fold] { columns: auto; }
    section.card[data-fold]::after, .stories[data-fold]::after, .social-feed[data-fold]::after {
        content: attr(data-fold); position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 0 .65rem; text-align: center;
        font-weight: 700; font-size: .9rem; color: var(--accent); cursor: pointer;
        background: linear-gradient(180deg, transparent, var(--panel) 58%);
    }
    .stories[data-fold]::after, .social-feed[data-fold]::after { background: linear-gradient(180deg, transparent, var(--bg) 58%); }

    /* Badges in long lists are plain pictures here: a drop shadow on each costs more than it shows at this size. */
    img.crest, img.kit-shirt { filter: none; }

    /* A drop-down never makes the page wider than the screen (its longest option used to). */
    main select { max-width: min(100%, calc(100vw - 2.2rem)); }
    main td select { max-width: 56vw; }
    .actions > label, .page-head label { min-width: 0; max-width: 100%; white-space: normal; }
    .actions > label > select, .page-head label > select { display: block; max-width: 100%; margin: .25rem 0 0; }

    /* Short fields sit two to a row instead of one under the other. */
    @supports selector(:has(*)) {
        .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .6rem; align-items: end; }
        .form-row > *:not(label) { grid-column: 1 / -1; }
        .form-row > label:has(input[type=text], input:not([type]), input[type=email], input[type=password], textarea, input[type=checkbox]) { grid-column: 1 / -1; }
        .form-row > label:only-child { grid-column: 1 / -1; }
    }

    /* The line-up's three choices (shape, style, instruction) share one row. */
    .tactic-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; padding: .55rem .6rem; }
    .tactic-bar label { flex-direction: column; align-items: stretch; gap: .15rem; font-size: .76rem; min-width: 0; }
    .tactic-bar select { width: 100%; margin: 0; padding: .3rem .35rem; min-height: 40px; }   /* (16px text: iOS zooms into smaller fields) */
    /* Grids of short fields: two to a row (text fields keep the full width). */
    main .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .6rem; }
    @supports selector(:has(*)) {
        main .form-grid > label:has(input[type=text], input:not([type]), input[type=email], input[type=password], input[type=color], textarea), main .form-grid > :not(label) { grid-column: 1 / -1; }
    }
    @supports not selector(:has(*)) { main .form-grid { grid-template-columns: 1fr; } }

    /* Shop shelves and pickers: two items to a row. */
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .shop-item { padding: .65rem; border-radius: 12px; }
    .shop-icon { font-size: 1.5rem; }
    .shop-item h3 { font-size: .92rem; margin: .15rem 0; }
    .shop-item p, .shop-item ul { font-size: .8rem; }
    .shop-foot { flex-wrap: wrap; }
    .shop-foot .btn { min-height: 36px; padding: .3rem .6rem; font-size: .85rem; }
    .bundle-shelf .shop-grid { grid-template-columns: 1fr; }
}

/* The live connection is being restored (see App.razor and ui.js): a small notice, not a screen that blocks the page. */
#components-reconnect-modal {
    display: none; position: fixed; left: 50%; bottom: calc(var(--bottombar) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 2000;
    align-items: center; gap: .55rem; padding: .55rem 1rem; border-radius: 999px; white-space: nowrap;
    background: #0a1130; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; color: var(--text);
}
#components-reconnect-modal.components-reconnect-show, #components-reconnect-modal.components-reconnect-failed, #components-reconnect-modal.components-reconnect-rejected { display: flex; }
#components-reconnect-modal .rc-lost { display: none; }
#components-reconnect-modal.components-reconnect-failed .rc-trying, #components-reconnect-modal.components-reconnect-rejected .rc-trying { display: none; }
#components-reconnect-modal.components-reconnect-failed .rc-lost, #components-reconnect-modal.components-reconnect-rejected .rc-lost { display: inline; }
