:root {
    color-scheme: dark;
    --cyan: #56f5ff;
    --violet: #a776ff;
    --lime: #b7ff5a;
    --ink: #070a13;
    --panel: rgba(6, 11, 27, .83);
    --logo-offset: 47px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 860px;
    min-height: 100vh;
    color: #e9faff;
    background: radial-gradient(circle at 50% -10%, #24235b 0, #0a0c1d 36%, #05060d 82%);
}

button {
    font: inherit;
}

.app-shell {
    width: 817px;
    margin: 0 auto;
    padding: 30px 0 22px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0 4px 18px;
    position: relative;
    padding-left: calc(var(--logo-offset) + 10px);
}

.topbar img {
  position: absolute;
  top: 0;
  left: 0; 
  max-width: var(--logo-offset);
  border-radius: 50%;
}

.eyebrow {
    margin: 0 0 5px;
    color: #8da7bf;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 27px;
    font-weight: 500;
    letter-spacing: .035em;
}

h1 span {
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(86,245,255,.86);
}

.room-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bfe9ee;
    font-size: 13px;
}

.room-indicator small {
    color: #758ba2;
    margin-left: 6px;
}

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 10px var(--lime), 0 0 22px var(--lime);
    animation: pulse 1.8s infinite;
}

.room-shell {
    padding: 8px;
    overflow: hidden;
    border: 1px solid rgba(86,245,255,.37);
    border-radius: 16px;
    background: rgba(23,22,62,.38);
    box-shadow: 0 0 0 1px rgba(167,118,255,.17) inset, 0 0 25px rgba(59,226,255,.18), 0 18px 60px #010208;
}

.room-viewport {
    width: 800px;
    height: 600px;
    overflow: hidden;
    border-radius: 9px;
    background: #0a0c14;
}

.room-rail {
    display: flex;
    width: max-content;
    height: 600px;
    transition: transform .65s cubic-bezier(.22,.78,.2,1);
}

.room {
    position: relative;
    flex: 0 0 800px;
    width: 800px;
    height: 600px;
    overflow: hidden;
    isolation: isolate;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.room::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(2,12,21,.1), transparent 36%, rgba(7,0,28,.12));
}

.bed-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.bed-layer svg {
    position: absolute;
    inset: 0;
    width: 800px;
    height: 600px;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(86,245,255,.8));
}

.bed-layer svg polygon, .bed-layer svg path, .bed-layer svg rect, .bed-layer svg ellipse {
    pointer-events: all;
    cursor: pointer;
    transition: fill .2s ease, stroke-width .2s ease, filter .2s ease;
}

.bed-ui {
    position: absolute;
    z-index: 5;
    width: 0;
    height: 0;
    pointer-events: none;
}

.timer {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%) scale(.84);
    min-width: 104px;
    padding: 10px 13px 8px;
    opacity: 0;
    border: 1px solid var(--cyan);
    border-radius: 11px;
    background: var(--panel);
    color: #efffff;
    font-variant-numeric: tabular-nums;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .045em;
    line-height: 1;
    text-align: center;
    text-shadow: 0 0 10px var(--cyan);
    box-shadow: 0 0 11px rgba(86,245,255,.9), 0 0 28px rgba(86,245,255,.36), inset 0 0 20px rgba(86,245,255,.14);
    transition: opacity .25s ease, transform .25s ease;
}

.timer .timer-label {
    display: block;
    margin-bottom: 5px;
    color: #9bc7d0;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .16em;
    text-shadow: none;
    text-transform: uppercase;
}

.timer-value {
    display: block;
    transform-origin: center;
}

.timer.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.timer.is-finished {
    cursor: pointer;
}

/* Csak a számérték pulzál: a timer és a menük pozicionáló koordinátái fixek. */
.timer.is-finished .timer-value {
    animation: completed 1s ease-in-out infinite alternate;
}

.fan-menu, .control-menu {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.fan-menu.is-open, .control-menu.is-open {
    opacity: 1;
    pointer-events: auto;
}

.program-button, .control-button {
    position: absolute;
    left: 0;
    top: 0;
    border: 1px solid rgba(86,245,255,.8);
    border-radius: 999px;
    background: rgba(4,12,31,.91);
    color: #e5ffff;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 0 8px var(--cyan);
    box-shadow: 0 0 10px rgba(86,245,255,.5), inset 0 0 14px rgba(86,245,255,.12);
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) scale(.3);
    transition: opacity .28s ease calc(var(--delay) * 52ms), transform .38s cubic-bezier(.17,.84,.31,1.35) calc(var(--delay) * 52ms), background .18s ease, box-shadow .18s ease;
}

.program-button {
    padding: 8px 11px;
    font-size: 11px;
    letter-spacing: .025em;
}

.program-button small {
    display: block;
    margin-top: 2px;
    color: var(--lime);
    font-size: 9px;
    text-align: center;
    text-shadow: 0 0 8px var(--lime);
}

.fan-menu.is-open .program-button, .control-menu.is-open .control-button {
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1);
}

.program-button:hover, .control-button:hover {
    background: rgba(50, 17, 105, .95);
    box-shadow: 0 0 16px var(--violet), 0 0 32px rgba(86,245,255,.55), inset 0 0 18px rgba(167,118,255,.4);
}

.control-button {
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
}

.control-button.stop {
    color: #ffb9c2;
    border-color: #ff5d75;
    text-shadow: 0 0 8px #ff4b6a;
}

.bed-ui.is-complete .timer {
    color: var(--lime);
    border-color: var(--lime);
    text-shadow: 0 0 10px var(--lime);
    box-shadow: 0 0 16px var(--lime), inset 0 0 18px rgba(183,255,90,.2);
}

.help {
    margin: 14px 5px 0;
    color: #8496aa;
    font-size: 12px;
    line-height: 1.35;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mouse-gesture {
    height: 20px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
}

.help kbd {
    display: block;
    width: 11px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: url(mouse-middle-button.png) center / 100% 100% no-repeat;
    transform: rotate(-30deg);
    transform-origin: center;
}

.help kbd:last-child {
    background-image: url(mouse-right-button.png);
}

.mouse-gesture-separator {
    color: #687d95;
    line-height: 1;
}

@keyframes pulse {
    50% {
        opacity: .5;
        transform: scale(.75);
    }
}

@keyframes completed {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.08);
    }
}
