/* ==========================================================================
   BRANDAUER BROADCASTING CRT TV & COZY VINTAGE ROOM
   ========================================================================== */

:root {
    /* Teletext Color Palette */
    --tt-black: #000000;
    --tt-red: #ff0000;
    --tt-green: #00ff00;
    --tt-yellow: #ffff00;
    --tt-blue: #1c3dff;
    --tt-magenta: #ff00ff;
    --tt-cyan: #00ffff;
    --tt-white: #ffffff;
    
    /* Room Light Variables */
    --room-brightness: 1;
    --led-red: #ff2222;
    --led-green: #22ff22;
}

/* Light / Dark room toggling rules on body */
body.room-lights-on {
    --room-brightness: 1;
    background: 
        radial-gradient(circle at 18% 8%, rgba(255, 227, 177, 0.56) 0%, rgba(255, 227, 177, 0.16) 27%, rgba(66, 40, 22, 0.36) 72%),
        linear-gradient(rgba(92, 57, 28, 0.08), rgba(38, 23, 13, 0.42)),
        url('assets/wall_texture.png') no-repeat center center fixed !important;
    background-size: cover !important;
    background-blend-mode: screen, multiply, normal;
}

body.room-lights-off {
    --room-brightness: 0.15;
    background: 
        radial-gradient(circle at center, rgba(10, 8, 7, 0.45) 0%, rgba(0, 0, 0, 0.96) 95%),
        url('assets/wall_texture.png') no-repeat center center fixed !important;
    background-size: cover !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: 
        radial-gradient(circle at 18% 8%, rgba(255, 227, 177, 0.56) 0%, rgba(255, 227, 177, 0.16) 27%, rgba(66, 40, 22, 0.36) 72%),
        linear-gradient(rgba(92, 57, 28, 0.08), rgba(38, 23, 13, 0.42)),
        url('assets/wall_texture.png') no-repeat center center fixed;
    background-size: cover;
    background-blend-mode: screen, multiply, normal;
    color: #e8dcc8;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px 0;
    transition: background 0.8s ease;
}

/* Dynamic screen back-glow reflecting on the wall behind the TV */
.ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 600px;
    border-radius: 50%;
    background-color: rgba(0, 255, 64, 0.25);
    filter: blur(140px);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: background-color 0.8s ease, opacity 0.6s ease;
}

/* 1980s Living Room Environment Wrapper */
.living-room {
    width: 100%;
    max-width: 1520px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.living-room-header {
    position: absolute;
    top: 12px;
    left: 24px;
    text-align: left;
    z-index: 5;
    margin-bottom: 0;
    transition: filter 0.8s ease;
    filter: brightness(var(--room-brightness));
    opacity: 0.74;
}

.logo-text {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    background: linear-gradient(135deg, #fff4dd 0%, #c4a47d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.logo-text span {
    font-size: 0.62rem;
    font-family: 'Share Tech Mono', monospace;
    background: #ff5500;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(255, 85, 0, 0.4);
    margin-left: 5px;
}

.tagline {
    display: none;
}

/* Main Scene Container hosting the TV set and wall poster */
.tv-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: clamp(650px, 92vh, 900px);
    overflow: visible;
    z-index: 2;
}

/* Warm diagonal window wash, like late afternoon light on a wallpapered room */
.sun-wash {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    filter: brightness(var(--room-brightness));
    background:
        linear-gradient(102deg, transparent 0 17%, rgba(255, 234, 181, 0.18) 17% 22%, transparent 22% 31%, rgba(255, 236, 188, 0.16) 31% 36%, transparent 36% 100%),
        radial-gradient(circle at 23% 19%, rgba(255, 244, 211, 0.2), transparent 23%);
    transition: filter 0.8s ease;
}

/* Framed posters hanging on the wall */
.room-poster {
    position: absolute;
    background: #efe1c4;
    box-shadow: 
        0 18px 36px rgba(0, 0, 0, 0.62),
        0 5px 12px rgba(0, 0, 0, 0.42),
        inset 0 0 0 7px #25160e,
        inset 0 0 0 10px #7f552e;
    border-radius: 2px;
    overflow: hidden;
    z-index: 1;
    padding: 16px 16px 30px;
    transition: all 0.3s ease, filter 0.8s ease;
    filter: brightness(var(--room-brightness)) sepia(0.12);
}

.room-poster img {
    width: 100%;
    aspect-ratio: 1 / 0.72;
    object-fit: cover;
    display: block;
    filter: saturate(0.9) contrast(0.94);
}

.room-poster span,
.room-poster small {
    position: absolute;
    left: 18px;
    right: 18px;
    text-align: center;
    color: #3c2415;
    font-family: Georgia, 'Times New Roman', serif;
}

.room-poster span {
    bottom: 11px;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.room-poster small {
    bottom: 2px;
    font-size: 0.55rem;
    letter-spacing: 1px;
}

.room-poster--lake {
    left: 4.5%;
    top: 8%;
    width: min(260px, 18vw);
}

.room-poster--wien {
    right: 4.5%;
    top: 10%;
    width: min(225px, 15vw);
    padding-bottom: 31px;
}

.room-poster--wien img {
    aspect-ratio: 0.78 / 1;
    filter: sepia(0.48) saturate(0.72) contrast(0.92);
}

.room-poster--wien span {
    top: 25px;
    bottom: auto;
    font-size: 1.45rem;
}

.room-poster--grid {
    left: 5.2%;
    bottom: 16.5%;
    top: auto;
    width: min(205px, 14vw);
    padding: 12px 12px 22px;
    opacity: 0.74;
    transform: rotate(-2deg);
}

.room-poster--grid img {
    aspect-ratio: 1 / 0.72;
}

.room-poster--grid span {
    bottom: 8px;
    font-size: 0.68rem;
}

.room-poster--grid small {
    display: none;
}

/* Shelf and small room props */
.room-shelf {
    position: absolute;
    top: 4%;
    left: 50%;
    width: min(520px, 36vw);
    height: 86px;
    transform: translateX(-50%);
    z-index: 1;
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.shelf-board {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    height: 18px;
    background: linear-gradient(180deg, #9a5b25 0%, #5a3115 60%, #2d1709 100%);
    box-shadow: 0 10px 18px rgba(0,0,0,0.45), inset 0 1px rgba(255,255,255,0.22);
}

.shelf-board::before,
.shelf-board::after {
    content: "";
    position: absolute;
    bottom: -16px;
    width: 22px;
    height: 23px;
    background: #5a3115;
    box-shadow: inset 0 -3px rgba(0,0,0,0.25);
}

.shelf-board::before { left: 20px; transform: skewX(-18deg); }
.shelf-board::after { right: 20px; transform: skewX(18deg); }

.shelf-plant {
    position: absolute;
    left: 44px;
    bottom: 38px;
    width: 92px;
    height: 62px;
    background:
        radial-gradient(ellipse at 24% 72%, #44702b 0 18%, transparent 19%),
        radial-gradient(ellipse at 45% 50%, #5a8a37 0 17%, transparent 18%),
        radial-gradient(ellipse at 64% 68%, #386821 0 18%, transparent 19%),
        radial-gradient(ellipse at 77% 39%, #6a9d44 0 16%, transparent 17%),
        radial-gradient(ellipse at 34% 33%, #4d7e2d 0 16%, transparent 17%);
}

.shelf-plant::after {
    content: "";
    position: absolute;
    left: 32px;
    bottom: -16px;
    width: 42px;
    height: 24px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, #e2c99e, #a56d3d);
    box-shadow: inset 0 2px rgba(255,255,255,0.18), 0 4px 8px rgba(0,0,0,0.35);
}

.shelf-book {
    position: absolute;
    right: 62px;
    height: 18px;
    padding: 3px 10px 2px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.62rem;
    color: #24150b;
    box-shadow: 0 2px 5px rgba(0,0,0,0.35);
}

.shelf-book--cream {
    bottom: 61px;
    background: #e8d3ac;
    right: 104px;
}

.shelf-book--green {
    bottom: 42px;
    background: #4f5b3e;
    color: #f0e2c5;
    right: 86px;
}

.shelf-book--black {
    bottom: 23px;
    background: #1f1a14;
    color: #dcb76f;
    right: 45px;
    width: 176px;
}

/* Vintage Wall Toggle Light Switch */
.light-switch-plate {
    position: absolute;
    left: 3.5%;
    top: 42%;
    bottom: auto;
    width: 48px;
    height: 76px;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(135deg, #a8a8a8, #7a7a7a);
    border: 1px solid #555;
    border-radius: 4px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.6),
        inset 1px 1px 1px rgba(255, 255, 255, 0.3),
        inset -1px -1px 1.5px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.switch-casing {
    width: 12px;
    height: 28px;
    background: #222;
    border-radius: 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.switch-toggle {
    width: 8px;
    height: 14px;
    background: linear-gradient(to bottom, #eaeaea, #9e9e9e);
    border: 1px solid #666;
    border-radius: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    position: absolute;
    transition: transform 0.15s ease;
}

body.room-lights-on .switch-toggle {
    transform: translateY(-4px); /* Up position */
}

body.room-lights-off .switch-toggle {
    transform: translateY(4px); /* Down position */
}

.switch-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 7px;
    color: #1a1a1a;
    font-weight: bold;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* SONY Trinitron TV Cabinet Set */
.tv-set {
    position: relative;
    z-index: 2;
    width: min(83dvh, 65vw);
    max-width: 850px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.tv-cabinet-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: none;
    filter: none;
    border-radius: 24px;
}

.tv-cabinet-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('assets/tv_cabinet_cutout.png?v=3');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: normal;
    filter: drop-shadow(0 24px 18px rgba(0, 0, 0, 0.28));
    z-index: 4;
    pointer-events: none;
}

.table-radio {
    position: absolute;
    left: 4.2%;
    bottom: 8.5%;
    width: min(270px, 18vw);
    height: min(124px, 8.6vw);
    min-height: 86px;
    background: linear-gradient(180deg, #4c2c15 0%, #1d130c 100%);
    border: 7px solid #2f1b0d;
    border-radius: 10px;
    box-shadow: 0 20px 32px rgba(0,0,0,0.62), inset 0 1px rgba(255,255,255,0.2);
    z-index: 2;
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.table-radio::before {
    content: "TELEFUNKEN";
    position: absolute;
    left: 16px;
    bottom: 9px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.52rem;
    color: #f1b848;
    letter-spacing: 1px;
}

.radio-grille {
    position: absolute;
    left: 16px;
    top: 18px;
    width: 40%;
    height: 52%;
    background:
        repeating-linear-gradient(90deg, rgba(233,170,63,0.75) 0 2px, transparent 2px 6px),
        repeating-linear-gradient(0deg, rgba(233,170,63,0.35) 0 2px, transparent 2px 6px),
        #120d09;
    border: 2px solid #9b642a;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.85);
}

.radio-scale {
    position: absolute;
    right: 44px;
    top: 19px;
    width: 38%;
    height: 48%;
    border: 1px solid #8f6b32;
    background:
        repeating-linear-gradient(0deg, transparent 0 7px, rgba(225,177,81,0.38) 7px 8px),
        linear-gradient(90deg, rgba(238,173,61,0.08), rgba(238,173,61,0.28));
}

.radio-knob {
    position: absolute;
    right: 12px;
    bottom: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 27%, #fff0b1 0%, #c17c2e 28%, #321a0c 78%);
    box-shadow: 0 3px 6px rgba(0,0,0,0.6);
}

.kaernten-mug {
    position: absolute;
    right: 4.6%;
    bottom: 8.5%;
    width: min(110px, 7.4vw);
    height: min(128px, 8.6vw);
    min-height: 86px;
    background: linear-gradient(90deg, #f3eee2, #bfb39e);
    border-radius: 7px 9px 12px 12px;
    box-shadow: 0 18px 28px rgba(0,0,0,0.48), inset -10px 0 18px rgba(0,0,0,0.14);
    z-index: 2;
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.kaernten-mug::after {
    content: "";
    position: absolute;
    right: -32px;
    top: 34px;
    width: 36px;
    height: 46px;
    border: 8px solid #d6cbb9;
    border-left: 0;
    border-radius: 0 22px 22px 0;
}

.kaernten-mug span {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 22px;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 800;
    color: #3a2615;
    text-align: center;
    font-size: clamp(0.58rem, 0.8vw, 0.8rem);
}

/* Realistic Glass CRT Screen Area */
.tv-screen-area {
    position: absolute;
    top: 21.6%;
    left: 24.5%;
    width: 57%;
    height: 44.8%;
    background: #000;
    border-radius: 20px 24px 24px 20px;
    overflow: hidden;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.99),
        inset 0 0 15px rgba(0, 255, 64, 0.1);
    z-index: 5;
    container-type: inline-size;
}

.screen {
    width: 100%;
    height: 100%;
    background-color: #030403;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    user-select: none;
}

/* CRT Screen Overlays */
.scanlines {
    position: absolute;
    inset: 0;
    z-index: 24;
    pointer-events: none !important;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.16) 2px,
        rgba(0, 0, 0, 0.16) 4px
    );
    opacity: 0.6;
}

.screen-flicker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.012);
    opacity: 0;
    pointer-events: none !important;
    z-index: 9;
    animation: crt-flicker 0.18s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 0.015; }
    50% { opacity: 0.005; }
    100% { opacity: 0.012; }
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle,
        rgba(0, 0, 0, 0) 58%,
        rgba(0, 0, 0, 0.42) 85%,
        rgba(0, 0, 0, 0.88) 100%
    );
    pointer-events: none !important;
    z-index: 8;
}

.glare-overlay {
    position: absolute;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.01) 35%,
        rgba(255, 255, 255, 0) 55%
    );
    transform: rotate(-8deg);
    pointer-events: none !important;
    z-index: 11;
}

#noise-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    opacity: 0;
    pointer-events: none !important;
}

.power-mask {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    z-index: 20;
    pointer-events: none !important;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Invisible overlay bounds on top of cabinet controls */
.tv-btn-overlay {
    position: absolute;
    background: rgba(255, 255, 255, 0);
    border: none;
    outline: none;
    cursor: pointer;
    z-index: 10;
}

.tv-btn-overlay--power {
    left: 84.8%;
    top: 75.2%;
    width: 2.8%;
    height: 2.8%;
    border-radius: 50%;
}

.tv-btn-overlay--vhf {
    left: 61.2%;
    top: 74.5%;
    width: 8.5%;
    height: 8.5%;
    border-radius: 50%;
}

.tv-btn-overlay--vol {
    left: 71.8%;
    top: 74.5%;
    width: 8.5%;
    height: 8.5%;
    border-radius: 50%;
}

/* Realistic 3D rotating dial knob design overlaid */
.tv-dial-knob {
    background: conic-gradient(
        from 0deg,
        #1d1d22 0%,
        #3c3c46 12%,
        #1d1d22 25%,
        #111115 42%,
        #3c3c46 50%,
        #111115 58%,
        #1d1d22 75%,
        #3c3c46 88%,
        #1d1d22 100%
    );
    border: 1.5px solid #08080b;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.95),
        inset 0 1px 2px rgba(255, 255, 255, 0.22),
        inset 0 -1px 2px rgba(0, 0, 0, 0.85);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.tv-dial-knob:hover {
    background: conic-gradient(
        from 0deg,
        #282830 0%,
        #484855 12%,
        #282830 25%,
        #18181f 42%,
        #484855 50%,
        #18181f 58%,
        #282830 75%,
        #484855 88%,
        #282830 100%
    );
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.95),
        inset 0 1px 3px rgba(255, 255, 255, 0.3),
        inset 0 -1px 3px rgba(0, 0, 0, 0.85);
}

/* Metallic Center Cap */
.tv-dial-knob::before {
    content: "";
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #525260 0%, #17171c 75%, #000 100%);
    box-shadow: 
        inset 0 1px 1.5px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Dial Notch Indicator Tick */
.tv-dial-knob::after {
    content: "";
    position: absolute;
    top: 5%;
    left: 50%;
    width: 3px;
    height: 25%;
    background: #ff5500; /* vibrant retro orange */
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

/* Red LED Power indicator */
.power-indicator {
    position: absolute;
    left: 88.5%;
    top: 76.2%;
    width: 0.8%;
    height: 0.8%;
    border-radius: 50%;
    background-color: #3f0807;
    box-shadow: inset 0 1px rgba(0,0,0,0.5);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

.power-indicator.on {
    background-color: #ff2222;
    box-shadow: 0 0 6px #ff2222, 0 0 12px #ff2222;
}

/* Red LED display on TV cabinet */
.led-display {
    position: absolute;
    left: 78.2%;
    top: 75.2%;
    width: 5.2%;
    height: 2.8%;
    background: #0b0202;
    border: 1px solid #221515;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(8px, 1.2cqw, 14px);
    color: #ff2222;
    text-shadow: 0 0 4px rgba(255, 34, 34, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
    z-index: 10;
}

/* Floating remote control setup on desktop */
.tv-remote {
    position: absolute;
    right: -130px;
    bottom: 8%;
    width: 155px;
    z-index: 12;
    transform: rotate(5deg);
    transition: transform 0.2s ease, right 0.2s ease;
}

.tv-remote:hover {
    transform: rotate(2deg) translateY(-5px);
}

.mobile-remote-pad {
    display: none;
}

/* Wooden Shelf Table at the bottom */
.tv-desk {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: clamp(90px, 15vh, 150px);
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.12), transparent 20% 80%, rgba(0,0,0,0.22)),
        linear-gradient(180deg, #835023 0%, #3a1e0c 45%, #170b04 100%);
    border-top: 5px solid #9a6734;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.85);
    filter: brightness(var(--room-brightness));
    transition: filter 0.8s ease;
}

.tv-shadow {
    display: none;
}


/* ==========================================================================
   TELETEXT LAYOUT GRID ENGINE
   ========================================================================== */

.teletext-grid {
    width: 100%;
    height: 100%;
}

.teletext-container {
    width: 100%;
    height: 100%;
    padding: 8px 10px;
    background-color: var(--tt-black);
    font-family: 'VT323', monospace;
    font-size: 15.5px;
    line-height: 1.08;
    letter-spacing: 0.4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.tt-row {
    display: flex;
    white-space: pre;
    width: 100%;
    height: 16.5px;
    overflow: hidden;
    position: relative;
}

/* Character Color Spans */
.tt-w { color: var(--tt-white); }
.tt-r { color: var(--tt-red); }
.tt-g { color: var(--tt-green); }
.tt-y { color: var(--tt-yellow); }
.tt-b { color: var(--tt-blue); }
.tt-m { color: var(--tt-magenta); }
.tt-c { color: var(--tt-cyan); }
.tt-k { color: var(--tt-black); }

/* Color Background Utilities */
.tt-bg-r { background-color: var(--tt-red); color: var(--tt-black); }
.tt-bg-g { background-color: var(--tt-green); color: var(--tt-black); }
.tt-bg-g .tt-w { color: var(--tt-black); }
.tt-bg-y { background-color: var(--tt-yellow); color: var(--tt-black); }
.tt-bg-y .tt-w { color: var(--tt-black); }
.tt-bg-b { background-color: var(--tt-blue); color: var(--tt-white); }
.tt-bg-m { background-color: var(--tt-magenta); color: var(--tt-black); }
.tt-bg-c { background-color: var(--tt-cyan); color: var(--tt-black); }
.tt-bg-w { background-color: var(--tt-white); color: var(--tt-black); }

/* Color Test Pattern calibration bar styling blocks */
.tt-block {
    display: inline-block;
    width: 15px;
    height: 100%;
}
.tt-block-red { background-color: var(--tt-red); }
.tt-block-green { background-color: var(--tt-green); }
.tt-block-yellow { background-color: var(--tt-yellow); }
.tt-block-cyan { background-color: var(--tt-cyan); }
.tt-block-magenta { background-color: var(--tt-magenta); }
.tt-block-white { background-color: var(--tt-white); }

/* Double Height Typography Mode */
.tt-dh {
    font-size: 31px;
    line-height: 1;
    height: 33px;
    transform: scaleY(2);
    transform-origin: top left;
    margin-bottom: 16.5px;
}

.tt-dh-space {
    height: 16.5px;
    pointer-events: none;
}

.tt-blink {
    animation: tt-blinker 1s steps(2, start) infinite;
}

.tt-link {
    cursor: pointer;
    text-decoration: underline;
    pointer-events: auto !important;
}
.tt-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tt-external {
    color: var(--tt-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    pointer-events: auto;
}

.tt-external:hover,
.tt-external:focus-visible {
    background-color: rgba(0, 255, 255, 0.18);
    outline: none;
}

.tt-input {
    background: rgba(255, 255, 255, 0.1); cursor: text;
    border: none;
    outline: none;
    font-family: 'VT323', monospace;
    font-size: 15.5px;
    color: var(--tt-yellow);
    border-bottom: 2px dashed var(--tt-yellow);
    width: 110px;
    caret-color: var(--tt-white);
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.tt-input:focus {
    color: var(--tt-cyan);
    border-bottom-color: var(--tt-cyan);
}

.tt-button {
    background: var(--tt-blue);
    color: var(--tt-white);
    border: none;
    padding: 1px 6px;
    font-family: 'VT323', monospace;
    font-size: 13.5px;
    cursor: pointer;
    pointer-events: auto !important;
}
.tt-button:hover {
    background: var(--tt-cyan);
    color: var(--tt-black);
}

.visualizer-bar {
    font-family: 'VT323', monospace;
    color: var(--tt-green);
}

/* ==========================================================================
   REMOTE CONTROL (TABLE POSITION LAYOUT)
   ========================================================================== */

.remote-layout-pos {
    position: absolute;
    right: 80px;
    bottom: -10px;
    z-index: 10;
}

.remote-control {
    width: 155px;
    height: 395px;
    background: linear-gradient(180deg, #28292d 0%, #17181c 100%);
    border: 4px solid #141416;
    border-radius: 14px;
    box-shadow: 
        0 18px 30px rgba(0, 0, 0, 0.95),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -2px 5px rgba(0, 0, 0, 0.6);
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: rotateZ(2deg) rotateY(-4deg);
    transition: transform 0.3s ease;
    filter: brightness(var(--room-brightness));
    position: relative;
}
.remote-control:hover {
    transform: rotateZ(0deg) rotateY(0deg) translateY(-8px);
}

/* 1980s Infrared Emitter Lens */
.remote-ir-window {
    height: 12px;
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-top: -15px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #2b0303 0%, #7d0303 35%, #b50404 50%, #7d0303 65%, #2b0303 100%);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 3.5px solid #0c0c0e;
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}
.remote-ir-window::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 80%);
}

.remote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #111113;
    padding-bottom: 8px;
    margin-bottom: 2px;
}
.remote-header .brand {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    font-weight: 900;
    color: #dfdfdf;
    letter-spacing: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.remote-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2b0505;
    border: 1px solid #09090a;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.8);
}
.remote-led.active {
    background-color: #ff2222;
    box-shadow: 0 0 8px #ff2222, 0 0 15px #ff2222;
}

.remote-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn {
    background: linear-gradient(180deg, #444549 0%, #2a2b2f 100%);
    border: 1px solid #151618;
    border-bottom: 2.5px solid #0f1011;
    border-radius: 5px;
    color: #dfdfdf;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 
        0 3px 4px rgba(0,0,0,0.65),
        inset 0 1px rgba(255,255,255,0.08);
    outline: none;
    transition: all 0.08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.btn:active {
    transform: translateY(1.5px);
    border-bottom-width: 1px;
    box-shadow: 
        0 1px 1px rgba(0,0,0,0.4),
        inset 0 1.5px 3px rgba(0,0,0,0.85);
    background: linear-gradient(180deg, #222325 0%, #151617 100%);
}

/* Vintage Sony Red Power Button */
.btn-power {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e52b2b 0%, #990e0e 100%);
    border: 1px solid #5a0707;
    border-bottom: 3px solid #480505;
    box-shadow: 
        0 3px 5px rgba(0,0,0,0.7),
        inset 0 1px 1px rgba(255,255,255,0.2);
}
.btn-power::after {
    content: "⏻";
    font-size: 1.05rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.btn-power:active {
    transform: translateY(1.5px);
    border-bottom-width: 1px;
    box-shadow: 
        0 1px 1px rgba(0,0,0,0.4),
        inset 0 1.5px 3px rgba(0,0,0,0.9);
}

.btn-mute {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.numeric-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #101011;
    padding: 8px;
    border-radius: 8px;
    border: 1.5px solid #080809;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

/* Rubbery Beige Sony Numeric Keys */
.btn-num {
    height: 28px;
    background: linear-gradient(180deg, #eae8e2 0%, #bcbaa4 100%);
    border: 1px solid #7c7b6d;
    border-bottom: 3.2px solid #5a594e;
    color: #1a1a1c;
    border-radius: 4px;
    font-size: 0.98rem;
    font-weight: 800;
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.45);
}
.btn-num:active {
    transform: translateY(1.5px);
    border-bottom-width: 1px;
    background: linear-gradient(180deg, #9b9a89 0%, #7a796b 100%);
    box-shadow: 
        0 1px 1px rgba(0,0,0,0.3),
        inset 0 1.5px 3px rgba(0,0,0,0.8);
}

.btn-txt, .btn-index {
    font-size: 0.65rem;
    color: #ffaa00;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 900;
    background: linear-gradient(180deg, #38393d 0%, #202123 100%);
}

.rocker-group {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.rocker {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #0f1011;
    padding: 4px;
    border-radius: 8px;
    border: 1.5px solid #060607;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.85);
}
.rocker .btn {
    width: 32px;
    height: 28px;
    border-radius: 4px;
}
.rocker-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.58rem;
    color: #8f9095;
    font-weight: 800;
    margin: 3px 0;
    letter-spacing: 0.5px;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.8);
}

.color-shortcut-group {
    display: flex;
    justify-content: space-between;
    background: #101011;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #080809;
}
.btn-color {
    width: 24px;
    height: 14px;
    border-radius: 3px;
    box-shadow: 
        0 2.5px 3px rgba(0,0,0,0.7),
        inset 0 1px rgba(255,255,255,0.2);
    cursor: pointer;
    border-style: solid;
    border-width: 1px;
}
.btn-color.red { background: linear-gradient(to bottom, #ff3333, #aa0000); border-color: #500; }
.btn-color.green { background: linear-gradient(to bottom, #22ff22, #008800); border-color: #040; }
.btn-color.yellow { background: linear-gradient(to bottom, #ffff22, #aaaa00); border-color: #550; }
.btn-color.blue { background: linear-gradient(to bottom, #2266ff, #0022bb); border-color: #004; }

/* ==========================================================================
   DECORATIVE FOOTER
   ========================================================================== */

.system-footer {
    display: none;
}
.system-footer a {
    color: #777;
    text-decoration: underline;
}
.system-footer a:hover {
    color: #999;
}
kbd {
    background-color: #1a1a1a;
    color: #ffaa00;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
    border: 1px solid #333;
}

/* ==========================================================================
   RESPONSIVE LAYOUT FOR SMALL SCREENS (COLLAPSE TO FULL-SCREEN TELETEXT)
   ========================================================================== */

@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
        background: #000008;
        padding: 0;
    }

    .living-room {
        height: 100%;
        gap: 0;
    }

    .living-room-header {
        background: #09090e;
        border-bottom: 2px solid var(--tt-blue);
        padding: 8px 12px;
        width: 100%;
        margin-bottom: 0;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .logo-text span {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .tagline {
        display: none; /* Hide tagline on mobile */
    }

    .tv-scene {
        flex: 1;
        height: auto;
        min-height: 0;
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        background: #000008;
    }

    .tv-set {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        aspect-ratio: auto;
    }

    .tv-cabinet-wrapper {
        background-image: none !important;
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        height: 100%;
    }

    .tv-screen-area {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .teletext-container {
        font-size: clamp(8px, 4.2cqw, 18px); /* Scale up text to fill screen */
        padding: 4px;
    }

    .tt-row {
        height: 4.2cqw;
    }

    .tt-dh {
        font-size: 8.4cqw;
        height: 8.4cqw;
        margin-bottom: 4.2cqw;
    }

    .tt-dh-space {
        height: 4.2cqw;
    }

    /* Hide background elements, switch, remote, desk */
    .room-poster,
    .room-shelf,
    .sun-wash,
    .table-radio,
    .kaernten-mug,
    .light-switch-plate,
    .tv-remote,
    .tv-desk,
    .tv-btn-overlay,
    .led-display,
    .power-indicator {
        display: none !important;
    }

    .system-footer {
        display: none !important; /* Hide footer on mobile to save screen space */
    }
}

.radio-media {
    position: fixed;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   1:1 REFERENCE BACKGROUND MODE
   ========================================================================== */

body.bg-style-2.tv-room,
body.bg-style-2.room-lights-on,
body.bg-style-2.room-lights-off {
    background: #050302 !important;
    background-image: none !important;
    background-blend-mode: normal !important;
    display: grid;
    place-items: center;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    padding: 0;
    overflow: hidden;
}

body.bg-style-2 .ambient-glow,
body.bg-style-2 .living-room-header,
body.bg-style-2 .sun-wash,
body.bg-style-2 .room-shelf,
body.bg-style-2 .room-poster,
body.bg-style-2 .table-radio,
body.bg-style-2 .kaernten-mug,
body.bg-style-2 .tv-desk,
body.bg-style-2 .system-footer,
body.bg-style-2 .led-display,
body.bg-style-2 .power-indicator {
    display: none !important;
}

body.bg-style-2 .living-room {
    width: 100vw;
    height: 100vh;
    max-width: none;
    display: grid;
    place-items: center;
    gap: 0;
    z-index: 1;
}

body.bg-style-2 .tv-scene {
    position: relative;
    width: min(100vw, calc(100vh * 1672 / 941));
    height: min(100vh, calc(100vw * 941 / 1672));
    aspect-ratio: 1672 / 941;
    background: url('assets/reference-room.png?v=1') center center / contain no-repeat;
    overflow: hidden;
    display: block;
}

body.bg-style-2 .tv-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 49% 50%, rgba(0, 0, 0, 0.12) 0 28%, rgba(0, 0, 0, 0.36) 56%, rgba(0, 0, 0, 0.74) 100%),
        linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.46));
    transition: opacity 0.35s ease;
}

body.bg-style-2.room-lights-off .tv-scene::after {
    opacity: 0.64;
}

body.bg-style-2.room-main-off:not(.room-lights-off) .tv-scene::after {
    opacity: 0.28;
}

body.bg-style-2.room-lamp-off:not(.room-lights-off) .tv-scene::after {
    opacity: 0.18;
}

body.bg-style-2 .tv-set,
body.bg-style-2 .tv-cabinet-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    display: block;
    filter: none;
    border-radius: 0;
    pointer-events: none;
}

body.bg-style-2 .tv-set {
    z-index: 3;
}

body.bg-style-2 .tv-cabinet-wrapper {
    background: none !important;
}

body.bg-style-2 .tv-cabinet-wrapper::before {
    display: none !important;
}

body.bg-style-2 .tv-cabinet-wrapper::after {
    content: "";
    position: absolute;
    left: 37.2%;
    top: 24.4%;
    width: 37.4%;
    height: 45.0%;
    border-radius: 14px 14px 24px 24px;
    background: #000;
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.96),
        inset 0 0 7px rgba(40, 255, 90, 0.06);
    z-index: 5;
    pointer-events: none;
}

body.bg-style-2 .tv-screen-area {
    position: absolute;
    left: 37.35%;
    top: 24.6%;
    width: 37.1%;
    height: 44.6%;
    border-radius: 12px 12px 22px 22px;
    background: #000;
    overflow: hidden;
    box-shadow:
        inset 0 0 22px rgba(0, 0, 0, 0.9),
        inset 0 0 8px rgba(30, 255, 70, 0.08);
    z-index: 6;
    pointer-events: auto;
}

body.bg-style-2 .screen {
    background-color: #000;
}

body.bg-style-2 .teletext-container {
    --tt-fill-x: 1.92;
    width: calc(100% / var(--tt-fill-x));
    padding: 6px 8px;
    font-size: clamp(10px, 2.35cqw, 14px);
    line-height: 1.02;
    letter-spacing: 0.45px;
    transform: scaleX(var(--tt-fill-x));
    transform-origin: left top;
}

body.bg-style-2 .teletext-container .tt-row:first-child {
    font-size: 0.68em;
    letter-spacing: 0.2px;
}

body.bg-style-2 .teletext-container .tt-row:first-child .tt-g {
    font-size: 0.92em;
}

body.bg-style-2 .tt-row {
    height: clamp(11px, 2.85cqw, 16px);
}

body.bg-style-2 .tt-dh {
    font-size: clamp(22px, 5.3cqw, 32px);
    height: clamp(22px, 5.3cqw, 32px);
    margin-bottom: clamp(10px, 2.6cqw, 16px);
}

body.bg-style-2 .tt-dh-space {
    height: clamp(10px, 2.6cqw, 16px);
}

body.bg-style-2 .scanlines {
    opacity: 0.42;
}

body.bg-style-2 .glare-overlay {
    opacity: 0.34;
}

body.bg-style-2 .tv-btn-overlay {
    display: block !important;
    position: absolute;
    pointer-events: auto;
    opacity: 0;
    background: transparent !important;
    border: 0;
    box-shadow: none;
    cursor: pointer;
    z-index: 16;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

body.bg-style-2 .tv-btn-overlay:hover {
    opacity: 0;
    box-shadow: none;
}

body.bg-style-2 .tv-dial-knob:hover {
    opacity: 1;
    box-shadow: none;
}

body.bg-style-2 .tv-dial-knob {
    position: absolute;
    opacity: 1;
    border-radius: 50%;
    background: transparent !important;
    border: 0;
    box-shadow: none;
    cursor: grab;
}

body.bg-style-2 .tv-dial-knob:active {
    cursor: grabbing;
}

body.bg-style-2 .tv-dial-knob::before {
    display: none;
}

body.bg-style-2 .tv-dial-knob::after {
    content: "";
    display: block;
    position: absolute;
    left: 47%;
    top: 9%;
    width: 7%;
    height: 33%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 165, 54, 0.92), rgba(118, 60, 20, 0.92));
    box-shadow: 0 0 4px rgba(255, 111, 24, 0.32), 0 1px 1px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.12s ease;
}

body.bg-style-2 .tv-dial-knob:hover::after,
body.bg-style-2 .tv-dial-knob:active::after,
body.bg-style-2 .tv-dial-knob.is-pressed::after {
    opacity: 0.42;
}

body.bg-style-2 .tv-btn-overlay--power {
    left: 71.55%;
    top: 77.55%;
    width: 2.9%;
    height: 4.75%;
}

body.bg-style-2 .tv-btn-overlay--vhf {
    left: 58.85%;
    top: 75.75%;
    width: 5.9%;
    height: 9.45%;
}

body.bg-style-2 .tv-btn-overlay--vol {
    left: 64.95%;
    top: 75.75%;
    width: 5.25%;
    height: 8.85%;
}

body.bg-style-2 .tv-btn-overlay--power.is-pressed,
body.bg-style-2 .tv-btn-overlay--power:active {
    opacity: 0.72;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 38%, rgba(255, 40, 32, 0.62), rgba(45, 3, 2, 0.5) 70%) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.72), 0 0 8px rgba(255, 24, 12, 0.3);
}

body.bg-style-2 .led-display {
    display: flex !important;
    position: absolute;
    left: 68.9%;
    top: 76.25%;
    width: 2.8%;
    height: 3.4%;
    align-items: center;
    justify-content: center;
    z-index: 18;
    pointer-events: none;
    padding: 0;
    border-radius: 3px;
    border: 0;
    background: #050000;
    color: #ff1e16;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(8px, 0.92vw, 13px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-shadow: 0 0 4px rgba(255, 26, 16, 0.9), 0 0 9px rgba(255, 0, 0, 0.45);
    opacity: 1;
    box-shadow: inset 0 0 9px rgba(0, 0, 0, 0.98);
}

body.bg-style-2 .light-switch-plate {
    display: block !important;
    position: absolute;
    left: 7.55%;
    top: 32.95%;
    width: 2.35%;
    height: 7.05%;
    min-width: 14px;
    min-height: 28px;
    z-index: 12;
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.15s ease, outline-color 0.15s ease;
}

body.bg-style-2 .light-switch-plate--lamp {
    left: 92.5%;
    top: 30%;
    width: 7.5%;
    height: 55%;
}

body.bg-style-2 .light-switch-plate--lamp:hover {
    box-shadow: 0 0 10px 4px rgba(255, 220, 120, 0.22) !important;
    border-radius: 8px;
}

body.bg-style-2 .light-switch-plate--lamp:active {
    box-shadow: 0 0 16px 6px rgba(255, 220, 120, 0.35) !important;
    border-radius: 8px;
}

body.bg-style-2 .light-switch-plate:focus-visible {
    outline: 2px solid rgba(255, 214, 140, 0.75);
    outline-offset: 2px;
}

body.bg-style-2 .light-switch-plate:hover {
    outline: 0;
    box-shadow: 0 0 3px 1px rgba(255, 220, 120, 0.13) !important;
    border-radius: 3px;
}

body.bg-style-2 .light-switch-plate:active {
    outline: 0;
    box-shadow: 0 0 5px 1px rgba(255, 220, 120, 0.22) !important;
    border-radius: 3px;
}

body.bg-style-2 .light-switch-plate .switch-casing,
body.bg-style-2 .light-switch-plate .switch-toggle,
body.bg-style-2 .light-switch-plate .switch-label {
    display: none !important;
}

body.bg-style-2 .light-switch-plate * {
    pointer-events: none;
}

body.bg-style-2 .tv-remote {
    display: block !important;
    position: absolute;
    left: 80.0%;
    top: 41.4%;
    width: 9.0%;
    height: 38.8%;
    z-index: 12;
    opacity: 1;
    transform: rotate(4.7deg);
    pointer-events: none;
}

body.bg-style-2 .tv-remote:hover {
    transform: rotate(4.7deg);
}

body.bg-style-2 .tv-remote,
body.bg-style-2 .remote-control,
body.bg-style-2 .remote-body,
body.bg-style-2 .button-row,
body.bg-style-2 .numeric-pad,
body.bg-style-2 .rocker-group,
body.bg-style-2 .rocker,
body.bg-style-2 .color-shortcut-group {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

body.bg-style-2 .remote-control,
body.bg-style-2 .remote-body,
body.bg-style-2 .button-row,
body.bg-style-2 .numeric-pad,
body.bg-style-2 .rocker-group,
body.bg-style-2 .rocker,
body.bg-style-2 .color-shortcut-group {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    display: block;
    transform: none !important;
    pointer-events: none;
}

body.bg-style-2 .remote-control:hover {
    transform: none !important;
}

body.bg-style-2 .remote-ir-window,
body.bg-style-2 .remote-header,
body.bg-style-2 .rocker-label {
    display: none !important;
}

body.bg-style-2 .tv-remote .btn {
    position: absolute;
    display: block;
    opacity: 0;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    color: transparent !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none;
    pointer-events: auto !important;
    cursor: pointer;
    transition: opacity 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    transform-origin: center;
    border-radius: 4px;
}

body.bg-style-2 .tv-remote .btn.is-hovered,
body.bg-style-2 .tv-remote .btn:hover,
body.bg-style-2 .tv-remote .btn:focus-visible {
    opacity: 0.18 !important;
    background: rgba(255, 245, 210, 0.18) !important;
    box-shadow: none !important;
    transform: none;
}

body.bg-style-2 .tv-remote .btn::after {
    display: none !important;
}

body.bg-style-2 .tv-remote .btn.is-pressed,
body.bg-style-2 .tv-remote .btn:active {
    opacity: 0.42 !important;
    background: rgba(255, 238, 196, 0.28) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.42) !important;
    transform: translateY(0.5px) scale(0.96);
}

body.bg-style-2 .tv-remote .btn-power.is-hovered,
body.bg-style-2 .tv-remote .btn-power.is-pressed,
body.bg-style-2 .tv-remote .btn-power:active {
    background: rgba(255, 42, 34, 0.34) !important;
    border-radius: 50%;
}

body.bg-style-2 .tv-remote .btn-color.is-hovered,
body.bg-style-2 .tv-remote .btn-color.is-pressed,
body.bg-style-2 .tv-remote .btn-color:active {
    opacity: 0.34 !important;
    transform: translateY(0.5px) scale(0.92);
}

/* Calibrated to the visible remote buttons in assets/reference-room.png. */
body.bg-style-2 .tv-remote .btn-num[data-num="1"] { left: 7.8%; top: 51.3%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="2"] { left: 26.5%; top: 51.1%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="3"] { left: 45.3%; top: 51.0%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="4"] { left: 7.9%; top: 58.9%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="5"] { left: 26.5%; top: 58.9%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="6"] { left: 45.2%; top: 58.8%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="7"] { left: 7.7%; top: 66.9%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="8"] { left: 26.5%; top: 66.7%; width: 12.2%; height: 5.4%; }
body.bg-style-2 .tv-remote .btn-num[data-num="9"] { left: 45.3%; top: 66.5%; width: 12.2%; height: 5.4%; }

body.bg-style-2 #remote-txt-toggle {
    left: 7.6%;
    top: 75.1%;
    width: 12.2%;
    height: 5.4%;
}

body.bg-style-2 .tv-remote .btn-num[data-num="0"] {
    left: 26.3%;
    top: 74.4%;
    width: 12.2%;
    height: 5.4%;
}

body.bg-style-2 #remote-index {
    left: 46.7%;
    top: 74.1%;
    width: 12.2%;
    height: 5.4%;
}

body.bg-style-2 #remote-vol-up { left: 10.2%; top: 85.0%; width: 13.5%; height: 5.2%; }
body.bg-style-2 #remote-vol-down { left: 11.3%; top: 94.1%; width: 13.5%; height: 5.2%; }
body.bg-style-2 #remote-ch-up { left: 44.6%; top: 83.9%; width: 13.5%; height: 5.2%; }
body.bg-style-2 #remote-ch-down { left: 45.8%; top: 93.2%; width: 13.5%; height: 5.2%; }

body.bg-style-2 #remote-power { left: 4.2%; top: 37.4%; width: 12%; height: 5.8%; }
body.bg-style-2 #remote-mute { left: 39.6%; top: 36.2%; width: 14%; height: 6.0%; }

body.bg-style-2 #shortcut-red { left: 1.3%; top: 98.0%; width: 9.4%; height: 2.8%; }
body.bg-style-2 #shortcut-green { left: 17.2%; top: 97.9%; width: 9.4%; height: 2.8%; }
body.bg-style-2 #shortcut-yellow { left: 32.5%; top: 97.6%; width: 9.4%; height: 2.8%; }
body.bg-style-2 #shortcut-blue { left: 48.5%; top: 97.4%; width: 9.4%; height: 2.8%; }

@media (max-width: 768px) {
    body.bg-style-2.tv-room,
    body.bg-style-2.room-lights-on,
    body.bg-style-2.room-lights-off {
        background: #050302 !important;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }

    body.bg-style-2 .living-room {
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
        place-items: start center;
    }

    body.bg-style-2 .tv-scene {
        flex: none;
        width: min(170vw, calc((100dvh + 295px) * 941 / 1672));
        height: auto;
        aspect-ratio: 941 / 1672;
        max-height: none;
        min-height: 0;
        margin-top: 0;
        margin-left: 0;
        left: 50%;
        top: -20dvh;
        transform: translateX(-69.8%);
        background: url('assets/reference-room-mobile.png?v=1') center center / contain no-repeat;
    }

    body.bg-style-2 .tv-set,
    body.bg-style-2 .tv-cabinet-wrapper {
        width: 100%;
        height: 100%;
    }

    body.bg-style-2 .tv-screen-area {
        position: absolute;
        left: 20.5%;
        top: 31.0%;
        width: 60.0%;
        height: 36.0%;
        border-radius: 10px 10px 22px 22px;
    }

    body.bg-style-2 .tv-cabinet-wrapper::after {
        left: 20.5%;
        top: 31.0%;
        width: 60.0%;
        height: 36.0%;
        border-radius: 10px 10px 22px 22px;
    }

    body.bg-style-2 .teletext-container {
        --tt-fill-x: 1.72;
        --tt-fill-y: 1.47;
        width: calc(100% / var(--tt-fill-x));
        height: calc(100% / var(--tt-fill-y));
        transform: scale(var(--tt-fill-x), var(--tt-fill-y));
        transform-origin: left top;
        padding: 4px 5px;
        font-size: clamp(7.5px, 2.55cqw, 10px);
        line-height: 1.02;
        letter-spacing: 0;
    }

    body.bg-style-2 .teletext-page-130 {
        --tt-fill-x: 1.58;
        --tt-fill-y: 1.33;
        padding: 4px 5px;
        font-size: clamp(7px, 2.25cqw, 9px);
        line-height: 0.96;
    }

    body.bg-style-2 .teletext-page-130 .tt-row {
        height: 10.7px;
    }

    body.bg-style-2 .teletext-page-130 .tt-row.tt-dh {
        height: 22px;
        margin-bottom: 2px;
        transform: none;
        font-size: 1em;
    }

    body.bg-style-2 .teletext-page-130 .tt-dh-space {
        display: none;
        height: 0;
    }

    body.bg-style-2 .teletext-page-130 #game-freq.tt-dh {
        height: auto;
        margin-bottom: 0;
        transform: none;
        font-size: 1.75em;
        line-height: 0.95;
    }

    body.bg-style-2 .teletext-page-130 .tt-button {
        min-width: 1.35em;
        min-height: 1.38em;
        padding: 0 0.55em;
        font-size: 1.08em;
        line-height: 1;
        vertical-align: baseline;
    }

    body.bg-style-2 .teletext-page-130 #btn-toggle-auto,
    body.bg-style-2 .teletext-page-130 #btn-reboot {
        min-height: 1.42em;
        padding-inline: 0.65em;
    }

    body.bg-style-2 .led-display {
        display: flex !important;
        left: 69.2%;
        top: 73.1%;
        width: 7.4%;
        height: 3.3%;
        font-size: clamp(9px, 2.4vw, 14px);
        border-radius: 2px;
        z-index: 16;
    }

    body.bg-style-2 .tv-remote {
        display: none !important;
    }

    body.bg-style-2 .mobile-remote-pad {
        position: fixed;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: max(28px, env(safe-area-inset-bottom));
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 6px;
        padding: 8px;
        border-radius: 14px;
        background: rgba(9, 8, 7, 0.94);
        border: 1px solid rgba(255, 226, 150, 0.16);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.08);
        pointer-events: auto;
    }

    body.bg-style-2 .mobile-remote-key {
        grid-column: span 2;
        min-width: 0;
        min-height: 38px;
        padding: 0 4px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: linear-gradient(180deg, rgba(50, 45, 37, 0.96), rgba(16, 14, 12, 0.98));
        color: #f4ead1;
        font-family: 'Share Tech Mono', monospace;
        font-size: clamp(11px, 3.15vw, 15px);
        font-weight: 800;
        letter-spacing: 0;
        box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.32);
        touch-action: manipulation;
    }

    body.bg-style-2 .mobile-remote-key[data-mobile-action="ch-down"] {
        grid-column: 7 / span 2;
    }

    body.bg-style-2 .mobile-remote-key[data-mobile-action="ch-up"] {
        grid-column: 9 / span 2;
    }

    body.bg-style-2 .mobile-remote-key:active,
    body.bg-style-2 .mobile-remote-key.is-pressed {
        transform: translateY(1px) scale(0.97);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.55);
    }

    body.bg-style-2 .mobile-remote-key--power {
        color: #ff9a8e;
    }

    body.bg-style-2 .mobile-remote-key--red { border-bottom: 4px solid #b51219; }
    body.bg-style-2 .mobile-remote-key--green { border-bottom: 4px solid #1fad4f; }
    body.bg-style-2 .mobile-remote-key--yellow { border-bottom: 4px solid #d8c526; color: #fff8b5; }
    body.bg-style-2 .mobile-remote-key--blue { border-bottom: 4px solid #2b9de8; }
}

@media (prefers-reduced-motion: reduce) {
    .screen-flicker {
        animation: none;
    }
}



[hidden] {
    display: none !important;
}
