html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #000000;
    color: #E9E9E9;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}


/* --- The on-screen display ------------------------------------------------ */

/* Everything inside is sized in em off this one font-size, so the box reads
   like a monitor's own OSD at any resolution: about a quarter of the width of
   a 1080p screen, never smaller than legible on a phone. The JS moves it with
   a transform; left/top stay at the corner. */
#ns-osd {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    box-sizing: border-box;
    width: 18em;
    max-width: calc(100vw - 16px);
    padding: 1.05em 1.25em 1.25em;
    font-size: clamp(14px, 3vmin, 44px);
    background: #141414;
    border: max(1px, 0.09em) solid #3A3A3A;
    border-radius: 0.3em;
    color: #E9E9E9;
    will-change: transform;
}

.ns-row {
    display: flex;
    align-items: center;
    gap: 0.95em;
}

.ns-icon {
    flex: 0 0 auto;
    width: 3.2em;
    height: 3.2em;
}

.ns-head {
    min-width: 0;
}

.ns-title {
    font-size: 1.7em;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ns-input {
    margin-top: 0.25em;
    font-size: 0.95em;
    color: #A0A0A0;
    white-space: nowrap;
}

.ns-rule {
    margin: 0.85em 0 0.65em;
    border-top: max(1px, 0.06em) solid #333333;
}

/* Two lines tall whatever it says, so the box never changes height as the
   message changes and the drift never jumps. */
.ns-note {
    margin: 0;
    min-height: 2.8em;
    font-size: 0.8em;
    line-height: 1.4;
    color: #8C8C8C;
}

/* The monitor's maker, tucked in the corner: the screen's second honest tell
   after the SCART input. */
.ns-brand {
    position: absolute;
    right: 1.3em;
    bottom: 0.5em;
    font-size: 0.5em;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4A4A4A;
}

/* While it hunts for a signal the red cross is not there yet, and the
   connector icon pulses as though something is being tried. */
.ns-cross,
.ns-check {
    display: none;
}

#ns-osd.ns-nosignal .ns-cross {
    display: inline;
}

#ns-osd.ns-searching .ns-icon {
    animation: ns-pulse 1.1s ease-in-out infinite;
}

@keyframes ns-pulse {
    50% {
        opacity: 0.35;
    }
}

/* Power saving: the box goes, the screen is simply black. */
#ns-osd.ns-asleep,
#ns-osd.ns-switching {
    visibility: hidden;
}


/* --- The reveal ------------------------------------------------------------ */

.ns-prank {
    display: none;
}

/* The drift stops and the box settles in the middle, a little wider, carrying
   the punchline in the same OSD style. !important beats the inline transform
   the drift leaves behind. */
#ns-osd.ns-revealed {
    left: 50%;
    top: 50%;
    width: 24em;
    max-width: calc(100vw - 24px);
    transform: translate(-50%, -50%) !important;
}

#ns-osd.ns-revealed .ns-note {
    display: none;
}

#ns-osd.ns-revealed .ns-check {
    display: inline;
}

#ns-osd.ns-revealed .ns-prank {
    display: block;
    font-size: 0.88em;
    line-height: 1.45;
    color: #A8A8A8;
}

.ns-prank p {
    margin: 0 0 0.75em;
}

.ns-prank p:last-child {
    margin-bottom: 0;
}

.ns-prank .ns-punch {
    font-size: 1.12em;
    font-weight: 600;
    color: #FFFFFF;
}


/* --- Hint ---------------------------------------------------------------- */

#ns-hint {
    position: fixed;
    left: 50%;
    top: 34px;
    transform: translateX(-50%);
    z-index: 4;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 4vw, 20px);
    line-height: 1.5;
    text-align: center;
    color: #FFFFFF;
    background: rgba(40, 40, 40, 0.92);
    border-radius: 14px;
    padding: 18px 28px 22px;
    box-sizing: border-box;
    width: max-content;
    max-width: min(92vw, 30em);
    overflow: hidden;

    transition: opacity 0.6s ease;
}

#ns-hint kbd {
    font-family: inherit;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* Countdown to the hint going away: drains over HINT_TIMEOUT_MS, which the
   JS hands over as --hint-ms. */
#ns-hint::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    box-sizing: content-box;
    height: 5px;
    background: #FFFFFF;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    transform-origin: left center;
    animation: ns-hint-countdown var(--hint-ms, 8s) linear forwards;
}

@keyframes ns-hint-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

#ns-hint.ns-hint-gone {
    opacity: 0;
    pointer-events: none;
}
