:root {
    --p: #a855f7;
    --c: #00eaff;
    --warn: #ffe66d;
    --err: #ff5478;
    --bg: #080b16;
    --glass: rgba(12, 18, 35, .18);
    --glass-strong: rgba(8, 12, 25, .38);
    --border: rgba(255, 255, 255, .15);
    --text: #f4f7ff;
    --muted: #9ba9c5;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0; width: 100%; height: 100%; min-height: 100%;
    overflow: hidden; background: var(--bg); color: var(--text);
    font-family: 'Inter', 'Segoe UI', sans-serif; overscroll-behavior: none;
}
body { display: flex; align-items: center; justify-content: center; position: relative; isolation: isolate; }
button, textarea { font-family: inherit; }
button { touch-action: manipulation; }
.video-background { position: fixed; inset: 0; z-index: -5; overflow: hidden; background: #080b16; }
.video-background video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center; opacity: .85;
}
.video-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(5, 9, 22, .12), rgba(13, 8, 30, .07), rgba(3, 12, 24, .16));
    backdrop-filter: blur(.5px); -webkit-backdrop-filter: blur(.5px);
}
.cyber-grid {
    position: fixed; inset: 0; z-index: -4; pointer-events: none; opacity: .22;
    background-image: linear-gradient(rgba(0, 234, 255, .075) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(168, 85, 247, .075) 1px, transparent 1px);
    background-size: 36px 36px; mask-image: linear-gradient(to bottom, black, transparent 95%);
}
.ambient {
    position: fixed; width: 280px; height: 280px; border-radius: 50%; filter: blur(100px);
    opacity: .12; z-index: -3; pointer-events: none; animation: ambientMove 12s ease-in-out infinite alternate;
}
.ambient.one { top: -100px; left: -100px; background: var(--c); }
.ambient.two { right: -100px; bottom: -100px; background: var(--p); animation-delay: -5s; }
@keyframes ambientMove { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 35px) scale(1.2); } }
.topbar { position: fixed; top: 14px; right: 16px; z-index: 100; display: flex; align-items: center; gap: 10px; }
.status-pill {
    display: flex; align-items: center; gap: 7px; padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.13); border-radius: 30px;
    background: rgba(8, 15, 30, .15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #dceaff;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #35ffb0; box-shadow: 0 0 12px #35ffb0; }
.menu-toggle {
    width: 43px; height: 43px; border: 1px solid rgba(0, 234, 255, .3); border-radius: 14px;
    color: white; background: rgba(10, 20, 40, .20); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-size: 20px; cursor: pointer; box-shadow: 0 0 22px rgba(0, 234, 255, .08); transition: .25s;
}
.menu-toggle:hover { border-color: var(--c); box-shadow: 0 0 22px rgba(0, 234, 255, .22); transform: translateY(-2px); }
.menu-panel {
    position: absolute; top: 53px; right: 0; width: 230px; padding: 12px;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 19px;
    background: rgba(8, 13, 28, .48); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(.97); transform-origin: top right; transition: .22s ease;
}
.menu-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.menu-heading { padding: 9px 10px 13px; margin-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.menu-heading strong { display: block; font-size: 13px; letter-spacing: 1px; color: var(--c); }
.menu-heading span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.menu-link {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 10px;
    border-radius: 11px; color: #eaf0ff; text-decoration: none; font-size: 12px; font-weight: 600;
    background: transparent; border: none; text-align: left; cursor: pointer; transition: .2s;
}
.menu-link:hover { background: rgba(0, 234, 255, .09); color: var(--c); }
.menu-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .07); font-size: 15px; }
.app-core {
    width: min(94%, 650px); height: min(88dvh, 850px); min-height: 420px; margin-top: 26px; padding: 16px;
    display: flex; flex-direction: column; position: relative; overflow: hidden;
    background: rgba(12, 18, 35, .13); border: 1px solid rgba(255, 255, 255, .18); border-radius: 25px;
    backdrop-filter: blur(5px) saturate(125%); -webkit-backdrop-filter: blur(5px) saturate(125%);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .20), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 45px rgba(0, 234, 255, .035);
}
.app-core::before {
    content: ""; position: absolute; top: 0; left: 15%; width: 70%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--c), var(--p), transparent); opacity: .85;
}
.title-box { flex-shrink: 0; text-align: center; margin-bottom: 15px; padding-top: 1px; }
.brand-line { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 7px; }
.brand-symbol { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(0, 234, 255, .38); border-radius: 10px; color: var(--c); background: rgba(0, 234, 255, .08); font-size: 17px; box-shadow: 0 0 18px rgba(0, 234, 255, .1); }
.title-box h1 {
    margin: 0; font-size: clamp(20px, 4vw, 26px); line-height: 1.2; font-weight: 900; letter-spacing: 2px; text-transform: uppercase;
    background: linear-gradient(100deg, #fff, var(--c), #d8a5ff, #fff); background-size: 220% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: titleFlow 6s linear infinite;
}
@keyframes titleFlow { to { background-position: 220% center; } }
.title-box > span { display: block; color: #bdc9df; font-size: 9px; letter-spacing: 2.2px; font-weight: 700; }
.subtitle { margin-top: 7px; color: #8d9bb8; font-size: 10px; }
.workspace {
    flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; flex-direction: column;
    border-radius: 17px; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(2, 7, 17, .12); box-shadow: inset 0 0 35px rgba(0, 0, 0, .08);
}
.workspace-head {
    flex-shrink: 0; height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px;
    background: rgba(255, 255, 255, .025); border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #718099; }
.window-dots i:first-child { background: #ff647c; }
.window-dots i:nth-child(2) { background: #ffd166; }
.window-dots i:nth-child(3) { background: #4dffc3; }
.workspace-label { color: #a7b4cd; font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
textarea {
    flex: 1; min-height: 0; width: 100%; padding: 14px; border: none; outline: none; resize: none;
    background: transparent; color: #8dffd6; caret-color: var(--c); font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px; line-height: 1.65; white-space: pre; overflow: auto; -webkit-overflow-scrolling: touch; tab-size: 4;
}
textarea::placeholder { color: rgba(205, 219, 242, .48); line-height: 1.8; }
textarea::-webkit-scrollbar, #previewFrame::-webkit-scrollbar { width: 5px; }
textarea::-webkit-scrollbar-thumb { background: rgba(0, 234, 255, .35); border-radius: 10px; }
#previewFrame { display: none; width: 100%; height: 100%; min-height: 0; border: none; background: white; }
.god-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0; flex-shrink: 0; }
.btn-god {
    position: relative; overflow: hidden; min-height: 46px; padding: 12px 7px; border-radius: 13px;
    font-size: 10px; font-weight: 900; letter-spacing: .6px; border: 1px solid rgba(255,255,255,.18);
    cursor: pointer; transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-god::after { content: ""; position: absolute; top: -100%; left: -50%; width: 35%; height: 300%; background: rgba(255, 255, 255, .25); transform: rotate(25deg); transition: left .45s; }
.btn-god:hover::after { left: 130%; }
.btn-god:active { transform: scale(.97); }
.btn-enc { color: white; background: linear-gradient(120deg, rgba(145,60,240,.42), rgba(192,77,255,.34)); box-shadow: 0 6px 22px rgba(168, 85, 247, .12); }
.btn-dec { color: #eaffff; background: linear-gradient(120deg, rgba(0,234,255,.36), rgba(109,255,221,.29)); box-shadow: 0 6px 22px rgba(0, 234, 255, .10); }
.btn-god:hover { filter: brightness(1.12); box-shadow: 0 7px 25px rgba(0, 234, 255, .13); }
.tool-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; flex-shrink: 0; }
.btn-t {
    min-width: 0; padding: 11px 3px; color: #dce6f8; background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 11px; font-size: 9px; font-weight: 800; cursor: pointer; transition: .2s;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.btn-t:hover { color: var(--c); background: rgba(0, 234, 255, .07); border-color: rgba(0, 234, 255, .35); transform: translateY(-2px); }
.btn-t:active { transform: scale(.96); }
.btn-t.active { color: #f7fbff; background: rgba(255, 230, 109, .32); border-color: rgba(255, 230, 109, .65); }
.btn-delete { color: #ff8198; }
.console-log {
    flex-shrink: 0; margin-top: 11px; padding: 10px 11px; min-height: 34px;
    border: 1px solid rgba(255, 255, 255, .08); border-left: 3px solid var(--c); border-radius: 9px;
    background: rgba(0, 0, 0, .15); color: #bdcbe2; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.console-log::first-letter { color: var(--c); }
.az-scanner {
    position: absolute; left: 0; top: -5px; width: 100%; height: 2px; z-index: 10; display: none; pointer-events: none;
    background: white; box-shadow: 0 0 12px var(--c), 0 0 28px var(--p); animation: scanAZ 1s ease-in-out infinite alternate;
}
@keyframes scanAZ { from { top: 0; } to { top: 100%; } }
.footer { flex-shrink: 0; padding-top: 10px; display: flex; justify-content: space-between; gap: 8px; color: #8391ad; font-size: 9px; }
.footer b { color: #c4d1e9; font-weight: 700; }
.footer .version { color: var(--c); }
@media (max-width: 520px) {
    .topbar { top: 10px; right: 10px; }
    .status-pill { padding: 8px 10px; font-size: 9px; }
    .menu-toggle { width: 40px; height: 40px; border-radius: 12px; }
    .app-core { width: calc(100% - 20px); height: calc(100dvh - 75px); min-height: 390px; margin-top: 45px; padding: 12px; border-radius: 21px; }
    .title-box { margin-bottom: 12px; }
    .title-box h1 { font-size: 22px; letter-spacing: 1.5px; }
    .title-box > span { font-size: 8px; letter-spacing: 1.6px; }
    .subtitle { font-size: 9px; }
    .workspace { border-radius: 13px; }
    textarea { padding: 11px; font-size: 11px; }
    .god-controls { gap: 8px; margin: 10px 0; }
    .btn-god { min-height: 43px; padding: 10px 4px; font-size: 9px; letter-spacing: 0; }
    .tool-bar { gap: 5px; }
    .btn-t { padding: 11px 1px; font-size: 8px; border-radius: 9px; }
    .console-log { margin-top: 9px; padding: 9px; font-size: 9px; }
    .footer { font-size: 8px; }
    .ambient { opacity: .10; }
    .video-background video { object-position: center; }
}
@media (max-height: 650px) {
    .app-core { height: calc(100dvh - 65px); min-height: 0; margin-top: 45px; padding: 10px; }
    .title-box { margin-bottom: 8px; }
    .title-box h1 { font-size: 19px; }
    .brand-symbol { width: 27px; height: 27px; }
    .subtitle { margin-top: 4px; }
    .god-controls { margin: 8px 0; }
    .btn-god { min-height: 38px; padding: 8px 4px; }
    .btn-t { padding: 8px 2px; }
    .console-log { margin-top: 7px; padding: 7px; }
    .footer { padding-top: 7px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
