:root {
    --bg-deep: #050505; --text-main: #EAEAEA; --accent: #20c454dc;
    --sheet-bg: #0F0F0F;
    --font-ui: 'Manrope', sans-serif; --font-head: 'Playfair Display', serif; --font-mono: 'Cinzel', serif;
    --safe-top: env(safe-area-inset-top, 20px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg-deep); color: var(--text-main); font-family: var(--font-ui); overflow: hidden; height: 100vh; width: 100vw; overscroll-behavior: none; }

.noise-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.25; pointer-events: none; background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iIzAwMCIvPjwvc3ZnPg=='); }

/* HEADER */
.luxury-header { 
    position: fixed; 
    top: 0; left: 0; width: 100%; 
    height: auto;
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    padding: max(15px, env(safe-area-inset-top)) 20px 10px 20px; 
    z-index: 50; 
    pointer-events: none; 
}

/* ЛЕВАЯ ЧАСТЬ (Лого) */
.brand-block { 
    pointer-events: auto; 
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
}
.logo-title { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: #fff; }
.logo-subtitle { font-size: 8px; color: #666; letter-spacing: 0.4em; }

/* ПРАВАЯ ЧАСТЬ (Кнопки и Даты) */
.controls-cluster { 
    pointer-events: auto; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 12px; 
}

/* Переключатель режимов */
.mode-switch { 
    display: flex; 
    gap: 15px; 
    font-size: 10px; 
    text-transform: uppercase; 
    justify-content: flex-end;
    margin-bottom: 5px;
}

.mode-link { 
    color: #444; background: none; border: none; 
    cursor: pointer; padding: 2px 0; 
    transition: 0.3s; font-weight: 700; text-decoration: none;
}
.mode-link.active { 
    color: var(--accent); border-bottom: 1px solid var(--accent); 
}

/* КНОПКА CALCULATE */
.action-btn-rect {
    padding: 8px 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cfcfcf;
    background: transparent;
    border: none;
    border-right: 7px solid #59ff00;
    border-bottom: 2px solid #59ff00;
    transform: skewX(-25deg);
    transition: all 0.2s ease;
    box-shadow: none;
}

.action-btn-rect:hover {
    color: #4bfc9e;
    transform: skewX(-25deg) translateX(2px);
}

/* MATRIX — СТАТИЧНЫЙ РЕЖИМ 300x300 */
.artifact-container { 
    position: absolute; 
    top: 40%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 300px;
    height: 300px;
    pointer-events: none; 
    user-select: none;
}

.matrix-wrapper { 
    width: 100%; 
    height: 100%; 
    position: relative; 
}

.matrix-bg-img { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0; 
    opacity: 0.9;
    object-fit: contain;
}

#matrixContainer { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0; 
}

.matrix-num { 
    position: absolute; 
    transform: translate(-50%, -50%); 
    color: #fff; 
    font-family: var(--font-ui); 
    font-weight: 800; 
    font-size: 11px;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
    width: 24px;
    text-align: center; 
    color: #ffffff !important; 
}

.sheet-container {
    position: fixed; 
    left: 0; right: 0; 
    bottom: 0; 
    height: 90vh; 
    background: var(--sheet-bg); 
    border-radius: 0; 
    box-shadow: 0 -10px 50px rgba(0,0,0,0.8); 
    z-index: 100; 
    transform: translateY(85%); 
    will-change: transform; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
}

.sheet-header { 
    width: 100%; 
    padding: 15px 0 10px 0; 
    background: var(--sheet-bg); 
    border-radius: 0; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    flex-shrink: 0; 
    cursor: grab; 
    touch-action: none; 
}

.sheet-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background: repeating-linear-gradient(135deg, transparent, transparent 5px, var(--accent) 5px, var(--accent) 6px);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    opacity: 0.8;
}

.sheet-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background: repeating-linear-gradient(-135deg, transparent, transparent 5px, var(--accent) 5px, var(--accent) 6px);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    opacity: 0.8;
}

.drag-pill { width: 40px; height: 4px; background: #444; border-radius: 10px; margin-bottom: 15px; }

/* TABS */
.tabs-row { 
    width: 100%; 
    overflow-x: auto; 
    display: flex; 
    gap: 20px; 
    padding: 0 20px; 
    scrollbar-width: none; 
    pointer-events: auto; 
    z-index: 10;
}

.tab-item { 
    font-size: 11px; 
    font-weight: 700; 
    color: #555; 
    text-transform: uppercase; 
    padding-bottom: 8px; 
    border-bottom: 2px solid transparent; 
    transition: 0.3s; 
    white-space: nowrap; 
    cursor: pointer; 
    user-select: none;
}

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

/* SLIDES */
.sheet-body { 
    flex: 1 1 auto;
    width: 100%; 
    background: #000; 
    position: relative; 
    overflow: hidden;
    display: flex; 
    flex-direction: column; 
    min-height: 0;
}

.slides-container { 
    display: flex;
    flex-direction: row;
    width: 100%; 
    height: 100%;
    overflow-x: auto;        
    overflow-y: hidden;
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    flex: 1 1 auto;
    min-width: 0;
}

.slide-page { 
    flex: 0 0 100%;
    width: 100%; 
    height: 100%; 
    overflow-y: auto; 
    scroll-snap-align: start; 
    -webkit-overflow-scrolling: touch; 
    position: relative;
    padding: 20px 20px 60vh 20px; 
}

.slide-inner { 
    background: #000; 
    min-height: 100%; 
}
.slide-header-block { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 30px; 
}

.arcana-num-box { 
    position: relative; 
    width: 120px; 
    height: 80px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-shrink: 0;
    background: transparent; 
    border: none; 
    border-radius: 0; 
}

.arcana-num-box .num { 
    font-family: var(--font-mono); 
    font-size: 48px; 
    font-weight: 700; 
    color: #fff;
}

.arcana-num-box::before { 
    content: ''; 
    position: absolute; 
    bottom: 0; left: -3px;
    width: 15px; 
    height: 15px; 
    border-bottom: 3px solid #C6FF00; 
    border-left: 3px solid #C6FF00; 
    transform: skewX(-25deg);
}

.arcana-num-box::after { 
    content: ''; 
    position: absolute; 
    top: 0; right: -3px;
    width: 15px; 
    height: 15px; 
    border-top: 3px solid #a7d500; 
    border-right: 3px solid #a7d500; 
    transform: skewX(-25deg);
}

.arcana-titles { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}
.cat-cyber-title { 
    font-family: 'Courier New', monospace; 
    font-size: 12px; color: #666; 
    letter-spacing: 0.15em; 
    margin-bottom: 5px; 
    text-transform: uppercase; 
}
.arcana-name-title { 
    font-family: var(--font-head); 
    font-size: 22px; color: #fff; 
    border-bottom: 1px solid rgba(255,255,255,0.3); 
    padding-bottom: 3px; 
    width: fit-content; 
}

.text-zone { margin-bottom: 25px; }
.text-label { display: block; font-weight: 800; font-size: 12px; margin-bottom: 6px; letter-spacing: 0.05em; }
.text-content { font-size: 14px; line-height: 1.6; color: #ccc; }
.label-plus { color: #39FF14; }
.label-minus { color: #DC143C; }
.label-advice { color: #87CEEB; }
.block-plus { margin-bottom: 30px; }
.block-minus { margin-bottom: 20px; }
.advice-list { list-style: none; padding: 0; color: #ccc; font-size: 14px; }
.advice-list li { margin-bottom: 4px; position: relative; padding-left: 15px; }
.advice-list li::before { content: '>'; position: absolute; left: 0; color: #87CEEB; font-size: 10px; top: 3px; }

/* HEALTH TABLE */
.acc-row { border-bottom: 1px solid #222; }
.acc-trigger { width: 100%; padding: 15px 0; display: flex; justify-content: space-between; align-items: center; background: none; border: none; cursor: pointer; }
.acc-left { display: flex; gap: 10px; align-items: center; }
.acc-num { font-family: var(--font-mono); font-size: 18px; color: var(--accent); width: 30px; }
.acc-title { font-family: var(--font-ui); font-size: 14px; color: #fff; text-transform: uppercase; }
.acc-panel { max-height: 0; overflow: hidden; transition: 0.3s; background: #0a0a0a; }
.acc-row.open .acc-panel { max-height: 500px; }
.acc-content-inner { padding: 15px; }

.health-columns { display: flex; justify-content: space-around; margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; }
.h-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }

.h-val-circle { width: 34px; height: 34px; display: flex; justify-content: center; align-items: center; color: #fff; font-family: var(--font-mono); font-size: 14px; position: relative; border: none; background: transparent; } 
.h-val-circle::before { content: ""; position: absolute; bottom: 0; left: 0; width: 10px; height: 10px; border-bottom: 2px solid #C6FF00; border-left: 2px solid #C6FF00; transform: skewX(-20deg); } 
.h-val-circle::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-top: 2px solid #C6FF00; border-right: 2px solid #C6FF00; transform: skewX(-20deg); }
.h-label { font-size: 8px; color: #666; text-transform: uppercase; }

/* === PROGRAM BOX (ЗОЛОТОЙ СТИЛЬ) === */
.program-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.program-box::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; 
    width: 4px; 
    height: 100%; 
    background: #c6a22c12; 
}

.program-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
}

/* === ИСПРАВЛЕНИЕ: БЕЛЫЙ ЦВЕТ ТЕКСТА === */
.program-badge { 
    font-size: 9px; 
    text-transform: uppercase; 
    color: #ffffff;  /* <-- ТЕПЕРЬ БЕЛЫЙ */
    letter-spacing: 2px; 
    font-weight: 800; 
    border: 1px solid #dcb01e; 
    padding: 4px 8px; 
    border-radius: 4px; 
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
}

.program-title { 
    font-family: var(--font-head); 
    color: #fff; 
    font-size: 16px; 
    text-transform: uppercase; 
    text-align: right; 
}

.program-nums { 
    font-family: var(--font-mono); 
    font-size: 24px; 
    color: #d1d1d1; 
    margin-bottom: 15px; 
    font-weight: 700; 
}

.program-desc { font-size: 14px; line-height: 1.6; color: #ddd; margin-bottom: 15px; }
.program-lesson { font-size: 13px; color: #aaa; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; font-style: italic; }

/* TERMINAL HEALTH TABLE */
.health-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid rgba(255, 255, 255, 0.1); background: #080808; border-radius: 8px; margin-top: 15px; }
.health-table { width: 100%; min-width: 600px; border-collapse: collapse; font-family: 'Courier New', monospace; font-size: 11px; }
.health-table th { text-align: left; padding: 10px; background: rgba(255, 255, 255, 0.05); color: #888; text-transform: uppercase; font-weight: normal; }
.hrow { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.hrow:last-child { border-bottom: none; }
.health-table td { padding: 12px 10px; vertical-align: middle; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.health-table tr:last-child td { border-bottom: none; }
.g { color: #666; font-weight: bold; width: 40px; }
.n { color: #fff; font-weight: bold; }
.n .sub { font-size: 9px; color: #555; margin-top: 2px; }
.a { color: var(--accent); font-weight: bold; font-size: 14px; text-align: center; width: 30px; }
.p, .m { color: #aaa; max-width: 150px; }
.p::before { content: '[+] '; color: #4CAF50; opacity: 0.7; }
.m::before { content: '[-] '; color: #F44336; opacity: 0.7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; font-size: 10px; opacity: 0.6; font-family: monospace; }
.chip { background: rgba(255, 255, 255, 0.05); padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.1); }

/* DATE INPUTS */
.inputs-line {
    display: flex;
    flex-direction: column; 
    align-items: flex-end;  
    gap: 5px;               
}

.term-group {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.term-sep, .term-plus {
    color: #444;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.term-plus {
    color: var(--accent);
    margin-right: 5px;
}

.term-input {
    position: relative;
    font-family: 'Courier New', monospace; 
    font-size: 14px;
    color: #fff;
    min-width: 28px;
    text-align: center;
    border-bottom: 1px solid #333; 
    cursor: pointer;
    padding-bottom: 2px;
    transition: all 0.2s ease;
    user-select: none;
}

.term-input:hover, .term-input.active {
    border-bottom-color: var(--accent); 
    color: var(--accent);
    text-shadow: 0 0 10px rgba(212,175,55, 0.3);
}

.term-dropdown {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    max-height: 200px;
    overflow-y: auto;
    background: #000;
    border: 1px solid #333;
    z-index: 1000;
    display: none; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}

.term-dropdown.show {
    display: block;
}

.term-dropdown::-webkit-scrollbar { width: 2px; }
.term-dropdown::-webkit-scrollbar-thumb { background: var(--accent); }

.term-option {
    padding: 8px 0;
    text-align: center;
    color: #666;
    font-size: 12px;
    border-bottom: 1px solid #111;
    transition: 0.1s;
}

.term-option:hover {
    background: #111;
    color: #fff;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 4px;  
    height: 4px;
}
::-webkit-scrollbar-track {
    background: #050505; 
    border-left: 1px solid rgba(255, 255, 255, 0.1); 
}
::-webkit-scrollbar-thumb {
    background: #006c4a; 
    border-radius: 0;    
}
::-webkit-scrollbar-thumb:hover {
    background: #fff; 
    box-shadow: 0 0 10px #00ac76; 
}

/* CYBER HEALTH TABLE */
.cyber-health-wrap {
    width: 100%;
    font-family: 'Courier New', monospace; 
    margin-top: 10px;
}
.ch-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; 
    padding: 10px 5px;
    border-bottom: 2px solid #333;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}
.ch-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: center;
    padding: 12px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}
.ch-row:hover {
    background: rgba(255, 255, 255, 0.03);
}
.ch-cell-name {
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    display: flex;
    flex-direction: column;
}
.ch-chakra-sub {
    font-size: 9px;
    color: #555;
    margin-top: 2px;
}
.ch-cell-val {
    text-align: center;
    color: #888;
    font-size: 13px;
}
.ch-cell-res {
    text-align: center;
    color: #C6FF00; 
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(198, 255, 0, 0.3);
}
.ch-details {
    display: none; 
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid #C6FF00; 
    margin-bottom: 5px;
}
.ch-row.active + .ch-details {
    display: block; 
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.ch-desc-block { margin-bottom: 10px; font-size: 12px; line-height: 1.4; }
.ch-label { font-weight: bold; display: inline-block; width: 20px; }
.ch-plus { color: #39FF14; }
.ch-minus { color: #DC143C; }
.ch-advice { color: #039aff; }
.ch-total-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 15px 5px;
    border-top: 2px solid #333;
    margin-top: 5px;
    background: rgba(198, 255, 0, 0.05); 
}
