:root {
    color-scheme: dark;
    --bg: #06060c;
    --panel: rgba(16, 15, 28, 0.82);
    --panel-strong: rgba(21, 18, 38, 0.94);
    --line: rgba(255, 255, 255, 0.09);
    --line-hot: rgba(255, 65, 190, 0.42);
    --text: #f7f4ff;
    --muted: #958fa8;
    --muted-strong: #bbb4ca;
    --pink: #ff2da8;
    --pink-hot: #ff58c1;
    --purple: #8c52ff;
    --cyan: #52dcff;
    --red: #ff3d68;
    --green: #3ef3b1;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 24px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 50% -10%, rgba(126, 51, 255, 0.15), transparent 40%),
        linear-gradient(145deg, #07070e 0%, #090711 50%, #05060b 100%);
    font-family: Inter, "Segoe UI", "Noto Sans JP", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible {
    outline: 2px solid var(--pink-hot);
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ambient {
    position: fixed;
    z-index: 0;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.22;
    animation: ambientFloat 14s ease-in-out infinite alternate;
}

.ambient-one { top: -240px; left: -180px; background: #8120fa; }
.ambient-two { right: -220px; bottom: -260px; background: #e31391; animation-delay: -7s; }

.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.022;
    background-image: repeating-linear-gradient(0deg, transparent 0, transparent 2px, #fff 3px);
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

.app-shell, .host-shell { position: relative; z-index: 1; min-height: 100vh; }

.view { display: none; opacity: 0; }
.view.is-active { display: flex; animation: viewIn 0.7s var(--ease) forwards; }

.auth-view {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.glass-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(23, 20, 39, 0.91), rgba(11, 11, 20, 0.86));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.035);
    backdrop-filter: blur(20px);
}

.auth-card {
    position: relative;
    width: min(100%, 490px);
    overflow: hidden;
    padding: 52px 54px 38px;
    border-radius: 30px;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pink), var(--purple), transparent);
    box-shadow: 0 0 22px rgba(255,45,168,0.75);
}

.auth-card::after {
    content: "";
    position: absolute;
    top: -100px;
    right: -120px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255,45,168,0.1);
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(140,82,255,0.08);
    pointer-events: none;
}

.brand-lockup { position: relative; text-align: center; }

.brand-mark {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto 24px;
    transform: rotate(45deg);
    border: 1px solid rgba(255, 80, 190, 0.42);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255,45,168,0.17), rgba(140,82,255,0.08));
    box-shadow: 0 0 35px rgba(255,45,168,0.17), inset 0 0 18px rgba(255,45,168,0.08);
}

.brand-mark::before, .brand-mark::after, .brand-mark span {
    content: "";
    position: absolute;
    inset: 14px;
    border: 2px solid var(--pink-hot);
    border-radius: 50% 10% 50% 10%;
    box-shadow: 0 0 12px rgba(255,45,168,0.55);
}

.brand-mark::after { inset: 21px 11px; transform: rotate(90deg); border-color: var(--purple); }
.brand-mark span { inset: 24px; border-radius: 50%; border-color: white; background: white; }

.brand-mark.small { width: 42px; height: 42px; margin: 0 14px 0 0; border-radius: 13px; }
.brand-mark.small::before { inset: 10px; }
.brand-mark.small::after { inset: 15px 8px; }
.brand-mark.small span { inset: 18px; }

.eyebrow, .section-label {
    margin: 0;
    color: var(--pink-hot);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.28em;
    line-height: 1.4;
}

.brand-logo {
    margin: 7px 0 0;
    font-family: "Arial Black", Impact, sans-serif;
    font-size: clamp(36px, 9vw, 52px);
    font-style: italic;
    letter-spacing: -0.07em;
    line-height: 1;
    text-shadow: 0 0 28px rgba(255,255,255,0.08);
}

.brand-logo span {
    color: transparent;
    background: linear-gradient(110deg, var(--pink-hot), var(--purple));
    background-clip: text;
    -webkit-background-clip: text;
}

.auth-copy { margin: 46px 0 24px; text-align: center; }
.auth-copy h2 { margin: 9px 0 9px; font-size: 19px; letter-spacing: 0.02em; }
.auth-copy > p:last-child { margin: 0 auto; max-width: 330px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-form { display: grid; gap: 14px; }

.code-input {
    width: 100%;
    height: 76px;
    padding: 0 20px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 16px;
    color: var(--text);
    background: rgba(4,4,10,0.6);
    box-shadow: inset 0 0 22px rgba(0,0,0,0.35);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.75em;
    text-align: center;
    text-indent: 0.75em;
    transition: border-color .25s, box-shadow .25s;
}

.code-input::placeholder { color: #5e596c; opacity: 1; }
.code-input:focus { border-color: rgba(255,45,168,0.6); box-shadow: 0 0 0 4px rgba(255,45,168,0.08), inset 0 0 24px rgba(255,45,168,0.04); }
.host-code-input { letter-spacing: 0.13em; text-indent: 0; font-size: 17px; }

.form-error { min-height: 18px; margin: -2px 0 -2px; color: #ff6d8b; font-size: 12px; text-align: center; }

.primary-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 58px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(100deg, #ed218f, #b52adb 55%, #7146f6);
    box-shadow: 0 12px 32px rgba(216, 35, 160, 0.24), inset 0 1px 0 rgba(255,255,255,0.25);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.1em;
    transition: transform .25s var(--ease), box-shadow .25s, filter .25s;
}

.primary-button::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(100deg, rgba(255,255,255,0.11), transparent 55%);
    pointer-events: none;
}

.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: saturate(1.15); box-shadow: 0 16px 42px rgba(216,35,160,0.33); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.button-arrow { font-size: 20px; font-weight: 400; }

.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 0; color: #6e687b; font-size: 10px; }
.lock-icon { position: relative; width: 10px; height: 8px; border: 1px solid #777083; border-radius: 2px; }
.lock-icon::before { content: ""; position: absolute; left: 1px; right: 1px; bottom: 6px; height: 6px; border: 1px solid #777083; border-bottom: 0; border-radius: 7px 7px 0 0; }

.control-view, .host-console { min-height: 100vh; flex-direction: column; padding: 28px clamp(24px, 4vw, 66px) 24px; }
.control-header, .host-header { display: flex; align-items: center; justify-content: space-between; width: min(100%, 1400px); margin: 0 auto 28px; }
.compact-brand { display: flex; align-items: center; }
.brand-logo.compact { margin-top: 4px; font-size: 24px; }
.compact-brand .eyebrow { font-size: 8px; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(10,10,17,0.68);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #77717e; box-shadow: 0 0 0 4px rgba(120,114,126,.08); }
.status-badge.is-online { border-color: rgba(62,243,177,.2); color: #a8f8db; }
.status-badge.is-online .status-dot { background: var(--green); box-shadow: 0 0 10px var(--green), 0 0 0 4px rgba(62,243,177,.09); animation: statusPulse 1.8s infinite; }
.status-badge.is-warning { border-color: rgba(255,175,70,.22); color: #ffd08e; }
.status-badge.is-warning .status-dot { background: #ffad42; box-shadow: 0 0 10px #ffad42; }

.icon-button, .text-button {
    min-width: 34px;
    min-height: 34px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(10,10,17,.65);
    cursor: pointer;
}
.icon-button:hover, .text-button:hover { color: #fff; border-color: rgba(255,45,168,.3); }
.text-button { padding: 0 13px; font-size: 11px; }

.control-layout { display: grid; grid-template-columns: minmax(250px, 310px) minmax(580px, 1fr); gap: 22px; width: min(100%, 1180px); margin: auto; }
.device-controls-stack { display: grid; gap: 22px; min-width: 0; }
.device-panel, .control-panel, .host-device-card, .metrics-card, .handy-safety-card, .remote-card, .log-card { border-radius: var(--radius); }
.device-panel { align-self: start; padding: 25px 18px 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 5px 19px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 18px; }
.panel-count { color: #6f687e; font-size: 9px; font-weight: 800; letter-spacing: .13em; }

.device-tab {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 78px;
    margin: 0 0 10px;
    padding: 13px 13px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    background: rgba(5,5,10,.36);
    text-align: left;
}
.device-tab.is-selected { border-color: rgba(255,45,168,.35); background: linear-gradient(100deg, rgba(255,45,168,.1), rgba(140,82,255,.06)); box-shadow: inset 3px 0 var(--pink); }
.device-tab.is-disabled { opacity: .44; }
.handy-device-tab { border-color: rgba(82,220,255,.25) !important; background: linear-gradient(100deg, rgba(82,220,255,.07), rgba(140,82,255,.06)) !important; box-shadow: inset 3px 0 var(--cyan) !important; }
.device-status-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #5d5865; box-shadow: 0 0 0 4px rgba(120,114,126,.06); }
.device-status-dot.is-online { background: var(--green); box-shadow: 0 0 10px var(--green), 0 0 0 4px rgba(62,243,177,.08); }
.device-icon { position: relative; flex: 0 0 44px; height: 44px; margin-right: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.025); }
.ufo-icon::before, .ufo-icon::after { content: ""; position: absolute; top: 13px; width: 9px; height: 17px; border: 1px solid var(--pink-hot); border-radius: 8px 8px 4px 4px; box-shadow: 0 0 8px rgba(255,45,168,.3); }
.ufo-icon::before { left: 9px; transform: rotate(-12deg); }.ufo-icon::after { right: 9px; transform: rotate(12deg); }
.handy-icon::before { content: ""; position: absolute; width: 11px; height: 25px; left: 16px; top: 8px; border: 1px solid #8d8798; border-radius: 7px 7px 3px 3px; transform: rotate(14deg); }
.device-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.device-copy strong { font-size: 13px; letter-spacing: .04em; }
.device-copy small { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.selected-check { margin-left: auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: white; background: linear-gradient(135deg,var(--pink),var(--purple)); font-size: 11px; }
.soon-chip { margin-left: auto; padding: 4px 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; font-size: 8px; white-space: nowrap; }
.device-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; padding: 17px 4px 2px; border-top: 1px solid rgba(255,255,255,.06); }
.device-meta div { display: flex; flex-direction: column; gap: 5px; }.device-meta span { color: #686274; font-size: 7px; letter-spacing: .15em; }.device-meta strong { font-size: 9px; letter-spacing: .12em; }

.control-panel { position: relative; overflow: hidden; padding: 27px 34px 28px; }
.control-panel::before { content: ""; position: absolute; top: -180px; left: calc(50% - 210px); width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(216,39,171,.10), transparent 67%); pointer-events: none; }
.host-notice { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 35px; margin-bottom: 22px; border: 1px solid rgba(255,176,64,.16); border-radius: 10px; color: #d8b579; background: rgba(255,176,64,.045); font-size: 10px; }
.host-notice.is-online { color: #93d6c0; border-color: rgba(62,243,177,.14); background: rgba(62,243,177,.035); }
.notice-icon { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; font-weight: 800; }
.intensity-heading, .pattern-heading { position: relative; display: flex; align-items: center; justify-content: space-between; }
.intensity-heading h2, .pattern-heading h2 { margin: 4px 0 0; font-size: 17px; }
.run-badge { display: inline-flex; align-items: center; gap: 7px; color: #777181; font-size: 9px; letter-spacing: .12em; }
.run-badge span { width: 7px; height: 7px; border-radius: 50%; background: #777181; }
.run-badge.is-running { color: var(--pink-hot); }.run-badge.is-running span { background: var(--pink-hot); box-shadow: 0 0 11px var(--pink); animation: statusPulse 1.3s infinite; }

.intensity-control { position: relative; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 20px; width: min(100%, 550px); margin: 0 auto; }
.step-button { position: relative; z-index: 2; width: 62px; height: 62px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; color: #d9d3e3; background: linear-gradient(145deg, rgba(31,28,47,.9), rgba(10,10,17,.9)); box-shadow: 0 10px 28px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.05); cursor: pointer; font-size: 28px; font-weight: 200; transition: .2s var(--ease); }
.step-button:hover { color: #fff; border-color: rgba(255,45,168,.45); box-shadow: 0 0 28px rgba(255,45,168,.12); transform: scale(1.05); }
.intensity-orbit { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; height: 230px; }
.orbit-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%,-50%); }
.ring-one { width: 190px; height: 190px; border: 1px solid rgba(255,45,168,.24); box-shadow: inset 0 0 40px rgba(255,45,168,.05), 0 0 40px rgba(255,45,168,.05); }
.ring-two { width: 158px; height: 158px; border: 1px dashed rgba(140,82,255,.25); animation: orbitSpin 22s linear infinite; }
.intensity-orbit::before, .intensity-orbit::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%,-50%); }
.intensity-orbit::before { width: 130px; height: 130px; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.06), rgba(255,45,168,.08) 45%, rgba(9,8,17,.5)); box-shadow: 0 0 45px rgba(217,38,174,.13); }
.intensity-orbit::after { width: 5px; height: 5px; margin: -95px 0 0 -3px; background: var(--pink-hot); box-shadow: 0 0 13px var(--pink); }
.intensity-value { position: relative; z-index: 2; display: flex; align-items: flex-start; line-height: 1; }
.intensity-value strong { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(66px, 7vw, 84px); letter-spacing: -.08em; text-shadow: 0 0 34px rgba(255,255,255,.1); }
.intensity-value span { margin: 9px 0 0 7px; color: var(--pink-hot); font-size: 18px; font-weight: 800; }
.intensity-orbit small { position: relative; z-index: 2; margin-top: 8px; color: #746e7e; font-size: 8px; font-weight: 800; letter-spacing: .2em; }

.slider-wrap { width: min(100%, 590px); margin: -1px auto 23px; }
.slider-labels { display: flex; justify-content: space-between; margin-bottom: 9px; color: #66606e; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.neon-slider { --range-progress: 50%; width: 100%; height: 20px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.neon-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--pink) 0, var(--purple) var(--range-progress), #282432 var(--range-progress), #282432 100%); box-shadow: 0 0 12px rgba(255,45,168,.22); }
.neon-slider::-moz-range-track { height: 4px; border-radius: 99px; background: #282432; }.neon-slider::-moz-range-progress { height: 4px; border-radius: 99px; background: linear-gradient(90deg,var(--pink),var(--purple)); }
.neon-slider::-webkit-slider-thumb { width: 19px; height: 19px; margin-top: -8px; appearance: none; border: 4px solid #fff; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(255,45,168,.25),0 0 18px var(--pink); }
.neon-slider::-moz-range-thumb { width: 13px; height: 13px; border: 4px solid #fff; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(255,45,168,.25),0 0 18px var(--pink); }

.transport-controls { display: flex; align-items: center; flex-direction: column; gap: 9px; }
.action-toggle-button { display: flex; align-items: center; justify-content: center; gap: 24px; width: 100%; min-height: 88px; padding: 14px 28px; border: 1px solid rgba(255,45,168,.4); border-radius: 18px; color: #fff; background: linear-gradient(100deg, rgba(235,34,148,.95), rgba(128,59,234,.96)); box-shadow: 0 16px 38px rgba(202,38,159,.24), inset 0 1px rgba(255,255,255,.18); cursor: pointer; transition: .24s var(--ease); }
.action-toggle-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); box-shadow: 0 20px 46px rgba(202,38,159,.32); }
.action-toggle-button.is-running { border-color: rgba(255,61,104,.62); background: linear-gradient(100deg, #f02f5c, #b2184d 58%, #6e163f); box-shadow: 0 16px 40px rgba(255,61,104,.25), inset 0 1px rgba(255,255,255,.16); }
.action-toggle-button:disabled { opacity: .5; cursor: wait; }
.action-copy { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; min-width: 210px; text-align: left; }
.action-copy strong { font-size: 24px; letter-spacing: .16em; line-height: 1; }
.action-copy small { color: rgba(255,255,255,.68); font-size: 9px; letter-spacing: .07em; }
.emergency-stop-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 126px; min-height: 32px; padding: 5px 13px; border: 1px solid rgba(255,61,104,.3); border-radius: 999px; color: #cd8295; background: rgba(255,61,104,.035); cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .08em; transition: .2s; }
.emergency-stop-button:hover:not(:disabled) { color: #fff; border-color: var(--red); background: rgba(255,61,104,.12); box-shadow: 0 0 22px rgba(255,61,104,.12); }
.emergency-stop-button .stop-icon { width: 8px; height: 8px; border-radius: 2px; }
.play-icon, .stop-icon { display: block; flex: 0 0 auto; }
.play-icon { width: 0; height: 0; margin-left: 4px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid white; filter: drop-shadow(0 0 5px rgba(255,255,255,.5)); }
.stop-icon { width: 13px; height: 13px; border-radius: 3px; background: var(--red); box-shadow: 0 0 10px rgba(255,61,104,.4); }
.action-toggle-button .play-icon { border-top-width: 12px; border-bottom-width: 12px; border-left-width: 19px; }
.action-toggle-button .stop-icon { width: 22px; height: 22px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.42); }

.pattern-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid rgba(255,255,255,.065); }
.pattern-heading > span { color: #6d6679; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.pattern-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 15px; }
.pattern-button { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 60px; padding: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; color: var(--muted-strong); background: rgba(6,6,12,.43); cursor: pointer; text-align: left; transition: .2s; }
.pattern-button:hover { border-color: rgba(255,45,168,.25); background: rgba(255,45,168,.035); }
.pattern-button.is-selected { border-color: rgba(255,45,168,.38); background: linear-gradient(110deg,rgba(255,45,168,.1),rgba(140,82,255,.06)); box-shadow: inset 0 -2px var(--pink); color: #fff; }
.pattern-button strong { font-size: 10px; }.pattern-button small { color: #716b7d; font-size: 8px; }
.pattern-direction, .tongue-icon { grid-row: 1 / 3; position: relative; display: block; width: 30px; height: 30px; }
.pattern-direction::before { content: ""; position: absolute; left: 14px; top: 4px; width: 2px; height: 20px; border-radius: 3px; background: linear-gradient(var(--pink-hot), var(--purple)); box-shadow: 0 0 7px rgba(255,45,168,.65); }
.pattern-direction::after { content: ""; position: absolute; left: 10px; bottom: 5px; width: 8px; height: 8px; border-right: 2px solid var(--purple); border-bottom: 2px solid var(--purple); transform: rotate(45deg); }
.direction-up { transform: rotate(180deg); }
.tongue-icon { width: 24px; height: 28px; margin-left: 3px; border: 2px solid var(--pink-hot); border-top-width: 1px; border-radius: 9px 9px 12px 12px; background: linear-gradient(160deg, rgba(255,88,193,.42), rgba(255,45,168,.12)); box-shadow: 0 0 10px rgba(255,45,168,.25), inset 0 -4px 8px rgba(140,82,255,.18); transform: rotate(8deg); }
.tongue-icon::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 2px; width: 1px; background: rgba(116,17,76,.72); border-radius: 2px; }
.tongue-icon::after { content: ""; position: absolute; left: 4px; right: 4px; top: -3px; height: 7px; border-top: 2px solid var(--pink-hot); border-radius: 50%; }

/* HANDY 2 user control */
[hidden] { display: none !important; }
.handy-control-panel { position: relative; overflow: hidden; padding: 27px 34px 28px; border-radius: var(--radius); }
.handy-control-panel::before { content: ""; position: absolute; right: -120px; bottom: -150px; width: 350px; height: 350px; border-radius: 50%; background: radial-gradient(circle, rgba(82,220,255,.08), transparent 68%); pointer-events: none; }
.handy-panel-header, .handy-speed-readout { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.handy-panel-header h2 { margin: 5px 0 0; font-size: 18px; }
.handy-mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 23px 0 20px; padding: 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 15px; background: rgba(5,5,10,.4); }
.handy-mode-button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-height: 52px; border: 1px solid transparent; border-radius: 11px; color: #777181; background: transparent; cursor: pointer; transition: .2s; }
.handy-mode-button strong { font-size: 11px; letter-spacing: .15em; }.handy-mode-button small { font-size: 8px; }
.handy-mode-button.is-selected { border-color: rgba(82,220,255,.28); color: #fff; background: linear-gradient(110deg,rgba(82,220,255,.1),rgba(140,82,255,.08)); box-shadow: inset 0 -2px var(--cyan); }
.handy-mode-panel { position: relative; min-height: 112px; padding: 18px 19px; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; background: rgba(4,4,9,.3); }
.handy-speed-readout h3, .manual-copy h3 { margin: 5px 0 0; font-size: 15px; }
.handy-speed-readout > div:last-child { display: flex; align-items: flex-start; }.handy-speed-readout strong { font-family: "Arial Black",sans-serif; font-size: 38px; line-height: 1; }.handy-speed-readout > div:last-child span { margin: 4px 0 0 5px; color: var(--cyan); font-size: 13px; font-weight: 800; }
.handy-slider-wrap { margin: 14px auto 0; }.handy-velocity-slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--cyan) 0, var(--purple) var(--range-progress), #282432 var(--range-progress), #282432 100%); box-shadow: 0 0 12px rgba(82,220,255,.18); }.handy-velocity-slider::-webkit-slider-thumb { background: var(--cyan); box-shadow: 0 0 0 3px rgba(82,220,255,.22),0 0 18px var(--cyan); }
.manual-love-panel { min-height: 390px; padding: 18px 24px 20px; }
.manual-copy > p:last-child { max-width: 470px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.love-stage { position: relative; display: grid; grid-template-columns: 135px 1fr; align-items: center; gap: 34px; min-height: 305px; margin-top: 11px; }
.heart-layer { position: absolute; z-index: 5; left: 0; top: 0; width: 170px; height: 100%; overflow: visible; pointer-events: none; }
.burst-heart { position: absolute; left: calc(55px + var(--heart-x)); bottom: var(--heart-y); color: var(--pink-hot); font-size: var(--heart-size); line-height: 1; text-shadow: 0 0 9px rgba(255,45,168,.8); opacity: 0; animation: heartBurst 1.25s var(--ease) forwards; }
.love-meter { position: relative; width: 92px; height: 276px; margin: 0 auto; touch-action: none; cursor: ns-resize; user-select: none; }
.love-meter-track { position: absolute; left: 38px; top: 12px; bottom: 12px; width: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 99px; background: #191520; box-shadow: inset 0 0 14px rgba(0,0,0,.7), 0 0 24px rgba(255,45,168,.05); }
.love-meter-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; border-radius: inherit; background: linear-gradient(to top,#7a46f1,var(--pink),#ff75c9); box-shadow: 0 0 18px rgba(255,45,168,.45); transition: height .06s linear; }
.love-meter-thumb { position: absolute; z-index: 3; left: 18px; bottom: calc(50% - 27px); display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%,#ff79cc,#ed278f 48%,#8d2add); box-shadow: 0 0 0 7px rgba(255,45,168,.08),0 0 28px rgba(255,45,168,.42); font-size: 25px; transition: bottom .06s linear, transform .15s; }
.love-meter.is-dragging .love-meter-thumb { transform: scale(1.1); box-shadow: 0 0 0 9px rgba(255,45,168,.11),0 0 38px rgba(255,45,168,.6); }
.love-limit { position: absolute; left: 73px; color: #5f596a; font-size: 7px; font-weight: 800; }.love-limit-top { top: 9px; }.love-limit-bottom { bottom: 8px; }
.love-readouts { display: grid; gap: 14px; }.love-readouts > div { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 5px 15px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.06); border-radius: 13px; background: rgba(5,5,10,.36); }.love-readouts span { color: #777080; font-size: 8px; font-weight: 800; letter-spacing: .13em; }.love-readouts strong { font-size: 17px; }.love-readouts b { color: #fff; font-size: 22px; }.love-readouts > small { color: #6f6879; font-size: 9px; line-height: 1.5; }
.excitement-bar { grid-column: 1 / 3; height: 4px; overflow: hidden; border-radius: 99px; background: #27212e; }.excitement-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--purple),var(--pink-hot)); box-shadow: 0 0 10px var(--pink); transition: width .12s linear; }
.handy-transport { position: relative; display: flex; align-items: center; flex-direction: column; gap: 9px; margin-top: 18px; }
.handy-action-button { border-color: rgba(82,220,255,.35); background: linear-gradient(100deg,#17a5ca,#6461e8 55%,#9432d9); box-shadow: 0 16px 38px rgba(38,139,200,.2),inset 0 1px rgba(255,255,255,.18); }
.handy-action-button:hover:not(:disabled) { box-shadow: 0 20px 46px rgba(38,139,200,.27); }

@keyframes heartBurst {
    0% { opacity: 0; transform: translate(0,0) scale(.45) rotate(0); }
    16% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--heart-drift),-125px) scale(1.18) rotate(var(--heart-rotate)); }
}

.control-footer { display: flex; align-items: center; gap: 15px; width: min(100%,1180px); margin: 20px auto 0; color: #4d4858; font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.secret-version-link, .secret-version-link:visited, .secret-version-link:hover, .secret-version-link:active { color: inherit; text-decoration: none; cursor: default; }
.footer-line { flex: 1; height: 1px; background: linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,45,168,.14),rgba(255,255,255,.04)); }

.toast-region { position: fixed; z-index: 20; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(360px, calc(100% - 44px)); }
.toast { padding: 14px 16px; border: 1px solid rgba(255,255,255,.11); border-left: 3px solid var(--pink); border-radius: 12px; color: #ded9e8; background: rgba(16,14,25,.96); box-shadow: 0 12px 38px rgba(0,0,0,.4); font-size: 11px; line-height: 1.55; animation: toastIn .35s var(--ease); }
.toast.is-error { border-left-color: var(--red); }.toast.is-success { border-left-color: var(--green); }

/* Host console */
.host-login-card { width: min(100%, 460px); }
.host-shell { width: 100%; }
.host-console { width: 100%; }
.browser-warning { width: min(100%,1180px); margin: 0 auto 18px; padding: 12px 15px; border: 1px solid rgba(255,175,70,.22); border-radius: 12px; color: #ffd08e; background: rgba(255,175,70,.06); font-size: 11px; }
.host-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(100%,1180px); margin: auto; }
.host-device-card, .metrics-card, .handy-safety-card, .remote-card, .log-card { padding: 24px; }
.host-device-visual { display: flex; align-items: center; gap: 20px; min-height: 120px; margin: 8px 0 18px; padding: 18px; border: 1px solid rgba(255,255,255,.055); border-radius: 17px; background: rgba(4,4,9,.3); }
.dual-device { display: flex; align-items: center; gap: 6px; }
.dual-device span { position: relative; display: block; width: 30px; height: 62px; border: 1px solid rgba(255,45,168,.5); border-radius: 17px 17px 8px 8px; background: linear-gradient(160deg,rgba(255,45,168,.22),rgba(140,82,255,.04)); box-shadow: 0 0 18px rgba(255,45,168,.12); transform: rotate(-7deg); }
.dual-device span:nth-child(2) { transform: rotate(7deg); }
.host-device-visual p { margin: 0 0 7px; font-size: 12px; font-weight: 800; letter-spacing: .08em; }.host-device-visual small { color: var(--muted); font-size: 10px; }
.bluetooth-button { width: 100%; }.bluetooth-symbol { font-size: 18px; }
.connection-help { margin: 12px 3px 0; color: #6f6979; font-size: 9px; line-height: 1.6; }
.handy-device-visual { min-height: 92px; margin-bottom: 12px; }
.handy-machine-icon { position: relative; flex: 0 0 54px; height: 72px; border: 1px solid rgba(82,220,255,.3); border-radius: 17px 17px 10px 10px; background: linear-gradient(160deg,rgba(82,220,255,.16),rgba(140,82,255,.05)); box-shadow: 0 0 20px rgba(82,220,255,.08); }
.handy-machine-icon::before { content: ""; position: absolute; left: 13px; right: 13px; top: 13px; height: 11px; border: 1px solid rgba(255,255,255,.28); border-radius: 4px; background: rgba(5,5,10,.5); }
.handy-machine-icon span { position: absolute; left: 20px; top: 30px; width: 12px; height: 29px; border: 1px solid var(--cyan); border-radius: 7px; box-shadow: 0 0 9px rgba(82,220,255,.28); }
.connection-key-field { display: grid; gap: 7px; margin-bottom: 10px; }.connection-key-field > span { color: #6e6878; font-size: 8px; font-weight: 800; letter-spacing: .14em; }.connection-key-field input { width: 100%; height: 43px; padding: 0 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; color: #fff; background: rgba(4,4,9,.5); font-size: 12px; letter-spacing: .08em; }.connection-key-field input:focus { border-color: rgba(82,220,255,.5); box-shadow: 0 0 0 3px rgba(82,220,255,.06); }
.handy-connect-button { background: linear-gradient(100deg,#169dc2,#6161e4 58%,#8b36d2); box-shadow: 0 12px 32px rgba(38,139,200,.2), inset 0 1px 0 rgba(255,255,255,.2); }.link-symbol { font-size: 20px; }
.metric-primary { display: grid; grid-template-columns: auto 1fr; align-items: start; justify-content: center; width: max-content; margin: 21px auto 24px; }.metric-primary strong { font-family: "Arial Black",sans-serif; font-size: 72px; letter-spacing: -.07em; line-height: .95; }.metric-primary > span { margin: 7px; color: var(--pink-hot); font-size: 18px; font-weight: 800; }.metric-primary small { grid-column: 1 / 3; margin-top: 8px; color: #726c7d; font-size: 8px; font-weight: 800; letter-spacing: .18em; text-align: center; }
.motor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.motor-grid > div { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 15px; border: 1px solid rgba(255,255,255,.06); border-radius: 13px; background: rgba(4,4,9,.26); }.motor-grid span { color: #6e6878; font-size: 8px; letter-spacing: .12em; }.motor-grid strong { font-size: 14px; }.motor-grid small { grid-column: 1 / 3; color: var(--pink-hot); font-size: 8px; }
.motion-scale-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 9px 5px 14px; }.motion-scale-heading > div:first-child { display: flex; align-items: flex-start; }.motion-scale-heading > div:first-child strong { font-family: "Arial Black",sans-serif; font-size: 50px; letter-spacing: -.06em; line-height: 1; }.motion-scale-heading > div:first-child span { margin: 5px; color: var(--cyan); font-size: 15px; font-weight: 800; }.motion-scale-heading > div:last-child { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }.motion-scale-heading > div:last-child b { color: #8aeaff; font-size: 14px; }.motion-scale-heading small { max-width: 150px; color: #716b7d; font-size: 8px; text-align: right; }
.motion-comparison { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: 8px; margin-top: 17px; padding: 16px; border: 1px solid rgba(255,255,255,.06); border-radius: 15px; background: rgba(4,4,9,.3); }
.motion-meter { display: grid; grid-template-columns: 1fr 18px; grid-template-rows: auto 1fr; gap: 7px 10px; height: 146px; }.motion-meter > span { grid-column: 1 / 3; color: #756e80; font-size: 8px; font-weight: 800; letter-spacing: .1em; }.motion-meter-track { position: relative; grid-row: 2; width: 20px; height: 112px; margin: auto; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 99px; background: #19151f; }.motion-meter-track i { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; border-radius: inherit; background: linear-gradient(to top,var(--purple),var(--pink)); box-shadow: 0 0 12px rgba(255,45,168,.3); transition: height .18s var(--ease); }.motion-meter.is-output .motion-meter-track i { background: linear-gradient(to top,#277ca2,var(--cyan)); box-shadow: 0 0 12px rgba(82,220,255,.3); }.motion-meter strong { align-self: center; font-size: 11px; }.motion-meter strong b { font-size: 16px; }.motion-arrow { color: #676071; font-size: 18px; text-align: center; }
.handy-live-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: #696272; font-size: 7px; letter-spacing: .08em; }.handy-live-meta b { margin-left: 4px; color: #bcb5c9; }
.toggle { position: relative; display: inline-block; width: 48px; height: 26px; cursor: pointer; }.toggle input { position: absolute; opacity: 0; }.toggle span { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.11); border-radius: 20px; background: #24202d; transition: .2s; }.toggle span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #827b8d; transition: .2s var(--ease); }.toggle input:checked + span { border-color: rgba(62,243,177,.3); background: rgba(62,243,177,.12); }.toggle input:checked + span::before { transform: translateX(22px); background: var(--green); box-shadow: 0 0 12px rgba(62,243,177,.45); }
.remote-card > p { margin: -5px 5px 18px; color: var(--muted); font-size: 11px; }
.client-count { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.06); border-radius: 14px; background: rgba(4,4,9,.26); }.client-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(82,220,255,.22); border-radius: 50%; color: var(--cyan); box-shadow: 0 0 18px rgba(82,220,255,.06); }.client-count div { display: flex; flex-direction: column; }.client-count strong { font-size: 23px; }.client-count small { color: #716a7d; font-size: 8px; letter-spacing: .13em; }
.force-stop-button { display: flex; align-items: center; justify-content: center; gap: 15px; width: 100%; min-height: 68px; margin-top: 14px; border: 1px solid rgba(255,61,104,.46); border-radius: 14px; color: white; background: linear-gradient(110deg,rgba(255,61,104,.22),rgba(80,9,31,.28)); box-shadow: inset 0 0 25px rgba(255,61,104,.04); cursor: pointer; text-align: left; transition: .2s; }.force-stop-button:hover { border-color: var(--red); background-color: rgba(255,61,104,.1); box-shadow: 0 0 30px rgba(255,61,104,.12); }.force-stop-button .stop-icon { width: 18px; height: 18px; }.force-stop-button > span:last-child { display: flex; flex-direction: column; gap: 5px; }.force-stop-button strong { font-size: 13px; letter-spacing: .11em; }.force-stop-button small { color: #ab8190; font-size: 8px; }
.log-card { min-height: 320px; }
.activity-log { height: 236px; overflow-y: auto; margin: 0; padding: 0 4px 0 0; list-style: none; scrollbar-width: thin; scrollbar-color: #3e3549 transparent; }.activity-log li { position: relative; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 11px; min-height: 45px; border-bottom: 1px solid rgba(255,255,255,.05); color: #beb7c9; font-size: 10px; }.activity-log li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #81798c; }.activity-log li[data-type="command"]::before { background: var(--pink); box-shadow: 0 0 8px var(--pink); }.activity-log li[data-type="safety"]::before { background: var(--red); box-shadow: 0 0 8px var(--red); }.activity-log li[data-type="host"]::before { background: var(--cyan); }.activity-log time { color: #615b6d; font-size: 8px; }.activity-log .empty-log { display: flex; justify-content: center; color: #635d6d; }.activity-log .empty-log::before { display: none; }

@keyframes viewIn { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
@keyframes ambientFloat { to { transform: translate(45px,25px) scale(1.08); } }
@keyframes orbitSpin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes statusPulse { 50% { opacity: .45; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 920px) {
    .control-layout { grid-template-columns: 1fr; }
    .device-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .device-panel .panel-heading, .device-meta { grid-column: 1 / 3; }
    .device-tab { margin: 0; }
    .host-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .auth-card { padding: 42px 24px 30px; }
    .control-view, .host-console { padding: 20px 14px; }
    .control-header, .host-header { align-items: flex-start; }
    .status-badge { padding: 0 9px; }.header-actions .status-badge { max-width: 150px; }
    .control-panel { padding: 20px 16px; }
    .device-panel { grid-template-columns: 1fr; }.device-panel .panel-heading, .device-meta { grid-column: 1; }
    .intensity-control { grid-template-columns: 48px 1fr 48px; gap: 5px; }
    .step-button { width: 45px; height: 45px; font-size: 21px; }
    .intensity-orbit { height: 210px; }.ring-one { width: 174px; height: 174px; }.ring-two { width: 145px; height: 145px; }.intensity-orbit::after { margin-top: -87px; }
    .action-toggle-button { min-height: 80px; gap: 18px; }.action-copy { min-width: 190px; }.action-copy strong { font-size: 21px; }
    .pattern-grid { grid-template-columns: 1fr; }
    .pattern-button { min-height: 55px; }
    .handy-control-panel { padding: 20px 16px; }
    .love-stage { grid-template-columns: 112px 1fr; gap: 12px; }.manual-love-panel { padding: 17px 12px; }.love-readouts > div { padding: 12px 10px; }
    .control-footer { display: none; }
    .brand-logo.compact { font-size: 20px; }
    .compact-brand .eyebrow { font-size: 6px; }.brand-mark.small { width: 36px; height: 36px; }
    .metric-primary strong { font-size: 58px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
