.dead-pixel-test-component {
    padding: 1%;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    background: var(--container-bg, #f8f9fa);
    border: 1px solid var(--container-border, #dee2e6);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
}

.dead-pixel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dead-pixel-header h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.2;
    color: #2c3e50;
    text-align: center;
    width: 100%;
}

.dead-pixel-screen {
    position: relative;
    flex: 1;
    min-height: 220px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    background: #ff0000;
    outline: none;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid var(--container-border, #dee2e6);
    border-radius: 4px;
    /* The border is transparent on the home page; without this the test colour shows
       through it as a 1px frame, which stays in Per Pixel mode. */
    background-clip: padding-box;
}

.dead-pixel-screen:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.dead-pixel-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
    z-index: 0;
}

.dead-pixel-screen .fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    cursor: pointer;
    color: white;
    z-index: 10;
    /* Lifted above the control bar while it's visible and would overlap
       (--fullscreen-lift is set by the script in DeadPixelTest.ejs). */
    transform: translateY(calc(-1 * var(--fullscreen-lift, 0px)));
    transition: background 0.2s, transform 220ms ease;
}

.dead-pixel-screen .fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.dead-pixel-screen .fullscreen-btn svg {
    display: block;
    width: 24px;
    height: 24px;
}

/* Fullscreen covers every pixel of the display, edges included. */
.dead-pixel-screen.is-fullscreen {
    padding: 0;
    border: 0;
    border-radius: 0;
}

.dead-pixel-controls {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.38);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 12;
}

.dead-pixel-controls.is-faded {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    pointer-events: none;
}

.dead-pixel-screen .dead-pixel-controls {
    bottom: 12px;
}

.dead-pixel-warning {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    z-index: 20;
    cursor: default;
}

.dead-pixel-warning[hidden] {
    display: none;
}

.dead-pixel-warning-box {
    max-width: min(90%, 420px);
    padding: 1.1rem 1.25rem;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dead-pixel-warning-box h4 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #b91c1c;
}

.dead-pixel-warning-box p {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.dead-pixel-warning-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.dead-pixel-warning-actions button {
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
}

.dead-pixel-warning-actions button#deadPixelWarningAccept {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.dead-pixel-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dead-pixel-speed label {
    color: rgba(255, 255, 255, 0.9);
}

.dead-pixel-speed input {
    width: 88px;
    accent-color: #ffffff;
}

.dead-pixel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.dead-pixel-toggle input {
    accent-color: #ffffff;
}

.dead-pixel-test-component .dead-pixel-controls {
    bottom: 12px;
}
