@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700;800&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    background-color: #040d0a;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Верхній тулбар */
.top-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #0d231b;
    border: 1px solid #1a4938;
    color: #d1fae5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    cursor: pointer;
}
.top-icon-btn:hover {
    background: #174032;
    color: #34d399;
    transform: translateY(-1px);
}
.top-icon-btn:active {
    transform: translateY(0);
}

.cell-action-btn {
    padding: 6px 10px;
    border-radius: 9px;
    background: #0d231b;
    border: 1px solid #1a4938;
    font-size: 11px;
    font-weight: 700;
    color: #d1fae5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
}
.cell-action-btn:hover {
    background: #163d2f;
    border-color: #34d399;
}

/* Бокові ярлики */
.side-tab-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #0b2018;
    border: 1px solid #184736;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-tab-btn:hover {
    background: #14392b;
    border-color: #34d399;
    transform: scale(1.05);
}
.side-tab-btn.active {
    background: #153f30;
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}
.side-tab-btn .tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #22d3ee;
    color: #02201b;
    font-size: 8px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    padding: 1px 4px;
    border-radius: 6px;
}

/* Висувні панелі */
.cell-drawer {
    position: absolute;
    right: 48px;
    top: 0;
    bottom: 0;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
    transform: translateX(0);
    opacity: 1;
}
.cell-drawer.drawer-closed {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* Панель фаз для Мітозу, Мейозу та Метаболізму */
.process-bar {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: rgba(7, 22, 16, 0.92);
    border: 1px solid rgba(52, 211, 153, 0.45);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.process-bar.hidden {
    display: none;
}

.phase-pill-btn {
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #a7f3d0;
    background: #0c241b;
    border: 1px solid #194a38;
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.phase-pill-btn:hover {
    background: #143a2c;
    color: #ffffff;
}
.phase-pill-btn.active {
    background: #10b981;
    color: #032015;
    border-color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}
.phase-pill-btn.auto-btn.active {
    background: #22d3ee;
    color: #031924;
    border-color: #a5f3fc;
}

/* VIEWCUBE */
.viewcube-wrapper {
    width: 56px;
    height: 56px;
    perspective: 250px;
    cursor: pointer;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-25deg) rotateY(25deg);
    transition: transform 0.08s ease-out;
}

.face {
    position: absolute;
    width: 56px;
    height: 56px;
    background: rgba(11, 32, 24, 0.88);
    border: 1.5px solid #10b981;
    color: #ecfdf5;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: visible;
    transition: background 0.15s, color 0.15s;
}
.face:hover {
    background: #10b981;
    color: #022c16;
}

.face.front  { transform: rotateY(0deg) translateZ(28px); }
.face.back   { transform: rotateY(180deg) translateZ(28px); }
.face.right  { transform: rotateY(90deg) translateZ(28px); }
.face.left   { transform: rotateY(-90deg) translateZ(28px); }
.face.top    { transform: rotateX(90deg) translateZ(28px); }
.face.bottom { transform: rotateX(-90deg) translateZ(28px); }

.cube-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #6ee7b7;
    transition: all 0.15s;
    cursor: pointer;
}
.cube-btn:hover {
    background: #13392b;
    color: #ffffff;
}

/* Картки */
.cell-card {
    background: #0a1b14;
    border: 1px solid #164030;
    border-radius: 12px;
    padding: 10px;
    transition: all 0.15s ease;
    cursor: pointer;
}
.cell-card:hover {
    border-color: #2dd4bf;
    background: #0e261d;
}
.cell-card.active {
    border-color: #22d3ee;
    background: #0e2d24;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.2);
}

.organelle-chip {
    background: #0a1d16;
    border: 1px solid #164030;
    border-radius: 10px;
    padding: 8px 10px;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.organelle-chip:hover {
    border-color: #34d399;
    background: #0f2a20;
}
.organelle-chip.active {
    border-color: #34d399;
    background: #123629;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

.cell-slider {
    accent-color: #2dd4bf;
    height: 5px;
    border-radius: 4px;
    background: #153c2e;
    outline: none;
    cursor: pointer;
}

/* Скролбар */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: #040d0a;
}
::-webkit-scrollbar-thumb {
    background: #153c2d;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #226049;
}

@keyframes scaleUp {
    from { transform: scale(0.93); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.animate-scale-up {
    animation: scaleUp 0.18s ease-out forwards;
}

@supports (height: 100dvh) {
    body {
        height: 100dvh !important;
    }
}

@media (pointer: coarse), (hover: none) {
    .mouse-hints {
        display: none !important;
    }
}