/*
 * PC Tech Vault browser GPU test. Colours come from the theme's variables, so light and dark follow the
 * site scheme; the fallbacks are the dark values. The method notes are always-open cards (.pctv-gpu-test__info).
 */

.pctv-gpu-test {
    display: grid;
    gap: var(--nc-space-4, 1rem);
    margin: 0 0 var(--nc-space-5, 1.5rem);
    color: var(--nc-text, #e7edf7);
}

/* The theme gives every button display:inline-flex, which beats the browser's own [hidden] rule. */
.pctv-gpu-test [hidden] {
    display: none !important;
}

.pctv-gpu-test__lead {
    margin: 0;
    color: var(--nc-text-secondary, #bac7d8);
}

.pctv-gpu-test__panel {
    display: grid;
    gap: var(--nc-space-3, 0.75rem);
    padding: var(--nc-space-4, 1rem);
    border: 1px solid var(--nc-border, #2a3a51);
    border-radius: var(--nc-radius-md, 8px);
    background: var(--nc-surface-1, #0d1623);
}

.pctv-gpu-test__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--nc-space-3, 0.75rem) var(--nc-space-4, 1rem);
}

.pctv-gpu-test__buttons {
    display: flex;
    gap: var(--nc-space-2, 0.5rem);
}

.pctv-gpu-test__buttons button {
    min-height: 44px;
    min-width: 7.5rem;
}

/* Start: the site's filled accent button, a size larger, with a play icon. The light scheme's rule for
   white text on filled buttons doesn't reach this button, so both schemes set the text colour here:
   dark ink on the bright dark-scheme blue (as the site's buttons), white on the deeper light-scheme blue. */
.pctv-gpu-test .pctv-gpu-test__start {
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.4rem;
    border-color: var(--nc-accent, #2388ff) !important;
    background: var(--nc-accent, #2388ff) !important;
    color: #0b1207 !important;
    font-size: 1rem;
    box-shadow: 0 6px 18px -8px var(--nc-accent, #2388ff);
}

html[data-theme="light"] .pctv-gpu-test .pctv-gpu-test__start {
    color: #fff !important;
}

.pctv-gpu-test .pctv-gpu-test__start:hover:not(:disabled) {
    border-color: var(--nc-link-hover, #91caff) !important;
    background: var(--nc-link-hover, #91caff) !important;
}

.pctv-gpu-test .pctv-gpu-test__start svg {
    flex: 0 0 auto;
}

.pctv-gpu-test__start:disabled {
    opacity: 0.55;
    cursor: progress;
    box-shadow: none;
}

/* Secondary look for Stop. The theme's global button rule is far more specific than its own
   .nc-button--secondary, so the colours need !important here to show as a secondary button. */
.pctv-gpu-test .pctv-gpu-test__stop {
    border-color: var(--nc-border-strong, #395273) !important;
    background: var(--nc-surface-2, #121d2d) !important;
    color: var(--nc-text-strong, #f7faff) !important;
}

.pctv-gpu-test__gpu-choice {
    display: flex;
    align-items: center;
    gap: var(--nc-space-2, 0.5rem);
    min-width: 0;
    color: var(--nc-text-secondary, #bac7d8);
    font-size: 0.9rem;
}

.pctv-gpu-test__gpu-choice select {
    min-height: 44px;
    min-width: 0;
    max-width: 22rem;
}

@media (max-width: 480px) {
    .pctv-gpu-test__gpu-choice {
        flex: 1 1 100%;
    }

    .pctv-gpu-test__gpu-choice select {
        flex: 1 1 auto;
        max-width: none;
    }
}

.pctv-gpu-test__note {
    flex: 1 1 16rem;
    margin: 0;
    color: var(--nc-text-secondary, #bac7d8);
    font-size: 0.9rem;
}

.pctv-gpu-test__progress {
    display: grid;
    gap: var(--nc-space-2, 0.5rem);
}

.pctv-gpu-test__bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--nc-surface-inset, var(--nc-surface-2, #121d2d));
}

.pctv-gpu-test__bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--nc-accent, #2388ff);
    transition: width 0.25s linear;
}

.pctv-gpu-test__status {
    margin: 0;
    color: var(--nc-text-secondary, #bac7d8);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.pctv-gpu-test__result {
    display: grid;
    gap: var(--nc-space-3, 0.75rem);
}

.pctv-gpu-test__scores {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nc-space-3, 0.75rem) var(--nc-space-6, 2.5rem);
    align-items: flex-start;
}

.pctv-gpu-test__score {
    display: flex;
    flex-direction: column;
    margin: 0;
    line-height: 1;
}

.pctv-gpu-test__score-label {
    color: var(--nc-text-muted, #8799b0);
    font-size: 0.8rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pctv-gpu-test__score-value {
    margin-top: 0.3rem;
    color: var(--nc-text-strong, #f7faff);
    font-size: clamp(2.6rem, 9vw, 3.6rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.pctv-gpu-test__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nc-space-2, 0.5rem) var(--nc-space-4, 1rem);
    margin: 0;
}

.pctv-gpu-test__facts div {
    display: flex;
    gap: var(--nc-space-2, 0.5rem);
    align-items: baseline;
    min-width: 0;
}

.pctv-gpu-test__facts dt {
    flex: 0 0 8.5rem;
    color: var(--nc-text-muted, #8799b0);
    font-size: 0.85rem;
}

.pctv-gpu-test__facts dd {
    min-width: 0;
    margin: 0;
    color: var(--nc-text-strong, #f7faff);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.pctv-gpu-test__notes {
    padding-left: var(--nc-space-3, 0.75rem);
    border-left: 3px solid var(--nc-warning, #f2bd58);
    color: var(--nc-text-secondary, #bac7d8);
    font-size: 0.9rem;
}

.pctv-gpu-test__notes p {
    margin: 0 0 0.4rem;
}

.pctv-gpu-test__notes p:last-child {
    margin-bottom: 0;
}

.pctv-gpu-test__stage {
    position: relative;
}

/* Over the paused picture during the compute part, so the box keeps its size and nothing jumps.
   The text sits low so the overlay in the corner stays readable. */
.pctv-gpu-test__stage-note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: var(--nc-space-4, 1rem);
    border-radius: var(--nc-radius-sm, 6px);
    background: rgba(0, 0, 0, 0.62);
    color: #f7faff;
    font-weight: 700;
    text-align: center;
}

/* On-screen display in the corner of the preview, as in OSD tools. The preview is always a dark scene,
   so the overlay keeps its own dark backdrop and light text in both site schemes. */
.pctv-gpu-test__osd {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    display: grid;
    gap: 0.1rem;
    max-width: calc(100% - 1rem);
    padding: 0.4rem 0.55rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #f7faff;
    font: 600 0.78rem/1.3 var(--nc-font-mono, ui-monospace, monospace);
    font-variant-numeric: tabular-nums;
    white-space: pre;
}

.pctv-gpu-test__osd span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pctv-gpu-test__osd span:first-child {
    color: #8fc3ff;
}

@media (max-width: 480px) {
    .pctv-gpu-test__osd {
        top: 0.3rem;
        left: 0.3rem;
        padding: 0.25rem 0.4rem;
        font-size: 0.66rem;
    }

    .pctv-gpu-test__stage-note {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* While the test runs, the overlay and the note carry the information; the status line stays for screen
   readers only, and after a finished run, where the result says it. It shows for the messages at the
   end of an interrupted run (stopped, too slow). */
.pctv-gpu-test.is-running .pctv-gpu-test__status,
.pctv-gpu-test.is-done .pctv-gpu-test__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.pctv-gpu-test__stage canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--nc-radius-sm, 6px);
    background: #000;
}

.pctv-gpu-test__message p {
    margin: 0 0 0.5rem;
}

.pctv-gpu-test__browsers {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--nc-text-secondary, #bac7d8);
}

.pctv-gpu-test__browsers li + li {
    margin-top: 0.3rem;
}

.pctv-gpu-test__about {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nc-space-3, 0.75rem);
    margin-top: var(--nc-space-4, 1rem);
}

/* Test tiles: one per test, in run order. While the test runs, the current tile is outlined; afterwards
   each tile holds its result. Tests this browser can't run are dimmed. Four columns on wide screens:
   the first row holds the four WebGL tests, the second the three WebGPU tests. */
.pctv-gpu-test__tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--nc-space-2, 0.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pctv-gpu-test__tile {
    display: grid;
    align-content: start;
    gap: 0.2rem;
    min-width: 0;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--nc-border, #2a3a51);
    border-radius: var(--nc-radius-md, 8px);
    background: var(--nc-surface-2, #121d2d);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pctv-gpu-test__tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.pctv-gpu-test__icon {
    color: var(--nc-accent, #2388ff);
}

.pctv-gpu-test__tile-group {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nc-accent, #2388ff) 14%, transparent);
    color: var(--nc-link, #56a8ff);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pctv-gpu-test__tile--core .pctv-gpu-test__tile-group {
    background: rgba(72, 196, 140, 0.16);
    color: #48c48c;
}

html[data-theme="light"] .pctv-gpu-test__tile--core .pctv-gpu-test__tile-group {
    background: rgba(20, 160, 106, 0.12);
    color: #0f7f54;
}

.pctv-gpu-test__tile--extra .pctv-gpu-test__tile-group {
    background: var(--nc-surface-1, #0d1623);
    color: var(--nc-text-muted, #8799b0);
}

.pctv-gpu-test__tile-name {
    color: var(--nc-text-strong, #f7faff);
    font-weight: 800;
}

.pctv-gpu-test__tile-line {
    color: var(--nc-text-secondary, #bac7d8);
    font-size: 0.82rem;
    line-height: 1.35;
}

.pctv-gpu-test__tile-value {
    margin-top: 0.25rem;
    color: var(--nc-text-muted, #8799b0);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.pctv-gpu-test__tile.has-value .pctv-gpu-test__tile-value {
    color: var(--nc-text-secondary, #bac7d8);
}

.pctv-gpu-test__tile.has-value [data-value] {
    color: var(--nc-text-strong, #f7faff);
    font-size: 1.15rem;
    font-weight: 850;
}

.pctv-gpu-test__tile.is-current {
    border-color: var(--nc-accent, #2388ff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-accent, #2388ff) 22%, transparent);
}

.pctv-gpu-test__tile.is-current .pctv-gpu-test__icon {
    animation: pctv-gpu-test-pulse 1.2s ease-in-out infinite;
}

.pctv-gpu-test__tile.is-done .pctv-gpu-test__icon {
    color: #48c48c;
}

.pctv-gpu-test__tile.is-unavailable {
    opacity: 0.5;
}

@keyframes pctv-gpu-test-pulse {
    50% { opacity: 0.35; }
}

@media (max-width: 860px) {
    .pctv-gpu-test__tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {

    .pctv-gpu-test__tile {
        padding: 0.6rem 0.7rem;
    }
}

/* The notes are always open (owner, 2026-11-30): cards with a body-size title, two columns on wide screens.
   Inside the post content an h2 would pick up the article h2 (large type, top rule, padding), so it is reset. */
.pctv-gpu-test__info {
    padding: var(--nc-space-3, 0.75rem) var(--nc-space-4, 1rem);
    border: 1px solid var(--nc-border, #263142);
    border-left: 3px solid #48c48c;
    border-radius: var(--nc-radius-md, 10px);
    background: var(--nc-surface-1, #101722);
}

html[data-theme="light"] .pctv-gpu-test__info { border-left-color: #14a06a; }

.pctv-gpu-test .pctv-gpu-test__info h2 {
    margin: 0 0 0.5rem;
    padding: 0;
    border: 0;
    color: var(--nc-text-strong, #f7faff);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.pctv-gpu-test .pctv-gpu-test__info h2::before,
.pctv-gpu-test .pctv-gpu-test__info h2::after {
    content: none;
}

.pctv-gpu-test__info ul {
    margin: 0;
    padding-left: 1.1rem;
}

.pctv-gpu-test__info li {
    margin: 0 0 0.35rem;
    color: var(--nc-text-secondary, #b7c3d3);
    font-size: 0.93rem;
    line-height: 1.5;
}

.pctv-gpu-test__info li:last-child {
    margin-bottom: 0;
}

.pctv-gpu-test__info p {
    margin: 0 0 0.6rem;
    color: var(--nc-text-secondary, #b7c3d3);
    font-size: 0.95rem;
    line-height: 1.6;
}

.pctv-gpu-test__info:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.pctv-gpu-test__info > :last-child {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .pctv-gpu-test__about { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .pctv-gpu-test__facts {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .pctv-gpu-test__panel {
        padding: var(--nc-space-3, 0.75rem);
    }

    .pctv-gpu-test__buttons {
        flex: 1 1 100%;
    }

    .pctv-gpu-test__buttons button {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pctv-gpu-test__bar span {
        transition: none;
    }

    .pctv-gpu-test__tile.is-current .pctv-gpu-test__icon {
        animation: none;
    }
}

/* The full score sits beside the core score, a size smaller: the core score is the headline. */
.pctv-gpu-test__score--full .pctv-gpu-test__score-value {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    color: var(--nc-text, #e7edf7);
}
