/* =========================================================================
   🎛️ 1. HỆ THỐNG BIẾN TOÀN CỤC & THEMES (GOM GỌN CHỐNG TRÙNG LẶP TỪ EGS_UI & MAIN)
   ========================================================================= */
:root {
    /* Biến vị trí Layout (Chuẩn main.css) */
    --panel-left-offset: 36vw;
    --mobile-top-offset: 35vh;
    --mobile-bot-offset: 11vh;

    /* Biến Màu Sắc Cơ Sở & Role Themes (egs_ui.min.css) */
    --black-gnal: rgba(26, 26, 26, 1);
    --white-gnal: #DFDFDF;
    --glass: 1px 1px 8px -1px rgba(0, 0, 0, 0.25);
    --bgimg: rgba(207, 207, 207, 1);
    --techprimary: rgba(255, 230, 0, 1);
    --techsecond: rgba(255, 51, 66, 1);
    --techprimary-neutral: rgba(18, 18, 18, 1);
    --techsecond-neutral: rgba(33, 33, 33, 1);
    --rigprimary: rgba(168, 85, 247, 1);
    --rigsecond: rgba(16, 185, 129, 1);
    --rigprimary-neutral: rgba(15, 23, 42, 1);
    --rigsecond-neutral: rgba(30, 27, 75, 1);
    --modellingprimary: rgba(0, 229, 255, 1);
    --modellingsecond: rgba(255, 107, 0, 1);
    --modellingprimary-neutral: rgba(24, 26, 32, 1);
    --modellingsecond-neutral: rgba(38, 41, 50, 1);

    /* Biến Màu Sắc Chủ Đạo & Hệ Thống (Đồng bộ với knob.js) */
    --primary: #00f5ff;
    --primary-hover: #008287;
    --secondary: #ff6b00;
    --secondary-hover: #a94700;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ca8a04;
    --info: #0284c7;
    --light: #f8fafc;
    --dark: #0f172a;
    --bg-color: #181A20;
    --bg-surface: #262932;
    --border-color: #cbd5e1;
    --glass-bg: rgba(255, 255, 255, .65);
    --glass-border: rgba(255, 255, 255, .4);
    --glass-blur: blur(16px);
    --glow-primary: 0 0 20px rgba(0, 245, 255, 0.65);
    --glow-accent: 0 0 25px rgba(255, 107, 0, .5);
    --modal-bg: rgba(15, 23, 42, .6);
    --card-bg: #ffffff;

    /* Biến Typography & Khoảng cách UI */
    --text-color: #DFDFDF;
    --text-muted: #868686;
    --sub-body-font-family: "Chakra Petch", Helvetica;
    --body-text-font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
    --tiltle-font-family: "Chakra Petch", "Segoe UI", Tahoma, sans-serif;
    --heading-1-font-family: "Chakra Petch", Helvetica;
    --spacing-xs: .25rem;
    --spacing-sm: .5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
    --container-max: 1200px;
    --grid-gap: 1.5rem;
    --border-radius: .5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / .1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / .15);

    /* Biến Trạng Thái Custom Cursor (Mặc định - Tín hiệu - Thông báo) */
    --cursor-primary: var(--primary);
    --cursor-glow: rgba(0, 245, 255, 0.65);
    --cursor-error: #ff3333;
    --cursor-success: #00ff66;
}

/* Dành cho Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(11, 15, 25, 0.7);
}

/* Dành cho Chrome, Safari, Edge (WebKit) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    cursor: none;
}

::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    cursor: none;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary), inset 0 0 4px rgba(255, 255, 255, 0.6);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    cursor: none;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
    box-shadow: 0 0 14px var(--primary), 0 0 22px transparent;
    cursor: none;
}

body.dark-mode,
[data-theme=dark] {
    --text-color: #DFDFDF;
    --text-muted: #868686;
    --bg-color: #0b0f19;
    --bg-surface: #111827;
    --border-color: #1f2937;
    --glass-bg: rgba(17, 24, 39, .7);
    --glass-border: rgba(255, 255, 255, .08);
    --modal-bg: rgba(0, 0, 0, .8);
    --card-bg: #111827;
}

body.theme-technical {
    --primary: #ff3342 !important;
    --secondary: #ffe600 !important;
    --bg-color: #121212 !important;
    --bg-surface: #212121 !important;
}

body.theme-artist {
    --primary: #ffe600 !important;
    --secondary: #ff3342 !important;
    --bg-color: #121212 !important;
    --bg-surface: #212121 !important;
}

body.theme-rigging {
    --primary: var(--rigprimary);
    --secondary: var(--rigsecond);
    --bg-color: var(--rigprimary-neutral);
    --bg-surface: var(--rigsecond-neutral);
}

body.theme-modelling {
    --primary: var(--modellingprimary);
    --secondary: var(--modellingsecond);
    --bg-color: var(--modellingprimary-neutral);
    --bg-surface: var(--modellingsecond-neutral);
}

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

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-family: var(--body-text-font-family);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    transition: background-color .3s ease, color .3s ease;
}

/* =========================================================================
   ✨ 2. XỬ LÝ ẨN/HIỆN CHUỘT TOÀN TRANG (ĐỒNG BỘ VỚI PHÍM F2)
   ========================================================================= */
html.custom-cursor-ready,
html.custom-cursor-ready body,
html.custom-cursor-ready *,
html.custom-cursor-ready *::before,
html.custom-cursor-ready *::after {
    cursor: none !important;
}

html:not(.custom-cursor-ready) #egs-custom-cursor {
    display: none !important;
    opacity: 0 !important;
}

body::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.1' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.35'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 1;
}

body>* {
    position: relative;
    z-index: 2;
}

/* =========================================================================
   📦 3. HỆ THỐNG GRID & UI COMPONENTS (TỪ EGS_UI.MIN.CSS)
   ========================================================================= */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(var(--grid-gap)/-2);
    margin-right: calc(var(--grid-gap)/-2);
}

.col {
    flex: 1 1 0%;
    padding-left: calc(var(--grid-gap)/2);
    padding-right: calc(var(--grid-gap)/2);
}

.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    padding: calc(var(--grid-gap)/2);
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-11 {
    flex: 0 0 91.666667%;
    max-width: 91.666667%;
}

.col-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
}

.col-9 {
    flex: 0 0 75%;
    max-width: 75%;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.col-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

.col-1 {
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
}

.nav,
.nav_glass,
.nav_glow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all .3s ease;
}

.nav_glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

.nav_glow {
    box-shadow: var(--glow-primary);
    border-bottom: 1px solid var(--primary);
}

.nav-brand {
    font-family: var(--tiltle-font-family);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-items {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}

.nav-link:hover {
    color: var(--primary);
}

.btn,
.btn_glass,
.btn_glow,
.btn_par {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    padding: .6rem 1.2rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), background-color .2s, box-shadow .2s;
}

.btn,
.btn_glow {
    background-color: var(--primary);
    color: #fff;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn_glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn_glass:hover {
    background-color: #2563eb1a;
    border-color: var(--primary);
}

.btn_glow {
    box-shadow: var(--glow-primary);
}

.btn_glow:hover {
    box-shadow: var(--glow-accent);
    transform: translateY(-2px);
}

.btn_par {
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: #fff;
    will-change: transform;
}

.btn_par:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px #0003;
}

.card,
.card_glass,
.card_glow {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}

.card:hover,
.card_glass:hover,
.card_glow:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card_glass,
.form_glass,
.alert_glass,
.modal_glass,
.badge_glass,
.toast_glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.card_glow {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    background-color: var(--bg-surface);
}

.card_glass .card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
}

.card-body,
.modal-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.form-group,
.table-container {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: .875rem;
}

.form-control,
.form_glass {
    display: block;
    width: 100%;
    padding: .6rem .85rem;
    font-size: 1rem;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: border-color .2s, box-shadow .2s;
}

.form-control {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.form-control:focus,
.form_glass:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.alert,
.alert_glass,
.alert_glow {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-success {
    background-color: #16a34a1a;
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background-color: #dc26261a;
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background-color: #ca8a041a;
    border-color: var(--warning);
    color: var(--warning);
}

.alert_glass,
.badge_glass {
    color: var(--text-color);
}

.alert_glow {
    background: #2563eb1a;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--glow-primary);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal,
.modal_glass,
.modal_glow {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}

.modal_glow {
    border: 1px solid var(--primary);
    box-shadow: var(--glow-primary), var(--shadow-lg);
}

.modal-backdrop.show .modal,
.modal-backdrop.show .modal_glass,
.modal-backdrop.show .modal_glow {
    transform: translateY(0);
}

.modal-header,
.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.badge,
.badge_glass,
.badge_glow {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 50rem;
}

.badge,
.badge_glow {
    background-color: var(--primary);
    color: #fff;
}

.badge_glow {
    box-shadow: var(--glow-primary);
}

.badge-success {
    background-color: var(--success);
}

.badge-danger {
    background-color: var(--danger);
}

.badge-warning {
    background-color: var(--warning);
    color: #000;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.table,
.table_glass {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: .95rem;
}

.table th,
.table td,
.table_glass th,
.table_glass td {
    padding: .75rem var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    background-color: var(--bg-surface);
}

.table-striped tbody tr:nth-child(odd) {
    background-color: var(--bg-surface);
}

.table-hover tbody tr:hover {
    background-color: #2563eb0d;
}

.table_glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
}

.table_glass th,
.table_glass td {
    border-bottom: 1px solid var(--glass-border);
}

.table_glass th {
    background: #ffffff1a;
}

.tabs-nav {
    display: flex;
    list-style: none;
    border-bottom: 2px solid var(--border-color);
    gap: var(--spacing-md);
}

.tab-item {
    padding: .5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content-item {
    display: none;
    padding: var(--spacing-md) 0;
}

.tab-content-item.active,
.accordion-item.open .accordion-body {
    display: block;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    background-color: var(--card-bg);
}

.accordion-header {
    padding: var(--spacing-md);
    font-weight: 600;
    cursor: pointer;
    background-color: var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-body {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: none;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast,
.toast_glass {
    pointer-events: auto;
    min-width: 280px;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeInUp .3s ease;
}

.toast {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-surface) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

.skeleton-text {
    height: 1rem;
    width: 100%;
    margin-bottom: .5rem;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 150px;
    width: 100%;
}

.text-center {
    text-align: center !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.mt-2 {
    margin-top: var(--spacing-md) !important;
}

.mb-2 {
    margin-bottom: var(--spacing-md) !important;
}

.grayscale {
    filter: grayscale(100%) !important;
}

.blur-sm {
    filter: blur(4px) !important;
}

.brightness-75 {
    filter: brightness(.75) !important;
}

.animate-fast {
    animation-duration: .3s !important;
}

.animate-normal {
    animation-duration: .6s !important;
}

.animate-infinite {
    animation-iteration-count: infinite !important;
}

.fade-in {
    animation: fadeIn .5s ease both;
}

.fade-in-up {
    animation: fadeInUp .4s ease both;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

/* =========================================================================
   🏛️ 4. HỆ THỐNG GIAO DIỆN GỐC CỦA DỰ ÁN (GIỮ NGUYÊN 100% TỪ MAIN.CSS & DOOR.CSS)
   ========================================================================= */
.door-app-container,
.sparksCanvas,
.orientation-warning-overlay,
.door-panel-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.door-app-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    overflow: hidden;
}

.door-app-container.opening #doorDesktop {
    animation: doorFadeOut 0.8s ease-in-out forwards;
}

.desktop-door {
    display: block;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.77vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.mobile-door {
    display: none;
}

.door-svg svg [id*="door"],
.door-svg svg [id*="Door"] {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-box: fill-box;
    transform-origin: center center;
}

.shake-light {
    animation: shakeLight 0.3s ease-in-out infinite;
}

.shake-medium-light {
    animation: shakeMediumLight 0.35s ease-in-out infinite;
}

.shake-medium {
    animation: shakeMedium 0.3s ease-in-out infinite;
}

.shake-medium-heavy {
    animation: shakeMediumHeavy 0.25s ease-in-out infinite;
}

.shake-heavy {
    animation: shakeHeavy 0.2s ease-in-out infinite;
}

#authInput {
    pointer-events: auto;
    box-sizing: border-box;
    text-align: center;
}

.ui-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 45px;
    z-index: 20;
    clip-path: polygon(20px 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 20px 100%, 0% 50%);
    box-shadow: inset 0 0 0 2px var(--primary), inset 0 0 12px var(--glow-primary);
    filter: drop-shadow(0 0 8px var(--primary));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sparksCanvas {
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#sparksCanvas {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.circuit-bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: var(--bg-color);
    z-index: 3;
}

.circuit-svg-obj {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    object-position: 50% 30%;
    flex-shrink: 0;
}

.terminal-input-box {
    background: var(--bg-surface);
    color: var(--primary);
    border: none;
    width: 100%;
    height: 100%;
    text-align: center;
    outline: none;
    font-family: var(--body-text-font-family);
    font-size: 14px;
    letter-spacing: 1px;
    padding: 0 15px;
    box-sizing: border-box;
}

.terminal-input-box::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

.terminal-input-box:focus::placeholder {
    color: transparent;
}

.orientation-warning-overlay {
    display: none;
    background: rgba(11, 15, 21, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.warning-box-wrapper,
.warning-box {
    width: 100%;
    clip-path: polygon(15px 0%, calc(100% - 15px) 0%, 100% 15px, 100% calc(100% - 15px), calc(100% - 15px) 100%, 15px 100%, 0% calc(100% - 15px), 0% 15px);
}

.warning-box-wrapper {
    max-width: 380px;
    background: var(--primary);
    padding: 2px;
    filter: drop-shadow(0 0 15px var(--glow-primary));
}

.warning-box {
    background: var(--bg-surface);
    padding: 35px 30px;
    color: var(--text-color);
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 1.5s ease-in-out infinite;
}

.warning-box h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-family: var(--tiltle-font-family);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.warning-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.door-panel-svg {
    z-index: 10;
    pointer-events: none;
    transform: translate3d(-100vw, 0, 0);
    will-change: transform;
    transition: transform 5000ms cubic-bezier(0.16, 1, 0.3, 1);
}

.metal-bot-right-svg {
    position: fixed;
    bottom: -30px;
    right: -30px;
    z-index: 10;
    pointer-events: auto;
    transform: translate3d(0, 150%, 0) scale(0.9);
    will-change: transform;
    transition: transform 1600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.door-panel-svg.panel-active,
.metal-bot-right-svg.panel-active {
    transform: translate3d(0, 0, 0) scale(1);
}

#glass {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.6),
        inset -10px -10px 20px rgba(0, 0, 0, 0.15),
        0 20px 40px rgba(0, 0, 0, 0.3);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: liquidMorph 8s ease-in-out infinite;
}

.hologram-hub-wrapper {
    position: fixed;
    z-index: 25;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.liquid-glass-box {
    position: relative;
    width: 100%;
    max-width: clamp(680px, 50vw, 920px);
    height: max-content !important;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: clamp(14px, 1.8vw, 26px) clamp(16px, 2.2vw, 30px);
    color: var(--white-gnal);
    font-family: var(--body-text-font-family);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(6px) saturate(190%);
    -webkit-backdrop-filter: blur(6px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    box-shadow:
        var(--glass),
        0 12px 32px 0 rgba(0, 0, 0, 0.38),
        inset 0 0 20px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.45);
    overflow: hidden !important;
    opacity: 0;
    transform: translate3d(120%, 0, 0) scale(0.96);
    transition: transform 950ms cubic-bezier(0.16, 1, 0.3, 1), opacity 650ms ease;
    pointer-events: none;
}

.liquid-glass-box.active-hub {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
    pointer-events: auto !important;
}

.liquid-glass-box::before {
    content: '';
    position: absolute;
    inset: -60%;
    background: linear-gradient(135deg,
            transparent 30%,
            rgba(255, 50, 120, 0.055) 40%,
            rgba(255, 220, 50, 0.055) 48%,
            rgba(50, 220, 255, 0.075) 55%,
            rgba(180, 100, 255, 0.055) 62%,
            transparent 72%);
    transform: rotate(25deg);
    animation: ultraCleanPrism 9s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.soft-skill-glass {
    transition-delay: 120ms;
    padding: clamp(10px, 1.2vw, 16px) clamp(16px, 2.2vw, 30px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden !important;
}

.soft-skill-glass::before {
    clip-path: inset(0 round 16px);
}

.hub-content-pane {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vh, 18px);
    width: 100%;
}

.hub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.hub-title {
    font-family: var(--tiltle-font-family);
    font-size: clamp(1.25rem, 0.6rem + 1.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: 1.2px;
    line-height: 1.15;
    color: var(--primary) !important;
    text-shadow: 0 0 10px var(--glow-primary);
    text-transform: uppercase;
    white-space: nowrap;
}

.hud-col .hub-title {
    font-size: clamp(1rem, 0.45rem + 1.05vw, 1.55rem);
    letter-spacing: 1px;
    white-space: nowrap;
}

.hub-metrics {
    font-size: clamp(10px, 0.75vw, 13px);
    color: var(--white-gnal);
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
}

.target-box {
    position: relative;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--primary);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    padding: clamp(8px, 1.2vh, 14px) clamp(12px, 1.4vw, 18px);
    box-shadow: inset 0 0 12px rgba(0, 245, 255, 0.12);
}

.target-label {
    font-size: clamp(13px, 0.95vw, 17px);
    font-weight: 700;
    letter-spacing: 1.8px;
    color: var(--primary);
    margin-bottom: 4px;
}

.hub-text {
    font-size: clamp(12px, 0.85vw, 15.5px);
    line-height: 1.45;
    color: var(--white-gnal);
}

.hud-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(12px, 1.8vw, 24px);
    align-items: start;
}

.hud-col {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vh, 14px);
    min-width: 0;
}

.edu-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: clamp(6px, 0.8vh, 10px) clamp(8px, 1vw, 14px);
    border-radius: 6px;
    border-left: 2px solid var(--primary);
}

.edu-info {
    display: flex;
    flex-direction: column;
    font-size: clamp(10.5px, 0.8vw, 13.5px);
    font-weight: 700;
    gap: 2px;
}

.edu-year {
    font-size: clamp(11px, 0.75vw, 13px);
    color: var(--primary);
}

.sci-fi-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: clamp(4px, 0.5vh, 7px) clamp(7px, 0.8vw, 12px);
    font-size: clamp(9.5px, 0.65vw, 11.5px);
    font-weight: 700;
    color: #0b0f19;
    background: var(--primary);
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 0 8px var(--glow-primary);
    transition: transform 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
}

.sci-fi-mini-btn:hover {
    transform: translateY(-2px) scale(1.04);
    filter: brightness(1.2);
}

.skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    font-size: clamp(12px, 0.85vw, 15px);
    margin-bottom: 4px;
    color: var(--white-gnal);
}

.skill-bar {
    width: 60%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.skill-bar .fill {
    height: 100%;
    background: repeating-linear-gradient(-60deg,
            var(--primary),
            var(--primary) 5px,
            rgba(0, 0, 0, 0.35) 5px,
            rgba(0, 0, 0, 0.35) 7px);
    box-shadow: 0 0 8px var(--primary);
    transition: width 0.5s ease;
}

.exp-item {
    border-left: 2px solid var(--primary);
    padding-left: 8px;
    margin-bottom: 5px;
}

.exp-time {
    font-size: clamp(11.5px, 0.8vw, 14px);
    color: var(--text-muted);
}

.exp-proj {
    font-size: clamp(12.5px, 0.95vw, 16px);
    font-weight: 700;
    color: var(--white-gnal);
}

.exp-role {
    font-size: clamp(10px, 0.7vw, 12.5px);
    color: rgba(223, 223, 223, 0.75);
    line-height: 1.35;
}

.portfolio-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.scatter-gradient-btn {
    flex: 1 1 calc(33.333% - 6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: clamp(5px, 0.75vh, 9px) clamp(8px, 0.9vw, 14px);
    font-size: clamp(11px, 0.8vw, 14px);
    font-weight: 700;
    letter-spacing: 0.6px;
    white-space: nowrap;
    color: var(--white-gnal);
    text-decoration: none;
    border: 1px solid var(--primary);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 0),
        repeating-linear-gradient(115deg,
            rgba(255, 255, 255, 0.15) 0%,
            var(--primary) 25%,
            rgba(18, 24, 38, 0.92) 50%,
            var(--primary) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    background-size: 3px 3px, 200% 200%;
    background-position: 0 0, 60% 50%;
    transition: all 0.3s ease;
}

.scatter-gradient-btn:hover {
    background-position: 0 0, 0% 50%;
    color: #0b0f19;
    box-shadow: 0 0 12px var(--primary);
    transform: translateY(-2px);
}

.custom-portfolio-svg-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.scatter-gradient-btn:hover .custom-portfolio-svg-icon {
    filter: brightness(0);
}

.scatter-gradient-btn i.custom-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    line-height: 1;
    flex-shrink: 0;
}

.scatter-gradient-btn i.custom-svg-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.scatter-gradient-btn:hover i.custom-svg-icon svg {
    transform: scale(1.08);
}

.soft-skill-header {
    font-family: var(--tiltle-font-family);
    font-size: clamp(13px, 1.05vw, 18px);
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary);
    text-shadow: 0 0 8px var(--glow-primary);
    white-space: nowrap;
}

.soft-skill-icons {
    display: flex;
    gap: clamp(10px, 1.4vw, 16px);
    align-items: center;
}

.soft-skill-info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 115px;
}

.soft-skill-readout {
    font-size: clamp(10px, 0.8vw, 13px);
    color: var(--white-gnal);
    opacity: 0.75;
    letter-spacing: 0.6px;
    white-space: nowrap;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.soft-skill-readout.active-readout {
    color: var(--primary);
    opacity: 1;
    font-weight: 700;
    text-shadow: 0 0 8px var(--glow-primary);
}

.soft-skill-readout.hud-flash {
    animation: readoutHudFlash 0.35s ease-out;
}

.liquid-icon-item {
    --fill: 75%;
    --delay: 0s;
    --wall-thickness: 3.5px;
    position: relative;
    width: clamp(38px, 3.2vw, 50px);
    height: clamp(38px, 3.2vw, 50px);
    border-radius: 3px;
    background-color: #6e737b;
    background-image: radial-gradient(rgba(0, 0, 0, 0.38) 1px, transparent 0);
    background-size: 3px 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s ease, filter 0.25s ease;
    cursor: pointer;
}

.liquid-icon-item::after {
    content: attr(data-level);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(11, 15, 25, 0.92);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 0 8px var(--glow-primary);
}

.liquid-icon-item:hover,
.liquid-icon-item.is-active {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 0 18px var(--primary);
    filter: drop-shadow(0 0 10px var(--primary));
}

.liquid-icon-item:hover::after,
.liquid-icon-item.is-active::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tank-layer {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    padding: var(--wall-thickness);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.tank-core {
    width: 100%;
    height: 100%;
    background: #141821;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tank-core i {
    font-size: clamp(20px, 1.9vw, 24px);
    line-height: 1;
    -webkit-text-stroke: 0.6px currentColor;
}

.tank-empty {
    background-color: #8c929c;
    background-image:
        radial-gradient(rgba(20, 24, 33, 0.45) 1px, transparent 0),
        radial-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 0);
    background-size: 3px 3px;
    background-position: 0 0, 1.5px 1.5px;
    z-index: 1;
}

.tank-empty .tank-core i {
    color: rgba(140, 146, 156, 0.28);
}

.tank-filled {
    z-index: 2;
    background: linear-gradient(180deg, #ffffff 0%, var(--primary) 12%, var(--primary) 100%);
    box-shadow: 0 0 12px var(--primary), inset 0 0 6px #ffffff;
    animation: subtleLiquidSurface 3.2s ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
    transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tank-filled .tank-core {
    box-shadow: inset 0 0 7px var(--primary);
}

.tank-filled .tank-core i {
    color: var(--primary);
    text-shadow: 0 0 4px #ffffff, 0 0 10px var(--primary);
}

.erasing-spark {
    animation: sparkErase 0.4s forwards;
}

/* =========================================================================
   ✨ 5. CUSTOM INTERACTIVE CURSOR (CHUẨN HÓA VIEWBOX 32x32 & CLICK BURST)
   ========================================================================= */
.wave-ring-1 {
    animation: rippleWave 1.8s cubic-bezier(0.1, 0.5, 0.5, 1) infinite;
}

.wave-ring-2 {
    animation: rippleWave 1.8s cubic-bezier(0.1, 0.5, 0.5, 1) infinite;
    animation-delay: 0.6s;
}

.wave-ring-3 {
    animation: rippleWave 1.8s cubic-bezier(0.1, 0.5, 0.5, 1) infinite;
    animation-delay: 1.2s;
}

#egs-custom-cursor,
#egs-custom-cursor *,
#egs-custom-cursor svg {
    pointer-events: none !important;
    user-select: none !important;
}

#egs-custom-cursor {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    z-index: 2147483647 !important;
    transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#egs-custom-cursor.is-visible {
    opacity: 1;
}

#egs-custom-cursor svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
    filter: drop-shadow(0 0 8px var(--cursor-primary));
    background: transparent !important;
}

#egs-custom-cursor .cursor-origin,
#egs-custom-cursor .cursor-limit,
#egs-custom-cursor .cursor-wave,
#egs-custom-cursor .cursor-aura {
    transform-origin: 16px 16px;
    transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

#egs-custom-cursor .cursor-aura {
    opacity: 0.45;
    animation: cursorAuraPulse 2.2s ease-in-out infinite alternate;
}

#egs-custom-cursor .cursor-wave {
    stroke-width: 1.4px;
    opacity: 0;
    animation: cursorWaveRipple 2.1s cubic-bezier(0.12, 0.65, 0.4, 1) infinite;
}

#egs-custom-cursor .cursor-wave.wave-1 {
    animation-delay: 0s;
}

#egs-custom-cursor .cursor-wave.wave-2 {
    animation-delay: 0.7s;
}

#egs-custom-cursor .cursor-wave.wave-3 {
    animation-delay: 1.4s;
}

#egs-custom-cursor.state-hover svg {
    transform: scale(1.25);
    filter: drop-shadow(0 0 14px var(--cursor-primary));
}

#egs-custom-cursor.state-hover .cursor-origin {
    transform: scale(1.25);
}

#egs-custom-cursor.state-click svg {
    transform: scale(0.8) !important;
    filter: drop-shadow(0 0 18px var(--cursor-primary)) brightness(1.5) !important;
}

#egs-custom-cursor.state-click .cursor-origin {
    transform: scale(1.5) !important;
}

#egs-custom-cursor.state-click .cursor-wave.wave-1 {
    animation: cursorClickBurst 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#egs-custom-cursor.state-error {
    --cursor-primary: var(--cursor-error) !important;
}

#egs-custom-cursor.state-error svg {
    filter: drop-shadow(0 0 18px var(--cursor-error)) !important;
    animation: cursorErrorShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

#egs-custom-cursor.state-success {
    --cursor-primary: var(--cursor-success) !important;
}

#egs-custom-cursor.state-success svg {
    filter: drop-shadow(0 0 18px var(--cursor-success)) !important;
}

#egs-custom-cursor~canvas,
canvas:not([id]) {
    pointer-events: none !important;
}

/* =========================================================================
   🎬 6. HỆ THỐNG KEYFRAMES TOÀN CỤC (GOM GỌN TỪ EGS_UI, DOOR.CSS & MAIN.CSS)
   ========================================================================= */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100%, to {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shakeLight {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(0.8px, -0.8px);
    }
}

@keyframes shakeMediumLight {
    0%, 100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(-1.5px, 1px);
    }

    66% {
        transform: translate(1.5px, -1px);
    }
}

@keyframes shakeMedium {
    0%, 100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, -1px);
    }

    50% {
        transform: translate(-2px, 2px);
    }

    75% {
        transform: translate(1px, -1.5px);
    }
}

@keyframes shakeMediumHeavy {
    0%, 100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-3px, 2px);
    }

    40% {
        transform: translate(3px, -2.5px);
    }

    60% {
        transform: translate(-2.5px, -1px);
    }

    80% {
        transform: translate(2px, 2.5px);
    }
}

@keyframes shakeHeavy {
    0%, 100% {
        transform: translate(0, 0);
    }

    15% {
        transform: translate(-5px, -3px);
    }

    30% {
        transform: translate(5px, 4px);
    }

    45% {
        transform: translate(-4px, 3px);
    }

    60% {
        transform: translate(4px, -4px);
    }

    75% {
        transform: translate(-2.5px, 1.5px);
    }
}

@keyframes hologramGlitchOutDesktop {
    0% {
        transform: translate(-50%, -50%) scale(1, 1);
        opacity: 1;
        filter: drop-shadow(0 0 20px var(--primary)) brightness(1.5);
    }

    30% {
        transform: translate(-50%, -50%) scale(1.1, 0.85);
        opacity: 0.95;
        filter: drop-shadow(0 0 35px var(--primary)) brightness(2.5);
    }

    65% {
        transform: translate(-50%, -50%) scale(1.2, 0.05);
        opacity: 0.8;
        filter: drop-shadow(0 0 25px var(--primary)) brightness(2.8);
    }

    100% {
        transform: translate(-50%, -50%) scale(0, 0);
        opacity: 0;
        filter: drop-shadow(0 0 0px var(--primary));
    }
}

@keyframes hologramGlitchOutMobile {
    0% {
        transform: translate(-50%, -75%) scale(1, 1);
        opacity: 1;
        filter: drop-shadow(0 0 20px var(--primary)) brightness(1.5);
    }

    30% {
        transform: translate(-50%, -75%) scale(1.1, 0.85);
        opacity: 0.95;
        filter: drop-shadow(0 0 35px var(--primary)) brightness(2.5);
    }

    65% {
        transform: translate(-50%, -75%) scale(1.2, 0.05);
        opacity: 0.8;
        filter: drop-shadow(0 0 25px var(--primary)) brightness(2.8);
    }

    100% {
        transform: translate(-50%, -75%) scale(0, 0);
        opacity: 0;
        filter: drop-shadow(0 0 0px var(--primary));
    }
}

@keyframes liquidMorph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    50% {
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    }
}

@keyframes ultraCleanPrism {
    0%, 100% {
        transform: translate(-30%, -30%) rotate(25deg);
    }

    50% {
        transform: translate(30%, 30%) rotate(25deg);
    }
}

@keyframes readoutHudFlash {
    0% {
        opacity: 0.2;
        filter: brightness(2.5);
        transform: translateX(-4px);
    }

    100% {
        opacity: 1;
        filter: brightness(1);
        transform: translateX(0);
    }
}

@keyframes subtleLiquidSurface {
    0% {
        clip-path: polygon(0% calc(100% - var(--fill) - 2.5%),
                25% calc(100% - var(--fill) - 1%),
                50% calc(100% - var(--fill) + 0.5%),
                75% calc(100% - var(--fill) + 2%),
                100% calc(100% - var(--fill) + 2.5%),
                100% 100%,
                0% 100%);
    }

    50% {
        clip-path: polygon(0% calc(100% - var(--fill) + 0.5%),
                25% calc(100% - var(--fill) + 2%),
                50% calc(100% - var(--fill) + 1%),
                75% calc(100% - var(--fill) - 1.5%),
                100% calc(100% - var(--fill) - 1%),
                100% 100%,
                0% 100%);
    }

    100% {
        clip-path: polygon(0% calc(100% - var(--fill) + 2.5%),
                25% calc(100% - var(--fill) + 1%),
                50% calc(100% - var(--fill) - 0.5%),
                75% calc(100% - var(--fill) - 2%),
                100% calc(100% - var(--fill) - 2.5%),
                100% 100%,
                0% 100%);
    }
}

@keyframes sparkErase {
    0% {
        filter: brightness(2) blur(0px);
        opacity: 1;
        transform: scale(1);
    }

    50% {
        filter: brightness(5) drop-shadow(0 0 12px var(--secondary)) blur(2px);
        opacity: 0.5;
        transform: scale(1.02);
    }

    100% {
        filter: brightness(1) blur(5px);
        opacity: 0;
        transform: scale(0.98);
    }
}

@keyframes rippleWave {
    0% {
        r: 4px;
        opacity: 0.9;
        stroke-width: 2px;
    }

    100% {
        r: 15px;
        opacity: 0;
        stroke-width: 0.5px;
    }
}

@keyframes cursorWaveRipple {
    0% {
        transform: scale(1);
        opacity: 0.95;
        stroke-width: 1.8px;
    }

    85% {
        opacity: 0.25;
    }

    100% {
        transform: scale(3.85);
        opacity: 0;
        stroke-width: 0.3px;
    }
}

@keyframes cursorClickBurst {
    0% {
        transform: scale(1);
        opacity: 1;
        stroke-width: 3px;
    }

    100% {
        transform: scale(4.2);
        opacity: 0;
        stroke-width: 0.4px;
    }
}

@keyframes cursorAuraPulse {
    0% {
        opacity: 0.3;
        transform: scale(0.85);
    }

    100% {
        opacity: 0.75;
        transform: scale(1.02);
    }
}

@keyframes cursorErrorShake {
    0%, 100% {
        transform: translateX(0) scale(1.1);
    }

    20%, 60% {
        transform: translateX(-6px) scale(1.15);
    }

    40%, 80% {
        transform: translateX(6px) scale(1.15);
    }
}

/* =========================================================================
   📱🖥️ 7. HỆ THỐNG MEDIA QUERIES GOM THEO TỪNG LOẠI MÀN HÌNH
   ========================================================================= */

/* [MÀN HÌNH 1] TABLET & DESKTOP CHUNG (Rộng từ 768px trở lên):
   - Chia cột Grid (.col-md-*) của egs_ui.min.css.
   - Chạy hiệu ứng biến mất của ô nhập mã (.ui-overlay.hologram-disappear) tại tâm (-50%, -50%).
   - Định vị tấm Door Panel (.door-panel-svg) cao 100vh trượt từ cạnh trái (-100%) vào. */
@media screen and (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .ui-overlay.hologram-disappear {
        animation: hologramGlitchOutDesktop 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .door-panel-svg {
        top: 0;
        left: 0;
        height: 100vh;
        width: auto;
        transform: translate3d(-100%, 0, 0) scale(0.9);
        transition: transform 1600ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .door-panel-svg.panel-active {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* [MÀN HÌNH 2] DESKTOP LỚN (Rộng từ 1024px trở lên):
   - Chia cột Grid kích thước lớn (.col-lg-3, .col-lg-4, .col-lg-6) của egs_ui.min.css. */
@media screen and (min-width: 1024px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* [MÀN HÌNH 3] DESKTOP & TABLET XOAY NGANG (min-width: 768px & landscape):
   - Đặt vị trí khung Hologram Hub (.hologram-hub-wrapper) nằm bên phải tấm Door Panel
     (cách trái một khoảng bằng --panel-left-offset cộng thêm clamp(3vw, 8vw, 12vw)) và căn giữa theo chiều dọc (-52%). */
@media screen and (min-width: 768px) and (orientation: landscape) {
    .hologram-hub-wrapper {
        top: 50%;
        left: calc(var(--panel-left-offset) + clamp(3vw, 8vw, 12vw));
        right: 3vw;
        width: auto;
        height: max-content;
        transform: translateY(-52%);
        gap: clamp(10px, 1.4vh, 16px);
    }
}

/* [MÀN HÌNH 4] LAPTOP / MÀN HÌNH NGANG CHIỀU CAO THẤP (min-width: 768px & max-height: 780px):
   - Thu gọn khoảng cách (gap: 8px, padding: 10px 16px) và cỡ chữ tiêu đề (.hub-title)
     để bảng Hologram Hub không bị tràn lên trên hoặc chạm vào nút vặn Knob ở dưới. */
@media screen and (min-width: 768px) and (max-height: 780px) {
    .hologram-hub-wrapper {
        transform: translateY(-50%);
        gap: 8px;
    }

    .liquid-glass-box {
        padding: 10px 16px;
    }

    .hub-content-pane,
    .hud-col {
        gap: 6px;
    }

    .hub-title {
        font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    }

    .hud-col .hub-title {
        font-size: clamp(0.9rem, 1.2vw, 1.15rem);
    }

    .target-box {
        padding: 5px 10px;
    }
}

/* [MÀN HÌNH 5] MÁY TÍNH BẢNG (IPAD / TABLET) CẦM DỌC (768px -> 1366px & portrait):
   - Hiển thị lớp phủ cảnh báo (.orientation-warning-overlay) nhắc người dùng xoay ngang máy tính bảng. */
@media screen and (min-width: 768px) and (max-width: 1366px) and (orientation: portrait) {
    .orientation-warning-overlay {
        display: flex !important;
    }
}

/* [MÀN HÌNH 6] ĐIỆN THOẠI DI ĐỘNG & MÀN HÌNH DỌC (max-width: 767px hoặc portrait):
   - Ẩn cửa Desktop (.desktop-door), bật cửa Mobile (.mobile-door) theo tỷ lệ 9:16 chuẩn.
   - Xoay dọc bảng mạch điện nền (.circuit-svg-obj) 90 độ cho khớp màn hình điện thoại.
   - Đẩy ô nhập mã (.ui-overlay) lên vị trí (-50%, -75%).
   - Cho tấm Door Panel (.door-panel-svg) rộng 100vw trượt từ đỉnh màn hình (-100%) xuống.
   - Thu gọn cụm nút vặn Knob (.metal-bot-right-svg) về 280px ở góc dưới phải.
   - Căn khung Hologram Hub (.hologram-hub-wrapper) nằm giữa Door Panel (top: 35vh + 10px) và Knob (bottom: 11vh + 10px). */
@media screen and (max-width: 767px), screen and (orientation: portrait) {
    .desktop-door {
        display: none !important;
    }

    .mobile-door {
        display: block !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 56.25vh;
        height: 100vh;
        min-height: 177.77vw;
        min-width: 100vw;
        z-index: 10;
        object-fit: fill;
    }

    .circuit-bg-layer {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .circuit-svg-obj {
        width: 100vh !important;
        height: 100vw !important;
        object-fit: cover !important;
        transform: rotate(90deg) scale(1.05);
        transform-origin: center center;
    }

    .ui-overlay {
        transform: translate(-50%, -75%);
    }

    .ui-overlay.hologram-disappear {
        animation: hologramGlitchOutMobile 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .door-panel-svg {
        top: 0;
        left: 0;
        width: 100vw;
        height: auto;
        transform: translate3d(0, -100%, 0) scale(0.9);
        transition: transform 1600ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .door-panel-svg.panel-active,
    .metal-bot-right-svg.panel-active {
        transform: translate3d(0, 0, 0) scale(1);
    }

    .metal-bot-right-svg {
        position: fixed;
        bottom: -15px;
        right: -20px;
        left: auto;
        top: auto;
        width: 280px;
        height: auto;
        transform: translate3d(0, 150%, 0) scale(0.85);
    }

    .hologram-hub-wrapper {
        top: calc(var(--mobile-top-offset) + 10px);
        bottom: calc(var(--mobile-bot-offset) + 10px);
        left: 3vw;
        right: 3vw;
        width: 94vw;
        height: auto;
        justify-content: center;
        gap: 10px;
    }

    .hud-grid-2col {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .target-box {
        padding: 5px 8px;
    }

    .hub-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .portfolio-actions {
        display: block;
        width: auto;
        min-height: 18vw;
        max-height: 28vw;
        gap: 8px;
        margin-top: 6px;
        padding: 0 8px 0 8px;
        overflow-y: auto;
        border: var(--primary) 0.2px solid;
    }

    .scatter-gradient-btn {
        flex: 1 0 calc(33.333% - 6px);
        display: block;
        margin: 8px 0 8px 0;
        align-items: center;
        justify-content: center;
    }
}

/* [MÀN HÌNH 7] ĐIỆN THOẠI MÀN HÌNH NHỎ / HẸP NGANG (max-width: 400px - VD: iPhone SE, iPhone Mini):
   - Giảm padding và khoảng cách giữa các icon Soft Skill (.soft-skill-glass, .soft-skill-icons) để không bị tràn ngang. */
@media screen and (max-width: 400px) {
    .soft-skill-glass {
        padding: 10px 12px;
        gap: 8px;
    }

    .soft-skill-info-col {
        min-width: 95px;
    }

    .soft-skill-icons {
        gap: 8px;
    }
}

/* [MÀN HÌNH 8] THIẾT BỊ CẢM ỨNG KHÔNG DÙNG CHUỘT (hover: none & pointer: coarse):
   - Ẩn con trỏ chuột tùy chỉnh (#egs-custom-cursor) trên thiết bị cảm ứng.
   - Thu gọn nhãn phần trăm (.liquid-icon-item::after) phía trên các bình Soft Skill khi chạm tay. */
@media (hover: none) and (pointer: coarse) {
    .liquid-icon-item::after {
        top: -18px;
        font-size: 8.5px;
        padding: 1px 4px;
    }

    #egs-custom-cursor {
        display: none !important;
    }
}