/* the hidden attribute must win over display: flex / grid of cards (catalog search hides items with it) */
[hidden] { display: none !important; }

:root {
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #1c2433;
    --muted: #5d6b82;
    --line: #e1e6ef;
    --head: #14213d;
    --accent: #2f6fed;
    --accent-soft: #e6eefe;
    --green: #1f9d55;
    --amd: #d6332b;
    --intel: #0b6fc4;
    --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: .4rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 .9rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

/* header */
.header { background: var(--head); color: #fff; position: sticky; top: 0; z-index: 20; }
.header__inner { max-width: 1120px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.header__logo { color: #fff; font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: .4rem; }
.header__logo:hover { text-decoration: none; }
.header__logo-mark { display: block; border-radius: 7px; }
.header__nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.header__nav a { color: #cfd8ea; font-size: .95rem; }
.header__nav a:hover { color: #fff; }

.lang { position: relative; }
.lang summary { cursor: pointer; list-style: none; color: #fff; border: 1px solid #3b4a6b; border-radius: 8px; padding: .25rem .6rem; font-size: .85rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang__list { position: absolute; right: 0; top: 2.2rem; background: var(--card); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); list-style: none; margin: 0; padding: .4rem 0; min-width: 160px; }
.lang__list a { display: block; padding: .35rem 1rem; color: var(--text); }
.lang__list a[aria-current] { font-weight: 700; color: var(--accent); }

/* layout */
.main { max-width: 1120px; margin: 0 auto; padding: 1rem 16px 2rem; }
.card { background: var(--card); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 0 0 1rem; box-shadow: 0 1px 2px rgba(20,33,61,.06); }
.card--flush { padding: 0; overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-2 > .card { margin: 0; }
.grid-2 + .card, .grid-2 + section { margin-top: 1rem; }
.lead { color: var(--muted); max-width: 46rem; }
.note { color: var(--muted); font-size: .85rem; }
.crumbs { font-size: .85rem; color: var(--muted); }
.more { display: inline-block; margin-top: .6rem; font-weight: 600; }

/* hero / pickers */
.hero { background: var(--card); border-radius: var(--radius); padding: 1.5rem 1.3rem; margin-bottom: 1rem; text-align: center; }
.hero .lead { margin: 0 auto 1.2rem; }
.vs-row { display: flex; align-items: center; gap: 1rem; justify-content: center; margin: .5rem 0 1rem; }
.vs-row--single { justify-content: flex-start; }
.vs-row__vs { font-weight: 800; color: var(--accent); }
.vs-row__label { color: var(--muted); }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: .7rem 2rem; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }

.picker { position: relative; width: 340px; max-width: 100%; text-align: left; }
.picker__btn { width: 100%; display: flex; align-items: center; gap: .5rem; background: var(--card); border: 2px solid var(--line); border-radius: 10px; padding: .65rem .8rem; font-size: 1rem; cursor: pointer; color: var(--text); text-align: left; }
.picker__btn:hover { border-color: var(--accent); }
.picker__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__arrow { color: var(--muted); }
.picker__panel { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: .5rem; }
.picker__input { width: 100%; font-size: 16px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
.picker__list { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.picker__list li { padding: .45rem .6rem; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: .5rem; }
.picker__list li:hover, .picker__list li[aria-selected="true"] { background: var(--accent-soft); }
.picker__list li small { color: var(--muted); }
.picker__list .picker__empty { cursor: default; color: var(--muted); }

.brand { font-size: .7rem; font-weight: 700; color: #fff; border-radius: 4px; padding: .1rem .35rem; }
.brand--amd { background: var(--amd); }
.brand--intel { background: var(--intel); }

/* bars */
.bars { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.bars li { margin-bottom: .7rem; }
.bar { position: relative; background: #edf0f6; border-radius: 6px; height: 22px; margin-top: .25rem; overflow: hidden; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; }
.bar--green span { background: var(--green); }
.bar b { position: absolute; right: .3rem; top: 3px; line-height: 16px; font-size: .85rem; background: rgba(255,255,255,.9); border-radius: 4px; padding: 0 .35rem; }
.bar--big { height: 34px; }
.bar--big b { top: 5px; line-height: 24px; font-size: 1rem; }
.bar--win span { background: var(--green); }
.bar em { font-style: normal; color: var(--green); margin-left: .3rem; }
.rating .bar { min-width: 140px; margin: 0; }

.score { margin-bottom: 1rem; }
.score__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.score__meta { color: var(--muted); font-size: .9rem; }
.verdict { font-size: 1.1rem; font-weight: 600; }

/* tables */
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs tbody th { font-weight: 500; color: var(--muted); width: 40%; }
.specs--two tbody th { width: 34%; }
.specs--two td { width: 33%; }
.specs thead th { font-size: .9rem; }
.specs__better { font-weight: 700; color: var(--green); }

.rating { width: 100%; border-collapse: collapse; font-size: .95rem; }
.rating th, .rating td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.rating th { cursor: pointer; user-select: none; font-size: .85rem; color: var(--muted); }
.rating th[aria-sort="ascending"]::after { content: " ▲"; }
.rating th[aria-sort="descending"]::after { content: " ▼"; }
.rating td:nth-child(4) { width: 30%; }

.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { background: var(--card); border-radius: 8px; padding: .4rem .9rem; color: var(--text); }
.tabs .tabs__on { background: var(--accent); color: #fff; }
.pager { display: flex; gap: .4rem; margin: 1rem 0; }
.pager a, .pager span { padding: .3rem .7rem; border-radius: 6px; background: var(--card); }
.pager span { background: var(--accent); color: #fff; }

/* chips / pairs */
.chip { display: inline-flex; flex-direction: column; background: var(--accent-soft); border-radius: 8px; padding: .35rem .7rem; color: var(--text); font-weight: 700; line-height: 1.2; }
.chip small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.chip:hover { text-decoration: none; background: #d6e3fd; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.pairs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; }
.pairs__link { display: flex; align-items: center; gap: .5rem; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; }
.pairs__link:hover { text-decoration: none; border-color: var(--accent); }
.pairs__vs { color: var(--muted); font-size: .85rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.mini { border: 1px solid var(--line); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.mini__score { color: var(--muted); font-size: .85rem; }
.mini__link { font-size: .85rem; font-weight: 600; }
.ticks { margin: 0; padding-left: 1.2rem; }
.ticks li { margin-bottom: .3rem; }

/* tasks */
.task-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.task-links span { color: var(--muted); font-weight: 600; }
.task-link { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; color: var(--text); font-weight: 600; }
.task-link:hover { border-color: var(--accent); text-decoration: none; }
.task-link--ai { border-color: #7c4dff; color: #5b2fd6; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.task-card { background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--text); border-top: 4px solid var(--accent); }
.task-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(20,33,61,.12); }
.task-card--ai { border-top-color: #7c4dff; }
.task-card--gaming { border-top-color: var(--amd); }
.task-card--office { border-top-color: var(--green); }
.task-card p { color: var(--muted); font-size: .92rem; }
.task-card ol { margin: 0; padding-left: 1.2rem; font-weight: 600; }

/* games */
.pc-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.pc-form__field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; color: var(--muted); }
.pc-form__field .picker { width: 300px; }
.pc-form select, .game-search { font-size: 16px; padding: .6rem .7rem; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.game-search { width: 100%; margin-bottom: 1rem; }
.games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.games__item { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.games__link { color: var(--text); display: flex; flex-direction: column; }
.games__link small { color: var(--muted); }
.status { align-self: flex-start; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; }
.status--rec { background: #dcf5e6; color: #146c3a; }
.status--min { background: #fff3cd; color: #7a5a00; }
.status--no { background: #fde2e1; color: #a32019; }
.status--unknown { background: #eceff4; color: var(--muted); }
.result { margin-top: 1rem; border-radius: 10px; padding: .8rem 1rem; background: #eceff4; }
.result--rec { background: #dcf5e6; }
.result--min { background: #fff3cd; }
.result--no { background: #fde2e1; }
.result__status { font-size: 1.2rem; font-weight: 800; margin: 0 0 .5rem; }
.result__lines { margin: 0 0 .5rem; padding-left: 1.2rem; }
.result__lines .is-ok::marker { content: "✓  "; color: var(--green); }
.result__lines .is-bad::marker { content: "✗  "; color: #c0392b; }
.req-parts { margin-top: 1rem; }
@media (max-width: 760px) { .pc-form__field, .pc-form__field .picker { width: 100%; } }

/* footer */
.footer { background: var(--head); color: #aab6cc; font-size: .85rem; }
.footer__inner { max-width: 1120px; margin: 0 auto; padding: 1.2rem 16px; }
.footer a { color: #dbe3f3; }

@media (max-width: 760px) {
    h1 { font-size: 1.45rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .vs-row { flex-direction: column; gap: .5rem; }
    .vs-row--single { align-items: stretch; }
    .picker { width: 100%; }
    .header__nav { order: 3; flex-basis: 100%; gap: .8rem; }
    .specs--two thead th { font-size: .8rem; }
    .specs--two th, .specs--two td { padding: .5rem .3rem; font-size: .9rem; }
    .card { padding: 1rem; }
}
.brand--nvidia { background: #76b900; }

/* Popular models marked on the comparison chart */
.bar__tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(20, 30, 50, .28); z-index: 1; }
.bar--big b { z-index: 2; }
.chart-refs { position: relative; margin: -.6rem 0 .8rem; }
.chart-refs--rows1 { height: 2.1rem; }
.chart-refs--rows2 { height: 3.5rem; }
.chart-refs--rows3 { height: 4.9rem; }
.chart-refs__line { position: absolute; top: 0; width: 1px; background: rgba(20, 30, 50, .28); }
.chart-refs__line--row0 { height: .7rem; }
.chart-refs__line--row1 { height: 2.1rem; }
.chart-refs__line--row2 { height: 3.5rem; }
.chart-refs__label { position: absolute; font-size: .8rem; line-height: 1.4rem; white-space: nowrap; padding: 0 .2rem; background: var(--card, #fff); }
.chart-refs__label--row0 { top: .7rem; }
.chart-refs__label--row1 { top: 2.1rem; }
.chart-refs__label--row2 { top: 3.5rem; }
.chart-refs__label--right { transform: translateX(-100%); }
@media (max-width: 640px) {
    .chart-refs, .bar__tick { display: none; }
}
.brand--qualcomm { background: #3253dc; }
.brand--mediatek { background: #e8a317; }
.brand--samsung { background: #1428a0; }
.brand--apple { background: #555; }
.brand--google { background: #4285f4; }
.brand--arm { background: #0091bd; }
.tabs--center { justify-content: center; }
.tabs button { background: var(--bg); border: 0; border-radius: 8px; padding: .4rem .9rem; color: var(--text); font: inherit; cursor: pointer; }
.tabs button.tabs__on { background: var(--accent); color: #fff; }
.hero .tabs a, .card .tabs a { background: var(--bg); }
.hero .tabs a.tabs__on, .card .tabs a.tabs__on { background: var(--accent); }

/* header menus: device type ▾ → compare / rankings */
.header__nav { align-items: center; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; color: #cfd8ea; font-size: .95rem; display: flex; align-items: center; gap: .3rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                       transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.menu[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.menu summary:hover, .menu[open] summary { color: #fff; }
.menu__list { position: absolute; left: 0; top: 2rem; background: var(--card); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
              list-style: none; margin: 0; padding: .4rem 0; min-width: 230px; z-index: 30; }
.menu__list a { display: block; padding: .45rem 1rem; color: var(--text); white-space: nowrap; }
.menu__list a:hover { background: var(--accent-soft); text-decoration: none; }
@media (max-width: 760px) {
    .menu { position: static; }
    .menu__list { left: 16px; right: 16px; top: auto; margin-top: .5rem; min-width: 0; }
    .menu__list a { white-space: normal; padding: .6rem 1rem; }
}
.brand--xiaomi { background: #ff6900; }
.brand--oneplus { background: #eb0029; }
.brand--nothing { background: #111; }
.brand--vivo { background: #415fff; }
.brand--asus { background: #00539b; }
.brand--lenovo { background: #e2231a; }
.brand--hp { background: #0096d6; }
.brand--dell { background: #007db8; }
.brand--acer { background: #83b81a; }
.brand--msi { background: #c8102e; }

/* estimated FPS (fps.py) */
.fps { margin-top: 1rem; }
.table-scroll { overflow-x: auto; }
.fps__table { border-collapse: collapse; width: 100%; min-width: 22rem; font-variant-numeric: tabular-nums; }
.fps__table th, .fps__table td { padding: .45rem .6rem; border-bottom: 1px solid #e3e7ee; text-align: center; white-space: nowrap; }
.fps__table th[scope="row"] { text-align: left; font-weight: 600; white-space: normal; }
.fps--good { background: #dcf5e6; color: #146c3a; }
.fps--ok { background: #fff3cd; color: #7a5a00; }
.fps--bad { background: #fde2e1; color: #a32019; }
.games__fps { font-size: .8rem; font-weight: 600; border-radius: 6px; padding: .15rem .45rem; white-space: nowrap; }

/* laptop model page */
.model-link { margin: -.3rem 0 1rem; font-weight: 600; }
.cfg-table th, .cfg-table td { white-space: nowrap; }

/* game check: developer minimum | recommended | your PC */
.req-cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 34rem; margin-top: .8rem; }
.req-cmp th, .req-cmp td { padding: .6rem .7rem; border-bottom: 1px solid #e3e7ee; text-align: left; vertical-align: top; }
.req-cmp thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.req-cmp th[scope="row"] { font-weight: 600; white-space: nowrap; }
.req-cmp td small { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.req-cmp td.is-ok { background: #effaf3; }
.req-cmp td.is-bad { background: #fdf0ef; }
.req-cmp__mark { font-weight: 700; margin-right: .25rem; }
td.is-ok .req-cmp__mark { color: #146c3a; }
td.is-bad .req-cmp__mark { color: #a32019; }
.req-cmp__mine { background: #eef3ff; font-weight: 600; }
thead .req-cmp__mine { color: #1d4ed8; }

/* best PC builds (/pc/builds/) */
.builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.build { border: 1px solid #e3e7ee; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #fff; }
.build--best { border-color: #f5a524; box-shadow: 0 0 0 2px rgba(245, 165, 36, .25); }
.build h3 { margin: 0; font-size: 1.1rem; }
.build__badge { margin: 0; font-size: .8rem; font-weight: 700; color: #a15c00; }
.build__price { margin: 0; font-size: 1.4rem; font-weight: 800; }
.build__price small { font-size: .75rem; font-weight: 500; color: var(--muted); }
.build__parts { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .92rem; }
.build__fps { min-width: 0; font-size: .85rem; }
.build__fps th, .build__fps td { padding: .35rem .4rem; }
.build__ai { margin: 0; }
.build .more { margin-top: auto; }
.build__label { margin: 0; font-size: .8rem; color: var(--muted); }
.fps__table.build__fps { min-width: 0; table-layout: fixed; }

/* picker: brand buttons above the search */
.picker__brands { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.picker__brand { border: 1px solid var(--line); background: #f3f6fb; border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; }
.picker__brand:hover { background: #e6edff; border-color: #b9c9f5; }

/* build comparison */
.build__cmp { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; user-select: none; }
.build__cmp input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent, #2563eb); cursor: pointer; }
.build__cmp:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.build--picked .build__cmp { border-color: var(--accent, #2563eb); background: #eef4ff; font-weight: 600; }
.build-pair select { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.build--cmp h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.cmp-metric { margin: .9rem 0; }
.cmp-metric__label { margin: 0 0 .25rem; font-weight: 600; }
.cmp-metric__row { display: grid; grid-template-columns: minmax(8rem, 19rem) 1fr; gap: .6rem; align-items: center; margin: .2rem 0; }
.cmp-metric__name { font-size: .85rem; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; }
.cmp-metric__row .bar { margin: 0; }
@media (max-width: 560px) { .cmp-metric__row { grid-template-columns: 1fr; gap: .1rem; } }

/* FPS in 10 popular games (popular_fps.py): build cards, laptop pages and comparisons */
.build__pop { margin-top: .4rem; }
.build__pop summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.build__pop .pop-fps { margin-top: .4rem; font-size: .9rem; }
.pop-fps th[scope=row] { text-align: left; font-weight: 500; }
.pop-fps__win { font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }
.build__pop .table-scroll { overflow-x: auto; }
.build__pop .pop-fps { width: 100%; min-width: 0; table-layout: fixed; }
.build__pop .pop-fps th, .build__pop .pop-fps td { padding: .3rem .25rem; font-size: .8rem; white-space: normal; }
.build__pop .pop-fps th[scope=row] { width: 34%; word-break: break-word; }
.pop__pick { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0 0 .6rem; }
.pop__group { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.pop__label { font-size: .85rem; color: var(--muted); margin-right: .15rem; }
.pop__chip { cursor: pointer; font: inherit; font-size: .85rem; }
.pop__chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.build__pop .pop__chip { font-size: .75rem; padding: .15rem .45rem; }
